/* Advoke CV — Editor Shell (Four-Region Application Layout) */

.editor {
  display: grid;
  grid-template-rows: auto 1fr;
  height: calc(100dvh - var(--header-height-mobile));
  width: 100%;
  background-color: var(--ink-50);
  overflow: hidden;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .editor {
    height: calc(100dvh - var(--header-height));
  }
}

.editor__body {
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
  min-height: 0;
  position: relative;
}

@media (min-width: 1024px) {
  .editor__body {
    grid-template-columns: 15rem minmax(0, 1fr) minmax(0, 1.1fr);
  }
}

@media (min-width: 1280px) {
  .editor__body {
    grid-template-columns: 16rem minmax(0, 1fr) minmax(0, 1.25fr);
  }
}

@media (min-width: 1536px) {
  .editor__body {
    grid-template-columns: 18rem minmax(0, 1fr) minmax(0, 1.35fr);
  }
}

.editor__pane {
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-color: var(--white);
  position: relative;
}

.editor__pane--sidebar {
  background-color: var(--white-warm);
  border-right: 1px solid var(--color-border);
  display: none;
}

@media (min-width: 1024px) {
  .editor__pane--sidebar {
    display: flex;
  }
}

.editor__pane--form {
  background-color: var(--white);
  border-right: 1px solid var(--color-border);
  display: none;
}

.editor__pane--form.is-active {
  display: flex;
}

@media (min-width: 1024px) {
  .editor__pane--form {
    display: flex;
  }
}

.editor__pane--preview {
  background-color: var(--ink-50);
  display: none;
}

.editor__pane--preview.is-active {
  display: flex;
}

@media (min-width: 1024px) {
  .editor__pane--preview {
    display: flex;
  }
}

.editor__pane-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.editor__pane-scroll::-webkit-scrollbar {
  width: 8px;
}

.editor__pane-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.editor__pane-scroll::-webkit-scrollbar-thumb {
  background-color: var(--color-border-strong);
  border-radius: var(--radius-full);
  border: 2px solid var(--white);
}

.editor__pane-scroll::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-text-muted);
}

.editor__pane--preview .editor__pane-scroll {
  background-color: var(--ink-100);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(15, 23, 42, 0.05) 1px, transparent 0);
  background-size: 16px 16px;
}

.editor__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-10) var(--space-6);
  height: 100%;
  text-align: center;
  color: var(--color-text-muted);
}

.editor__empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-xl);
  background-color: var(--color-accent-soft);
  color: var(--color-accent-active);
}

.editor__empty-icon svg {
  width: 28px;
  height: 28px;
}

.editor__empty-title {
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin: 0;
}

.editor__empty-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
  max-width: 32ch;
  line-height: 1.5;
}

.editor__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  height: 100%;
  min-height: 240px;
  padding: var(--space-8);
}

.editor__loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-accent-soft);
  border-top-color: var(--color-accent);
  border-radius: var(--radius-full);
  animation: editor-spin 800ms linear infinite;
}

@keyframes editor-spin {
  to { transform: rotate(360deg); }
}

.editor__loading-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
}

.editor-divider-v {
  width: 1px;
  height: 100%;
  background-color: var(--color-border);
  flex-shrink: 0;
}

.editor-scrim {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.4);
  z-index: var(--z-modal-backdrop);
  display: none;
}

.editor-scrim.is-open {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .editor__loading-spinner {
    animation: none;
  }
  .editor__pane-scroll {
    scroll-behavior: auto;
  }
}