*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: var(--color-magenta);
  text-decoration: none;
}

a:hover {
  color: var(--color-magenta-hover);
}
:root {
  /* Colores de marca */
  --color-violet: #7C3AED;
  --color-magenta: #EC4899;
  --color-magenta-hover: #F472B6;
  --color-blue: #3882F6;
  --color-green: #10B981;
  --gradient-brand: linear-gradient(135deg, var(--color-violet) 0%, var(--color-magenta) 100%);

  /* Superficies */
  --color-bg: #0A0E17;
  --color-panel: #12182A;
  --color-panel-alt: #0D1220;
  --color-border: #262F45;
  --color-border-strong: #3B4258;

  /* Texto */
  --color-text: #F3F5F9;
  --color-text-secondary: #8B93A8;
  --color-text-muted: #5C6479;

  /* Tipografía */
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Radios */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Sombras */
  --shadow-panel: 0 40px 80px -40px rgba(0, 0, 0, 0.6);
  --shadow-cta: 0 10px 24px -10px rgba(124, 58, 237, 0.6);
}
body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

code, pre {
  font-family: var(--font-mono);
}
.app-layout {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 256px;
  flex-shrink: 0;
  height: 100vh;
  overflow: hidden;
  transition: width 0.25s ease, opacity 0.2s ease, padding 0.2s ease;

  position: sticky;
  top: 0;

  display: flex;
  flex-direction: column;
}

.app-layout.zen-mode .sidebar {
  width: 0;
  padding: 0;
  border: none;
  opacity: 0;
  pointer-events: none;
}

/* Manual collapse (full sidebar <-> icon rail) only makes sense on
   desktop, where the sidebar isn't already forced into a rail/drawer by
   the tablet/mobile breakpoints below. */
@media (min-width: 1024px) {
  .sidebar--collapsed {
    width: 80px;
  }

  .sidebar--collapsed .sidebar__brand-name,
  .sidebar--collapsed .sidebar__section-title,
  .sidebar--collapsed .sidebar__document-label,
  .sidebar--collapsed .sidebar__new-label,
  .sidebar--collapsed .sidebar__hint,
  .sidebar--collapsed .sidebar__ad,
  .sidebar--collapsed .sidebar__caption,
  .sidebar--collapsed .sidebar__search,
  .sidebar--collapsed .sidebar__document-delete {
    display: none;
  }
}

.main-content {
  flex: 1;
  min-width: 0;
  overflow: auto;
  background: var(--color-panel-alt);
}

/* Backdrop for the mobile/tablet sidebar overlay. Inert (never painted)
   above the tablet breakpoint, regardless of its visibility class. */
.sidebar-backdrop {
  display: none;
}

/* ===================== Tablet / netbook (640–1024px) ===================== */
@media (min-width: 640px) and (max-width: 1023px) {
  .sidebar {
    width: 64px;
  }

  .sidebar.sidebar--drawer-open {
    position: fixed;
    inset: 0 auto 0 0;
    width: 256px;
    z-index: 210;
    box-shadow: var(--shadow-panel);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(10, 14, 23, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .sidebar-backdrop--visible {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ============================ Mobile (<640px) ============================ */
@media (max-width: 639px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 84vw;
    max-width: 320px;
    z-index: 210;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-panel);
  }

  .sidebar.sidebar--drawer-open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(10, 14, 23, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .sidebar-backdrop--visible {
    opacity: 1;
    pointer-events: auto;
  }
}
.sidebar {
  background: var(--color-panel-alt);
  border-right: 1px solid var(--color-border);
  padding: 24px 18px;
  gap: 24px;
}

.sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar__logo {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
}

.sidebar__brand-name {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: var(--color-text);
}

.sidebar__header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar__toggle {
  color: var(--color-text-secondary);
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar__toggle:hover {
  color: var(--color-text);
}

/* Desktop always shows the full sidebar; the toggle only makes sense
   on tablet (expand rail to overlay) and mobile (close the drawer). */
@media (min-width: 1024px) {
  .sidebar__toggle {
    display: none;
  }
}

/* "Nuevo documento" as an icon button in the header: on tablet it sits next
   to the sandwich toggle once the drawer is open (see below). On desktop,
   where the sandwich is hidden entirely (rule above), it takes that same
   slot instead. Mobile keeps just the bottom-of-list button when the
   drawer is open - no icon duplicate next to its sandwich. */
.sidebar__header-new-document {
  display: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  color: var(--color-text-secondary);
}

.sidebar__header-new-document:hover {
  color: var(--color-magenta);
  background: rgba(124, 58, 237, 0.12);
}

.sidebar__header-new-document svg {
  width: 16px;
  height: 16px;
}

@media (min-width: 1024px) {
  .sidebar__header-new-document {
    display: flex;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .sidebar.sidebar--drawer-open .sidebar__header-new-document {
    display: flex;
  }
}

/* Bottom-of-list "new document" hidden while the drawer is open on both
   tablet (moved next to the sandwich above) and mobile (use the topbar's
   icon once the drawer is closed instead). */
@media (max-width: 1023px) {
  .sidebar.sidebar--drawer-open .sidebar__new-document {
    display: none;
  }
}

.sidebar__section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.sidebar__section-title {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.sidebar__search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 9px 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.sidebar__search svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.sidebar__search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  font-size: 13px;
  color: var(--color-text-muted);
}

.sidebar__search-input:focus {
  outline: none;
}

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

.sidebar__documents {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 90px;
  overflow-y: auto;
}

.sidebar__document-row {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 9px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.sidebar__document-row[hidden] {
  display: none;
}

.sidebar__document-row--removing {
  opacity: 0;
  transform: translateX(-8px);
  pointer-events: none;
}

.sidebar__document-row--active {
  background: rgba(124, 58, 237, 0.16);
}

.sidebar__document-row--active .sidebar__document {
  color: var(--color-text);
}

.sidebar__document-row--active .sidebar__document-dot {
  background: var(--color-magenta);
}

.sidebar__document {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar__document-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__document-dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-border-strong);
}

.sidebar__document-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-right: 4px;
  border-radius: 7px;
  color: var(--color-text-secondary);
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.sidebar__document-delete svg {
  width: 14px;
  height: 14px;
}

.sidebar__document-row:hover .sidebar__document-delete,
.sidebar__document-row:focus-within .sidebar__document-delete {
  opacity: 1;
}

.sidebar__document-delete:hover {
  color: #EF4444;
}

@media (hover: none) {
  .sidebar__document-delete {
    opacity: 1;
  }
}

.sidebar__hint {
  border: 1px dashed var(--color-border);
  border-radius: 12px;
  padding: 16px;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.sidebar__new-document {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-magenta);
  flex-shrink: 0;
}

.sidebar__new-document:hover {
  color: var(--color-magenta-hover);
}

/* Moved next to where the sandwich would be, not duplicated. */
@media (min-width: 1024px) {
  .sidebar__new-document {
    display: none;
  }
}

.sidebar__spacer {
  flex: 1;
}

.sidebar__ad {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px dashed var(--color-border);
  border-radius: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  padding: 12px;
  flex-shrink: 0;
}

.sidebar__caption {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 0;
  flex-shrink: 0;
}

.sidebar__footer {
  padding-top: 4px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.sidebar__legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 8px;
}

.sidebar__legal-links a {
  font-size: 11px;
  color: var(--color-text-muted);
}

.sidebar__legal-links a:hover {
  color: var(--color-text-secondary);
}

/* Tablet icon rail: hidden everywhere except the collapsed tablet state. */
.sidebar__rail {
  display: none;
}

.sidebar__rail-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.sidebar__rail-icon:hover {
  color: var(--color-magenta);
  background: rgba(124, 58, 237, 0.12);
}

.sidebar__rail-icon svg {
  width: 16px;
  height: 16px;
}

.sidebar__rail-ad {
  display: none;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 1px dashed var(--color-border);
  border-radius: 8px;
}

@media (min-width: 640px) and (max-width: 1023px) {
  .sidebar:not(.sidebar--drawer-open) .sidebar__full-only {
    display: none;
  }

  .sidebar:not(.sidebar--drawer-open) .sidebar__rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-height: 0;
    padding: 4px 0 12px;
  }

  .sidebar:not(.sidebar--drawer-open) {
    padding: 16px 10px;
  }

  .sidebar:not(.sidebar--drawer-open) .sidebar__header {
    flex-direction: column;
    gap: 12px;
  }
}
.document-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.document-header__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.document-header__label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.document-title {
  border: none;
  background: none;
  padding: 0;
  font-weight: 700;
  font-size: 22px;
  color: var(--color-text);
  width: 100%;
}

.document-title::placeholder {
  color: var(--color-text-muted);
}

.document-title:focus {
  outline: none;
}

.document-header__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.btn svg {
  width: 14px;
  height: 14px;
}

.btn--primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: var(--shadow-cta);
}

.btn--primary:hover {
  color: #fff;
  filter: brightness(1.05);
}

.btn--secondary {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn--secondary:hover {
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

.btn--ghost {
  color: var(--color-text-secondary);
}

.btn--ghost:hover {
  color: var(--color-text);
}

.btn--danger {
  background: #EF4444;
  color: #fff;
}

.btn--danger:hover {
  background: #DC2626;
  color: #fff;
}
.export-modal[hidden] {
  display: none;
}

.export-modal__overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 14, 23, 0.6);
}

.export-modal__dialog {
  width: 420px;
  max-width: 100%;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.export-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--color-border);
}

.export-modal__title {
  margin: 0;
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text);
}

.export-modal__close {
  display: flex;
  color: var(--color-text-secondary);
}

.export-modal__close:hover {
  color: var(--color-text);
}

.export-modal__close svg {
  width: 18px;
  height: 18px;
}

.export-modal__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 24px;
}

.export-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border: 1.5px solid var(--color-border);
  border-radius: 14px;
  background: none;
  text-align: left;
}

.export-option--active {
  border-color: var(--color-violet);
  background: rgba(124, 58, 237, 0.14);
}

.export-option__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: #1B2338;
  color: var(--color-text-secondary);
}

.export-option--active .export-option__icon {
  background: var(--gradient-brand);
  color: #fff;
}

.export-option__icon svg {
  width: 20px;
  height: 20px;
}

.export-option__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.export-option__title {
  font-weight: 700;
  font-size: 15px;
  color: var(--color-text);
}

.export-option__subtitle {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.export-option__check {
  display: none;
  flex-shrink: 0;
  margin-left: auto;
  color: var(--color-magenta);
}

.export-option--active .export-option__check {
  display: flex;
}

.export-option__check svg {
  width: 18px;
  height: 18px;
}

.export-modal__footer {
  display: flex;
  gap: 10px;
  padding: 20px 24px;
  border-top: 1px solid var(--color-border);
}

.export-modal__submit {
  flex: 1;
  justify-content: center;
  font-weight: 700;
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-modal__overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 14, 23, 0.6);
}

.confirm-modal__dialog {
  width: 400px;
  max-width: 100%;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.confirm-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--color-border);
}

.confirm-modal__title {
  margin: 0;
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text);
}

.confirm-modal__close {
  display: flex;
  color: var(--color-text-secondary);
}

.confirm-modal__close:hover {
  color: var(--color-text);
}

.confirm-modal__close svg {
  width: 18px;
  height: 18px;
}

.confirm-modal__body {
  padding: 20px 24px;
}

.confirm-modal__body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.confirm-modal__footer {
  display: flex;
  gap: 10px;
  padding: 20px 24px;
  border-top: 1px solid var(--color-border);
}

.confirm-modal__confirm {
  flex: 1;
  justify-content: center;
  font-weight: 700;
}
.doki-scroll,
.preview-content pre,
.preview-content table {
  scrollbar-width: thin;
  scrollbar-color: #262F45 transparent;
}

.doki-scroll::-webkit-scrollbar,
.preview-content pre::-webkit-scrollbar,
.preview-content table::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.doki-scroll::-webkit-scrollbar-track,
.preview-content pre::-webkit-scrollbar-track,
.preview-content table::-webkit-scrollbar-track {
  background: transparent;
}

.doki-scroll::-webkit-scrollbar-thumb,
.preview-content pre::-webkit-scrollbar-thumb,
.preview-content table::-webkit-scrollbar-thumb {
  background: #262F45;
  border-radius: 8px;
  border: 2px solid #0A0E17;
}

.doki-scroll::-webkit-scrollbar-thumb:hover,
.preview-content pre::-webkit-scrollbar-thumb:hover,
.preview-content table::-webkit-scrollbar-thumb:hover {
  background: #3B4258;
}
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.6);
  color: var(--color-text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 60;
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0.35s;
}
.page-content {
  padding: 48px 56px;
  max-width: 720px;
}

.page-content h1 {
  font-size: 32px;
  color: var(--color-text);
}

.page-content h2 {
  font-size: 20px;
  color: var(--color-text);
  margin-top: 36px;
}

.page-content p,
.page-content ul,
.page-content ol {
  margin: 0 0 16px;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.page-content ul,
.page-content ol {
  padding-left: 1.4em;
}

.page-content li {
  margin-bottom: 8px;
}

.page-content a {
  color: var(--color-magenta);
}

.page-content a:hover {
  color: var(--color-magenta-hover);
}

.page-content strong {
  color: var(--color-text);
}

.page-content p.page-content__meta {
  color: var(--color-text-muted);
  font-size: 13px;
  margin-top: -8px;
}

.page-content--legal {
  max-width: 760px;
}

.page-content__contact-link {
  font-size: 20px;
  font-weight: 700;
}

.page-content--home {
  max-width: 760px;
}

.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 8px;
}

.home-section {
  margin-top: 32px;
}

.page-content code {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.9em;
}

.page-content pre {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 16px;
}

.page-content pre code {
  background: none;
  border: none;
  padding: 0;
}

.page-content table {
  border-collapse: collapse;
  margin: 0 0 16px;
  width: 100%;
}

.page-content th,
.page-content td {
  border: 1px solid var(--color-border);
  padding: 6px 10px;
  text-align: left;
  color: var(--color-text-secondary);
}
.document-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.editor-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
}

.mobile-topbar {
  display: none;
}

.toolbar {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  flex-shrink: 0;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 32px;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 600;
  transition: opacity 0.2s ease;
  overflow-x: auto;
}

.editor-toolbar__format {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
  transition: flex 0.2s ease;
}

.editor-toolbar__format > * {
  flex-shrink: 0;
}

.editor-toolbar button:not(.btn) {
  display: flex;
  align-items: center;
  padding: 0;
  color: inherit;
  font: inherit;
  line-height: 1;
}

.editor-toolbar button:not(.btn):hover {
  color: var(--color-magenta);
}

.editor-toolbar button:not(.btn):disabled {
  color: var(--color-text-muted);
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.editor-toolbar__format svg {
  width: 15px;
  height: 15px;
}

.toolbar-separator {
  width: 1px;
  height: 16px;
  background: var(--color-border);
  transition: background 0.2s ease;
}

.editor-toolbar button.editor-toolbar__zen-toggle {
  padding: 5px 8px;
  border-radius: 7px;

  color: var(--color-magenta);
}

.editor-toolbar__zen-label {
  margin-left: 3px;
}

.editor-toolbar__zen-toggle:hover {
  color: var(--color-magenta-hover);
  background: rgba(124, 58, 237, 0.12);
}

.app-layout.zen-mode .editor-toolbar button.editor-toolbar__zen-toggle {
  background: rgba(124, 58, 237, 0.24);
  color: var(--color-magenta-hover);
}

.editor-toolbar__zen-actions {
  display: none;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.editor-toolbar__wordcount {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.editor-toolbar__exit {
  display: flex;
  color: var(--color-text-secondary);
  opacity: 0.6;
}

.editor-toolbar__exit:hover {
  opacity: 1;
}

.editor-toolbar__exit svg {
  width: 14px;
  height: 14px;
}

.editor-panels {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.panel-tabs {
  display: none;
}

.editor-workspace {
  display: flex;
  flex: 1;
  min-height: 0;
}

.editor-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  background: var(--color-bg);
  border-right: 1px solid var(--color-border);
}

.editor-panel__body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.editor-ad {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  height: 100px;
  border-top: 1px dashed var(--color-border);
  background: var(--color-bg);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.editor-gutter {
  flex-shrink: 0;
  width: 48px;
  overflow: hidden;
  padding: 26px 12px 26px 0;

  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.9;
  text-align: right;
  color: var(--color-text-muted);
  white-space: pre;
  user-select: none;
}

.editor-measure {
  position: absolute;
  top: -9999px;
  left: -9999px;
  visibility: hidden;
  box-sizing: border-box;
  padding: 0 32px 0 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.9;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.editor-measure span {
  display: block;
}

.editor-textarea {
  width: 100%;
  height: 100%;
  resize: none;
  border: none;
  background: none;
  padding: 26px 32px 26px 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.9;
  color: #D5DAE5;
}

.editor-textarea:focus {
  outline: none;
}

.preview-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  background: var(--color-panel-alt);
}

.preview-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.preview-content {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 56px;
  font-size: 16px;
  line-height: 1.75;
  color: #D5DAE5;
}

.preview-ad {
  flex-shrink: 0;
  width: 100%;
  height: 90px;
  display: none;
  align-items: center;
  justify-content: center;
  border-top: 1px dashed var(--color-border);
  background: var(--color-bg);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.preview-ad__label--mobile {
  display: none;
}

.preview-content h1,
.preview-content h2,
.preview-content h3,
.preview-content h4,
.preview-content h5,
.preview-content h6 {
  color: var(--color-text);
}

.preview-content h1 {
  font-size: 38px;
  margin-bottom: 8px;
}

.preview-content p,
.preview-content ul,
.preview-content ol,
.preview-content blockquote,
.preview-content table,
.preview-content pre {
  margin: 0 0 16px;
}

.preview-content ul,
.preview-content ol {
  padding-left: 1.4em;
}

.preview-content blockquote {
  margin-left: 0;
  padding: 4px 20px;
  border-left: 3px solid var(--color-violet);
  color: var(--color-text-secondary);
}

.preview-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 24px 0;
}

.preview-content pre {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  overflow-x: auto;
}

.preview-content pre code {
  background: none;
  padding: 0;
}

.preview-content code {
  background: #1B2338;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 14px;
  color: var(--color-text);
}

.preview-content strong {
  color: var(--color-text);
}

.preview-content a {
  color: var(--color-magenta);
}

.preview-content img {
  max-width: 100%;
  border-radius: var(--radius-sm);
}

.preview-content table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  width: 100%;
}

.preview-content th,
.preview-content td {
  border: 1px solid var(--color-border);
  padding: 8px 12px;
  text-align: left;
}

.preview-content th {
  color: var(--color-text);
  background: var(--color-panel);
}

.statusbar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.statusbar__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-green);
  flex-shrink: 0;
}

.editor-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 10px 32px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  font-size: 12px;
  color: var(--color-text-muted);
  transition: opacity 0.2s ease;
}

.editor-statusbar__filetype {
  display: flex;
  align-items: center;
  gap: 6px;
}

.editor-statusbar__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-green);
  flex-shrink: 0;
}

/* Modo zen */

.document-header {
  transition: opacity 0.2s ease;
}

.app-layout.zen-mode .document-header {
  opacity: 0;
  height: 0;
  padding: 0;
  border-bottom: none;
  overflow: hidden;
  pointer-events: none;
}

.app-layout.zen-mode .editor-statusbar {
  opacity: 0;
  height: 0;
  padding: 0;
  border-top: none;
  overflow: hidden;
  pointer-events: none;
}

.app-layout.zen-mode .preview-ad {
  display: none;
}

/* Tablet's sandwich lives inside .sidebar, already hidden in zen mode via
   the .sidebar rule above. Mobile's lives in .mobile-topbar instead, a
   sibling of .document-header, so it needs its own rule here. */
.app-layout.zen-mode .mobile-topbar__menu {
  display: none;
}

.app-layout.zen-mode .editor-toolbar__format {
  flex: 1;
  justify-content: center;
  opacity: 0.85;
}

.app-layout.zen-mode .toolbar-separator {
  background: #181F32;
}

.app-layout.zen-mode .editor-toolbar__zen-actions {
  display: flex;
}

.app-layout.zen-mode .editor-panel {
  border-right-color: #181F32;
}

.app-layout.zen-mode .editor-panel__body {
  justify-content: center;
}

.app-layout.zen-mode .editor-gutter {
  padding-top: 96px;
  padding-bottom: 96px;
}

.app-layout.zen-mode .editor-textarea {
  flex: 0 0 560px;
  max-width: 100%;
  padding: 96px 24px;
}

.app-layout.zen-mode .preview-content {
  max-width: 560px;
  padding: 96px 24px;
}

/* ===================== Tablet / netbook (640–1024px) ===================== */
@media (min-width: 640px) and (max-width: 1023px) {
  .preview-content {
    padding: 32px 24px;
  }

  .editor-textarea {
    padding: 20px 16px 20px 12px;
  }

  .editor-gutter {
    width: 40px;
    padding: 20px 8px 20px 0;
  }
}

/* ============================ Mobile (<640px) ============================ */
@media (max-width: 639px) {
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
  }

  .mobile-topbar__menu {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 18px;
    line-height: 1;
    color: var(--color-text-secondary);
  }

  .mobile-topbar__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -0.02em;
    color: var(--color-text);
  }

  .mobile-topbar__brand .sidebar__logo {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .mobile-topbar__action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--color-text-secondary);
  }

  .mobile-topbar__action:hover {
    color: var(--color-magenta);
  }

  .mobile-topbar__action svg {
    width: 17px;
    height: 17px;
  }

  /* Título + Exportar compacto */
  .document-header {
    padding: 12px 16px;
    gap: 10px;
  }

  .document-header__label {
    display: none;
  }

  .document-title {
    font-size: 17px;
  }

  .document-header__actions .statusbar {
    display: none;
  }

  .document-header__actions .btn {
    padding: 9px 14px;
    font-size: 13px;
  }

  /* Tabs Editar / Vista previa en vez de paneles lado a lado */
  .panel-tabs {
    display: flex;
    flex-shrink: 0;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
  }

  .panel-tabs__tab {
    flex: 1;
    padding: 12px 0;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    border-bottom: 2px solid transparent;
  }

  .panel-tabs__tab--active {
    color: var(--color-text);
    border-bottom-color: var(--color-magenta);
  }

  .editor-workspace[data-active-panel="edit"] .preview-panel {
    display: none;
  }

  .editor-workspace[data-active-panel="preview"] .editor-panel {
    display: none;
  }

  .editor-panel {
    border-right: none;
  }

  .editor-textarea {
    padding: 18px 16px;
  }

  .preview-content {
    padding: 24px 20px;
  }

  /* Banner nativo 320×100 al pie de cada tab, en vez del bloque del sidebar.
     Oculto hasta que AdSense apruebe el sitio; el div se mantiene en el DOM. */
  .editor-ad {
    display: none;
  }

  .preview-ad {
    height: 100px;
  }

  .preview-ad__label--desktop {
    display: none;
  }

  .preview-ad__label--mobile {
    display: inline;
  }
}
.maintenance {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--color-bg);
  text-align: center;
}

.maintenance__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 440px;
}

.maintenance__logo {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 20px;
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 32px;
  margin-bottom: 24px;
}

.maintenance__icon {
  display: flex;
  margin-bottom: 20px;
  color: var(--color-text-secondary);
}

.maintenance__icon svg {
  width: 56px;
  height: 56px;
  stroke-width: 1.5;
}

.maintenance__title {
  margin: 0 0 12px;
  font-weight: 800;
  font-size: 28px;
  color: var(--color-text);
}

.maintenance__message {
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.maintenance__eta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  margin-bottom: 28px;
}

.maintenance__eta-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-magenta);
}

.maintenance__eta-text {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #D5DAE5;
}

.maintenance__footer {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.maintenance__text--short {
  display: none;
}

/* ===================== Tablet / netbook (640–1024px) ===================== */
@media (min-width: 640px) and (max-width: 1023px) {
  .maintenance__card {
    max-width: 380px;
  }

  .maintenance__logo {
    width: 60px;
    height: 60px;
    border-radius: 17px;
    font-size: 26px;
    margin-bottom: 20px;
  }

  .maintenance__icon svg {
    width: 46px;
    height: 46px;
  }

  .maintenance__title {
    font-size: 23px;
  }

  .maintenance__message {
    font-size: 15px;
  }

  .maintenance__footer {
    display: none;
  }
}

/* ============================ Mobile (<640px) ============================ */
@media (max-width: 639px) {
  .maintenance__card {
    max-width: none;
  }

  .maintenance__logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    font-size: 24px;
    margin-bottom: 18px;
  }

  .maintenance__icon svg {
    width: 44px;
    height: 44px;
  }

  .maintenance__title {
    font-size: 21px;
  }

  .maintenance__message {
    font-size: 14px;
  }

  .maintenance__eta {
    padding: 10px 16px;
  }

  .maintenance__eta-text {
    font-size: 12px;
  }

  .maintenance__footer {
    display: none;
  }

  .maintenance__text--full {
    display: none;
  }

  .maintenance__text--short {
    display: inline;
  }
}
/*















 
 */
