:root {
  --app-sidebar-width: 15rem;
}

/* —— Shell + menú lateral —— */
.app-shell {
  display: flex;
  min-height: 100dvh;
}

.app-sidebar {
  width: var(--app-sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #1a2b4a;
  color: #e2e8f0;
  border-right: 1px solid rgb(255 255 255 / 0.08);
  z-index: 30;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.15rem 1rem 1rem;
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
}

.app-brand-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: #0d9488;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-brand-title {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.app-brand-sub {
  font-size: 0.72rem;
  color: rgb(226 232 240 / 0.55);
  margin-top: 0.1rem;
}

.app-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0.65rem;
}

.app-nav-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 0.65rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(226 232 240 / 0.75);
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.app-nav-item:hover {
  background: rgb(255 255 255 / 0.08);
  color: #fff;
}

.app-nav-item.is-active {
  background: rgb(13 148 136 / 0.25);
  color: #fff;
}

.app-sidebar-footer {
  margin-top: auto;
  padding: 0.65rem;
  border-top: 1px solid rgb(255 255 255 / 0.08);
}

.app-nav-item--footer {
  opacity: 0.9;
}

.app-nav-item--logout:hover {
  background: rgb(190 18 60 / 0.18);
  color: #fecdd3;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.app-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.app-view.hidden {
  display: none !important;
}

.board-header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
}

.board-header-text {
  flex: 1;
  min-width: 0;
}

.board-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

.app-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.65rem;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.app-sidebar-toggle:hover {
  background: #f0fdfa;
  color: #0d9488;
}

.app-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 54;
  background: rgb(15 23 42 / 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.app-sidebar-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 767px) {
  :root {
    --app-sidebar-width: 0;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(18rem, 88vw);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
    z-index: 55;
  }

  .app-sidebar-toggle {
    display: inline-flex;
  }
}

@media (min-width: 768px) {
  .app-sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100dvh;
    max-height: 100dvh;
  }

  .app-sidebar-toggle {
    display: none;
  }

  .app-sidebar-backdrop {
    display: none !important;
  }
}

/* —— Archivo de tarjetas —— */
.archive-view {
  background: #f8fafc;
}

.board-card--archived {
  opacity: 0.92;
}

.board-card--completed {
  --card-accent: #94a3b8;
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}

.board-card--completed::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background: rgb(248 250 252 / 0.72);
  pointer-events: none;
}

.board-card--completed:hover {
  transform: none;
  box-shadow: 0 2px 10px rgb(15 23 42 / 0.05);
}

.board-card-completed-badge {
  position: relative;
  z-index: 3;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
}

.board-card-title--completed {
  color: #64748b;
}

.board-card-date--completed {
  color: #64748b;
  font-weight: 600;
}

.board-card--completed .board-card-color-tag {
  position: relative;
  z-index: 3;
  color: #64748b;
  background: rgb(255 255 255 / 0.55);
  border-color: rgb(148 163 184 / 0.35);
}

.board-card--completed .board-card-complete,
.board-card--completed .board-card-archive {
  position: relative;
  z-index: 5;
}

/* —— Roadmap —— */
.roadmap-view {
  background: #f8fafc;
}

.roadmap-main {
  overflow-y: auto;
  padding: 1.25rem 1rem 2rem;
}

.roadmap-intro {
  margin: 0 auto 1.5rem;
  padding: 0 0.25rem;
}

.roadmap-intro-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.roadmap-intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0f766e;
  background: #f0fdfa;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0;
}

.roadmap-intro-text {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #475569;
}

.roadmap-intro-text.is-editing,
.rm-editable.is-editing {
  outline: 2px solid #99f6e4;
  outline-offset: 4px;
  border-radius: 0.35rem;
}

.roadmap-save-status {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.5rem;
  min-height: 1.25rem;
}

.roadmap-save-status.is-ok {
  color: #0f766e;
}

.roadmap-save-status.is-err {
  color: #be123c;
}

.roadmap-layout {
  display: grid;
  gap: 1.25rem;
  max-width: 56rem;
  margin: 0 auto;
}

@media (min-width: 900px) {
  .roadmap-layout {
    grid-template-columns: 1fr 1.1fr;
    align-items: start;
  }
}

.roadmap-track-wrap {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1rem;
}

.roadmap-track-hint {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

.roadmap-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.roadmap-step-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.roadmap-step.is-active .roadmap-step-btn {
  border-color: #0d9488;
  background: #f0fdfa;
}

.roadmap-step-circle {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #1a2b4a;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.roadmap-step-title {
  display: block;
  font-weight: 700;
  color: #1a2b4a;
  font-size: 0.9375rem;
}

.roadmap-step-summary {
  display: block;
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.roadmap-detail {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.25rem;
  min-height: 12rem;
}

.roadmap-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.875rem;
  min-height: 10rem;
}

.roadmap-detail-head {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.roadmap-detail-head-text {
  flex: 1;
  min-width: 0;
}

.roadmap-detail-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: #f0fdfa;
  color: #0d9488;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.roadmap-detail-step {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0d9488;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.roadmap-detail-title {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a2b4a;
}

.roadmap-detail-text {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #475569;
  margin-bottom: 1rem;
}

.roadmap-detail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.roadmap-detail-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.875rem;
  color: #475569;
}

.roadmap-step-inline-detail {
  display: none;
  margin-top: 0.65rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
}

.roadmap-step.is-active .roadmap-step-inline-detail {
  display: block;
}

@media (min-width: 900px) {
  .roadmap-step-inline-detail {
    display: none !important;
  }

  .roadmap-detail--desktop {
    display: block;
  }
}

@media (max-width: 899px) {
  .roadmap-detail--desktop {
    display: none !important;
  }
}

/* —— Documentos —— */
.documents-view {
  background: #f8fafc;
}

.documents-main {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1rem 2.5rem;
  max-width: 42rem;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.documents-upload-card,
.documents-list-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.25rem;
}

.documents-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 0.85rem;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.documents-dropzone:hover,
.documents-dropzone.is-dragover,
.documents-dropzone:focus-visible {
  border-color: #0d9488;
  background: #f0fdfa;
  outline: none;
}

.documents-dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.documents-dropzone-title {
  font-weight: 700;
  color: #1a2b4a;
  font-size: 0.9375rem;
}

.documents-dropzone-hint {
  font-size: 0.8125rem;
  color: #64748b;
  max-width: 22rem;
  line-height: 1.45;
}

.documents-upload-btn {
  margin-top: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 0.6rem;
  background: #0d9488;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
}

.documents-upload-btn:hover {
  background: #0f766e;
}

.documents-status {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.75rem;
  min-height: 1.25rem;
}

.documents-status.is-ok {
  color: #0f766e;
}

.documents-status.is-err {
  color: #be123c;
}

.documents-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.documents-list-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1a2b4a;
}

.documents-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.documents-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  padding: 2rem 0.5rem;
  color: #94a3b8;
  font-size: 0.875rem;
}

.documents-empty-hint {
  font-size: 0.8125rem;
  color: #cbd5e1;
}

.documents-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.documents-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.documents-item:hover {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.documents-item-delete {
  flex-shrink: 0;
}

.documents-item-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.6rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #0d9488;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.documents-item-body {
  flex: 1;
  min-width: 0;
}

.documents-item-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1a2b4a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.documents-item-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}

/* —— Modal vista previa documento —— */
.doc-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgb(15 23 42 / 0.45);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.doc-preview-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.doc-preview-modal {
  position: fixed;
  z-index: 90;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(0.97);
  width: min(94vw, 52rem);
  max-height: min(88vh, 44rem);
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 24px 60px rgb(15 23 42 / 0.2);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

.doc-preview-modal.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.doc-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.doc-preview-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.doc-preview-title {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a2b4a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-preview-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.45rem;
  color: #94a3b8;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.doc-preview-close:hover {
  color: #64748b;
  background: #f1f5f9;
}

.doc-preview-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1rem 1.15rem 1.15rem;
  -webkit-overflow-scrolling: touch;
}

.doc-preview-loading,
.doc-preview-error {
  font-size: 0.875rem;
  color: #64748b;
  text-align: center;
  padding: 2rem 0.5rem;
}

.doc-preview-error {
  color: #be123c;
}

.doc-preview-iframe {
  width: 100%;
  height: min(70vh, 36rem);
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #f8fafc;
}

.doc-preview-text {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #334155;
}

.doc-preview-text h1,
.doc-preview-text h2,
.doc-preview-text h3 {
  font-family: Fraunces, Georgia, serif;
  color: #1a2b4a;
  margin: 1rem 0 0.5rem;
}

.doc-preview-text h1 { font-size: 1.25rem; }
.doc-preview-text h2 { font-size: 1.1rem; }
.doc-preview-text h3 { font-size: 1rem; }

.doc-preview-text p {
  margin: 0.45rem 0;
}

.doc-preview-text pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, monospace;
  font-size: 0.8125rem;
}

.doc-preview-path {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

/* —— Configuración —— */
.settings-view {
  background: #f8fafc;
}

.settings-main {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1rem 2.5rem;
}

.settings-form {
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.settings-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.25rem;
}

.settings-section-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1a2b4a;
  margin-bottom: 0.35rem;
}

.settings-section-hint {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #64748b;
  margin-bottom: 1rem;
}

.settings-section-hint code {
  font-size: 0.75rem;
  background: #f1f5f9;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
}

.settings-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.35rem;
}

.settings-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  font-size: 0.9375rem;
  color: #1e293b;
  background: #fff;
}

.settings-input:focus {
  outline: 2px solid #99f6e4;
  border-color: #0d9488;
}

.settings-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.settings-input-row .settings-input {
  flex: 1;
  min-width: 0;
}

.settings-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  flex-shrink: 0;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  background: #fff;
  color: #475569;
}

.settings-icon-btn:hover {
  border-color: #0d9488;
  color: #0d9488;
  background: #f0fdfa;
}

.settings-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.45rem;
}

.settings-model-picker {
  position: relative;
}

.settings-model-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  background: #fff;
  font-size: 0.9375rem;
  color: #1e293b;
  text-align: left;
}

.settings-model-trigger:hover,
.settings-model-trigger.is-open {
  border-color: #0d9488;
  background: #f8fffe;
}

.settings-model-trigger:focus-visible {
  outline: 2px solid #99f6e4;
  border-color: #0d9488;
}

.settings-model-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-model-chevron {
  flex-shrink: 0;
  color: #64748b;
  transition: transform 0.15s;
}

.settings-model-trigger.is-open .settings-model-chevron {
  transform: rotate(180deg);
}

.settings-model-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 40;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 12px 32px rgb(15 23 42 / 0.12);
  overflow: hidden;
}

.settings-model-search {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.875rem;
  color: #1e293b;
  background: #f8fafc;
}

.settings-model-search:focus {
  outline: none;
  background: #fff;
}

.settings-model-loading {
  font-size: 0.8125rem;
  color: #64748b;
  padding: 0.75rem;
  text-align: center;
}

.settings-model-options {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  max-height: 16rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.settings-model-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 0.5rem;
  text-align: left;
  background: transparent;
  border: 0;
}

.settings-model-option:hover {
  background: #f0fdfa;
}

.settings-model-option.is-selected {
  background: #ccfbf1;
}

.settings-model-option-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1a2b4a;
}

.settings-model-option-id {
  font-size: 0.75rem;
  color: #64748b;
}

.settings-model-empty {
  font-size: 0.8125rem;
  color: #94a3b8;
  padding: 0.85rem 0.65rem;
  text-align: center;
}

.settings-model-empty--err {
  color: #be123c;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.settings-save-btn {
  padding: 0.65rem 1.25rem;
  border-radius: 0.65rem;
  background: #0d9488;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
}

.settings-save-btn:hover {
  background: #0f766e;
}

.settings-status {
  font-size: 0.8125rem;
  color: #64748b;
  min-height: 1.25rem;
}

.settings-status.is-ok {
  color: #0f766e;
}

.settings-status.is-err {
  color: #be123c;
}

.settings-gate {
  display: flex;
  justify-content: center;
  padding: 2rem 1rem 3rem;
}

.settings-gate-card {
  width: min(100%, 28rem);
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 8px 30px rgb(15 23 42 / 0.06);
  text-align: center;
}

.settings-gate-card h2 {
  margin: 0.85rem 0 0.35rem;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.25rem;
  color: #1a2b4a;
}

.settings-gate-card > p {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #64748b;
}

.settings-gate-form {
  text-align: left;
  margin-top: 0.5rem;
}

.settings-content {
  width: 100%;
}

.settings-section--users {
  margin: 1.25rem auto 0;
}

.settings-section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.settings-section-head-row .settings-section-title {
  margin-bottom: 0;
}

.settings-inline-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 0.55rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f766e;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
}

.settings-inline-btn:hover {
  background: #ccfbf1;
}

.settings-cancel-btn {
  padding: 0.55rem 0.9rem;
  border-radius: 0.65rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
}

.settings-cancel-btn:hover {
  background: #e2e8f0;
}

.users-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.users-empty {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

.users-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #f8fafc;
}

.users-item.is-self {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.users-item-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1a2b4a;
  margin: 0;
}

.users-item-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #0f766e;
  background: #ccfbf1;
}

.users-item-meta {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0.15rem 0 0;
}

.users-item-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.users-action-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.users-action-btn:hover:not(:disabled) {
  background: #e2e8f0;
  color: #1a2b4a;
}

.users-action-btn--delete:hover:not(:disabled) {
  background: #fff1f2;
  color: #be123c;
}

.users-action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.user-form-wrap {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.user-form-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1a2b4a;
  margin: 0 0 0.85rem;
}

.user-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.user-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

/* —— Login —— */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(160deg, #e2e8f0 0%, #f8fafc 45%, #f0fdfa 100%);
  font-family: 'DM Sans', system-ui, sans-serif;
}

.login-card {
  width: min(100%, 22rem);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1.15rem;
  padding: 1.5rem 1.35rem 1.35rem;
  box-shadow: 0 16px 48px rgb(15 23 42 / 0.1);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}

.login-brand-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.85rem;
  background: #0d9488;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-title {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a2b4a;
  margin: 0;
  line-height: 1.2;
}

.login-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0.2rem 0 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.login-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  margin-top: 0.35rem;
}

.login-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  font-size: 0.9375rem;
  color: #1a2b4a;
  background: #fff;
}

.login-input:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgb(13 148 136 / 0.15);
}

.login-password-row {
  position: relative;
}

.login-password-row .login-input {
  width: 100%;
  padding-right: 2.75rem;
}

.login-icon-btn {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.55rem;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.login-icon-btn:hover {
  background: #f1f5f9;
  color: #1a2b4a;
}

.login-error {
  font-size: 0.8125rem;
  color: #be123c;
  background: #fff1f2;
  border-radius: 0.5rem;
  padding: 0.45rem 0.6rem;
  margin: 0.25rem 0 0;
}

.login-error.hidden {
  display: none;
}

.login-submit {
  margin-top: 0.65rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 0.65rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
  background: #0d9488;
}

.login-submit:hover:not(:disabled) {
  background: #0f766e;
}

.login-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* —— Asistente IA —— */
.ai-chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #f8fafc;
}

.ai-chat-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: 52rem;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem 1rem;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 0;
  min-height: 0;
}

.ai-chat-welcome {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #64748b;
}

.ai-chat-welcome-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: 1rem;
  background: #f0fdfa;
  color: #0d9488;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-chat-welcome-title {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a2b4a;
  margin-bottom: 0.5rem;
}

.ai-chat-welcome-text {
  font-size: 0.9375rem;
  line-height: 1.55;
  max-width: 22rem;
  margin: 0 auto;
}

.ai-chat-msg {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.ai-chat-msg--user {
  flex-direction: row-reverse;
}

.ai-chat-msg-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-chat-msg--user .ai-chat-msg-avatar {
  background: #1a2b4a;
  color: #fff;
}

.ai-chat-msg--assistant .ai-chat-msg-avatar {
  background: #ccfbf1;
  color: #0f766e;
}

.ai-chat-msg-body {
  max-width: 85%;
  min-width: 0;
}

.ai-chat-msg--user .ai-chat-msg-body {
  text-align: right;
}

.ai-chat-msg-role {
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ai-chat-msg-content {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  padding: 0.75rem 0.9rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #334155;
  text-align: left;
}

.ai-chat-msg-content--md > :first-child {
  margin-top: 0;
}

.ai-chat-msg-content--md > :last-child {
  margin-bottom: 0;
}

.ai-chat-msg-content--md p {
  margin: 0 0 0.65rem;
}

.ai-chat-msg-content--md p:last-child {
  margin-bottom: 0;
}

.ai-chat-msg-content--md strong {
  font-weight: 700;
  color: #1a2b4a;
}

.ai-chat-msg-content--md em {
  font-style: italic;
}

.ai-chat-msg-content--md ol,
.ai-chat-msg-content--md ul {
  margin: 0.35rem 0 0.75rem;
  padding-left: 1.25rem;
}

.ai-chat-msg-content--md li {
  margin-bottom: 0.45rem;
}

.ai-chat-msg-content--md li:last-child {
  margin-bottom: 0;
}

.ai-chat-msg-content--md li > ul,
.ai-chat-msg-content--md li > ol {
  margin-top: 0.35rem;
  margin-bottom: 0;
}

.ai-chat-msg-content--md h1,
.ai-chat-msg-content--md h2,
.ai-chat-msg-content--md h3,
.ai-chat-msg-content--md h4 {
  margin: 0.85rem 0 0.45rem;
  font-family: inherit;
  font-weight: 700;
  color: #1a2b4a;
  line-height: 1.35;
}

.ai-chat-msg-content--md h1:first-child,
.ai-chat-msg-content--md h2:first-child,
.ai-chat-msg-content--md h3:first-child,
.ai-chat-msg-content--md h4:first-child {
  margin-top: 0;
}

.ai-chat-msg-content--md h1 { font-size: 1.05rem; }
.ai-chat-msg-content--md h2 { font-size: 1rem; }
.ai-chat-msg-content--md h3 { font-size: 0.98rem; }
.ai-chat-msg-content--md h4 { font-size: 0.95rem; }

.ai-chat-msg-content--md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86em;
  padding: 0.08rem 0.35rem;
  border-radius: 0.35rem;
  background: #f1f5f9;
  color: #0f172a;
}

.ai-chat-msg-content--md pre {
  margin: 0.5rem 0 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  background: #0f172a;
  color: #e2e8f0;
  overflow-x: auto;
}

.ai-chat-msg-content--md pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 0.84rem;
}

.ai-chat-msg-content--md a {
  color: #0d9488;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ai-chat-msg-content--md blockquote {
  margin: 0.5rem 0 0.75rem;
  padding: 0.55rem 0.85rem;
  border-left: 3px solid #99f6e4;
  background: #f8fafc;
  color: #475569;
  border-radius: 0 0.45rem 0.45rem 0;
}

.ai-chat-msg--user .ai-chat-msg-content {
  background: #1a2b4a;
  border-color: #1a2b4a;
  color: #f8fafc;
}

.ai-chat-typing {
  display: flex;
  gap: 0.35rem;
  padding: 0.75rem 1rem;
}

.ai-chat-typing span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #94a3b8;
  animation: ai-typing 1.2s infinite ease-in-out;
}

.ai-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes ai-typing {
  0%, 80%, 100% { opacity: 0.35; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

.ai-chat-form {
  flex-shrink: 0;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.ai-upload-toast {
  font-size: 0.8125rem;
  margin-bottom: 0.45rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.5rem;
  text-align: center;
}

.ai-upload-toast--loading { color: #64748b; background: #f8fafc; }
.ai-upload-toast--ok { color: #0f766e; background: #f0fdfa; }
.ai-upload-toast--warn { color: #b45309; background: #fffbeb; }
.ai-upload-toast--err { color: #be123c; background: #fff1f2; }

.ai-chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 0.15rem;
  padding: 0.4rem 0.45rem 0.4rem 0.25rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.06);
}

.ai-chat-composer:focus-within {
  border-color: #5eead4;
  box-shadow: 0 0 0 3px rgb(94 234 212 / 0.25);
}

.ai-chat-attach {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  flex-shrink: 0;
  border-radius: 0.65rem;
  color: #64748b;
  cursor: pointer;
}

.ai-chat-attach:hover {
  color: #0d9488;
  background: #f0fdfa;
}

.ai-chat-input {
  flex: 1;
  resize: none;
  min-height: 2.5rem;
  max-height: 10rem;
  padding: 0.55rem 0.35rem;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9375rem;
}

.ai-chat-send {
  width: 2.35rem;
  height: 2.35rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: #0d9488;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-chat-send:disabled {
  opacity: 0.5;
}

/* —— Widget flotante IA —— */
.ai-widget {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 50;
  pointer-events: none;
}

.ai-widget.is-hidden {
  display: none;
}

.ai-widget-fab {
  pointer-events: auto;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 999px;
  background: linear-gradient(145deg, #1a2b4a 0%, #0d9488 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px rgb(26 43 74 / 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ai-widget-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 10px 32px rgb(13 148 136 / 0.4);
}

.ai-widget.is-panel-open .ai-widget-fab {
  background: #1a2b4a;
}

body.board-fab-visible .ai-widget {
  bottom: 5.5rem;
}

body.board-fab-visible .fab-add {
  z-index: 55;
}

body.resource-editor-open #btn-add-resource {
  display: none !important;
}

body.resource-editor-open.board-fab-visible .ai-widget {
  bottom: 1.5rem;
}

body.resource-editor-open.board-fab-visible .ai-widget-panel {
  bottom: 5.75rem;
}

.ai-widget-panel {
  pointer-events: auto;
  position: fixed;
  right: 1.5rem;
  bottom: 5.75rem;
  width: min(22rem, calc(100vw - 2rem));
  height: min(32rem, 70vh);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 16px 48px rgb(15 23 42 / 0.18);
  overflow: hidden;
  transform-origin: bottom right;
  animation: ai-widget-in 0.2s ease;
}

body.board-fab-visible .ai-widget-panel {
  bottom: 10rem;
}

@keyframes ai-widget-in {
  from {
    opacity: 0;
    transform: translateY(0.75rem) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ai-widget-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.ai-widget-title {
  font-family: Fraunces, Georgia, serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a2b4a;
  margin: 0;
}

.ai-widget-subtitle {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0.15rem 0 0;
  line-height: 1.35;
}

.ai-widget-head-actions {
  display: flex;
  gap: 0.2rem;
  flex-shrink: 0;
}

.ai-widget-icon-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-widget-icon-btn:hover {
  color: #1a2b4a;
  background: #f1f5f9;
}

.ai-widget-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #f8fafc;
  padding: 0 0.75rem 0.75rem;
}

.ai-widget-messages {
  flex: 1;
  min-height: 0;
  padding: 0.75rem 0;
}

.ai-widget-messages .ai-chat-welcome {
  padding: 1.5rem 0.5rem;
}

.ai-widget-messages .ai-chat-welcome-text {
  font-size: 0.875rem;
}

.ai-widget-form {
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .ai-widget-panel {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
  }

  body.board-fab-visible .ai-widget-panel {
    bottom: 10rem;
  }
}

/* —— White Paper —— */
.white-paper-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #e2e8f0;
}

.board-header-inner--wp {
  position: relative;
  justify-content: center;
}

.board-header-inner--wp .app-sidebar-toggle {
  position: absolute;
  left: 1rem;
}

.board-header-text--center {
  text-align: center;
  width: 100%;
  padding: 0 3rem;
}

.plan-estrategico-nav {
  flex-shrink: 0;
  display: flex;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.plan-estrategico-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  padding: 0.45rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.plan-estrategico-nav-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.plan-estrategico-nav-btn.is-active {
  background: #0f4c81;
  border-color: #0f4c81;
  color: #fff;
}

.plan-estrategico-nav-btn.is-active svg {
  stroke: currentColor;
}

.white-paper-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.white-paper-toolbar--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
}

.white-paper-toolbar--center .white-paper-save-status {
  text-align: center;
}

.white-paper-save-status {
  font-size: 0.8125rem;
  color: #64748b;
  text-align: right;
  flex-shrink: 0;
}

.white-paper-toolbar-hint {
  font-size: 0.8125rem;
  color: #64748b;
  display: none;
}

.white-paper-toolbar--center .white-paper-toolbar-hint {
  display: block;
}

@media (min-width: 640px) {
  .white-paper-toolbar-hint {
    display: block;
  }
}

.wp-block-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: 0.55rem;
  color: #1a2b4a;
  background: #fff;
  border: 1.5px solid #94a3b8;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.12);
  transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.wp-block-edit-btn svg {
  display: block;
  flex-shrink: 0;
}

.wp-block-edit-btn:hover:not(:disabled) {
  color: #0d9488;
  background: #f0fdfa;
  border-color: #0d9488;
}

.wp-block-edit-btn.is-active {
  color: #fff;
  background: #0d9488;
  border-color: #0d9488;
  box-shadow: 0 2px 8px rgb(13 148 136 / 0.35);
}

.wp-block-edit-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.wp-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.wp-section-head-main {
  flex: 1;
  min-width: 0;
}

.wp-section-head .wp-section-title {
  margin: 0;
  min-width: 0;
  display: block;
  width: 100%;
}

.wp-block-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(145deg, #f0fdfa, #ccfbf1);
  color: #0f766e;
  border: 1px solid #99f6e4;
  box-shadow: 0 2px 6px rgb(13 148 136 / 0.1);
}

.wp-block-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 2;
}

.wp-block-toolbar--float {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wp-cover {
  position: relative;
}

.wp-cover .wp-cover-decor-icon {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  pointer-events: none;
}

.wp-cover .wp-block-toolbar--float {
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.wp-cover .wp-block-toolbar-main {
  display: flex;
  align-items: center;
}

.wp-cover .white-paper-zoom-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.wp-cover .white-paper-zoom-btn {
  background: #fff;
  border-color: rgb(255 255 255 / 0.85);
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.2);
}

.wp-cover .white-paper-zoom-btn:hover:not(:disabled) {
  background: #f0fdfa;
  border-color: #f0fdfa;
}

.wp-cover .wp-block-icon {
  background: #fff;
  color: #0d9488;
  border-color: rgb(255 255 255 / 0.65);
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.15);
}

.wp-cover .wp-block-edit-btn {
  background: #fff;
  border-color: #fff;
  color: #1a2b4a;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.2);
}

.wp-cover .wp-block-edit-btn:hover:not(:disabled) {
  background: #f0fdfa;
  color: #0d9488;
  border-color: #f0fdfa;
}

.wp-cover .wp-block-edit-btn.is-active {
  background: #0d9488;
  border-color: #0d9488;
  color: #fff;
}

.wp-footer {
  position: relative;
}

.wp-footer .wp-block-toolbar--float {
  position: static;
  justify-content: flex-start;
  margin-bottom: 0.65rem;
}

.wp-footer .wp-block-icon {
  background: #f8fafc;
  color: #64748b;
  border-color: #e2e8f0;
}

.wp-section--highlight .wp-block-icon {
  background: linear-gradient(145deg, #ecfdf5, #d1fae5);
  color: #047857;
  border-color: #6ee7b7;
}

.wp-section--muted .wp-block-icon {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
  box-shadow: none;
}

.wp-section--accent .wp-block-icon {
  background: linear-gradient(145deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
  border-color: #93c5fd;
}

.wp-block-icon[data-wp-section="propuesta-valor"] {
  color: #b45309;
  background: linear-gradient(145deg, #fffbeb, #fef3c7);
  border-color: #fcd34d;
}

.wp-block-icon[data-wp-section="mvp-fases"] {
  color: #7c3aed;
  background: linear-gradient(145deg, #f5f3ff, #ede9fe);
  border-color: #c4b5fd;
}

.wp-block-icon[data-wp-section="cap11"] {
  color: #1d4ed8;
  background: linear-gradient(145deg, #eff6ff, #dbeafe);
  border-color: #93c5fd;
}

.wp-block-icon[data-wp-section="cap14"] {
  color: #0f766e;
  background: linear-gradient(145deg, #f0fdfa, #ccfbf1);
  border-color: #5eead4;
}

.wp-block-icon[data-wp-section="horizonte"] {
  color: #0369a1;
  background: linear-gradient(145deg, #f0f9ff, #e0f2fe);
  border-color: #7dd3fc;
}

.wp-section.is-editing,
.wp-cover.is-editing,
.wp-footer.is-editing {
  outline: 2px solid rgb(13 148 136 / 0.35);
  outline-offset: 2px;
}

.white-paper-presentation.is-editing {
  box-shadow: none;
}

.white-paper-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 0.65rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: #0d9488;
}

.white-paper-save-btn:hover:not(:disabled) {
  background: #0f766e;
}

.white-paper-save-btn:disabled {
  opacity: 0.6;
}

.white-paper-save-status {
  font-size: 0.8125rem;
  color: #64748b;
  min-width: 6rem;
  text-align: right;
}

.white-paper-save-status--ok { color: #0f766e; }
.white-paper-save-status--err { color: #be123c; }

.white-paper-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1rem 2.5rem;
}

.white-paper-scroll-inner {
  max-width: 66.24rem;
  margin: 0 auto;
  position: relative;
}

.white-paper-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: 0.55rem;
  color: #1a2b4a;
  background: #fff;
  border: 1.5px solid #94a3b8;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.12);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.white-paper-zoom-btn:hover:not(:disabled) {
  color: #0d9488;
  background: #f0fdfa;
  border-color: #0d9488;
}

.white-paper-zoom-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.white-paper-presentation {
  background: #fff;
  border-radius: 0.25rem;
  box-shadow: 0 12px 40px rgb(15 23 42 / 0.1);
  overflow: hidden;
  font-family: 'DM Sans', system-ui, sans-serif;
  color: #334155;
  line-height: 1.6;
  zoom: var(--wp-font-scale, 1);
}

.wp-cover {
  background: linear-gradient(145deg, #1a2b4a 0%, #243656 55%, #0d9488 160%);
  color: #f8fafc;
  padding: 2.5rem 2rem 2rem;
  text-align: center;
}

.wp-cover-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #99f6e4;
  background: rgb(255 255 255 / 0.08);
  border: 1px solid rgb(255 255 255 / 0.15);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.white-paper-presentation h1 {
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  color: #fff;
}

.wp-cover-sub {
  font-size: 1rem;
  line-height: 1.55;
  color: rgb(248 250 252 / 0.88);
  max-width: 36rem;
  margin: 0 auto 0.65rem;
}

.wp-cover-meta {
  font-size: 0.8125rem;
  color: rgb(248 250 252 / 0.55);
  margin-bottom: 1.75rem;
}

.wp-cover-values {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

@media (min-width: 520px) {
  .wp-cover-values {
    grid-template-columns: repeat(3, 1fr);
  }
}

.wp-value-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  background: rgb(255 255 255 / 0.07);
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 0.75rem;
  font-size: 0.75rem;
  color: rgb(248 250 252 / 0.75);
}

.wp-value-card strong {
  color: #fff;
  font-size: 0.8125rem;
}

.wp-value-card .wp-icon {
  color: #5eead4;
}

.wp-section {
  padding: 1.75rem 2rem;
  border-bottom: 1px solid #f1f5f9;
}

.wp-section--highlight { background: #f0fdfa; }
.wp-section--muted { background: #f8fafc; }
.wp-section--accent { background: linear-gradient(180deg, #fff 0%, #f0fdfa 100%); }

.wp-section-title {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: #1a2b4a;
  margin: 0 0 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #0d9488;
  display: inline-block;
}

.wp-section-body {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #475569;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.wp-section-body p { margin: 0 0 0.75rem; }
.wp-section-body ul, .wp-section-body ol { margin: 0 0 0.75rem; padding-left: 1.25rem; }
.wp-section-body strong { color: #1a2b4a; }

/* —— White Paper enriquecido (Neurodespertar) —— */
.white-paper-presentation--rich {
  border-radius: 1rem;
  box-shadow: 0 16px 48px rgb(15 23 42 / 0.12);
}

.wp-cover--rich {
  position: relative;
  overflow: hidden;
}

.wp-cover--rich::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 88%, rgb(13 148 136 / 0.35) 0%, transparent 42%),
    radial-gradient(circle at 88% 12%, rgb(99 102 241 / 0.2) 0%, transparent 38%);
  pointer-events: none;
}

.wp-cover--rich > * {
  position: relative;
  z-index: 1;
}

.wp-section--rich {
  padding: 2rem 2.25rem;
}

.wp-section--rich:nth-child(even) {
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.wp-section-label {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0d9488;
}

.wp-section--rich .wp-section-title {
  display: block;
  width: 100%;
  margin-bottom: 1.1rem;
  font-size: 1.2rem;
  line-height: 1.35;
  border-bottom: none;
  padding-bottom: 0;
}

.wp-section-body--rich {
  text-align: left;
}

.wp-rich-para {
  margin: 0 0 1rem;
  font-size: 0.97rem;
  line-height: 1.72;
  color: #475569;
}

.wp-rich-para:last-child {
  margin-bottom: 0;
}

.wp-rich-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #0d9488;
}

.wp-rich-icon svg {
  width: 1.1rem;
  height: 1.1rem;
  stroke-width: 2;
}

.wp-rich-num-item,
.wp-rich-bullet-item,
.wp-rich-cat-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin: 0.65rem 0;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgb(15 23 42 / 0.04);
}

.wp-section--highlight .wp-rich-num-item,
.wp-section--highlight .wp-rich-bullet-item,
.wp-section--highlight .wp-rich-cat-item {
  background: rgb(255 255 255 / 0.85);
  border-color: #99f6e4;
}

.wp-rich-num-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-width: 2.5rem;
  padding: 0.35rem 0.45rem;
  border-radius: 0.65rem;
  background: linear-gradient(145deg, #1a2b4a 0%, #0f766e 100%);
  color: #f0fdfa;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

.wp-rich-num-badge .wp-rich-icon {
  color: #99f6e4;
}

.wp-rich-num-badge .wp-rich-icon svg {
  width: 0.95rem;
  height: 0.95rem;
}

.wp-rich-num-item p,
.wp-rich-bullet-item p,
.wp-rich-cat-item p {
  margin: 0;
  flex: 1;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #475569;
}

.wp-rich-etapa {
  display: flex;
  gap: 0.85rem;
  margin: 1rem 0 0.5rem;
  padding: 1rem 1.1rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #f0fdfa 0%, #ecfeff 100%);
  border: 1px solid #99f6e4;
}

.wp-rich-etapa .wp-rich-icon svg {
  width: 1.35rem;
  height: 1.35rem;
  color: #0f766e;
}

.wp-rich-etapa-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0f766e;
}

.wp-rich-etapa-body p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #334155;
}

.wp-rich-nivel {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0.35rem 0 0.35rem 1.5rem;
  padding: 0.55rem 0.75rem;
  border-left: 3px solid #5eead4;
  background: rgb(240 253 250 / 0.5);
  border-radius: 0 0.5rem 0.5rem 0;
}

.wp-rich-nivel-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  background: #0d9488;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.wp-rich-nivel p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #475569;
}

.wp-rich-subsection {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 1.25rem 0 0.65rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border-radius: 0.65rem;
  border-left: 4px solid #1a2b4a;
}

.wp-rich-subsection-title {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: #1a2b4a;
  line-height: 1.4;
}

.wp-rich-subsection-num {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 0.35rem;
  background: #1a2b4a;
  color: #fff;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: middle;
}

.wp-rich-cat-item strong {
  color: #0f766e;
}

@media (max-width: 640px) {
  .wp-section--rich {
    padding: 1.35rem 1.1rem;
  }

  .wp-rich-nivel {
    margin-left: 0.5rem;
  }
}

.wp-footer {
  padding: 1.25rem 2rem 1.75rem;
  font-size: 0.8125rem;
  color: #94a3b8;
  text-align: center;
  background: #f8fafc;
}

.white-paper-save-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.white-paper-presentation .wp-editable {
  outline: none;
  border-radius: 0.25rem;
}

.white-paper-presentation:not(.is-editing) .wp-editable {
  cursor: default;
  user-select: text;
}

.wp-section.is-editing .wp-editable,
.wp-cover.is-editing .wp-editable,
.wp-footer.is-editing .wp-editable {
  cursor: text;
}

.wp-section.is-editing .wp-editable:focus,
.wp-cover.is-editing .wp-editable:focus,
.wp-footer.is-editing .wp-editable:focus {
  box-shadow: 0 0 0 2px rgb(13 148 136 / 0.3);
  background: rgb(13 148 136 / 0.05);
  border-radius: 0.25rem;
}

.wp-cover.is-editing .wp-editable:focus {
  background: rgb(255 255 255 / 0.08);
  box-shadow: 0 0 0 2px rgb(94 234 212 / 0.4);
}

.white-paper-loading, .white-paper-error {
  text-align: center;
  padding: 2rem 1rem;
  color: #64748b;
}

.white-paper-error { color: #be123c; }

/* White Paper — móvil y tablet: botones compactos en fila */
@media (max-width: 1024px) {
  .white-paper-presentation .wp-block-edit-btn,
  .white-paper-presentation .white-paper-zoom-btn {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.4rem;
    border-width: 1px;
  }

  .white-paper-presentation .wp-block-edit-btn svg {
    width: 13px;
    height: 13px;
  }

  .white-paper-presentation .white-paper-zoom-btn {
    font-size: 0.9rem;
  }

  .white-paper-presentation .wp-block-icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.45rem;
  }

  .white-paper-presentation .wp-block-icon svg {
    width: 0.9rem;
    height: 0.9rem;
  }

  .wp-cover {
    padding-top: 1rem;
  }

  .wp-cover .wp-cover-decor-icon {
    display: none;
  }

  .wp-cover .wp-block-toolbar--float {
    position: static;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
    width: 100%;
    margin-bottom: 0.65rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgb(255 255 255 / 0.15);
  }

  .wp-cover .wp-block-toolbar-main {
    display: flex;
    align-items: center;
    margin-left: 0;
  }

  .wp-cover .white-paper-zoom-bar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.3rem;
  }

  .wp-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.65rem;
  }

  .wp-section-head .wp-block-icon {
    order: 1;
    flex-shrink: 0;
  }

  .wp-section-head .wp-block-edit-btn {
    order: 2;
    flex-shrink: 0;
  }

  .wp-section-head-main {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }

  .wp-section-head .wp-section-title {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .wp-footer .wp-block-toolbar--float {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.65rem;
  }
}
