/* =========================================================================
   Foleo Pro — estilos (paleta slate / indigo)
   ========================================================================= */
:root,
:root[data-theme="dark"] {
  --page-bg: #030712;
  --text: #e2e8f0;
  --heading: #ffffff;
  --text-2: #cbd5e1;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --faint: #475569;

  --header-bg: rgba(3, 7, 18, 0.8);
  --header-border: rgba(30, 41, 59, 0.6);
  --header-shadow: none;

  --upload-bg: linear-gradient(to bottom, rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.4));
  --card-bg: rgba(15, 17, 26, 0.8);
  --card-border: rgba(30, 41, 59, 0.8);
  --card-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  --panel-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);

  --tabs-bg: rgba(15, 23, 42, 0.4);
  --tabs-border: rgba(30, 41, 59, 0.6);
  --tab-text: #94a3b8;
  --tab-hover-text: #e2e8f0;
  --tab-hover-bg: rgba(30, 41, 59, 0.5);
  --tab-active-bg: rgba(99, 102, 241, 0.1);
  --tab-active-text: #818cf8;

  --input-bg: rgba(15, 23, 42, 0.5);
  --input-bg-focus: #0f172a;
  --input-border: rgba(51, 65, 85, 0.8);
  --input-border-hover: #475569;
  --input-text: #e2e8f0;
  --placeholder: #475569;
  --input-shadow: none;
  --option-bg: #1e293b;

  --divider: #1e293b;

  --seg-bg: rgba(15, 23, 42, 0.5);
  --seg-border: rgba(51, 65, 85, 0.8);
  --seg-text: #94a3b8;
  --seg-hover-text: #e2e8f0;
  --seg-hover-bg: rgba(30, 41, 59, 0.5);
  --seg-active-bg: #6366f1;
  --seg-active-text: #ffffff;
  --seg-active-border: transparent;

  --info-bg: rgba(99, 102, 241, 0.05);
  --info-border: rgba(99, 102, 241, 0.1);
  --info-text: rgba(199, 210, 254, 0.7);

  --soft-bg: rgba(30, 41, 59, 0.3);
  --soft-border: rgba(51, 65, 85, 0.5);
  --soft-2-bg: rgba(15, 23, 42, 0.3);
  --soft-2-border: rgba(51, 65, 85, 0.6);
  --soft-2-hover: rgba(30, 41, 59, 0.5);

  --tag-bg: #334155;
  --tag-text: #a5b4fc;
  --tag-hover: #475569;
  --tag-border: transparent;
  --tagbar-bg: rgba(30, 41, 59, 0.8);

  --accent: #6366f1;
  --accent-600: #4f46e5;
  --accent-text: #818cf8;
  --accent-soft: rgba(99, 102, 241, 0.1);
  --accent-ring: rgba(99, 102, 241, 0.5);

  --dz-border: rgba(51, 65, 85, 0.6);
  --dz-bg: rgba(15, 23, 42, 0.5);
  --dz-hover-bg: rgba(30, 41, 59, 0.5);
  --dz-hover-border: rgba(99, 102, 241, 0.5);
  --dz-icon-bg: #1e293b;
  --dz-icon-text: #cbd5e1;

  --preview-bg: #0a0c10;
  --preview-border: rgba(30, 41, 59, 0.8);
  --preview-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --pbar-bg: rgba(15, 23, 42, 0.6);
  --pbar-border: rgba(30, 41, 59, 0.6);
  --zoom-bg: #0f172a;
  --zoom-border: #334155;
  --zoom-btn: #94a3b8;
  --zoom-btn-hover: #1e293b;
  --grid-line: rgba(255, 255, 255, 0.04);
  --page-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  --page-ring: rgba(255, 255, 255, 0.1);

  --anchor-bg: rgba(15, 23, 42, 0.8);
  --anchor-border: rgba(51, 65, 85, 0.8);
  --anchor-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
  --anchor-cell: #1e293b;
  --anchor-cell-hover: #334155;
  --anchor-cell-border: #334155;

  --shape-active-bg: rgba(99, 102, 241, 0.2);
  --shape-active-text: #818cf8;
  --preview-grad: linear-gradient(to bottom right, rgba(99, 102, 241, 0.1), transparent);
  --preview-grad-border: rgba(99, 102, 241, 0.2);
  --preview-grad-shadow: none;
  --eyebrow: rgba(129, 140, 248, 0.7);

  --theme-btn-bg: rgba(30, 41, 59, 0.8);
  --theme-btn-hover: #334155;
  --theme-btn-text: #fbbf24;
  --theme-btn-ring: #334155;

  --version: #475569;
  --pop-bg: #0f172a;
  --pop-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --page-bg: #f1f5f9;
  --text: #1e293b;
  --heading: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --faint: #94a3b8;

  --header-bg: rgba(255, 255, 255, 0.8);
  --header-border: rgba(226, 232, 240, 0.8);
  --header-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);

  --upload-bg: #ffffff;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --panel-shadow: 0 10px 15px -3px rgba(226, 232, 240, 0.5), 0 4px 6px -4px rgba(226, 232, 240, 0.5);

  --tabs-bg: rgba(248, 250, 252, 0.5);
  --tabs-border: rgba(226, 232, 240, 0.8);
  --tab-text: #64748b;
  --tab-hover-text: #1e293b;
  --tab-hover-bg: #f1f5f9;
  --tab-active-bg: #eef2ff;
  --tab-active-text: #4f46e5;

  --input-bg: #ffffff;
  --input-bg-focus: #ffffff;
  --input-border: #e2e8f0;
  --input-border-hover: #cbd5e1;
  --input-text: #1e293b;
  --placeholder: #94a3b8;
  --input-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --option-bg: #ffffff;

  --divider: #e2e8f0;

  --seg-bg: #f1f5f9;
  --seg-border: rgba(226, 232, 240, 0.8);
  --seg-text: #64748b;
  --seg-hover-text: #334155;
  --seg-hover-bg: rgba(226, 232, 240, 0.5);
  --seg-active-bg: #ffffff;
  --seg-active-text: #4f46e5;
  --seg-active-border: rgba(226, 232, 240, 0.5);

  --info-bg: #eef2ff;
  --info-border: #e0e7ff;
  --info-text: #3730a3;

  --soft-bg: #f8fafc;
  --soft-border: #e2e8f0;
  --soft-2-bg: #f8fafc;
  --soft-2-border: #e2e8f0;
  --soft-2-hover: #f1f5f9;

  --tag-bg: #ffffff;
  --tag-text: #4f46e5;
  --tag-hover: #eef2ff;
  --tag-border: #e2e8f0;
  --tagbar-bg: #f8fafc;

  --accent-text: #4f46e5;
  --accent-soft: #eef2ff;

  --dz-border: #cbd5e1;
  --dz-bg: #f8fafc;
  --dz-hover-bg: #f1f5f9;
  --dz-hover-border: #818cf8;
  --dz-icon-bg: #ffffff;
  --dz-icon-text: #64748b;

  --preview-bg: rgba(241, 245, 249, 0.5);
  --preview-border: #e2e8f0;
  --preview-shadow: inset 0 2px 4px rgba(226, 232, 240, 0.5);
  --pbar-bg: rgba(255, 255, 255, 0.6);
  --pbar-border: #e2e8f0;
  --zoom-bg: #f1f5f9;
  --zoom-border: #e2e8f0;
  --zoom-btn: #475569;
  --zoom-btn-hover: #ffffff;
  --grid-line: rgba(0, 0, 0, 0.04);
  --page-shadow: 0 25px 50px -12px rgba(203, 213, 225, 0.5);
  --page-ring: #e2e8f0;

  --anchor-bg: #f1f5f9;
  --anchor-border: #e2e8f0;
  --anchor-shadow: inset 0 2px 4px rgba(203, 213, 225, 0.3);
  --anchor-cell: #ffffff;
  --anchor-cell-hover: #eef2ff;
  --anchor-cell-border: #e2e8f0;

  --shape-active-bg: #eef2ff;
  --shape-active-text: #4338ca;
  --preview-grad: linear-gradient(to bottom right, #eef2ff, #ffffff);
  --preview-grad-border: #e0e7ff;
  --preview-grad-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --eyebrow: rgba(79, 70, 229, 0.7);

  --theme-btn-bg: #f1f5f9;
  --theme-btn-hover: #e2e8f0;
  --theme-btn-text: #475569;
  --theme-btn-ring: #e2e8f0;

  --version: #94a3b8;
  --pop-bg: #ffffff;
  --pop-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  color-scheme: light;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
}
body {
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  transition: background-color 0.5s, color 0.5s;
  -webkit-font-smoothing: antialiased;
}
::selection {
  background: rgba(99, 102, 241, 0.3);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
h1,
h2,
h3,
p {
  margin: 0;
}
.i {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* Brillos de fondo (solo oscuro) */
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.bg-glow span {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
}
.bg-glow span:first-child {
  top: -10%;
  left: -10%;
  width: 40%;
  height: 40%;
  background: rgba(49, 46, 129, 0.2);
  filter: blur(120px);
}
.bg-glow span:last-child {
  bottom: -10%;
  right: -5%;
  width: 30%;
  height: 30%;
  background: rgba(30, 58, 138, 0.1);
  filter: blur(100px);
}
:root[data-theme="light"] .bg-glow {
  display: none;
}

/* ---------- Cabecera ---------- */
.header {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--header-border);
  background: var(--header-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--header-shadow);
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(to bottom right, #6366f1, #2563eb);
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.brand h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--heading);
}
.brand h1 span {
  color: #6366f1;
  font-weight: 500;
}
.brand p {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.local {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.ping {
  position: relative;
  display: flex;
  width: 8px;
  height: 8px;
}
.ping span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #10b981;
}
.ping span:first-child {
  background: #34d399;
  opacity: 0.75;
  animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping {
  75%,
  100% {
    transform: scale(2);
    opacity: 0;
  }
}
.vsep {
  width: 1px;
  height: 24px;
  background: var(--divider);
}
.theme-btn {
  padding: 10px;
  border-radius: 999px;
  border: none;
  display: grid;
  place-items: center;
  background: var(--theme-btn-bg);
  color: var(--theme-btn-text);
  box-shadow: 0 0 0 1px var(--theme-btn-ring);
  transition: background 0.3s;
}
.theme-btn:hover {
  background: var(--theme-btn-hover);
}
.theme-btn .ic-moon,
:root[data-theme="light"] .theme-btn .ic-sun {
  display: none;
}
:root[data-theme="light"] .theme-btn .ic-moon {
  display: block;
}
@media (max-width: 767px) {
  .local,
  .vsep {
    display: none;
  }
}

/* ---------- Espacio de trabajo ---------- */
.workspace {
  position: relative;
  z-index: 10;
  flex: 1;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}
@media (min-width: 768px) {
  .workspace {
    padding: 24px;
  }
}
@media (min-width: 1024px) {
  .workspace {
    padding: 32px;
    gap: 32px;
  }
}
.aside {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}
@media (min-width: 1024px) {
  .workspace {
    grid-template-columns: clamp(430px, 40vw, 620px) minmax(0, 1fr);
  }
}
/* Pantallas con altura suficiente: todo cabe en la ventana y el panel se desplaza por dentro */
@media (min-width: 1024px) and (min-height: 600px) {
  .workspace {
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    flex: none;
    height: calc(100vh - var(--header-h, 73px));
    height: calc(100dvh - var(--header-h, 73px));
    min-height: 480px;
  }
  .aside {
    height: 100%;
    overflow-y: auto;
    padding-bottom: 24px;
    padding-right: 8px;
    scrollbar-width: none;
  }
  .aside::-webkit-scrollbar {
    display: none;
  }
}

/* ---------- Tarjetas ---------- */
.card {
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* Archivos */
.upload-card {
  position: relative;
  overflow: hidden;
  overflow: clip;
  padding: 24px;
  background: var(--upload-bg);
  flex: none;
}
.deco-monitor {
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  margin: 32px;
  stroke-width: 0.5;
  color: #818cf8;
  opacity: 0.2;
  transform: rotate(12deg) translate(16px, -16px);
  pointer-events: none;
}
:root[data-theme="light"] .deco-monitor {
  display: none;
}
.upload-inner {
  position: relative;
  z-index: 1;
}
.upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.upload-head h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--heading);
}
.upload-head p {
  font-size: 12px;
  margin-top: 2px;
  color: var(--muted);
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  background: #4f46e5;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  text-decoration: none;
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover {
  background: #6366f1;
}
.btn-primary:active {
  transform: scale(0.95);
}
.btn-primary .i {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.btn-ghost:hover {
  border-color: var(--accent);
}
.btn-ghost .i {
  width: 16px;
  height: 16px;
}
.dropzone {
  padding: 24px;
  border: 2px dashed var(--dz-border);
  border-radius: 12px;
  background: var(--dz-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  outline: none;
}
.dropzone:hover,
.dropzone:focus-visible,
body.dragover .dropzone {
  background: var(--dz-hover-bg);
  border-color: var(--dz-hover-border);
}
.dz-icon {
  padding: 12px;
  border-radius: 999px;
  background: var(--dz-icon-bg);
  color: var(--dz-icon-text);
  display: grid;
}
:root[data-theme="light"] .dz-icon {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.dz-icon .i {
  width: 20px;
  height: 20px;
}
.dropzone p {
  font-size: 14px;
  color: var(--text-2);
}
.files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.files:not(:empty) {
  margin-top: 16px;
}
.files li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--soft-2-border);
  background: var(--soft-2-bg);
}
.ftag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
.ftag.docx {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}
.fname {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
}
.fmeta {
  font-size: 12px;
  color: var(--muted-2);
  white-space: nowrap;
}
.mini {
  border: none;
  background: none;
  color: var(--muted-2);
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}
.mini:hover {
  color: var(--text);
  background: var(--tab-hover-bg);
}
.mini:disabled {
  opacity: 0.25;
  cursor: default;
  background: none;
}
.mini .i {
  width: 15px;
  height: 15px;
}
.link-btn {
  border: none;
  background: none;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 500;
  margin-top: 10px;
  padding: 0;
}
.link-btn:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ---------- Panel de configuración ---------- */
.config {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow: clip;
  box-shadow: var(--panel-shadow);
}
.tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--tabs-border);
  background: var(--tabs-bg);
  overflow-x: auto;
  flex: none;
}
.tabs button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  width: 100%;
  border: none;
  border-radius: 12px;
  background: none;
  color: var(--tab-text);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.025em;
  white-space: nowrap;
  transition: all 0.3s ease-out;
  outline: none;
}
.tabs button .i {
  transition: transform 0.3s;
}
.tabs button:hover {
  color: var(--tab-hover-text);
  background: var(--tab-hover-bg);
}
.tabs button:hover .i {
  transform: scale(1.1);
}
.tabs button.on {
  background: var(--tab-active-bg);
  color: var(--tab-active-text);
}
.tabs button.on .i {
  transform: scale(1.1);
  stroke-width: 2.5;
}
.tabs button.on::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: #6366f1;
  border-radius: 0 999px 999px 0;
}
.tabs button:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-ring);
}
.tab-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  min-width: 0;
}
@media (min-width: 640px) {
  .config {
    flex-direction: row;
  }
  .tabs {
    flex-direction: column;
    width: 160px;
    flex: none;
    border-bottom: none;
    border-right: 1px solid var(--tabs-border);
    overflow: visible;
  }
  .tab-content {
    padding: 32px;
  }
}
@media (min-width: 1024px) and (min-height: 600px) {
  .config {
    flex: 1 1 auto;
    min-height: 380px;
  }
}
@media (max-width: 639px) {
  .tabs button {
    width: auto;
    flex: 1;
    justify-content: center;
    padding: 10px 12px;
  }
  .tabs button.on::before {
    left: 50%;
    top: auto;
    bottom: 0;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    border-radius: 999px 999px 0 0;
  }
}

.tabpanel {
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: entrar 0.5s ease-out;
}
@keyframes entrar {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
}
.stack-3 {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stack-4 {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.grow {
  flex: 1;
  min-width: 0;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.row-between.end {
  align-items: flex-end;
}
.divider {
  height: 1px;
  width: 100%;
  background: var(--divider);
}
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.section-title h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--heading);
}
:root[data-theme="dark"] .section-title h3 {
  color: #e2e8f0;
}
.i.accent {
  color: #818cf8;
}

/* ---------- Campos ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.flabel {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.025em;
  color: var(--muted);
}
.flabel.lh {
  min-height: 18px;
}
.flabel output {
  color: var(--text-2);
}
input[type="text"],
input[type="number"],
input[type="search"],
select,
textarea,
.fp-btn {
  width: 100%;
  font-size: 14px;
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--input-text);
  box-shadow: var(--input-shadow);
  outline: none;
  transition: all 0.15s;
}
input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}
input:focus,
select:focus,
.fp-btn:focus-visible {
  background: var(--input-bg-focus);
  box-shadow: 0 0 0 2px var(--accent-ring);
}
input[type="number"] {
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.select {
  position: relative;
  display: block;
}
.select select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  cursor: pointer;
}
.select select:hover {
  border-color: var(--input-border-hover);
}
.select select option {
  background: var(--option-bg);
}
.select .i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
  color: var(--muted-2);
  pointer-events: none;
  transition: color 0.15s;
}
.select:hover .i {
  color: var(--text-2);
}
.suffix {
  position: relative;
  display: flex;
  align-items: center;
}
.suffix input {
  padding-right: 36px;
}
.suffix i {
  position: absolute;
  right: 12px;
  font-style: normal;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-2);
  pointer-events: none;
}
.w-24 {
  width: 96px !important;
}
input[type="range"] {
  width: 100%;
  accent-color: #6366f1;
  margin: 10px 0 0;
}

/* Segmentado */
.segmented {
  display: flex;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--seg-border);
  background: var(--seg-bg);
}
.seg-opt {
  flex: 1;
  position: relative;
  cursor: pointer;
}
.seg-opt input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.seg-opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--seg-text);
  text-align: center;
  line-height: 1.3;
  transition: all 0.2s;
}
.seg-opt span .i {
  width: 16px;
  height: 16px;
}
.seg-opt:hover span {
  color: var(--seg-hover-text);
  background: var(--seg-hover-bg);
}
.seg-opt input:checked + span {
  background: var(--seg-active-bg);
  color: var(--seg-active-text);
  border-color: var(--seg-active-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.seg-opt input:focus-visible + span {
  box-shadow: 0 0 0 2px var(--accent-ring);
}

.info-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--info-border);
  background: var(--info-bg);
  color: var(--info-text);
  font-size: 14px;
  line-height: 1.625;
}
.info-box .i {
  margin-top: 2px;
  color: #6366f1;
}
.soft-box {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--soft-border);
  background: var(--soft-bg);
}
.soft-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
}
.plan {
  font-size: 12px;
  color: var(--muted-2);
  margin-top: -12px;
  line-height: 1.55;
}
.plan.warn {
  color: #f59e0b;
}

/* Texto / plantillas */
.text-link {
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-text);
}
.text-link:hover {
  text-decoration: underline;
}
.plantillas {
  position: relative;
}
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  min-width: 200px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--pop-bg);
  box-shadow: var(--pop-shadow);
  display: flex;
  flex-direction: column;
}
.menu button {
  border: none;
  background: none;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}
.menu button:hover {
  background: var(--tab-active-bg);
  color: var(--tab-active-text);
}
.text-editor {
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  box-shadow: var(--input-shadow);
  overflow: hidden;
  overflow: clip;
  transition: box-shadow 0.15s;
}
.text-editor:focus-within {
  box-shadow: 0 0 0 2px var(--accent-ring);
}
.text-editor textarea {
  display: block;
  height: 80px;
  padding: 16px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  resize: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}
.text-editor textarea:focus {
  box-shadow: none;
  background: transparent;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--input-border);
  background: var(--tagbar-bg);
}
.tags button {
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--tag-border);
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s;
}
:root[data-theme="light"] .tags button {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.tags button:hover {
  background: var(--tag-hover);
}

/* Selector de fuentes */
.fontpicker {
  position: relative;
}
.fp-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}
.fp-btn:hover {
  border-color: var(--input-border-hover);
}
.fp-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fp-btn .i {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
  color: var(--muted-2);
}
.fp-pop {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  width: min(340px, calc(100vw - 48px));
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--input-border);
  background: var(--pop-bg);
  box-shadow: var(--pop-shadow);
}
.fp-list {
  max-height: 300px;
  overflow-y: auto;
  margin: 8px 0;
}
.fp-group {
  position: sticky;
  top: 0;
  padding: 8px 8px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--eyebrow);
  background: var(--pop-bg);
}
.fp-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  text-align: left;
  font-size: 16px;
  color: var(--text);
}
.fp-item small {
  font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  font-size: 11px;
  color: var(--muted-2);
  white-space: nowrap;
}
.fp-item:hover {
  background: var(--tab-hover-bg);
}
.fp-item.sel {
  background: var(--tab-active-bg);
  color: var(--tab-active-text);
}
.fp-actions {
  display: flex;
  gap: 6px;
}
.fp-actions .btn-ghost {
  flex: 1;
  font-size: 12px;
  padding: 7px 8px;
}
.fp-empty {
  padding: 10px;
  font-size: 12px;
  color: var(--muted-2);
}

/* Barra tipo Word */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -8px;
}
.tgroup {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 12px;
  border: 1px solid var(--seg-border);
  background: var(--seg-bg);
}
.tbtn {
  min-width: 32px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--seg-text);
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: all 0.2s;
}
.tbtn.txt {
  font-size: 12px;
  font-weight: 600;
}
.tbtn .i {
  width: 16px;
  height: 16px;
}
.tbtn:hover {
  color: var(--seg-hover-text);
  background: var(--seg-hover-bg);
}
.tbtn.on {
  background: var(--seg-active-bg);
  color: var(--seg-active-text);
  border-color: var(--seg-active-border);
}
.serif {
  font-family: Georgia, serif;
}
.color-tool {
  position: relative;
  width: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.color-a {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.1;
  padding: 0 4px;
  border-bottom: 4px solid var(--swatch, #000);
  color: var(--seg-hover-text);
}
.color-tool input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.font-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--preview-grad-border);
  background: var(--preview-grad);
  box-shadow: var(--preview-grad-shadow);
}
.fp-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--eyebrow);
  margin-bottom: 4px;
}
.muted-xs {
  font-size: 12px;
  color: var(--muted-2);
}
.fp-sample {
  font-size: 24px;
  letter-spacing: -0.025em;
  color: var(--heading);
  white-space: pre;
  text-align: right;
  line-height: 1.2;
  overflow: hidden;
  max-width: 65%;
  flex: none;
}

/* Posición */
.anchor-row {
  display: flex;
  align-items: center;
  gap: 24px;
}
.anchor-grid {
  width: 128px;
  height: 160px;
  flex: none;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 6px;
  border-radius: 12px;
  border: 1px solid var(--anchor-border);
  background: var(--anchor-bg);
  box-shadow: var(--anchor-shadow);
}
.anchor-grid button {
  border-radius: 8px;
  border: 1px solid var(--anchor-cell-border);
  background: var(--anchor-cell);
  transition: all 0.3s;
}
.anchor-grid button:hover {
  background: var(--anchor-cell-hover);
}
.anchor-grid button.on {
  background: #6366f1;
  border-color: #6366f1;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
  transform: scale(1.1);
  position: relative;
  z-index: 1;
}
.pill-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--soft-2-border);
  background: var(--soft-2-bg);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: all 0.2s;
}
.pill-btn:hover {
  background: var(--soft-2-hover);
  color: var(--text);
}
.pill-btn.on {
  border-color: #6366f1;
  background: var(--shape-active-bg);
  color: var(--shape-active-text);
}
.check-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--soft-2-border);
  background: var(--soft-2-bg);
  cursor: pointer;
  transition: background 0.15s;
}
.check-card:hover {
  background: var(--soft-2-hover);
}
.check-card input {
  position: absolute;
  top: 18px;
  left: 16px;
  width: 20px;
  height: 20px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.check-box {
  margin-top: 2px;
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 4px;
  display: grid;
  place-items: center;
  border: 1px solid #64748b;
  background: #1e293b;
  transition: all 0.15s;
}
:root[data-theme="light"] .check-box {
  border-color: #cbd5e1;
  background: #fff;
}
.check-box .i {
  width: 14px;
  height: 14px;
  stroke-width: 3;
  color: #fff;
  opacity: 0;
}
.check-card input:checked + .check-box {
  background: #6366f1;
  border-color: #6366f1;
}
.check-card input:checked + .check-box .i {
  opacity: 1;
}
.check-card input:focus-visible + .check-box {
  box-shadow: 0 0 0 2px var(--accent-ring);
}
.check-text {
  display: flex;
  flex-direction: column;
}
.check-text b {
  font-size: 14px;
  font-weight: 500;
  color: var(--heading);
}
:root[data-theme="dark"] .check-text b {
  color: #e2e8f0;
}
.check-text small {
  font-size: 12px;
  margin-top: 2px;
  color: var(--muted-2);
}

/* Diseño */
.shape-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.shape-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
  border-radius: 12px;
  border: 1px solid var(--soft-2-border);
  background: var(--soft-2-bg);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}
:root[data-theme="light"] .shape-grid button {
  background: #fff;
}
.shape-grid button .i {
  width: 24px;
  height: 24px;
  stroke-width: 1.5;
}
.shape-grid button:hover {
  background: var(--soft-2-hover);
  color: var(--text-2);
}
.shape-grid button.on {
  border-color: #6366f1;
  background: var(--shape-active-bg);
  color: var(--shape-active-text);
}
.shape-grid button.on .i {
  stroke-width: 2;
}
.shape-opts {
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: opacity 0.3s, filter 0.3s;
}
.shape-opts.off {
  opacity: 0.4;
  filter: grayscale(1);
  pointer-events: none;
}
.color-field {
  height: 44px;
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  box-shadow: var(--input-shadow);
  cursor: pointer;
  transition: opacity 0.2s, border-color 0.15s;
}
.color-field:focus-within {
  border-color: #6366f1;
}
.color-field.off {
  opacity: 0.5;
}
.color-field input {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.color-field input::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-field input::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}
.color-field input::-moz-color-swatch {
  border: none;
  border-radius: 6px;
}
.color-field span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  color: var(--text-2);
}
.toggle-link {
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-2);
}
.toggle-link.on {
  color: #6366f1;
}
.toggle-link:hover {
  text-decoration: underline;
}

/* ---------- Acción ---------- */
.action-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: none;
}
.btn-cta {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 12px;
  background: #4f46e5;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.025em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.25);
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
}
.btn-cta:hover:not(:disabled) {
  background: #6366f1;
}
.btn-cta:active:not(:disabled) {
  transform: scale(0.98);
}
.btn-cta:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.cta-arrow {
  display: grid;
  padding: 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
  transition: transform 0.2s;
}
.cta-arrow .i {
  width: 16px;
  height: 16px;
}
.btn-cta:hover:not(:disabled) .cta-arrow {
  transform: translateX(4px);
}
.action-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}
.reset-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-2);
  transition: color 0.15s;
}
.reset-btn:hover {
  color: var(--text-2);
}
.reset-btn .i {
  width: 12px;
  height: 12px;
}
.version {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--version);
}
.progress .bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--seg-bg);
  border: 1px solid var(--seg-border);
}
.progress .fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #4f46e5, #3b82f6);
  transition: width 0.15s ease;
}
.plabel {
  margin-top: 6px;
  font-size: 12px;
  text-align: center;
  color: var(--muted);
}
.result {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}
.result-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.result-info b {
  display: block;
  font-size: 14px;
  word-break: break-all;
  color: var(--heading);
}
.result-info small {
  font-size: 12px;
  color: var(--muted);
}
.ok-dot {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #10b981;
  color: #fff;
}
.ok-dot .i {
  width: 16px;
  height: 16px;
  stroke-width: 3;
}
.result-actions {
  display: flex;
  gap: 8px;
}
.result-actions a {
  flex: 1;
}

/* ---------- Vista previa ---------- */
.preview {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 80vh;
  overflow: hidden;
  overflow: clip;
  border-radius: 16px;
  border: 1px solid var(--preview-border);
  background: var(--preview-bg);
  box-shadow: var(--preview-shadow);
}
@media (min-width: 1024px) {
  .preview {
    height: 100%;
    min-height: 0;
  }
}
/* Pantallas muy bajas (p. ej. 1366×768 con zoom 125 %): la página se desplaza y la vista previa queda fija */
@media (min-width: 1024px) and (max-height: 599px) {
  .preview {
    position: sticky;
    top: 12px;
    height: calc(100vh - 24px);
  }
}
.preview-bar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--pbar-border);
  background: var(--pbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.pb-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pb-title h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.025em;
  color: var(--heading);
}
:root[data-theme="dark"] .pb-title h3 {
  color: #e2e8f0;
}
.icon-chip {
  display: grid;
  padding: 6px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.icon-chip .i {
  width: 16px;
  height: 16px;
}
.pb-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.pb-page {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pb-page b {
  color: var(--text);
}
.pb-page input {
  width: 52px;
  padding: 4px 6px;
  border-radius: 8px;
  font-size: 12px;
  text-align: center;
}
.badge {
  margin-left: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: pre;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--accent-soft);
  color: var(--accent-text);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.2);
}
.badge.off {
  background: var(--seg-bg);
  color: var(--muted-2);
  box-shadow: inset 0 0 0 1px var(--seg-border);
}
.zoom {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--zoom-border);
  background: var(--zoom-bg);
}
.zbtn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--zoom-btn);
  font-size: 15px;
  transition: background 0.15s;
}
.pb-nav .zbtn {
  border: 1px solid var(--zoom-border);
  background: var(--zoom-bg);
  border-radius: 8px;
}
.zbtn .i {
  width: 16px;
  height: 16px;
}
.zbtn:hover:not(:disabled) {
  background: var(--zoom-btn-hover);
}
:root[data-theme="light"] .zbtn:hover:not(:disabled) {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.zbtn:disabled {
  opacity: 0.35;
  cursor: default;
}
.zval {
  width: 44px;
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  color: var(--text-2);
}

.canvas-area {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: auto;
  padding: 32px;
}
.grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Página vacía */
.empty-page {
  position: relative;
  z-index: 10;
  margin: auto;
  width: 100%;
  max-width: 672px;
  aspect-ratio: 1 / 1.4;
  border-radius: 2px;
  background: #fff;
  box-shadow: var(--page-shadow), 0 0 0 1px var(--page-ring);
  display: flex;
  align-items: center;
  justify-content: center;
  container-type: size;
}
@media (min-width: 1024px) {
  .empty-page {
    width: auto;
    height: 100%;
    max-height: 100%;
    max-width: 100%;
  }
}
.fake-lines {
  position: absolute;
  inset: 48px;
  opacity: 0.1;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.fake-lines div {
  width: 100%;
  border-radius: 4px;
  background: #94a3b8;
  flex: none;
}
.fake-lines .block {
  background: #cbd5e1;
}
.cta {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px;
  margin: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  outline: none;
  text-align: center;
}
.cta:focus-visible {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.5);
}
.cta-icon {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
}
.cta-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.2);
  filter: blur(24px);
  transform: scale(1.5);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  transition: background 0.5s;
}
@keyframes pulse {
  50% {
    opacity: 0.5;
  }
}
.cta-box {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(to top right, #4f46e5, #3b82f6);
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
  transition: transform 0.3s;
}
.cta-box .i {
  width: 32px;
  height: 32px;
}
.cta:hover .cta-glow {
  background: rgba(99, 102, 241, 0.3);
}
.cta:hover .cta-box {
  transform: scale(1.05) rotate(-3deg);
}
.cta h3 {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}
.cta p {
  max-width: 260px;
  font-size: 14px;
  line-height: 1.625;
  color: #64748b;
  margin-bottom: 24px;
}
.cta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #4f46e5;
  background: #eef2ff;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2);
}
.cta-pill .i {
  width: 14px;
  height: 14px;
}
.fake-folio {
  position: absolute;
  pointer-events: none;
  color: #1e293b;
  white-space: pre;
  line-height: 1.15;
  transition: all 0.3s;
}

/* Documento real */
.canvas-wrap {
  position: relative;
  z-index: 10;
  margin: auto;
  line-height: 0;
  box-shadow: var(--page-shadow), 0 0 0 1px var(--page-ring);
  flex: none;
}
.canvas-wrap canvas {
  display: block;
  background: #fff;
}
/* Solo con «Posición libre» la página sirve para colocar el folio */
.canvas-wrap.libre {
  touch-action: none;
}
.canvas-wrap.libre canvas {
  cursor: crosshair;
}
body.dragover .canvas-wrap {
  outline: 3px dashed #6366f1;
  outline-offset: 8px;
}
.marker {
  position: absolute;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 2px solid #6366f1;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
  opacity: 0;
  transition: opacity 0.2s;
}
.marker::before,
.marker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: #6366f1;
}
.marker::before {
  width: 30px;
  height: 2px;
  margin: -1px 0 0 -15px;
}
.marker::after {
  width: 2px;
  height: 30px;
  margin: -15px 0 0 -1px;
}
.canvas-wrap.arrastrando .marker {
  opacity: 0.6;
}
.overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: color-mix(in srgb, var(--page-bg) 60%, transparent);
  backdrop-filter: blur(2px);
}
.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--seg-border);
  border-top-color: #6366f1;
  animation: girar 0.8s linear infinite;
}
@keyframes girar {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Avisos ---------- */
.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
}
.toast {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  border-left: 4px solid #6366f1;
  background: var(--pop-bg);
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--pop-shadow);
  animation: subir 0.2s ease;
}
.toast.err {
  border-left-color: #ef4444;
}
.toast.warn {
  border-left-color: #f59e0b;
}
.toast.ok {
  border-left-color: #10b981;
}
@keyframes subir {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

/* ---------- Responsive fino ---------- */
@media (max-width: 480px) {
  .grid-2 {
    gap: 14px;
  }
  .anchor-row {
    gap: 16px;
  }
  .anchor-grid {
    width: 104px;
    height: 132px;
  }
  .canvas-area {
    padding: 16px;
  }
  .header {
    padding: 12px 16px;
  }
  .upload-card {
    padding: 18px;
  }
  .font-preview {
    flex-direction: column;
    align-items: flex-start;
  }
  .fp-sample {
    max-width: 100%;
    text-align: left;
  }
}

/* Contenedor oculto para convertir Word */
.docx-render {
  position: fixed;
  left: -20000px;
  top: 0;
  background: #fff;
}
.docx-render .docx-wrapper {
  background: #fff !important;
  padding: 0 !important;
}
.docx-render .docx-wrapper > section.docx {
  box-shadow: none !important;
  margin: 0 0 20px !important;
}

/* ---------- Laptops (1024–1440 px de ancho o poca altura, p. ej. 1366×768) ---------- */
@media (min-width: 1024px) and (max-width: 1440px), (min-width: 1024px) and (max-height: 860px) {
  .header {
    padding: 10px 24px;
  }
  .workspace {
    grid-template-columns: clamp(430px, 40vw, 620px) minmax(0, 1fr);
    padding: 18px 24px;
    gap: 22px;
  }
  .aside {
    gap: 14px;
    padding-bottom: 4px;
  }
  .upload-card {
    padding: 16px 18px;
  }
  .upload-head {
    margin-bottom: 12px;
  }
  .dropzone {
    flex-direction: row;
    padding: 12px 14px;
    gap: 12px;
  }
  .dz-icon {
    padding: 8px;
  }
  .dropzone p {
    font-size: 13px;
    text-align: left;
  }
  .files:not(:empty) {
    margin-top: 12px;
  }
  .tabs {
    width: 128px;
    padding: 6px;
  }
  .tabs button {
    padding: 10px 12px;
    font-size: 13.5px;
  }
  .tab-content {
    padding: 20px 22px;
  }
  .tabpanel {
    gap: 20px;
  }
  .grid-2 {
    gap: 14px;
  }
  .stack-4 {
    gap: 12px;
  }
  input[type="text"],
  input[type="number"],
  input[type="search"],
  select,
  .fp-btn {
    padding: 8px 11px;
    font-size: 13.5px;
  }
  .select select {
    padding-right: 34px;
  }
  .segmented .seg-opt span {
    padding: 7px 8px;
    font-size: 13px;
  }
  .soft-box,
  .check-card {
    padding: 12px 14px;
  }
  .text-editor textarea {
    height: 64px;
    padding: 12px 14px;
  }
  .font-preview {
    padding: 14px 16px;
  }
  .fp-sample {
    font-size: 20px;
  }
  .anchor-grid {
    width: 112px;
    height: 140px;
    padding: 8px;
    gap: 5px;
  }
  .shape-grid button {
    padding: 12px 0;
  }
  .color-field {
    height: 40px;
  }
  .action-card {
    padding: 12px;
    gap: 10px;
  }
  .btn-cta {
    padding: 13px;
    font-size: 15px;
  }
  .config {
    min-height: 210px;
  }
  .upload-card.con-archivos .dropzone {
    display: none;
  }
  .upload-card.con-archivos .files:not(:empty) {
    margin-top: 0;
  }
  .files {
    max-height: 132px;
    overflow-y: auto;
  }
  .preview-bar {
    padding: 9px 16px;
  }
  .canvas-area {
    padding: 20px;
  }
}

/* Anchos intermedios: la barra de la vista previa se reparte en dos filas si hace falta */
@media (min-width: 1024px) and (max-width: 1200px) {
  .workspace {
    grid-template-columns: clamp(420px, 42vw, 620px) minmax(0, 1fr);
  }
  .pb-title h3 {
    font-size: 13px;
  }
  .badge {
    max-width: 130px;
  }
}

.fonts-row {
  grid-template-columns: minmax(0, 1fr) 104px;
}
/* Menús flotantes: se posicionan con JS (fixed) para no recortarse dentro del panel */
.fp-pop.flotante,
.menu.flotante {
  position: fixed;
  z-index: 200;
  right: auto;
  bottom: auto;
}

@container (max-width: 400px) {
  .cta {
    padding: 18px 16px;
    margin: 10px;
  }
  .cta-icon {
    width: 54px;
    height: 54px;
    margin-bottom: 14px;
  }
  .cta-box .i {
    width: 24px;
    height: 24px;
  }
  .cta h3 {
    font-size: 16px;
    margin-bottom: 4px;
  }
  .cta p {
    font-size: 12px;
    margin-bottom: 14px;
  }
  .cta-pill {
    font-size: 11px;
    padding: 6px 12px;
  }
}

/* Botón de ayuda "?" */
.help {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin-left: 4px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  vertical-align: 1px;
  color: var(--accent-text);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.3);
  cursor: help;
  user-select: none;
}
.help:hover,
.help:focus-visible {
  background: #6366f1;
  color: #fff;
  outline: none;
}
.soft-label .help {
  vertical-align: 2px;
}

/* ---------- Sin cabecera: más espacio para trabajar ---------- */
:root {
  --header-h: 0px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
/* Botón flotante de tema */
.theme-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  width: 46px;
  height: 46px;
  padding: 0;
  box-shadow: 0 0 0 1px var(--theme-btn-ring), 0 10px 25px -5px rgba(0, 0, 0, 0.45);
  transition: background 0.3s, transform 0.2s;
}
:root[data-theme="light"] .theme-fab {
  background: #ffffff;
  box-shadow: 0 0 0 1px var(--theme-btn-ring), 0 10px 25px -5px rgba(15, 23, 42, 0.2);
}
.theme-fab:hover {
  transform: translateY(-2px) rotate(-12deg);
}
.theme-fab .i {
  width: 20px;
  height: 20px;
}
.toasts {
  bottom: 78px;
}
.foot-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.action-foot .local {
  display: flex;
  font-size: 11px;
  gap: 6px;
  color: var(--muted-2);
}
.action-foot .ping {
  width: 6px;
  height: 6px;
}

/* ---------- Archivos Origen compacto ---------- */
.upload-card {
  padding: 14px 16px;
}
.upload-head {
  margin-bottom: 10px;
}
.upload-head h2 {
  font-size: 15px;
}
.btn-primary.sm {
  padding: 6px 14px;
  font-size: 13px;
}
.dropzone {
  flex-direction: row;
  padding: 10px 14px;
  gap: 12px;
  border-width: 1.5px;
}
.dz-icon {
  padding: 7px;
}
.dz-icon .i {
  width: 16px;
  height: 16px;
}
.dropzone p {
  font-size: 13px;
  text-align: left;
}
.upload-card.con-archivos .dropzone {
  display: none;
}
.upload-card.con-archivos .files:not(:empty) {
  margin-top: 0;
}
.files {
  max-height: 132px;
  overflow-y: auto;
}
.link-btn {
  margin-top: 8px;
}
@media (max-width: 480px) {
  .action-foot .local {
    display: none;
  }
}

/* ---------- Barra de acción compacta ---------- */
.action-card {
  padding: 12px;
  gap: 10px;
}
.action-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}
.action-row .btn-cta {
  flex: 1;
  width: auto;
  padding: 11px 14px;
  font-size: 15px;
  gap: 10px;
}
.action-row .reset-btn {
  flex: none;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--soft-2-border);
  background: var(--soft-2-bg);
  font-size: 12.5px;
  white-space: nowrap;
}
.action-row .reset-btn:hover {
  background: var(--soft-2-hover);
  color: var(--text);
}
.action-row .reset-btn .i {
  width: 14px;
  height: 14px;
}
@media (max-width: 420px) {
  .action-row .reset-btn {
    font-size: 0;
    gap: 0;
    padding: 0 13px;
  }
  .action-row .reset-btn .i {
    width: 16px;
    height: 16px;
  }
}

/* Título de sección dentro de una pestaña: menos separación con lo que sigue */
.tabpanel > .section-title {
  margin-bottom: -12px;
}
/* En la pestaña Fuente la barra de formato va junto a la fila anterior */
.tabpanel[data-panel="fuente"] .toolbar {
  margin-top: -8px;
}
@media (max-width: 639px) {
  .tabs {
    gap: 2px;
    padding: 6px;
  }
  .tabs button {
    flex-direction: column;
    gap: 4px;
    padding: 8px 4px;
    font-size: 11.5px;
    letter-spacing: 0;
  }
}

/* ---------- Resumen de varios documentos ---------- */
.docs-resumen {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--soft-2-border);
  background: var(--soft-2-bg);
}
.docs-texto {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.docs-texto b {
  font-size: 14px;
  font-weight: 600;
  color: var(--heading);
}
.docs-texto small {
  font-size: 12px;
  color: var(--muted-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.docs-resumen .btn-ghost {
  flex: none;
  padding: 7px 12px;
  font-size: 13px;
}

/* ---------- Modal ---------- */
body.modal-abierto {
  overflow: hidden;
}
.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: aparecer 0.15s ease;
}
:root[data-theme="light"] .modal-bg {
  background: rgba(15, 23, 42, 0.35);
}
@keyframes aparecer {
  from {
    opacity: 0;
  }
}
.modal {
  width: min(600px, 100%);
  max-height: min(640px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: var(--pop-bg);
  box-shadow: var(--pop-shadow);
  animation: subir 0.2s ease;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--divider);
}
.modal-head h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--heading);
}
.modal-head p {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}
.modal-head .zbtn {
  flex: none;
}
.modal-list.files {
  flex: 1;
  max-height: none;
  overflow-y: auto;
  margin: 0;
  padding: 14px 20px;
}
.modal-list li {
  gap: 8px;
  padding: 8px 8px 8px 6px;
  transition: opacity 0.15s, box-shadow 0.1s;
}
.modal-list li.inactivo {
  opacity: 0.5;
}
.modal-list li.inactivo .fname {
  text-decoration: line-through;
}
.modal-list li.moviendo {
  opacity: 0.35;
}
.modal-list li.antes {
  box-shadow: 0 -3px 0 #6366f1;
}
.modal-list li.despues {
  box-shadow: 0 3px 0 #6366f1;
}
.grip {
  display: grid;
  color: var(--muted-2);
  cursor: grab;
}
.grip .i {
  width: 16px;
  height: 16px;
}
.doc-check {
  width: 16px;
  height: 16px;
  margin: 0 2px;
  flex: none;
  accent-color: #6366f1;
  cursor: pointer;
}
.orden {
  min-width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-text);
  background: var(--accent-soft);
}
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--divider);
}
.modal-info {
  display: flex;
  flex-direction: column;
  font-size: 12.5px;
  color: var(--muted);
}
.modal-info .link-btn {
  align-self: flex-start;
  margin-top: 2px;
}
.modal-btns {
  display: flex;
  gap: 8px;
}
@media (max-width: 480px) {
  .modal-list li .fmeta {
    display: none;
  }
  .modal-btns {
    width: 100%;
  }
  .modal-btns > * {
    flex: 1;
  }
}

/* ---------- Unir / por separado ---------- */
.upload-head {
  gap: 10px;
}
.upload-titulo {
  flex: 1;
  min-width: 0;
}
.upload-titulo h2,
.upload-titulo p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modo-varios {
  flex: none;
  padding: 3px;
}
.modo-varios .seg-opt span {
  padding: 5px 9px;
  font-size: 12px;
  gap: 5px;
}
@media (max-width: 400px) {
  .upload-head {
    flex-wrap: wrap;
  }
  .modo-varios {
    order: 3;
    width: 100%;
  }
}
.modo-varios .seg-opt span .i {
  width: 14px;
  height: 14px;
}
.res-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
}
.res-lista li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--soft-2-border);
  background: var(--soft-2-bg);
  font-size: 12.5px;
}
.res-lista .fname {
  flex: 1;
}
.res-lista small {
  color: var(--muted-2);
  white-space: nowrap;
}
.res-lista a {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--accent-text);
}
.res-lista a:hover {
  background: var(--accent-soft);
}
.res-lista a .i {
  width: 16px;
  height: 16px;
}

/* ---------- Selector de documento en la vista previa ---------- */
.preview {
  container-type: inline-size;
}
.pb-doc select {
  width: auto;
  max-width: 210px;
  padding: 6px 30px 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
}
.pb-doc .i {
  right: 9px;
  width: 14px;
  height: 14px;
}
.preview-bar .pb-nav {
  margin: 0 auto;
}
.preview-bar .pb-nav[hidden] ~ .zoom {
  margin-left: auto;
}
@container (max-width: 820px) {
  .pb-title h3 {
    display: none;
  }
}
@container (max-width: 620px) {
  .pb-doc select {
    max-width: 150px;
  }
}

/* ---------- Grupos ---------- */
.upload-card.varios #btnAgregar {
  padding: 6px 9px;
}
.upload-card.varios #btnAgregar .txt {
  display: none;
}
.modal-modo {
  margin-top: 12px;
  display: flex;
}
.modal-modo .seg-opt span {
  padding: 6px 8px;
}
.barra-grupos {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 20px 0;
}
.bg-fila {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.bg-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}
.contador {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--zoom-border);
  background: var(--zoom-bg);
}
.contador b {
  min-width: 28px;
  text-align: center;
  font-size: 14px;
  color: var(--heading);
}
.bg-fila .btn-ghost {
  margin-left: auto;
  padding: 6px 12px;
  font-size: 12.5px;
}
.gtabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.gtab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--soft-2-border);
  background: var(--soft-2-bg);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}
.gtab small {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.gtab.vacio small {
  background: var(--seg-bg);
  color: var(--muted-2);
}
.gtab:hover {
  color: var(--text);
  background: var(--soft-2-hover);
}
.gtab.on {
  border-color: #6366f1;
  background: #6366f1;
  color: #fff;
}
.gtab.on small {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.hint-grupo {
  font-size: 12.5px;
  color: var(--muted);
}
.hint-grupo.warn {
  color: #f59e0b;
}
.modal-list li.en-grupo {
  border-color: rgba(99, 102, 241, 0.55);
  background: var(--accent-soft);
}
.gchip {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--seg-bg);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--seg-border);
}
.gchip.libre {
  color: #f59e0b;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
}
@media (max-width: 480px) {
  .bg-fila .btn-ghost {
    margin-left: 0;
  }
  .gchip {
    display: none;
  }
}

/* ---------- Desplegables con estilo propio (como Tipografía) ---------- */
.select select.cs-nativo {
  position: absolute;
  inset: auto;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.cs-btn {
  width: 100%;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 10px 36px 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--input-text);
  box-shadow: var(--input-shadow);
  font-size: 14px;
  text-align: left;
  outline: none;
  transition: all 0.15s;
}
.cs-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-btn:hover {
  border-color: var(--input-border-hover);
}
.cs-btn:focus-visible,
.select.abierto .cs-btn {
  background: var(--input-bg-focus);
  box-shadow: 0 0 0 2px var(--accent-ring);
}
.select .i {
  transition: transform 0.2s, color 0.15s;
}
.select.abierto .i {
  transform: translateY(-50%) rotate(180deg);
  color: var(--accent-text);
}
.cs-pop {
  position: fixed;
  z-index: 200;
  max-width: min(440px, calc(100vw - 16px));
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--input-border);
  background: var(--pop-bg);
  box-shadow: var(--pop-shadow);
  animation: subir 0.15s ease;
}
.cs-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font-size: 13.5px;
  text-align: left;
  white-space: nowrap;
  outline: none;
}
.cs-item span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-item:hover,
.cs-item:focus-visible {
  background: var(--tab-hover-bg);
}
.cs-item.sel {
  background: var(--tab-active-bg);
  color: var(--tab-active-text);
  font-weight: 600;
}
.cs-item.sel::after {
  content: "";
  flex: none;
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.pb-doc .cs-btn {
  width: auto;
  max-width: 210px;
  padding: 6px 30px 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
}
@container (max-width: 620px) {
  .pb-doc .cs-btn {
    max-width: 150px;
  }
}
@media (min-width: 1024px) and (max-width: 1440px), (min-width: 1024px) and (max-height: 860px) {
  .cs-btn {
    padding: 8px 34px 8px 11px;
    font-size: 13.5px;
  }
}

/* Los avisos van por encima de la ventana modal y su fondo desenfocado */
.toasts {
  z-index: 300;
  pointer-events: none; /* solo informan: no deben tapar botones */
}

/* Botón para cerrar un aviso (lo único del aviso que recibe clics) */
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-right: 8px;
}
.toast-txt {
  flex: 1;
  padding-top: 2px;
}
.toast-x {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: -1px 0 0;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--muted-2);
  pointer-events: auto;
  cursor: pointer;
}
.toast-x:hover,
.toast-x:focus-visible {
  background: var(--tab-hover-bg);
  color: var(--text);
  outline: none;
}
.toast-x .i {
  width: 14px;
  height: 14px;
}
