/* ============== BOTONES ============== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter Tight', sans-serif;
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  transition: all 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
}
.btn:hover { background: var(--ink); color: var(--paper); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: white;
}
.btn.primary:hover {
  background: var(--paper);
  color: var(--brand-primary);
}
.btn.ghost { border-color: var(--hairline); background: transparent; }
.btn.ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.active { background: var(--ink); color: var(--paper); }
.btn.danger:hover { background: #b91c1c; border-color: #b91c1c; color: white; }

.hdr-popover {
  position: fixed;
  z-index: 45;
  width: min(340px, calc(100vw - 24px));
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px -24px rgba(10, 10, 11, 0.34);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.hdr-popover.hidden {
  display: none;
}

.hdr-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hdr-popover-meta {
  font-size: 11px;
  line-height: 1.25;
  color: var(--muted);
  text-align: right;
}

.hdr-popover-current {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: rgba(255,255,255,0.56);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}

.hdr-popover-note {
  margin-top: 10px;
  padding: 10px 11px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.48);
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

.hdr-popover-note.is-upsell {
  border-color: rgba(245, 158, 11, 0.26);
  background: rgba(245, 158, 11, 0.08);
  color: #9a6700;
}

.hdr-popover-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.print-lite-block {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(var(--brand-primary-rgb), 0.16);
  border-radius: 12px;
  background: rgba(var(--brand-primary-rgb), 0.05);
}

.print-view-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.print-view-actions .btn {
  justify-content: center;
  min-height: 38px;
  padding: 8px 10px;
}

.hdr-menu-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.menu-section-label {
  margin-bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.menu-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.menu-field {
  display: grid;
  gap: 6px;
}

.menu-field span {
  font-size: 11px;
  color: var(--muted);
}

.menu-field-full {
  grid-column: 1 / -1;
}

.menu-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-slider-row strong {
  min-width: 38px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
}

.menu-full-btn {
  width: 100%;
  justify-content: center;
  margin-top: 10px;
}

.menu-inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.menu-inline-actions .btn {
  flex: 1 1 140px;
  justify-content: center;
}

.menu-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
}

.menu-empty-copy {
  padding: 10px 11px;
  border: 1px dashed rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

/* Menú de zonas: altura acotada con scroll interno para que quepa entero */
#zones-menu {
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Panel lateral de ajustes de la zona (se abre junto al menú de zonas) */
.zone-side-panel {
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: zonePanelIn 0.18s ease;
}
@keyframes zonePanelIn {
  from { opacity: 0; transform: translateX(6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.zone-side-panel::-webkit-scrollbar { width: 6px; }
.zone-side-panel::-webkit-scrollbar-thumb { background: rgba(10,10,11,0.18); border-radius: 999px; }
.zone-side-panel .hdr-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#zones-menu::-webkit-scrollbar { width: 6px; }
#zones-menu::-webkit-scrollbar-thumb { background: rgba(10,10,11,0.18); border-radius: 999px; }

/* Acordeones minimalistas del editor de zona */
.zone-acc {
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  margin-top: 4px;
}
.zone-acc-summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.zone-acc-summary::-webkit-details-marker { display: none; }
.zone-acc-summary::after {
  content: '⌄';
  font-size: 13px;
  transition: transform 0.2s;
  opacity: 0.6;
}
.zone-acc[open] .zone-acc-summary::after { transform: rotate(180deg); }
.zone-acc-body { padding: 2px 0 8px; }
.zone-edit-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.zones-list {
  display: grid;
  gap: 8px;
}

.zone-chip-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.zone-chip-row .zone-chip {
  flex: 1;
  min-width: 0;
}

.zone-chip.is-disabled {
  opacity: 0.55;
}

.zone-disable-btn {
  flex-shrink: 0;
  padding: 6px 10px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.54);
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 140ms;
}

.zone-disable-btn:hover {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.07);
  color: #ef4444;
}

.zone-disable-btn.is-active {
  border-color: rgba(var(--brand-primary-rgb), 0.4);
  background: rgba(var(--brand-primary-rgb), 0.07);
  color: rgba(var(--brand-primary-rgb), 1);
}

.zg-size-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.zg-size-row .input-field {
  flex: 1;
  min-width: 0;
}

.zg-snap-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.54);
  font-size: 10px;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 140ms;
}

.zg-snap-btn:hover {
  border-color: rgba(var(--brand-primary-rgb), 0.3);
  color: rgba(var(--brand-primary-rgb), 0.8);
}

.zg-snap-btn.is-on {
  border-color: rgba(var(--brand-primary-rgb), 0.45);
  background: rgba(var(--brand-primary-rgb), 0.08);
  color: rgba(var(--brand-primary-rgb), 1);
}

.zone-delete-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 140ms;
  align-self: center;
}

.zone-delete-btn:hover {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.07);
  color: #ef4444;
}

.zone-chip {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.54);
  text-align: left;
  transition: all 140ms;
}

.zone-chip:hover,
.zone-chip.active {
  border-color: rgba(var(--brand-primary-rgb), 0.42);
  background: rgba(var(--brand-primary-rgb), 0.08);
}

.zone-chip-swatch {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 999px;
  flex-shrink: 0;
}

.zone-chip-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.zone-chip-copy strong {
  font-size: 12px;
  line-height: 1.15;
}

.zone-chip-copy small {
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
}

.color-input-field {
  padding: 2px;
  height: 36px;
}

.menu-action {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: rgba(255,255,255,0.54);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: all 140ms;
}

.menu-action:hover {
  background: white;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -20px rgba(10, 10, 11, 0.32);
}

.menu-action[data-plan-upgrade="pro"] {
  border-color: var(--plan-pro-border);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.18);
}

.menu-action[data-plan-upgrade="premium"] {
  border-color: var(--plan-premium-border);
  box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.14);
}

.menu-action-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(10, 10, 11, 0.06);
  position: relative;
  flex-shrink: 0;
}

.menu-action-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.menu-action-copy strong {
  font-size: 12px;
  line-height: 1.1;
}

.menu-action-copy small {
  font-size: 11px;
  line-height: 1.25;
  color: var(--muted);
}

.menu-action-tag {
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(10, 10, 11, 0.06);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pro-button .menu-action-icon::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  padding: 2px;
  background: conic-gradient(
    from 0deg,
    #ff5f6d,
    #ffb86b,
    #ffe66d,
    #4ade80,
    #38bdf8,
    #8b5cf6,
    #ff5f6d
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

.pro-button.pro-unlocked .menu-action-tag {
  background: rgba(var(--brand-primary-rgb), 0.12);
  color: var(--brand-primary);
}

.pro-button.pro-locked .menu-action-tag {
  background: rgba(245, 158, 11, 0.14);
  color: #9a6700;
}

.hdr-pro-chip {
  background: linear-gradient(180deg, color-mix(in srgb, var(--plan-pro-fill) 84%, white), color-mix(in srgb, var(--plan-pro-accent) 18%, white));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--plan-pro-border) 28%, transparent);
}

.hdr-pro-chip:hover,
.hdr-pro-chip.active {
  background: linear-gradient(180deg, color-mix(in srgb, var(--plan-pro-fill) 76%, white), color-mix(in srgb, var(--plan-pro-accent) 24%, white));
}

.pro-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.pro-feature-card {
  display: grid;
  gap: 6px;
  padding: 11px 12px;
  border: 1px solid rgba(245, 158, 11, 0.16);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(255,196,107,0.08));
}

.pro-feature-card strong {
  font-size: 12px;
  line-height: 1.15;
}

.pro-feature-card span {
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hairline);
  background: transparent;
  cursor: pointer;
  transition: all 180ms;
}
.icon-btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.icon-btn.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ============== INPUTS ============== */
.input-field {
  width: 100%;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--hairline);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink);
  transition: all 180ms;
}
.input-field:focus { outline: none; border-color: var(--brand-primary); background: white; }

/* Custom number input arrows */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] { -moz-appearance: textfield; }

/* Range slider */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  height: 2px;
  background: var(--hairline);
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--brand-primary);
  border: 2px solid var(--paper);
  border-radius: 50%;
  cursor: pointer;
}

/* ============== COMPANY COLORS ============== */
.brand-color-field {
  min-width: 0;
}
.brand-color-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
}
.brand-color-preview {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
}
.brand-color-picker {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(255,255,255,0.6);
  cursor: pointer;
}
.brand-palette {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.brand-swatch {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(0,0,0,0.16);
  border-radius: 8px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
}
.brand-swatch.active {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.brand-color-error {
  display: none;
  margin-top: 6px;
  font-size: 10.5px;
  color: #b91c1c;
}
.brand-color-error.visible {
  display: block;
}

/* ============== INVENTORY PANEL ============== */
.inventory-empty {
  display: grid;
  gap: 6px;
  padding: 18px 14px;
  border: 1px dashed rgba(0, 0, 0, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.42);
}
.inventory-empty-title {
  font-size: 13px;
  font-weight: 600;
}
.inventory-empty p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}
.inventory-group {
  display: grid;
  gap: 8px;
}
.inventory-group-head {
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.inventory-group-lines {
  display: grid;
  gap: 6px;
}
.inventory-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}
.inventory-line-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.inventory-line-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}
.inventory-line-label {
  min-width: 0;
  line-height: 1.25;
}
.inventory-line-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}
.inventory-line-price {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.inventory-price-input {
  width: 56px;
  padding: 2px 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-align: right;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  outline: none;
  -moz-appearance: textfield;
}
.inventory-price-input::-webkit-outer-spin-button,
.inventory-price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.inventory-price-input:focus {
  border-color: var(--brand-primary, #2563eb);
  background: #fff;
}
.inventory-price-unit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  color: var(--muted);
}
.inventory-line-subtotal {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  min-width: 64px;
  text-align: right;
}

/* ============== EXPORT PREVIEW ============== */
.export-preview-shell {
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}
.export-preview-pages {
  min-height: 240px;
  max-height: min(68vh, 760px);
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.48);
}
.export-preview-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  color: var(--muted);
}
.export-preview-page {
  display: grid;
  gap: 10px;
}
.export-preview-page + .export-preview-page {
  margin-top: 18px;
}
.export-preview-page canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  box-shadow: 0 18px 40px -24px rgba(10, 10, 11, 0.35);
  background: white;
}
.export-preview-caption {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============== SHARE PLANNING ============== */
.share-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--hairline);
  border-radius: 9px;
  background: rgba(255,255,255,0.42);
  font-size: 12px;
  cursor: pointer;
}
.share-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-primary);
}
.share-file-state,
.share-summary {
  padding: 10px 11px;
  border: 1px solid var(--hairline);
  border-radius: 9px;
  background: rgba(255,255,255,0.42);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
}
.share-summary {
  color: var(--ink);
}

/* ============== CONTEXT MENU (preparado para Entrega 2) ============== */
#context-menu {
  position: fixed;
  z-index: 60;
  min-width: 320px;
  max-width: min(380px, calc(100vw - 20px));
  max-height: min(680px, calc(100vh - 20px));
  padding: 8px;
  display: none;
  overflow-y: auto;
}
#context-menu.visible {
  display: block;
  animation: ctxIn 160ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes ctxIn {
  from { opacity: 0; transform: scale(0.96) translateY(4px); }
  to { opacity: 1; transform: none; }
}
.ctx-section { padding: 6px 8px; }
.ctx-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.ctx-item {
  padding: 8px 10px;
  cursor: pointer;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 140ms;
  border-radius: 1px;
}
.ctx-item:hover { background: var(--ink); color: var(--paper); }
.ctx-divider { height: 1px; background: var(--hairline); margin: 6px 0; }

.ctx-editor {
  display: grid;
  gap: 12px;
}
.ctx-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.ctx-title {
  font-family: 'Inter Tight', sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}
.ctx-lock-badge {
  flex-shrink: 0;
  padding: 4px 7px;
  border: 1px solid rgba(185, 28, 28, 0.22);
  border-radius: 7px;
  background: rgba(185, 28, 28, 0.08);
  color: #b91c1c;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  text-transform: uppercase;
}
.ctx-block {
  display: grid;
  gap: 7px;
}
.ctx-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.ctx-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.ctx-field-full {
  grid-column: 1 / -1;
}
.ctx-field span,
.ctx-readonly span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.ctx-input {
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: rgba(255,255,255,0.58);
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}
.ctx-input:focus {
  outline: none;
  border-color: var(--ink);
  background: white;
}
.ctx-textarea {
  min-height: 86px;
  resize: vertical;
  line-height: 1.35;
}
.ctx-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: rgba(255,255,255,0.45);
  font-size: 11px;
  cursor: pointer;
}
.ctx-check input {
  width: 14px;
  height: 14px;
  accent-color: var(--ink);
}
.ctx-readonly {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 9px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: rgba(255,255,255,0.42);
}
.ctx-readonly strong {
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}
.ctx-empty {
  padding: 8px 9px;
  border: 1px dashed rgba(0,0,0,0.14);
  border-radius: 7px;
  color: var(--muted);
  font-size: 11.5px;
}
.ctx-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ctx-preset-btn {
  min-width: 0;
}
.ctx-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.ctx-action-btn {
  min-width: 0;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 5px 8px;
  padding: 8px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(255,255,255,0.46);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: all 140ms;
}
.ctx-action-btn svg {
  grid-row: span 2;
}
.ctx-action-btn span {
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.05;
}
.ctx-action-btn small {
  min-width: 0;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  line-height: 1;
}
.ctx-action-btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.ctx-action-btn:hover small {
  color: rgba(255,255,255,0.68);
}
.ctx-action-btn.danger {
  color: #b91c1c;
}
.ctx-action-btn.danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: white;
}

/* ============== CTX ADVANCED / COLOR ============== */
.ctx-advanced {
  border: 1px solid var(--hairline);
  border-radius: 9px;
  overflow: hidden;
}
.ctx-advanced-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
  list-style: none;
  user-select: none;
  background: rgba(255,255,255,0.32);
  transition: background 120ms;
}
.ctx-advanced-toggle::-webkit-details-marker { display: none; }
.ctx-advanced-toggle:hover { background: rgba(0,0,0,0.04); }
.ctx-advanced[open] .ctx-advanced-toggle {
  border-bottom: 1px solid var(--hairline);
}
.ctx-advanced[open] .ctx-advanced-icon {
  transform: rotate(180deg);
}
.ctx-advanced-icon { transition: transform 180ms; }
.ctx-advanced-body {
  padding: 9px 9px;
  display: grid;
  gap: 8px;
}
.ctx-color-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
}
.ctx-color-label {
  font-size: 11px;
  color: var(--muted);
  min-width: 40px;
  flex-shrink: 0;
}
.ctx-color-swatch {
  flex-shrink: 0;
  width: 36px;
  height: 32px;
  padding: 2px 3px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: white;
  cursor: pointer;
}
.ctx-color-hex {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  flex: 1;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: rgba(255,255,255,0.58);
}
.ctx-color-hex:focus {
  outline: none;
  border-color: var(--ink);
  background: white;
}

/* ============== PILLS ============== */
.pill-group { display: flex; gap: 4px; }
.pill {
  flex: 1;
  padding: 7px 10px;
  font-size: 11px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  transition: all 140ms;
}
.pill:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pill.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ============== STAT COUNTERS ============== */
.stat-num {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 42px;
  line-height: 1;
  letter-spacing: -0.04em;
}

/* ============== TAG CHIPS ============== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  background: rgba(10, 10, 11, 0.06);
  font-size: 10.5px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}

/* ============== PLAN GUIDE ============== */
.plan-guide {
  position: fixed;
  left: 16px;
  top: 76px;
  z-index: 32;
  width: min(330px, calc(100vw - 32px));
  max-height: calc(100vh - 170px);
  padding: 18px;
  overflow-y: auto;
}
.plan-guide.hidden {
  display: none;
}
.plan-guide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.plan-guide-next {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  margin-bottom: 12px;
  border: 1px solid rgba(var(--brand-primary-rgb), 0.22);
  border-radius: 10px;
  background: rgba(var(--brand-primary-rgb), 0.08);
  font-size: 12px;
  line-height: 1.25;
}
.plan-guide-steps {
  display: grid;
  gap: 10px;
}
.plan-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.46);
  opacity: 0.72;
}
.plan-step[data-state="active"] {
  border-color: rgba(var(--brand-primary-rgb), 0.5);
  background: rgba(var(--brand-primary-rgb), 0.1);
  opacity: 1;
}
.plan-step[data-state="done"] {
  opacity: 1;
  /* Plegar el paso completado a una fila compacta */
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  padding: 8px 12px;
  background: rgba(10,10,11,0.03);
  border-color: transparent;
}
.plan-step[data-state="done"] .plan-step-index {
  background: #16a34a;
  color: white;
  /* Mostrar tick en lugar del número */
  font-size: 0;
  position: relative;
}
.plan-step[data-state="done"] .plan-step-index::after {
  content: '✓';
  font-size: 13px;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.plan-step[data-state="done"] .plan-step-title {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
/* Ocultar el cuerpo completo excepto el título cuando está done */
.plan-step[data-state="done"] .plan-step-body > *:not(.plan-step-title) {
  display: none;
}
.plan-step-index {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(10, 10, 11, 0.08);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
}
.plan-step-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 3px;
}
.plan-step p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.plan-step-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.plan-step-action {
  width: 100%;
  justify-content: center;
  padding: 8px 10px;
}
.plan-step-action:disabled {
  cursor: default;
  opacity: 0.45;
  transform: none;
}
.plan-step-action:disabled:hover {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline);
}
.guide-pulse {
  animation: guidePulse 900ms ease-in-out 2;
}
.plan-step-mini {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.56);
}
.plan-step-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
}
.plan-step-mini-row strong {
  font-weight: 600;
}
.plan-step-mini-state {
  color: var(--muted);
  text-align: right;
}
@keyframes guidePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--brand-primary-rgb), 0); }
  50% { box-shadow: 0 0 0 4px rgba(var(--brand-primary-rgb), 0.22); }
}

/* ── Onboarding ring pulse (green) ── */
@keyframes onboardRing {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(var(--brand-primary-rgb), 0.75), 0 0 0 0 rgba(var(--brand-primary-rgb), 0.3);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(var(--brand-primary-rgb), 0.35), 0 0 0 8px rgba(var(--brand-primary-rgb), 0.1);
  }
}
.onboard-pulse {
  outline: 2px solid rgba(var(--brand-primary-rgb), 0.9) !important;
  outline-offset: 2px;
  animation: onboardRing 1.3s ease-in-out infinite !important;
  position: relative;
  z-index: 1;
}

/* ── Guide panel onboarding glow ── */
@keyframes guidePanelRing {
  0%, 100% { box-shadow: 0 4px 24px rgba(0,0,0,0.12), 0 0 0 0 rgba(var(--brand-primary-rgb), 0.45); }
  50% { box-shadow: 0 4px 24px rgba(0,0,0,0.12), 0 0 0 7px rgba(var(--brand-primary-rgb), 0.18); }
}
.guide-panel-pulse {
  animation: guidePanelRing 1.5s ease-in-out infinite;
}

/* ── Active guide step card pulsing border ── */
@keyframes stepCardRing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--brand-primary-rgb), 0.45); }
  50% { box-shadow: 0 0 0 5px rgba(var(--brand-primary-rgb), 0.18); }
}
.plan-step.step-onboard-pulse {
  outline: 1.5px solid rgba(var(--brand-primary-rgb), 0.75) !important;
  outline-offset: 1px;
  animation: stepCardRing 1.6s ease-in-out infinite;
}

/* ============== CALIBRATION INDICATOR (preparado para Entrega 2) ============== */
#calibration-banner {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  padding: 12px 22px;
  display: none;
  align-items: center;
  gap: 12px;
}
#calibration-banner.visible { display: inline-flex; animation: fadeIn 240ms both; }

/* ── Calibration step hint banner ── */
@keyframes calBannerIn {
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.cal-banner {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  max-width: 580px;
  width: calc(100% - 40px);
  background: rgba(10, 18, 30, 0.93);
  border: 1.5px solid rgba(34, 197, 94, 0.55);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45), 0 0 0 5px rgba(34,197,94,0.07);
  animation: calBannerIn 0.28s ease-out;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.5;
}
.cal-banner.hidden { display: none; }
.cal-banner-body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 14px 18px;
}
.cal-banner-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}
.cal-banner-text {
  flex: 1;
  margin: 0;
}
.cal-banner-text strong { color: #fff; }
.cal-arrow {
  display: inline-block;
  font-family: monospace;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.35);
  border-radius: 6px;
  padding: 1px 7px;
  color: #86efac;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.cal-banner-close {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 2px 0;
  flex-shrink: 0;
  margin-top: 1px;
  border-radius: 4px;
  transition: color 140ms;
}
.cal-banner-close:hover { color: #cbd5e1; }

/* ═══════════════════════════════════════════════════
   PLAN DROPDOWN + BUSCAR PLANO
   ═══════════════════════════════════════════════════ */

/* ── Dropdown ──────────────────────────────────────── */
.plan-dropdown {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  min-width: 160px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(20px);
  border: 0.5px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  box-shadow: 0 4px 20px -4px rgba(0,0,0,0.18), 0 1px 0 rgba(255,255,255,0.9) inset;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.plan-dropdown.hidden { display: none; }

.plan-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 13px;
  font-family: 'Inter Tight', sans-serif;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: background 120ms;
}
.plan-dropdown-item:hover { background: rgba(0,0,0,0.05); }
.plan-dropdown-item svg { opacity: 0.65; }

/* ── Search modal overlay ──────────────────────────── */
.plan-search-modal-bg {
  display: none;
  align-items: center;
  justify-content: center;
}
.plan-search-modal-bg.visible { display: flex; }

.plan-search-dialog {
  width: min(680px, calc(100vw - 40px));
  max-height: min(80vh, 680px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  padding: 28px 28px 20px;
  overflow: hidden;
}

.plan-search-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-shrink: 0;
}

/* ── Tabs ──────────────────────────────────────────── */
.plan-search-tabs {
  display: flex;
  gap: 0;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  margin: 0 -28px 14px;
  padding: 0 28px;
}
.plan-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.plan-tab:hover { color: var(--ink); }
.plan-tab.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }

/* ── Search input ──────────────────────────────────── */
.plan-search-input-wrap {
  position: relative;
  flex-shrink: 0;
  margin-bottom: 10px;
}

/* ── Filters row ───────────────────────────────────── */
.plan-search-filters {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  margin-bottom: 14px;
}
.plan-filter-select {
  flex: 1;
  height: 36px;
  padding: 0 28px 0 10px;
  border-radius: 8px;
  border: 1.5px solid rgba(26,32,44,0.15);
  background: rgba(255,255,255,0.6);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231a1a1c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
  transition: border-color 140ms;
}
.plan-filter-select:focus {
  outline: none;
  border-color: rgba(26,32,44,0.45);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}
.plan-filter-select:has(option:checked:not([value=""])) {
  border-color: rgba(26,32,44,0.45);
  background-color: rgba(26,32,44,0.06);
}
.plan-search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.4;
}
.plan-search-input {
  width: 100%;
  height: 46px;
  padding: 0 42px 0 40px;
  border: 1.5px solid rgba(0,0,0,0.15);
  border-radius: 10px;
  font-size: 15px;
  font-family: 'Inter Tight', sans-serif;
  background: rgba(0,0,0,0.03);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms, box-shadow 160ms;
  box-sizing: border-box;
}
.plan-search-input:focus {
  border-color: rgba(0,0,0,0.45);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}
.plan-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.07);
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 140ms;
}
.plan-search-clear:hover { opacity: 1; }

/* ── Results area ──────────────────────────────────── */
.plan-search-results {
  flex: 1;
  overflow-y: auto;
  min-height: 180px;
}
.plan-search-results::-webkit-scrollbar { width: 5px; }
.plan-search-results::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 4px; }

.plan-search-state {
  height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  gap: 4px;
  text-align: center;
}
.plan-search-state.hidden { display: none; }

.plan-search-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid rgba(0,0,0,0.1);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: planSpin 0.7s linear infinite;
  margin-bottom: 12px;
}
@keyframes planSpin { to { transform: rotate(360deg); } }

/* ── Results grid ──────────────────────────────────── */
.plan-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  padding-bottom: 4px;
}
.plan-search-grid.hidden { display: none; }

.plan-search-card {
  border: 1.5px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0,0,0,0.02);
  cursor: pointer;
  text-align: left;
  padding: 0;
  transition: border-color 160ms, box-shadow 160ms, transform 120ms;
}
.plan-search-card:hover {
  border-color: rgba(0,0,0,0.5);
  box-shadow: 0 4px 16px -6px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}
.plan-search-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  background: rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.plan-search-thumb img { width: 100%; height: 100%; object-fit: cover; }
.plan-search-card-info { padding: 9px 11px 10px; }
.plan-search-card-name {
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter Tight', sans-serif;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-search-card-zone {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
  opacity: 0.65;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-search-card-city { font-size: 11px; color: var(--muted); margin-top: 1px; }

#select-rect {
  stroke: var(--brand-secondary);
}

.blink-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(212, 255, 58, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(212, 255, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 255, 58, 0); }
}

/* ============== LOADING STATE ============== */
.skeleton-grid {
  background-image: linear-gradient(0deg, transparent calc(50% - 0.5px), rgba(10, 10, 11, 0.06) calc(50% - 0.5px), rgba(10, 10, 11, 0.06) calc(50% + 0.5px), transparent calc(50% + 0.5px));
}

/* ── Account popover ── */
.account-pop-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 12px;
  border: none;
  background: none;
  font-size: 12px;
  font-family: 'Inter Tight', sans-serif;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  border-radius: 7px;
  transition: background 120ms;
}
.account-pop-btn:hover { background: rgba(0,0,0,0.06); }
.account-pop-btn.danger:hover { background: rgba(185,28,28,0.08); color: #b91c1c; }

/* ============== AUTH + LICENSE ============== */
.hdr-account {
  max-width: 240px;
  justify-content: flex-start;
  gap: 8px;
}
.hdr-account .hdr-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(10, 10, 11, 0.18);
  flex-shrink: 0;
}
.hdr-account.is-connected .hdr-dot {
  background: var(--brand-primary);
}
#account-chip-label {
  max-width: 104px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-auth-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.42);
}
.company-auth-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.company-auth-title {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.15;
}
.company-auth-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.company-auth-status-text {
  font-size: 13px;
  font-weight: 600;
}
.company-auth-hint {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
.company-field-help {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}
.input-field.is-locked {
  background: rgba(10, 10, 11, 0.04);
  color: rgba(10, 10, 11, 0.72);
  cursor: default;
}
.schema-advanced-panel {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 10px 12px 12px;
  background: rgba(255, 255, 255, 0.44);
}
.schema-advanced-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
}
.schema-advanced-summary::-webkit-details-marker {
  display: none;
}
.company-auth-btn {
  justify-content: center;
  min-height: 40px;
  padding-inline: 10px;
}
.company-account-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.company-account-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  font-size: 12px;
}
.company-auth-btn.recommended {
  border-color: var(--brand-primary);
  background: rgba(var(--brand-primary-rgb), 0.08);
  color: var(--brand-primary);
}
.company-auth-btn.recommended:hover {
  background: var(--brand-primary);
  color: white;
}
/* Google synced state */
.access-social-btn.google-synced {
  border-color: #16a34a !important;
  background: rgba(22, 163, 74, 0.08) !important;
  color: #16a34a !important;
  cursor: default;
  pointer-events: none;
  font-weight: 600;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.access-google-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  flex-shrink: 0;
}
/* Botón Continuar debajo de Google */
.access-continue-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 40px;
  padding-inline: 16px;
  border: none;
  border-radius: 8px;
  background: var(--brand-primary, #1a1a1a);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  animation: fadeSlideIn 0.25s ease both;
}
.access-continue-btn:hover {
  opacity: 0.88;
}
.access-continue-btn.hidden {
  display: none;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Company Readiness Hint — aparece al intentar exportar/compartir sin datos ── */
.company-readiness-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  background: #fef9c3;
  border: 1px solid #fde047;
  color: #713f12;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  animation: fadeSlideIn 0.2s ease both;
}
.company-readiness-hint.hidden {
  display: none;
}

/* ── btn-company: sin cambio visual cuando falta nombre ── */
.btn-company--empty {}

/* ── Banner "faltan campos" en modal empresa ── */
.company-missing-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(234,179,8,0.12);
  border: 1px solid rgba(234,179,8,0.35);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  color: #92400e;
  margin-bottom: 12px;
}
.company-missing-banner::before {
  content: '⚠️';
  font-size: 13px;
  flex-shrink: 0;
}

/* ── Campo obligatorio vacío en el modal de datos del PDF ── */
.input-field.pdf-field-missing {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.06);
}
.input-field.pdf-field-missing::placeholder {
  color: #dc2626;
  opacity: 0.7;
}

/* ── Company save feedback — aparece brevemente al guardar ── */
.company-save-feedback {
  margin-top: 0.6rem;
  padding: 0.45rem 0.85rem;
  border-radius: 7px;
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  animation: fadeSlideIn 0.2s ease both;
}
.company-save-feedback.hidden { display: none; }

/* ── Company tabs ── */
.company-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 0;
}
.company-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 12px;
  font-family: 'Inter Tight', sans-serif;
  font-weight: 500;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--muted);
  transition: color 120ms, border-color 120ms;
}
.company-tab:hover { color: var(--ink); }
.company-tab.active { color: var(--ink); border-bottom-color: var(--ink); }

/* ── Company member row ── */
.company-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  background: rgba(10,10,11,0.03);
}
.company-member-row:hover { background: rgba(10,10,11,0.06); }
.company-member-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  flex-shrink: 0;
}
.company-member-info { flex: 1; min-width: 0; }
.company-member-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-member-email { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-member-role {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(10,10,11,0.08);
  white-space: nowrap;
}
.company-member-loading { font-size: 12px; color: var(--muted); padding: 8px 4px; }

.company-auth-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.company-license-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.12);
  color: #9a6700;
  font-size: 12px;
  line-height: 1.35;
}

.plans-modal-shell {
  display: none;
  z-index: 221;
}

.plans-modal-shell.visible {
  display: flex;
}

.plans-modal-card {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 22px;
  border-radius: 18px;
}

.plans-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.plans-modal-meta {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.plans-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.plans-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 196px;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 30px -28px rgba(0, 0, 0, 0.24);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  cursor: pointer;
}

.plans-card:hover,
.plans-card.is-focused {
  transform: translateY(-1px);
}

.plans-card[data-plan-code="free_lite"] {
  border-color: color-mix(in srgb, var(--plan-free-lite-border) 32%, transparent);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), var(--plan-free-lite-surface));
}

.plans-card[data-plan-code="pro"] {
  border-color: var(--plan-pro-border);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), var(--plan-pro-surface));
  box-shadow: 0 18px 32px -24px var(--plan-pro-shadow);
}

.plans-card[data-plan-code="premium"] {
  border-color: color-mix(in srgb, var(--plan-premium-border) 42%, transparent);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), var(--plan-premium-surface));
}

.plans-card.is-current {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.plans-card-popular {
  position: absolute;
  top: -12px;
  left: 16px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--plan-pro-accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.plans-card-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  color: white;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.plans-card-badge[data-plan-visual="free_lite"] {
  background: var(--plan-free-lite-badge-bg);
  color: var(--plan-free-lite-badge-text);
}

.plans-card-badge[data-plan-visual="pro"] {
  background: var(--plan-pro-badge-bg);
  color: var(--plan-pro-badge-text);
}

.plans-card-badge[data-plan-visual="premium"] {
  background: var(--plan-premium-badge-bg);
  color: var(--plan-premium-badge-text);
}

.plans-card-badge-icon {
  font-size: 12px;
  line-height: 1;
}

.plans-card-price {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.05;
}

.plans-card-price small {
  font-size: 11px;
  color: var(--muted);
}

.plans-card-subcopy {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.hdr-chip.is-active {
  background: rgba(37, 99, 235, 0.12);
  color: #2563EB;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.3);
}

.plans-card-highlights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.plans-card-highlight-item {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.35;
}

.plans-card-highlight-item::before {
  content: '✓';
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #16a34a;
}

.plans-card[data-plan-code="premium"] .plans-card-highlight-item:first-child::before {
  content: '★';
  color: var(--plan-premium-accent);
}

.plans-card-details {
  border-top: 1px solid rgba(10, 10, 11, 0.07);
  padding-top: 6px;
}

.plans-card-details-toggle {
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
  padding: 2px 0;
}

.plans-card-details-toggle::-webkit-details-marker { display: none; }

.plans-card-details[open] .plans-card-details-toggle {
  margin-bottom: 6px;
}

.plans-card-params {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 2px;
}

.plans-card-param {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.plans-card-param > span:first-child {
  font-weight: 600;
  min-width: 58px;
  color: var(--ink);
}

.plans-card-param code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  background: rgba(10, 10, 11, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  word-break: break-all;
}

.plans-card-param-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.plans-card-param-url {
  font-size: 11px;
  color: var(--brand-primary, #2563EB);
  text-decoration: none;
}

.plans-card-param-url:hover { text-decoration: underline; }

.plans-card-cta {
  min-height: 42px;
  margin-top: auto;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--ink);
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

.plans-card-cta:hover {
  transform: translateY(-1px);
}

.plans-card[data-plan-code="free_lite"] .plans-card-cta {
  background: rgba(10, 10, 11, 0.06);
  color: rgba(10, 10, 11, 0.42);
}

.plans-card[data-plan-code="pro"] .plans-card-cta {
  background: linear-gradient(180deg, #ffb600, #ff9a1f);
  box-shadow: 0 18px 24px -22px var(--plan-pro-shadow);
}

.plans-card[data-plan-code="premium"] .plans-card-cta {
  background: linear-gradient(180deg, #2b66f6, #1d4ed8);
  box-shadow: 0 18px 24px -22px var(--plan-premium-shadow);
}

.plans-card-cta.is-current {
  background: rgba(10, 10, 11, 0.06);
  color: rgba(10, 10, 11, 0.46);
  box-shadow: none;
}

.plans-table-wrap {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255,255,255,0.72);
}

.plans-table-title {
  padding: 14px 16px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.plans-table-head,
.plans-table-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(0, 1fr));
}

.plans-table-head {
  background: rgba(10, 10, 11, 0.03);
}

.plans-table-body .plans-table-row:nth-child(2n) {
  background: rgba(10, 10, 11, 0.02);
}

.plans-table-cell {
  min-width: 0;
  padding: 14px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 13px;
  text-align: center;
}

.plans-table-head .plans-table-cell {
  border-top: 0;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
}

.plans-table-cell.is-label {
  text-align: left;
  color: var(--ink);
}

.plans-table-cell[data-plan-column="free_lite"] {
  box-shadow: inset 2px 0 0 0 color-mix(in srgb, var(--plan-free-lite-border) 74%, transparent);
}

.plans-table-cell[data-plan-column="pro"] {
  box-shadow: inset 2px 0 0 0 var(--plan-pro-border);
}

.plans-table-cell[data-plan-column="premium"] {
  box-shadow: inset 2px 0 0 0 color-mix(in srgb, var(--plan-premium-border) 86%, transparent);
}

.plans-check {
  color: #16a34a;
  font-size: 18px;
  font-weight: 700;
}

.plans-dash {
  color: rgba(10, 10, 11, 0.24);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.access-shell {
  position: relative;
  width: min(430px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  scrollbar-width: none;
  padding: 28px 28px 22px;
  display: grid;
  gap: 16px;
  text-align: center;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(99, 102, 241, 0.08);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.96) inset,
    0 26px 64px -28px rgba(15, 23, 42, 0.28),
    0 12px 28px -18px rgba(15, 23, 42, 0.18);
}
.access-shell::-webkit-scrollbar {
  display: none;
}
.access-shell-accent {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  border-radius: 28px 28px 0 0;
  background: linear-gradient(90deg, #4f83ff 0%, #8b5cf6 100%);
}
.access-brand-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--brand-logo-from) 0%, var(--brand-logo-to) 100%);
  color: var(--brand-logo-ink);
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 16px 32px -18px rgba(15, 23, 42, 0.42);
}
.access-brand-copy {
  display: grid;
  gap: 4px;
}
.access-brand-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}
.access-brand-subtitle {
  margin: 0;
  font-size: 13px;
  color: #94a3b8;
}
.access-plan-row {
  display: flex;
  justify-content: center;
}
.tier-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--plan-free-lite-accent) 16%, white);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--plan-free-lite-border) 22%, transparent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: white;
  cursor: pointer;
}
.tier-pill::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: var(--plan-free-lite-badge-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.tier-pill[data-plan='pro'] {
  background: color-mix(in srgb, var(--plan-pro-accent) 16%, white);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--plan-pro-border) 22%, transparent);
}
.tier-pill[data-plan='pro']::before {
  background: var(--plan-pro-badge-bg);
}
.tier-pill[data-plan='premium'] {
  background: color-mix(in srgb, var(--plan-premium-accent) 14%, white);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--plan-premium-border) 20%, transparent);
}
.tier-pill[data-plan='premium']::before {
  background: var(--plan-premium-badge-bg);
}
.tier-pill > * {
  position: relative;
  z-index: 1;
}
.tier-pill-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  font-size: 10px;
}
.tier-pill-arrow {
  font-size: 13px;
  line-height: 1;
  opacity: 0.92;
}
.access-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.06);
}
.access-tab {
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #697586;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 160ms ease;
}
.access-tab.active {
  background: white;
  color: var(--ink);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.98) inset,
    0 8px 18px -14px rgba(15, 23, 42, 0.28);
}
.access-description {
  margin: 0;
}
.access-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.access-actions:has(.access-social-btn.hidden) {
  grid-template-columns: 1fr;
}
.access-social-btn {
  width: 100%;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  color: #1f2937;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 160ms ease;
}
.access-social-btn.hidden {
  display: none;
}
.access-social-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -22px rgba(15, 23, 42, 0.24);
}
.access-social-logo {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}
.access-social-logo-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  background: conic-gradient(#4285f4 0 25%, #34a853 25% 50%, #fbbc05 50% 75%, #ea4335 75% 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.access-social-logo-microsoft {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}
.access-social-logo-microsoft span:nth-child(1) { background: #f35325; }
.access-social-logo-microsoft span:nth-child(2) { background: #81bc06; }
.access-social-logo-microsoft span:nth-child(3) { background: #05a6f0; }
.access-social-logo-microsoft span:nth-child(4) { background: #ffba08; }
.access-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #98a2b3;
  font-size: 11.5px;
  font-weight: 600;
}
.access-divider::before,
.access-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(15, 23, 42, 0.12);
}
.access-divider span {
  white-space: nowrap;
}
.access-form {
  display: grid;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}
.access-field {
  min-width: 0;
  min-height: 38px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}
.access-field:focus-within {
  border-color: rgba(var(--brand-primary-rgb), 0.4);
  box-shadow:
    0 0 0 4px rgba(var(--brand-primary-rgb), 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}
.access-field-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #98a2b3;
}
.access-field-input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #111827;
  font-size: 15px;
  font-family: 'Inter Tight', system-ui, sans-serif;
}
.access-field-input::placeholder {
  color: #98a2b3;
}
.access-field-input:focus {
  outline: none;
}
.access-field-toggle {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #98a2b3;
  cursor: pointer;
  padding: 0;
}
.access-forgot {
  justify-self: end;
  border: 0;
  background: transparent;
  color: #1677ff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 4px;
}
.access-submit-btn {
  min-height: 38px;
  border: 0;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(180deg, #7eb9ff 0%, #69a7f6 100%);
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 18px 30px -22px rgba(37, 99, 235, 0.68);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.access-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 20px 36px -22px rgba(37, 99, 235, 0.72);
}
.access-submit-btn.recommended {
  box-shadow:
    0 0 0 3px rgba(var(--brand-primary-rgb), 0.12),
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 18px 30px -22px rgba(37, 99, 235, 0.68);
}
.access-meta {
  display: grid;
  gap: 4px;
}
.access-profile-summary {
  margin: 0;
  min-height: 16px;
  font-size: 12px;
  line-height: 1.45;
  color: #98a2b3;
}
.access-legal {
  max-width: 320px;
  margin: 0 auto;
  font-size: 12px;
  line-height: 1.45;
  color: #98a2b3;
}
.access-legal-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #1677ff;
  font-size: inherit;
  font-weight: 700;
  cursor: pointer;
}

.item-settings-handle {
  position: fixed;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: 0 8px 18px -12px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 42;
  cursor: pointer;
}

.item-settings-handle.hidden {
  display: none;
}

.item-settings-handle:hover {
  background: white;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .plans-modal-card {
    width: min(1040px, calc(100vw - 16px));
    padding: 18px;
  }

  .plans-card-grid,
  .plans-table-head,
  .plans-table-row {
    grid-template-columns: 1fr;
  }

  .plans-table-head {
    display: none;
  }

  .plans-table-cell {
    text-align: left;
  }

  .plans-table-cell[data-plan-column]::before {
    content: attr(data-plan-label);
    display: inline-block;
    min-width: 74px;
    margin-right: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    color: var(--muted);
  }

  .access-shell {
    width: min(430px, calc(100vw - 16px));
    padding: 26px 18px 20px;
  }

  .company-auth-head {
    flex-direction: column;
  }

  .access-actions {
    gap: 10px;
  }
}

@media (max-width: 420px) {
  .plans-card {
    min-height: auto;
  }

  .access-shell {
    border-radius: 24px;
    gap: 16px;
  }

  .access-shell-accent {
    border-radius: 24px 24px 0 0;
  }

  .access-actions {
    grid-template-columns: 1fr;
  }

  .access-tab {
    font-size: 14px;
  }
}

/* ═══════════════════════════════════════════════════════════
   TEMPLATE PILLS — Selector Base / Planning
   ═══════════════════════════════════════════════════════════ */

/* Contenedor de los dos pills */
.tpl-pills {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 0 10px 0;
}

/* Botón pill */
.tpl-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border, rgba(0,0,0,0.12));
  border-radius: 8px;
  background: var(--surface-2, rgba(0,0,0,0.04));
  color: var(--text, #111);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-align: left;
}
.tpl-pill:hover {
  background: var(--surface-3, rgba(0,0,0,0.07));
  border-color: var(--accent, #2563eb);
}
.tpl-pill.open {
  border-color: var(--accent, #2563eb);
  background: var(--surface-3, rgba(0,0,0,0.07));
}

/* Label fijo ("Plant. Base") */
.tpl-pill-kind {
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--muted, #888);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Separador | */
.tpl-pill-sep {
  color: var(--border, rgba(0,0,0,0.2));
  flex-shrink: 0;
}

/* Nombre dinámico de la plantilla */
.tpl-pill-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

/* Flecha chevron */
.tpl-pill-arrow {
  flex-shrink: 0;
  transition: transform 0.2s;
}
.tpl-pill.open .tpl-pill-arrow {
  transform: rotate(180deg);
}

/* Panel desplegable con lista filtrable — flotante (no empuja contenido) */
.tpl-pill-wrap {
  position: relative;
  z-index: 1;
}
.tpl-pill-wrap:has(.tpl-pill.open) {
  z-index: 10;
}

.tpl-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 10;
  border: 1px solid var(--border, rgba(0,0,0,0.12));
  border-radius: 8px;
  background: var(--surface, #fff);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
}
.tpl-panel.hidden { display: none; }

/* Input de filtro */
.tpl-filter {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-bottom: 1px solid var(--border, rgba(0,0,0,0.1));
  background: var(--surface-2, rgba(0,0,0,0.03));
  font-size: 11px;
  color: var(--text, #111);
  outline: none;
  box-sizing: border-box;
}
.tpl-filter:focus {
  background: var(--surface-3, rgba(0,0,0,0.05));
}

/* Lista de resultados */
.tpl-list {
  max-height: 180px;
  overflow-y: auto;
  padding: 4px 0;
}

/* Item de la lista */
.tpl-item {
  display: flex;
  align-items: center;
  padding: 7px 12px;
  font-size: 11px;
  cursor: pointer;
  gap: 6px;
  color: var(--text, #111);
  transition: background 0.12s;
}
.tpl-item:hover {
  background: var(--surface-2, rgba(0,0,0,0.05));
}
.tpl-item.is-active {
  font-weight: 700;
  color: var(--accent, #2563eb);
}
.tpl-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tpl-item-date {
  font-size: 10px;
  color: var(--muted, #888);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Mensaje vacío */
.tpl-empty {
  padding: 10px 12px;
  font-size: 11px;
  color: var(--muted, #888);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════
   TEMPLATE MENU — Secciones y carpeta
   ═══════════════════════════════════════════════════════════ */

/* Fila de carpeta activa (cabecera del popover, clickeable) */
.tpl-folder-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px 9px;
  cursor: pointer;
  border-bottom: 1px solid var(--border, rgba(0,0,0,0.08));
  margin-bottom: 8px;
  border-radius: 6px 6px 0 0;
  transition: background 0.15s;
}
.tpl-folder-row:hover { background: var(--surface-2, rgba(0,0,0,0.04)); }
.tpl-folder-icon { color: var(--muted, #888); flex-shrink: 0; }
.tpl-folder-name {
  flex: 1;
  font-size: 10.5px;
  color: var(--muted, #888);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tpl-folder-change {
  font-size: 12px;
  color: var(--muted, #bbb);
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.tpl-folder-hint {
  font-size: 10.5px;
  color: var(--muted, #888);
  line-height: 1.45;
  padding: 2px 10px 8px;
  margin: 0;
}

.tpl-folder-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--hairline, rgba(0,0,0,0.1));
  border-radius: 8px;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 11px;
  color: var(--text, #1a1a1c);
  text-align: left;
  transition: all 140ms;
}

.tpl-folder-btn:hover {
  border-color: rgba(var(--brand-primary-rgb), 0.4);
  background: rgba(var(--brand-primary-rgb), 0.06);
  color: rgba(var(--brand-primary-rgb), 1);
}

.tpl-folder-btn #template-folder-path {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted, #888);
  font-size: 10px;
}

/* Sección dentro del popover */
.tpl-section { padding: 0 0 4px; }
.tpl-section-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #888);
  padding: 4px 10px 6px;
}

/* Separador entre secciones */
.tpl-divider {
  height: 1px;
  background: var(--border, rgba(0,0,0,0.08));
  margin: 6px 0;
}

/* Acciones más compactas dentro de secciones */
.tpl-actions-compact .menu-action {
  padding: 7px 10px;
}
.tpl-actions-compact .menu-action strong { font-size: 11.5px; }
.tpl-actions-compact .menu-action small  { font-size: 10px; }

/* ═══════════════════════════════════════════════════════════
   MODO SELECCIÓN PLANNING — Banner flotante
   ═══════════════════════════════════════════════════════════ */

.planning-sel-banner {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  background: rgba(10,10,11,0.95);
  color: #f5f3ee;
  border-radius: 14px;
  border: 1.5px solid rgba(212,255,58,0.35);
  box-shadow: 0 8px 36px rgba(0,0,0,0.4);
  backdrop-filter: blur(16px);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  white-space: nowrap;
  animation: fadeSlideIn 0.25s ease both;
}
.planning-sel-banner.hidden { display: none !important; }

/* Símbolo "+" grande */
.planning-sel-cursor {
  font-size: 26px;
  font-weight: 300;
  color: #d4ff3a;
  line-height: 1;
  flex-shrink: 0;
  font-family: monospace;
}

/* Texto de instrucciones */
.planning-sel-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.planning-sel-info strong { color: #d4ff3a; font-size: 12px; }
.planning-sel-info span   { opacity: 0.75; font-size: 10.5px; }

/* Contador y botones */
.planning-sel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 6px;
}
.planning-sel-count {
  font-size: 10px;
  opacity: 0.65;
  max-width: 180px;
  white-space: normal;
  line-height: 1.3;
}

.planning-sel-btn {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}
.planning-sel-btn:hover { opacity: 0.85; }
.planning-sel-btn--ok     { background: #d4ff3a; color: #111; }
.planning-sel-btn--cancel { background: rgba(255,255,255,0.1); color: #f5f3ee; }

/* Cursor crosshair en el canvas cuando está en modo selección */
body.planning-select-mode #scene-canvas {
  cursor: crosshair !important;
}

/* ═══════════════════════════════════════════════════════════
   BOTÓN PLANTILLA — Resaltado 15s tras guardar
   ═══════════════════════════════════════════════════════════ */

@keyframes tplHighlight {
  0%   { box-shadow: 0 0 0 0 rgba(212,255,58,0.7); border-color: #d4ff3a; }
  50%  { box-shadow: 0 0 0 5px rgba(212,255,58,0); }
  100% { box-shadow: 0 0 0 0 rgba(212,255,58,0); border-color: #d4ff3a; }
}

.tpl-btn-highlight {
  border: 1.5px solid #d4ff3a !important;
  animation: tplHighlight 1.5s ease infinite;
}

/* ═══════════════════════════════════════════════════════════
   ZONA — Tooltip de cursor (modo colocación)
   ═══════════════════════════════════════════════════════════ */

.zone-cursor-tip {
  position: fixed;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: rgba(10,10,11,0.90);
  color: #f5f3ee;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  border-radius: 10px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 600;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 6px 20px rgba(0,0,0,0.30);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  user-select: none;
  transition: opacity 0.15s;
}

/* Cursor crosshair en el canvas durante colocación de zona */
body.zone-placing #scene-canvas {
  cursor: crosshair !important;
}

/* ============== LAYER PANEL ============== */
.layers-fab {
  position: fixed;
  top: 52px;
  right: 12px;
  z-index: 28;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: rgba(245, 243, 238, 0.88);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 140ms, box-shadow 140ms;
  box-shadow: 0 2px 8px -2px rgba(10,10,11,0.14);
}
.layers-fab:hover {
  background: rgba(245, 243, 238, 1);
  box-shadow: 0 4px 12px -4px rgba(10,10,11,0.22);
}
.layers-fab.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* Botón Luna — debajo del layers-fab */
.scene-mode-fab {
  top: 92px !important;
}
.scene-mode-fab.active {
  background: #0a0a0b;
  color: #f5f3ee;
  border-color: #0a0a0b;
}

/* Panel modo escena */
.scene-mode-panel {
  position: fixed;
  top: 92px;
  right: 52px;
  z-index: 35;
  width: 220px;
  border-radius: 12px;
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: 0 8px 32px -8px rgba(10,10,11,0.22);
}
.smp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.smp-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.smp-section {
  padding: 8px 0;
  border-bottom: 1px solid rgba(10,10,11,0.07);
}
.smp-section:last-child { border-bottom: none; }
.smp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.smp-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.smp-row .smp-label { margin-bottom: 0; }
.smp-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--ink);
  margin-left: 4px;
}
/* Paleta cielo */
.smp-sky-swatches {
  display: flex;
  gap: 6px;
}
.smp-swatch {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 120ms, transform 120ms;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.smp-swatch:hover { transform: scale(1.1); }
.smp-swatch.active { border-color: var(--brand-primary, #2563eb); }
/* Botones UI */
.smp-ui-swatches {
  display: flex;
  gap: 6px;
}
.smp-ui-btn {
  flex: 1;
  padding: 5px 0;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  background: transparent;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}
.smp-ui-btn:hover { background: rgba(10,10,11,0.06); }
.smp-ui-btn.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
/* Range */
.smp-range {
  width: 100%;
  accent-color: var(--brand-primary, #2563eb);
  margin-top: 2px;
}
/* Toggle switch */
.smp-toggle { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.smp-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.smp-toggle-track {
  width: 34px; height: 18px;
  background: rgba(10,10,11,0.15);
  border-radius: 9px;
  transition: background 200ms;
  position: relative;
}
.smp-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 200ms;
}
.smp-toggle input:checked + .smp-toggle-track { background: var(--brand-primary, #2563eb); }
.smp-toggle input:checked + .smp-toggle-track::after { transform: translateX(16px); }

/* UI dark mode aplicado al body */
body.ui-dark #header-mac { background: rgba(10,10,11,0.95) !important; }
body.ui-dark #dock { background: rgba(10,10,11,0.92) !important; border-color: rgba(255,255,255,0.08) !important; }
body.ui-dark #header-mac,
body.ui-dark #header-mac *,
body.ui-dark #dock,
body.ui-dark #dock * { color: #f5f3ee !important; }
body.ui-dark #dock button svg,
body.ui-dark #header-mac svg { stroke: #f5f3ee !important; }

.layer-panel {
  position: fixed;
  right: 12px;
  left: auto;
  top: 94px;
  z-index: 28;
  width: 186px;
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 8px 24px -8px rgba(10,10,11,0.22);
  user-select: none;
}

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

.layer-panel-title {
  font-family: 'Inter Tight', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted, #888);
}

.layer-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 0;
}

.layer-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  transition: background 120ms;
  cursor: pointer;
}
.layer-item:hover { background: rgba(10,10,11,0.05); }
.layer-item.active { background: rgba(37,99,235,0.10); }

.layer-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.layer-name-btn {
  flex: 1;
  text-align: left;
  font-family: 'Inter Tight', sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink, #1a1a1c);
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.layer-vis-btn,
.layer-lock-btn,
.layer-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted, #888);
  border-radius: 5px;
  flex-shrink: 0;
  transition: background 120ms, color 120ms;
}
.layer-vis-btn:hover,
.layer-lock-btn:hover,
.layer-edit-btn:hover {
  background: rgba(10,10,11,0.08);
  color: var(--ink, #1a1a1c);
}

.layer-panel-footer {
  border-top: 1px solid rgba(10,10,11,0.07);
  padding: 6px 8px;
}

.layer-move-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 5px 6px;
  border: 1px solid rgba(10,10,11,0.10);
  border-radius: 7px;
  background: none;
  font-family: 'Inter Tight', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink, #1a1a1c);
  cursor: pointer;
  transition: background 120ms;
}
.layer-move-btn:hover { background: rgba(10,10,11,0.07); }

/* ── Layer lock blink (capa bloqueada) ── */
@keyframes layer-lock-blink {
  0%, 100% { color: inherit; background: transparent; }
  50%       { color: #dc2626; background: rgba(220,38,38,0.15); }
}
.layer-lock-blink {
  animation: layer-lock-blink 0.55s ease-in-out infinite;
  border-radius: 4px;
}

/* ── Layer context menu ── */
.layer-ctx-menu {
  background: var(--surface, #fff);
  border: 1px solid rgba(10,10,11,0.12);
  border-radius: 10px;
  box-shadow: 0 8px 24px -4px rgba(10,10,11,0.22), 0 2px 8px -2px rgba(10,10,11,0.08);
  padding: 10px 12px;
  min-width: 192px;
  user-select: none;
}
.layer-ctx-title {
  font-family: 'Inter Tight', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted, #888);
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(10,10,11,0.07);
  margin-bottom: 8px;
}
.layer-ctx-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  cursor: default;
}
.layer-ctx-field:last-child { margin-bottom: 0; }
.layer-ctx-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #888);
  min-width: 46px;
}
.layer-ctx-input {
  flex: 1;
  font-family: 'Inter Tight', sans-serif;
  font-size: 12px;
  padding: 4px 7px;
  border: 1px solid rgba(10,10,11,0.14);
  border-radius: 6px;
  background: var(--bg, #f5f3ee);
  color: var(--ink, #1a1a1c);
  outline: none;
  min-width: 0;
}
.layer-ctx-input:focus { border-color: var(--accent, #2563eb); box-shadow: 0 0 0 2px rgba(37,99,235,0.15); }
.layer-ctx-color {
  width: 36px;
  height: 26px;
  border: 1px solid rgba(10,10,11,0.14);
  border-radius: 6px;
  cursor: pointer;
  padding: 2px;
  background: var(--bg, #f5f3ee);
}

/* ── Format mode: cursor pincel en canvas ── */
body.format-mode-active #scene-canvas {
  cursor: crosshair !important;
}

/* ── Format mode: borde naranja en botón activo ── */
body.format-mode-active #btn-format-tool {
  background: rgba(234,88,12,0.14);
  border-color: #ea580c;
  color: #ea580c;
}

/* ============== CATALOG SEARCH ============== */
.catalog-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px 12px;
  position: relative;
}

.catalog-search-icon {
  color: var(--muted, #888);
  flex-shrink: 0;
  pointer-events: none;
}

.catalog-search-input {
  flex: 1;
  height: 34px;
  padding: 0 10px 0 2px;
  border: none;
  border-bottom: 1.5px solid rgba(10,10,11,0.12);
  background: transparent;
  font-family: 'Inter Tight', sans-serif;
  font-size: 13px;
  color: var(--ink, #1a1a1c);
  outline: none;
  transition: border-color 150ms;
}
.catalog-search-input::placeholder {
  color: var(--muted, #aaa);
  font-size: 12px;
}
.catalog-search-input:focus {
  border-bottom-color: rgba(10,10,11,0.45);
}

.catalog-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(10,10,11,0.07);
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted, #888);
  flex-shrink: 0;
  transition: background 120ms;
}
.catalog-search-clear:hover { background: rgba(10,10,11,0.14); }
.catalog-search-clear.hidden { display: none; }

/* ── Grid normal (por categoría) ── */
.catalog-grid-items {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-height: 340px;
  overflow-y: auto;
}

/* ── Resultados de búsqueda ── */
.catalog-grid-search {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 2px;
}

.catalog-search-group {}

.catalog-search-group-label {
  font-family: 'Inter Tight', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted, #888);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(10,10,11,0.07);
}

.catalog-search-group-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Tarjeta pequeña en modo búsqueda */
.cat-card-sm {
  width: 90px;
}
.cat-card-sm .cat-thumb {
  height: 52px;
}
.cat-card-sm .cat-name {
  font-size: 10px;
  line-height: 1.25;
}

/* Highlight de coincidencia */
.catalog-highlight {
  background: rgba(250,204,21,0.45);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* Empty state */
.catalog-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px 8px;
  font-family: 'Inter Tight', sans-serif;
  font-size: 12px;
  color: var(--muted, #888);
  font-style: italic;
}

/* ============== MESSAGE OVERLAYS (MessageManager) ============== */
.msg-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(26,32,44,0.40);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: msg-fade-in 280ms ease;
}
@keyframes msg-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.msg-shell {
  background: rgba(245,243,238,0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(26,32,44,0.10);
  border-radius: 16px;
  max-width: 440px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(26,32,44,0.18), 0 4px 16px rgba(26,32,44,0.08);
  animation: msg-slide-up 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes msg-slide-up {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.msg-accent-bar {
  height: 3px;
  background: var(--brand-accent, #667eea);
}
.msg-variant-alerta .msg-accent-bar { background: #e53e3e; }
.msg-variant-oferta .msg-accent-bar { background: #667eea; }
.msg-variant-info   .msg-accent-bar { background: #38a169; }
.msg-variant-stats  .msg-accent-bar { background: #d69e2e; }

.msg-body { padding: 24px 28px 22px; }
.msg-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.15;
  color: #1a202c;
  margin-bottom: 10px;
}
.msg-text {
  font-size: 13px;
  line-height: 1.6;
  color: #4a5568;
  margin-bottom: 22px;
  white-space: pre-line;
}
.msg-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.msg-btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: 8px;
  font-family: 'Inter Tight', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 140ms;
}
.msg-btn-cancel {
  background: transparent;
  border-color: rgba(26,32,44,0.15);
  color: #4a5568;
}
.msg-btn-cancel:hover { background: rgba(26,32,44,0.05); }
.msg-btn-accept {
  background: #1a202c;
  color: #f5f3ee;
  border-color: #1a202c;
}
.msg-btn-accept:hover { opacity: 0.85; }
.msg-variant-alerta .msg-btn-accept { background: #e53e3e; border-color: #e53e3e; }
.msg-variant-oferta .msg-btn-accept { background: #667eea; border-color: #667eea; }
.msg-variant-info   .msg-btn-accept { background: #38a169; border-color: #38a169; }

/* ─── Barra móvil (oculta en escritorio) ─────────────────────────────────────── */
#mobile-header-bar { display: none; }

/* ─── Móvil ≤768px ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Barra superior móvil */
  #mobile-header-bar {
    display: flex;
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 36;
    height: 50px; padding: 0 10px;
    align-items: center; justify-content: space-between;
    background: rgba(10,10,14,.92);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .mob-hdr-brand { display: flex; align-items: center; gap: 8px; }
  .mob-hdr-logo { width: 24px; height: 24px; object-fit: contain; border-radius: 6px; }
  .mob-hdr-name { font-size: 15px; font-weight: 700; letter-spacing: -.02em; color: #f5f3ee; }
  .mob-hdr-right { display: flex; align-items: center; gap: 8px; }
  .mob-cam-seg { gap: 2px; }
  .mob-hdr-btn {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
    color: #cbd5e1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  }
  .mob-hdr-btn:hover, .mob-hdr-btn:active { background: rgba(255,255,255,.16); }

  /* Ocultar el header original */
  #header-mac {
    display: none !important;
    top: 50px !important; left: 0 !important; right: 0 !important;
    border-radius: 0 !important; height: auto !important;
    overflow: visible !important;
  }

  /* Drawer del header cuando hamburger abierto */
  body.mobile-menu-open #header-mac {
    display: flex !important;
    position: fixed;
    top: 50px; left: 0; right: 0;
    z-index: 35;
    max-height: calc(100dvh - 50px);
    overflow-y: auto;
    padding: 10px 10px 20px;
    background: rgba(10,10,14,.97);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
  }
  body.mobile-menu-open #header-inner {
    flex-direction: column !important;
    width: 100% !important; gap: 3px !important;
    align-items: stretch !important;
  }
  body.mobile-menu-open .hdr-chip,
  body.mobile-menu-open .hdr-icon {
    width: 100% !important; justify-content: flex-start !important;
    min-height: 48px !important; padding: 10px 14px !important;
    font-size: 14px !important; border-radius: 12px !important; gap: 10px !important;
  }
  body.mobile-menu-open .hdr-sep { display: none !important; }
  body.mobile-menu-open .hdr-segmented {
    width: 100% !important; display: flex !important; gap: 3px !important;
  }
  body.mobile-menu-open .hdr-seg {
    flex: 1 !important; justify-content: center !important;
    min-height: 48px !important; border-radius: 12px !important;
  }
  body.mobile-menu-open .hdr-chip > div,
  body.mobile-menu-open #header-brand { display: none !important; }

  /* Popovers en modo móvil: anclados bajo la barra */
  body.mobile-menu-open .hdr-popover {
    top: 50px !important; left: 0 !important; right: 0 !important;
    width: 100% !important; max-width: none !important;
    border-radius: 0 0 16px 16px !important;
  }

  /* Ajustar canvas y dock para la barra móvil */
  #scene-canvas { top: 50px !important; height: calc(100dvh - 50px) !important; }

  /* Header: scrollable sin barra, tap targets mayores (legacy, ya no necesario pero por si acaso) */
  .hdr-chip, .hdr-icon, .hdr-seg { min-width: 40px; min-height: 38px; }

  /* Detail panel: bottom sheet */
  #detail-panel {
    position: fixed !important;
    right: 0 !important; left: 0 !important;
    bottom: 0 !important; top: auto !important;
    width: 100% !important; max-width: 100% !important;
    max-height: 65vh;
    border-radius: 16px 16px 0 0;
    display: block !important;
    transform: translateY(110%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    padding-top: 20px;
    box-shadow: 0 -4px 32px rgba(0,0,0,.5);
  }
  #detail-panel::before {
    content: '';
    position: absolute; top: 8px; left: 50%;
    transform: translateX(-50%);
    width: 36px; height: 4px;
    background: rgba(255,255,255,.25);
    border-radius: 2px;
  }
  #detail-panel.is-open { transform: translateY(0); }

  /* Inventory: bottom sheet */
  #inventory-panel {
    left: 0 !important; right: 0 !important;
    bottom: 0 !important;
    width: 100% !important; max-width: none !important;
    max-height: 65vh;
    border-radius: 16px 16px 0 0;
  }

  /* Catálogo móvil: centrado en pantalla como lista */
  #catalog-modal {
    top: 50% !important; left: 50% !important;
    bottom: auto !important; right: auto !important;
    transform: translate(-50%, -50%) !important;
    width: calc(100vw - 24px) !important;
    max-width: 360px !important;
    max-height: 80dvh;
    border-radius: 16px !important;
    overflow-y: auto;
  }
  .catalog-grid-items {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    max-height: none !important;
  }
  .cat-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 11px 14px !important;
    border-radius: 0 !important;
    border-bottom: 1px solid rgba(10,10,11,0.07) !important;
    min-width: 0 !important;
    text-align: left !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .cat-card:last-child { border-bottom: none !important; }
  .cat-card .cat-thumb {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    flex-shrink: 0 !important;
    background: transparent !important;
    border-radius: 6px !important;
    padding: 0 !important;
  }
  .cat-card .cat-thumb svg,
  .cat-card .cat-thumb img { width: 32px !important; height: 32px !important; }
  .cat-card .cat-name {
    font-size: 14px !important;
    line-height: 1.3 !important;
    white-space: normal !important;
    font-weight: 500 !important;
  }

  /* Búsqueda móvil: grupos también en lista */
  .catalog-search-group-cards {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
  }
  .cat-card-sm {
    width: 100% !important;
  }

  /* Menú contextual: bottom sheet en móvil */
  #context-menu {
    position: fixed !important;
    left: 0 !important; right: 0 !important;
    bottom: 0 !important; top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    max-height: 72dvh !important;
    border-radius: 16px 16px 0 0 !important;
    padding: 4px 4px 20px !important;
    box-shadow: 0 -4px 32px rgba(0,0,0,0.18) !important;
  }
  #context-menu::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    background: rgba(0,0,0,0.15);
    border-radius: 2px;
    margin: 8px auto 10px;
  }
  #context-menu.visible {
    animation: ctxInMobile 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both !important;
  }
  @keyframes ctxInMobile {
    from { transform: translateY(100%); opacity: 0.8; }
    to   { transform: translateY(0);   opacity: 1; }
  }
  /* Compactar campos en móvil */
  .ctx-editor { gap: 8px !important; }
  .ctx-block { padding: 6px 4px !important; }
  .ctx-field-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }
  .ctx-field span, .ctx-readonly span { font-size: 9px !important; }
  .ctx-input { padding: 4px 6px !important; font-size: 12px !important; }
  .ctx-action-btn { padding: 6px 4px !important; font-size: 10px !important; }
  .ctx-action-btn small { font-size: 9px !important; }
  .ctx-actions { gap: 4px !important; }
  .ctx-label { font-size: 9px !important; margin-bottom: 4px !important; }
  .ctx-title { font-size: 13px !important; }
  .ctx-item { padding: 10px 14px !important; font-size: 13px !important; }

  /* Popovers del header: full-width */
  .hdr-popover {
    left: 6px !important; right: 6px !important;
    width: auto !important; max-width: none !important;
  }
}
.msg-variant-stats  .msg-btn-accept { background: #d69e2e; border-color: #d69e2e; }

/* ── Sección empresa en panels de plantillas ── */
.tpl-org-section { margin-top: 8px; border-top: 1px solid var(--hairline); padding-top: 6px; }
.tpl-org-header {
  display: flex; align-items: center; gap: 5px;
  font-size: 9.5px; font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); padding: 4px 12px 6px;
}

/* ── Context Spawn Menu ── */
.ctx-spawn-menu {
  position: fixed;
  z-index: 120;
  min-width: 180px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  padding: 5px;
  box-shadow: 0 8px 32px -8px rgba(0,0,0,0.22), 0 2px 8px -2px rgba(0,0,0,0.1);
}
.ctx-spawn-menu.hidden { display: none; }
.ctx-spawn-title {
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  padding: 4px 8px 2px;
}
.ctx-spawn-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  background: none;
  border-radius: 7px;
  font-size: 12px;
  font-family: 'Inter Tight', sans-serif;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: background 120ms;
}
.ctx-spawn-item:hover { background: rgba(0,0,0,0.06); }
.ctx-spawn-sep {
  height: 1px;
  background: rgba(0,0,0,0.07);
  margin: 4px 0;
}
.ctx-spawn-catalog {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 5px 10px;
  border: none;
  background: none;
  border-radius: 7px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: background 120ms;
}
.ctx-spawn-catalog:hover { background: rgba(0,0,0,0.06); color: var(--ink); }

/* ═══════════ WALL PAINTER ═══════════ */
.wp-tool-btn {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  border-radius: 7px; cursor: pointer;
  color: var(--ink);
  transition: background 120ms;
}
.wp-tool-btn:hover { background: rgba(0,0,0,0.07); }
.wp-tool-active {
  background: var(--brand-primary, #2563eb) !important;
  color: #fff !important;
}

.wall-ctx-item {
  display: block; width: 100%;
  padding: 8px 12px;
  background: none; border: none;
  text-align: left; font-size: 13px;
  color: var(--ink); cursor: pointer;
  border-radius: 7px;
  transition: background 120ms;
}
.wall-ctx-item:hover { background: rgba(0,0,0,0.05); }
.wall-ctx-danger { color: #ef4444 !important; }
.wall-ctx-danger:hover { background: rgba(239,68,68,0.08) !important; }

