/* ── WYSIWYG Resume Editor ── */

/* Editor shell */
.wysiwyg-editor {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Toolbar */
.wysiwyg-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(1, 56, 44, 0.06);
  position: sticky;
  top: 56px;
  z-index: 12;
  flex-shrink: 0;
}

.wysiwyg-toolbar__left {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.wysiwyg-toolbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Template picker button */
.wysiwyg-toolbar__template-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid rgba(1, 56, 44, 0.1);
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink, #01382c);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.wysiwyg-toolbar__template-btn:hover {
  border-color: rgba(5, 150, 105, 0.25);
  box-shadow: 0 2px 8px -4px rgba(1, 56, 44, 0.1);
}

.wysiwyg-toolbar__template-btn svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.5;
}

/* Template picker popover */
.wysiwyg-template-picker {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px;
  background: #fff;
  border: 1px solid rgba(1, 56, 44, 0.08);
  border-radius: 12px;
  box-shadow: 0 12px 32px -8px rgba(1, 56, 44, 0.15);
  z-index: 20;
  min-width: 360px;
}

/* Add section dropdown */
.wysiwyg-section-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  padding: 6px;
  background: #fff;
  border: 1px solid rgba(1, 56, 44, 0.08);
  border-radius: 10px;
  box-shadow: 0 12px 32px -8px rgba(1, 56, 44, 0.15);
  z-index: 20;
}

.wysiwyg-section-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink, #01382c);
  cursor: pointer;
  transition: background 0.12s;
  text-align: left;
}

.wysiwyg-section-menu__item:hover {
  background: rgba(5, 150, 105, 0.06);
  color: var(--accent, #059669);
}

.wysiwyg-section-menu__icon {
  width: 16px;
  height: 16px;
  opacity: 0.45;
  flex-shrink: 0;
}

/* Canvas */
.wysiwyg-canvas {
  flex: 1;
  overflow-y: auto;
  background: #eef0ee;
  padding: 32px 24px 48px;
  display: flex;
  justify-content: center;
}

/* Resume paper in WYSIWYG mode — relative for absolute children */
.wysiwyg-canvas .resume-paper {
  position: relative;
  cursor: text;
}

/* ── Contenteditable interactions ── */

.wysiwyg-canvas [contenteditable] {
  outline: none;
  border-radius: 2px;
  transition: box-shadow 0.15s ease;
  cursor: text;
}

.wysiwyg-canvas [contenteditable]:hover {
  box-shadow: 0 0 0 1.5px rgba(5, 150, 105, 0.1);
}

.wysiwyg-canvas [contenteditable]:focus {
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.22);
}

/* Placeholder for empty editable fields */
.wysiwyg-canvas [contenteditable]:empty::before {
  content: attr(data-placeholder);
  color: #b0b8b4;
  font-style: italic;
  pointer-events: none;
}

/* ── Section controls (drag handle + remove) ── */

.wysiwyg-canvas .resume-section {
  position: relative;
}

.wysiwyg-section-handle,
.wysiwyg-section-remove {
  position: absolute;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 5;
}

.wysiwyg-canvas .resume-section:hover .wysiwyg-section-handle,
.wysiwyg-canvas .resume-section:hover .wysiwyg-section-remove {
  opacity: 1;
}

.wysiwyg-section-handle {
  top: 0;
  right: -28px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: rgba(1, 56, 44, 0.3);
  cursor: grab;
  letter-spacing: 1px;
  user-select: none;
}

.wysiwyg-section-handle:active {
  cursor: grabbing;
}

.wysiwyg-section-remove {
  top: 0;
  right: -52px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(220, 38, 38, 0.15);
  border-radius: 50%;
  background: #fff;
  color: #DC2626;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  padding: 0;
  line-height: 1;
}

.wysiwyg-section-remove:hover {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.3);
}

/* ── Entry controls ── */

.wysiwyg-canvas .resume-entry {
  position: relative;
}

.wysiwyg-entry-remove {
  position: absolute;
  top: 0;
  right: -28px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(220, 38, 38, 0.12);
  border-radius: 50%;
  background: #fff;
  color: #DC2626;
  font-size: 10px;
  font-family: inherit;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.12s;
  padding: 0;
  line-height: 1;
  z-index: 5;
}

.wysiwyg-canvas .resume-entry:hover .wysiwyg-entry-remove {
  opacity: 1;
}

.wysiwyg-entry-remove:hover {
  background: rgba(220, 38, 38, 0.06);
}

/* ── Drag & drop states ── */

.wysiwyg-canvas .resume-section.is-dragging {
  opacity: 0.4;
}

.wysiwyg-canvas .resume-section.is-drag-over::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent, #059669);
  border-radius: 2px;
  z-index: 10;
}

/* ── Add buttons ── */

.wysiwyg-add-entry,
.wysiwyg-add-section {
  display: block;
  width: 100%;
  padding: 6px 0;
  border: 1px dashed rgba(1, 56, 44, 0.12);
  border-radius: 4px;
  background: none;
  font-family: inherit;
  font-size: 8px;
  font-weight: 600;
  color: rgba(1, 56, 44, 0.3);
  text-align: center;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  margin-top: 8px;
}

.wysiwyg-add-entry:hover,
.wysiwyg-add-section:hover {
  color: var(--accent, #059669);
  border-color: rgba(5, 150, 105, 0.25);
  background: rgba(236, 253, 245, 0.4);
}

.wysiwyg-add-section {
  margin-top: 16px;
  padding: 10px 0;
  font-size: 9px;
}

/* Contact add button */
.wysiwyg-add-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px dashed rgba(1, 56, 44, 0.15);
  border-radius: 50%;
  background: none;
  color: rgba(1, 56, 44, 0.3);
  font-size: 10px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  vertical-align: middle;
  transition: color 0.12s, border-color 0.12s;
}

.wysiwyg-add-inline:hover {
  color: var(--accent, #059669);
  border-color: rgba(5, 150, 105, 0.3);
}

/* ── Footer ── */

.wysiwyg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-top: 1px solid rgba(1, 56, 44, 0.06);
  background: #fff;
  flex-shrink: 0;
}

.wysiwyg-footer__right {
  display: flex;
  gap: 8px;
}

/* ── Responsive ── */

@media (max-width: 899px) {
  .wysiwyg-toolbar {
    padding: 8px 16px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .wysiwyg-canvas {
    padding: 16px 8px 32px;
  }
  .wysiwyg-canvas .resume-paper {
    padding: 28px 24px;
    min-height: auto;
  }
  .wysiwyg-section-handle,
  .wysiwyg-section-remove {
    right: -24px;
  }
  .wysiwyg-entry-remove {
    right: -22px;
  }
  .wysiwyg-footer {
    position: sticky;
    bottom: 0;
    z-index: 10;
  }
  .wysiwyg-template-picker {
    min-width: 280px;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .wysiwyg-toolbar__right .button--ghost {
    display: none;
  }
  .wysiwyg-section-handle,
  .wysiwyg-section-remove,
  .wysiwyg-entry-remove {
    position: absolute;
    right: 2px;
    opacity: 0.6;
  }
}

/* ── Canva-style editor shell ── */

.wysiwyg-editor {
  --editor-bg: #edf1ee;
  --panel-bg: #ffffff;
  --panel-border: rgba(1, 56, 44, 0.08);
  --panel-shadow: 0 18px 50px -34px rgba(1, 31, 25, 0.48);
  --muted: rgba(1, 56, 44, 0.56);
  --faint: rgba(1, 56, 44, 0.36);
  background: var(--editor-bg);
  min-height: calc(100vh - 56px);
}

[data-editor-section][hidden] {
  display: none !important;
}

body[data-page="applications"] .dashboard-bottom-nav {
  display: none !important;
}

.wysiwyg-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--panel-border);
  box-shadow: 0 10px 34px -30px rgba(1, 56, 44, 0.4);
}

.wysiwyg-toolbar__left,
.wysiwyg-toolbar__right,
.wysiwyg-toolbar__center {
  min-width: 0;
}

.wysiwyg-toolbar__left {
  position: relative;
}

.wysiwyg-toolbar__right {
  justify-content: flex-end;
}

.wysiwyg-document-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wysiwyg-document-title strong {
  color: var(--ink, #01382c);
  font-size: 0.9rem;
  line-height: 1.15;
}

.wysiwyg-document-title span {
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 600;
}

.wysiwyg-toolbar__center {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #f8faf8;
}

.wysiwyg-toolbar__divider {
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: rgba(1, 56, 44, 0.1);
}

.wysiwyg-icon-btn,
.wysiwyg-swatch,
.wysiwyg-zoom button,
.wysiwyg-page-tabs button {
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink, #01382c);
  font-family: inherit;
  cursor: pointer;
}

.wysiwyg-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 0.82rem;
}

.wysiwyg-icon-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.wysiwyg-icon-btn:hover,
.wysiwyg-icon-btn.is-active {
  border-color: rgba(5, 150, 105, 0.16);
  background: rgba(5, 150, 105, 0.08);
  color: var(--accent, #059669);
}

.wysiwyg-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border-color: rgba(1, 56, 44, 0.12);
}

.wysiwyg-swatch.is-active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(5, 150, 105, 0.34);
}

.wysiwyg-swatch--green {
  background: #059669;
}

.wysiwyg-swatch--blue {
  background: #2563eb;
}

.wysiwyg-swatch--graphite {
  background: #334155;
}

.wysiwyg-workbench {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 288px;
  gap: 14px;
  min-height: calc(100vh - 112px);
  padding: 14px;
}

.wysiwyg-left-rail,
.wysiwyg-right-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.wysiwyg-panel {
  position: relative;
  padding: 14px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
}

.wysiwyg-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--ink, #01382c);
  font-size: 0.8rem;
  font-weight: 800;
}

.wysiwyg-panel__link {
  border: none;
  background: transparent;
  color: var(--accent, #059669);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

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

.wysiwyg-templates .template-card,
.wysiwyg-template-picker .template-card {
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
}

.wysiwyg-templates .template-card__preview,
.wysiwyg-template-picker .template-card__preview {
  height: 112px;
}

.wysiwyg-templates .template-card.is-active {
  border-color: rgba(5, 150, 105, 0.45);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.wysiwyg-section-menu {
  top: 44px;
  right: 12px;
  z-index: 30;
}

.wysiwyg-template-picker[hidden],
.wysiwyg-section-menu[hidden] {
  display: none !important;
}

.wysiwyg-section-list,
.wysiwyg-suggestions,
.wysiwyg-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wysiwyg-section-list button,
.wysiwyg-suggestions button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(1, 56, 44, 0.08);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink, #01382c);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.wysiwyg-section-list button:hover,
.wysiwyg-suggestions button:hover {
  border-color: rgba(5, 150, 105, 0.24);
  background: rgba(236, 253, 245, 0.45);
}

.wysiwyg-section-list span {
  font-size: 0.8rem;
  font-weight: 800;
}

.wysiwyg-section-list small {
  color: var(--faint);
  font-size: 0.7rem;
  font-weight: 600;
  text-align: right;
}

.wysiwyg-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
  background: #dfe6e2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.wysiwyg-stagebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(1, 56, 44, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.wysiwyg-page-tabs,
.wysiwyg-zoom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wysiwyg-page-tabs button,
.wysiwyg-zoom button,
.wysiwyg-zoom span {
  min-width: 30px;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
}

.wysiwyg-page-tabs button {
  border-color: rgba(1, 56, 44, 0.1);
  background: #fff;
}

.wysiwyg-page-tabs button.is-active {
  background: var(--ink, #01382c);
  color: #fff;
}

.wysiwyg-zoom {
  padding: 3px;
  border: 1px solid rgba(1, 56, 44, 0.08);
  border-radius: 8px;
  background: #fff;
}

.wysiwyg-zoom button:hover {
  background: rgba(5, 150, 105, 0.08);
}

.wysiwyg-zoom span {
  display: inline-grid;
  place-items: center;
  color: var(--muted);
}

.wysiwyg-canvas {
  min-height: 0;
  padding: 34px 24px 56px;
  background:
    linear-gradient(rgba(1, 56, 44, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(1, 56, 44, 0.035) 1px, transparent 1px),
    #e6ece8;
  background-size: 28px 28px;
}

.wysiwyg-canvas .resume-paper {
  width: min(100%, 780px);
  min-height: 1050px;
  padding: 58px 64px;
  background: #fff;
  border-radius: 4px;
  transform: scale(var(--resume-scale, 1));
  transform-origin: top center;
  box-shadow: 0 26px 70px -34px rgba(1, 31, 25, 0.62), 0 0 0 1px rgba(1, 56, 44, 0.06);
}

.wysiwyg-canvas .resume-section:hover {
  box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.12), 0 10px 24px -22px rgba(1, 56, 44, 0.45);
}

.wysiwyg-canvas .resume-section {
  border-radius: 4px;
  padding: 6px;
  margin-left: -6px;
  margin-right: -6px;
}

.wysiwyg-section-handle,
.wysiwyg-section-remove,
.wysiwyg-entry-remove {
  box-shadow: 0 8px 18px -12px rgba(1, 56, 44, 0.4);
}

.wysiwyg-add-entry,
.wysiwyg-add-section {
  border-radius: 8px;
  font-size: 0.72rem;
  color: rgba(1, 56, 44, 0.48);
}

.wysiwyg-panel--score {
  background: linear-gradient(180deg, #f7fffb 0%, #ffffff 76%);
}

.wysiwyg-score {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.wysiwyg-score__value {
  font-size: 2.4rem;
  line-height: 0.9;
  font-weight: 800;
  color: var(--ink, #01382c);
}

.wysiwyg-score__label {
  padding-bottom: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.wysiwyg-scorebar {
  height: 8px;
  margin: 14px 0 10px;
  border-radius: 999px;
  background: rgba(1, 56, 44, 0.08);
  overflow: hidden;
}

.wysiwyg-scorebar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #059669, #2563eb);
}

.wysiwyg-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.wysiwyg-footer {
  display: none;
}

.wysiwyg-checklist label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.35;
}

.wysiwyg-checklist input {
  margin-top: 2px;
  accent-color: var(--accent, #059669);
}

.wysiwyg-suggestions button {
  justify-content: flex-start;
  color: var(--accent, #059669);
  font-size: 0.8rem;
  font-weight: 800;
}

/* ── Page-builder controls ── */

.template-card small {
  display: block;
  margin-top: 2px;
  color: rgba(1, 56, 44, 0.42);
  font-size: 0.64rem;
  font-weight: 700;
}

.wysiwyg-layout-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.wysiwyg-layout-options button,
.wysiwyg-element-grid button,
.wysiwyg-builder-actions button,
.wysiwyg-section-inspector button {
  border: 1px solid rgba(1, 56, 44, 0.08);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink, #01382c);
  font-family: inherit;
  cursor: pointer;
}

.wysiwyg-layout-options button {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
  padding: 9px;
  text-align: left;
}

.wysiwyg-layout-options button:hover,
.wysiwyg-layout-options button.is-active,
.wysiwyg-element-grid button:hover,
.wysiwyg-builder-actions button:hover,
.wysiwyg-section-inspector button:hover {
  border-color: rgba(5, 150, 105, 0.24);
  background: rgba(236, 253, 245, 0.45);
}

.layout-thumb {
  display: grid;
  width: 36px;
  height: 30px;
  gap: 3px;
  padding: 4px;
  border-radius: 5px;
  background: #eef4f1;
}

.layout-thumb::before,
.layout-thumb::after {
  content: "";
  border-radius: 2px;
  background: rgba(5, 150, 105, 0.62);
}

.layout-thumb--single {
  grid-template-columns: 1fr;
}

.layout-thumb--two,
.layout-thumb--sidebar {
  grid-template-columns: 1fr 1fr;
}

.layout-thumb--sidebar {
  grid-template-columns: 0.55fr 1fr;
}

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

.wysiwyg-element-grid button {
  display: flex;
  min-height: 66px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px;
  text-align: left;
}

.wysiwyg-element-grid span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 22px;
  border-radius: 5px;
  background: rgba(5, 150, 105, 0.1);
  color: var(--accent, #059669);
  font-size: 0.72rem;
  font-weight: 900;
}

.wysiwyg-element-grid button[data-add-element="divider"] span,
.wysiwyg-element-grid button[data-add-element="spacer"] span {
  width: 32px;
  height: 2px;
  margin-top: 10px;
  background: rgba(1, 56, 44, 0.32);
}

.wysiwyg-element-grid button[data-add-element="spacer"] span {
  height: 14px;
  border: 1px dashed rgba(1, 56, 44, 0.24);
  background: transparent;
}

.wysiwyg-element-grid strong {
  font-size: 0.78rem;
}

.wysiwyg-inspector {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wysiwyg-inspector label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: rgba(1, 56, 44, 0.62);
  font-size: 0.74rem;
  font-weight: 800;
}

.wysiwyg-inspector select {
  width: 100%;
  border: 1px solid rgba(1, 56, 44, 0.12);
  border-radius: 8px;
  background: #fff;
  color: var(--ink, #01382c);
  font: inherit;
  font-size: 0.8rem;
  padding: 8px 10px;
}

.wysiwyg-builder-actions,
.wysiwyg-section-inspector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.wysiwyg-builder-actions button,
.wysiwyg-section-inspector button {
  min-height: 34px;
  padding: 8px 10px;
  font-size: 0.75rem;
  font-weight: 800;
}

.wysiwyg-section-inspector {
  grid-template-columns: 1fr;
}

.wysiwyg-font-control {
  display: grid;
  gap: 7px;
}

.wysiwyg-font-control > span {
  color: rgba(1, 56, 44, 0.62);
  font-size: 0.72rem;
  font-weight: 850;
}

.wysiwyg-font-stepper {
  display: grid;
  grid-template-columns: 34px minmax(62px, 1fr) 34px;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(1, 56, 44, 0.12);
  border-radius: 8px;
  background: #fff;
}

.wysiwyg-font-stepper button {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 0;
  background: transparent;
  color: #0f2f28;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
}

.wysiwyg-font-stepper button:hover {
  background: rgba(5, 150, 105, 0.08);
}

.wysiwyg-font-stepper strong {
  display: grid;
  min-height: 34px;
  place-items: center;
  border-right: 1px solid rgba(1, 56, 44, 0.08);
  border-left: 1px solid rgba(1, 56, 44, 0.08);
  color: #0f2f28;
  font-size: 0.78rem;
  font-weight: 900;
}

.wysiwyg-font-control--section {
  padding-top: 4px;
}

/* ── Standard resume formatting and template previews ── */

.resume-paper {
  --resume-accent: #059669;
  --resume-heading: #01382c;
  --resume-muted: rgba(1, 56, 44, 0.58);
  color: #17231f;
  font-family: Figtree, Arial, sans-serif;
  font-size: 100%;
  line-height: 1.45;
}

.resume-header {
  margin-bottom: 26px;
  border-bottom: 2px solid rgba(1, 56, 44, 0.1);
  padding-bottom: 18px;
}

.resume-name {
  margin: 0;
  color: var(--resume-heading);
  font-size: 2.15em;
  line-height: 1.05;
  letter-spacing: 0;
}

.resume-headline {
  margin: 6px 0 12px;
  color: var(--resume-accent);
  font-size: 0.98em;
  font-weight: 800;
}

.resume-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  color: var(--resume-muted);
  font-size: 0.76em;
  font-weight: 650;
}

.resume-contact span:not(:last-of-type)::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  margin-left: 10px;
  border-radius: 50%;
  background: rgba(1, 56, 44, 0.28);
  vertical-align: middle;
}

.resume-section {
  margin-bottom: var(--section-gap, 18px);
}

.resume-section__title {
  margin: 0 0 8px;
  color: var(--resume-heading);
  font-size: 0.78em;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.resume-body {
  margin: 0;
  color: #25342f;
  font-size: 0.86em;
}

.resume-entry + .resume-entry {
  margin-top: 14px;
}

.resume-entry__top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.resume-entry strong {
  display: block;
  color: var(--resume-heading);
  font-size: 0.92em;
}

.resume-entry__company,
.resume-entry__dates {
  color: var(--resume-muted);
  font-size: 0.78em;
  font-weight: 700;
}

.resume-entry__list {
  margin: 7px 0 0;
  padding-left: 18px;
  color: #273832;
  font-size: 0.82em;
}

.resume-entry__list li + li {
  margin-top: 4px;
}

.resume-paper[data-density="compact"] {
  --section-gap: 12px;
}

.resume-paper[data-density="comfortable"] {
  --section-gap: 18px;
}

.resume-paper[data-density="open"] {
  --section-gap: 26px;
}

.resume-paper[data-layout="two"],
.resume-paper[data-layout="sidebar"] {
  display: grid;
  gap: 0 28px;
}

.resume-paper[data-layout="two"] {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.resume-paper[data-layout="sidebar"] {
  grid-template-columns: minmax(170px, 0.55fr) minmax(0, 1fr);
}

.resume-paper[data-layout="two"] .resume-header,
.resume-paper[data-layout="sidebar"] .resume-header,
.resume-paper[data-layout="two"] .resume-section--wide,
.resume-paper[data-layout="sidebar"] .resume-section--wide,
.resume-paper[data-layout="two"] .wysiwyg-add-section,
.resume-paper[data-layout="sidebar"] .wysiwyg-add-section {
  grid-column: 1 / -1;
}

.resume-paper[data-layout="sidebar"] .resume-section[data-wysiwyg-section="skills"],
.resume-paper[data-layout="sidebar"] .resume-section[data-wysiwyg-section="certifications"],
.resume-paper[data-layout="sidebar"] .resume-section[data-wysiwyg-section="education"] {
  grid-column: 1;
}

.resume-paper[data-layout="sidebar"] .resume-section[data-wysiwyg-section="summary"],
.resume-paper[data-layout="sidebar"] .resume-section[data-wysiwyg-section="experience"] {
  grid-column: 2;
}

.resume-section.is-selected {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18) !important;
}

.resume-section--emphasis {
  border-left: 3px solid var(--resume-accent);
  background: rgba(5, 150, 105, 0.045);
}

.resume-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(1, 56, 44, 0.32), transparent);
}

.resume-spacer {
  height: 28px;
}

.resume-metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.resume-metric-row span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid rgba(1, 56, 44, 0.08);
  border-radius: 7px;
  background: rgba(247, 250, 248, 0.8);
}

.resume-metric-row strong {
  color: var(--resume-accent);
  font-size: 1.1em;
}

.resume-metric-row small {
  color: var(--resume-muted);
  font-size: 0.68em;
  font-weight: 800;
}

.resume-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.resume-chip-list span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(5, 150, 105, 0.08);
  color: var(--resume-heading);
  font-size: 0.76em;
  font-weight: 800;
}

.resume-callout {
  padding: 12px 14px;
  border: 1px solid rgba(5, 150, 105, 0.18);
  border-radius: 8px;
  background: rgba(236, 253, 245, 0.68);
  color: var(--resume-heading);
  font-size: 0.86em;
  font-weight: 750;
}

.resume-paper[data-template="classic"] {
  --resume-accent: #6b5a3d;
  --resume-heading: #1f2933;
  font-family: Georgia, "Times New Roman", serif;
}

.resume-paper[data-template="classic"] .resume-header {
  text-align: center;
  border-top: 2px solid rgba(31, 41, 51, 0.16);
  border-bottom: 2px solid rgba(31, 41, 51, 0.16);
  padding-top: 18px;
}

.resume-paper[data-template="classic"] .resume-contact {
  justify-content: center;
}

.resume-paper[data-template="classic"] .resume-section__title {
  border-bottom: 1px solid rgba(31, 41, 51, 0.18);
  padding-bottom: 5px;
  letter-spacing: 0.12em;
}

.resume-paper[data-template="minimal"] {
  --resume-accent: #334155;
  --resume-heading: #111827;
}

.resume-paper[data-template="minimal"] .resume-header {
  border-bottom: 1px solid rgba(17, 24, 39, 0.12);
}

.resume-paper[data-template="minimal"] .resume-name {
  font-size: 1.86em;
}

.resume-paper[data-template="minimal"] .resume-section__title {
  color: rgba(17, 24, 39, 0.58);
  font-size: 0.68em;
}

.resume-paper[data-template="creative"] {
  --resume-accent: #2563eb;
  --resume-heading: #0f172a;
}

.resume-paper[data-template="creative"] .resume-header {
  margin: -22px -26px 26px;
  padding: 24px 28px;
  border: 0;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
}

.resume-paper[data-template="creative"] .resume-name,
.resume-paper[data-template="creative"] .resume-headline,
.resume-paper[data-template="creative"] .resume-contact {
  color: #fff;
}

.resume-paper[data-template="creative"] .resume-contact span::after {
  background: rgba(255, 255, 255, 0.38);
}

.resume-paper[data-template="creative"] .resume-section__title {
  color: var(--resume-accent);
}

.button__icon {
  width: 14px;
  height: 14px;
  margin-right: 5px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -2px;
}

/* ── PDF preview lightbox ── */

.preview-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: stretch;
  background: rgba(1, 18, 15, 0.72);
}

.preview-lightbox__backdrop {
  position: absolute;
  inset: 0;
}

.preview-lightbox__dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1480px, calc(100vw - 28px));
  height: min(920px, calc(100vh - 28px));
  margin: auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #eef2ef;
  box-shadow: 0 36px 90px -34px rgba(0, 0, 0, 0.78);
}

.preview-lightbox__bar {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid rgba(1, 56, 44, 0.1);
  background: rgba(255, 255, 255, 0.96);
}

.preview-lightbox__title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.preview-lightbox__title strong {
  color: var(--ink, #01382c);
  font-size: 0.9rem;
  line-height: 1.1;
}

.preview-lightbox__title span {
  color: rgba(1, 56, 44, 0.48);
  font-size: 0.72rem;
  font-weight: 700;
}

.preview-lightbox__controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px;
  border: 1px solid rgba(1, 56, 44, 0.08);
  border-radius: 8px;
  background: #f8faf8;
}

.preview-lightbox__zoom-btn,
.preview-lightbox__preset,
.preview-lightbox__close {
  display: inline-grid;
  place-items: center;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink, #01382c);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.preview-lightbox__zoom-btn {
  width: 30px;
  font-size: 1rem;
}

.preview-lightbox__zoom-label {
  display: inline-grid;
  place-items: center;
  min-width: 58px;
  height: 30px;
  color: rgba(1, 56, 44, 0.62);
  font-size: 0.74rem;
  font-weight: 800;
}

.preview-lightbox__preset {
  padding: 0 10px;
}

.preview-lightbox__preset:hover,
.preview-lightbox__zoom-btn:hover,
.preview-lightbox__preset.is-active {
  border-color: rgba(5, 150, 105, 0.18);
  background: rgba(5, 150, 105, 0.08);
  color: var(--accent, #059669);
}

.preview-lightbox__close {
  width: 34px;
  height: 34px;
  color: rgba(1, 56, 44, 0.62);
  font-size: 1.35rem;
  line-height: 1;
}

.preview-lightbox__close:hover {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
}

.preview-lightbox__viewport {
  position: relative;
  min-height: 0;
  overflow: auto;
  padding: 42px 28px 64px;
  background:
    linear-gradient(rgba(1, 56, 44, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(1, 56, 44, 0.04) 1px, transparent 1px),
    #dce5e0;
  background-size: 28px 28px;
}

.preview-lightbox__page {
  display: flex;
  justify-content: center;
  min-width: min-content;
  transform: scale(var(--preview-scale, 1));
  transform-origin: top center;
  transition: transform 0.18s ease;
}

.preview-lightbox__page .resume-paper {
  width: 780px;
  min-height: 1050px;
  padding: 58px 64px;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 28px 80px -34px rgba(0, 0, 0, 0.74), 0 0 0 1px rgba(1, 56, 44, 0.08);
}

.preview-lightbox__page [contenteditable] {
  box-shadow: none !important;
  cursor: default;
}

.preview-lightbox__page .wysiwyg-section-handle,
.preview-lightbox__page .wysiwyg-section-remove,
.preview-lightbox__page .wysiwyg-entry-remove,
.preview-lightbox__page .wysiwyg-add-entry,
.preview-lightbox__page .wysiwyg-add-section,
.preview-lightbox__page .wysiwyg-add-inline {
  display: none !important;
}

body.has-preview-lightbox {
  overflow: hidden;
}

@media (max-width: 1180px) {
  .wysiwyg-workbench {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .wysiwyg-right-rail {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  .preview-lightbox__bar {
    grid-template-columns: 1fr auto;
  }

  .preview-lightbox__controls {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .wysiwyg-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .wysiwyg-toolbar__center {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .wysiwyg-toolbar__right {
    justify-content: flex-start;
  }

  .wysiwyg-workbench {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .wysiwyg-right-rail {
    display: flex;
    grid-column: auto;
  }

  .wysiwyg-left-rail {
    order: 2;
  }

  .wysiwyg-stage {
    order: 1;
  }

  .wysiwyg-templates {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    overflow-x: auto;
  }

  .wysiwyg-canvas .resume-paper {
    min-width: 620px;
    padding: 40px 42px;
  }
}

@media (max-width: 640px) {
  .preview-lightbox__dialog {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .preview-lightbox__viewport {
    padding: 28px 14px 48px;
  }

  .wysiwyg-stagebar {
    align-items: flex-start;
    flex-direction: column;
  }

  .wysiwyg-canvas {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .wysiwyg-footer {
    display: none;
  }
}

[data-preview-open] {
  display: inline-flex !important;
  align-items: center;
}
