.editor-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper-100);
}

.editor-nav {
  background: rgba(248, 246, 240, 0.82);
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
  height: 56px;
  position: relative;
}
@supports (backdrop-filter: blur(1px)) {
  .editor-nav {
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
  }
}
.editor-nav::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass-500), transparent);
  opacity: 0.35;
}
.editor-nav .container {
  height: 100%;
  max-width: 100%;
  padding: 0 var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.editor-nav-left { display: flex; align-items: center; gap: var(--space-4); }
.back-link {
  color: var(--ink-700);
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule-strong);
  transition: background 0.15s ease;
}
.back-link:hover { background: rgba(20,33,27,0.06); color: var(--ink-900); }

.title-edit {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  color: var(--ink-900);
  max-width: 280px;
}
.title-edit:hover { border-color: var(--rule); }
.title-edit:focus { border-color: var(--ink-900); background: var(--paper-50); outline: none; }

.save-status {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-700);
}
.save-status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success); transition: background 0.2s ease;
}
.save-status.saving .dot { background: var(--brass-500); animation: pulse 0.8s ease infinite; }
.save-status.error .dot { background: var(--danger); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.editor-nav-right { display: flex; align-items: center; gap: var(--space-3); }

.nav-history-btns, .nav-json-btns { display: flex; align-items: center; gap: 4px; }

/* Main Editor Body split */
.editor-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

.form-pane {
  width: 48%;
  min-width: 380px;
  max-width: 70%;
  overflow-y: auto;
  padding: var(--space-6);
  background: var(--paper-100);
  border-right: 1px solid var(--rule);
}

/* Split Pane Drag Handle */
.split-resizer {
  width: 8px;
  background: var(--paper-200);
  cursor: col-resize;
  position: relative;
  z-index: 10;
  transition: background 0.15s ease;
  user-select: none;
}
.split-resizer:hover, .split-resizer.dragging {
  background: var(--brass-500);
  box-shadow: 0 0 8px rgba(194, 149, 43, 0.3);
}

.preview-pane {
  flex: 1;
  overflow-y: auto;
  background: #e6e3d9;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-5);
  position: relative;
}

/* Zoom controls */
.zoom-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--paper-50);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-card);
  z-index: 5;
}
.zoom-label { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-700); }
.zoom-btn {
  background: none; border: none;
  font-family: var(--font-mono); font-size: 0.72rem;
  padding: 3px 8px; border-radius: 4px;
  color: var(--ink-900); cursor: pointer;
}
.zoom-btn.active { background: var(--ink-900); color: var(--paper-50); font-weight: 700; }

.preview-wrapper {
  transition: transform 0.2s cubic-bezier(.22,1,.36,1);
  transform-origin: top center;
}

.paper-sheet {
  width: 816px; /* 8.5in at 96dpi */
  min-height: 1056px; /* 11in at 96dpi */
  background: white;
  box-shadow: 0 10px 30px rgba(20,33,27,0.18);
  border-radius: 2px;
}

/* Score Panel */
.score-panel {
  background: var(--paper-50);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}
.score-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.sh-label { font-family: var(--font-mono); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-700); }
.sh-num { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.score-bar { height: 6px; background: var(--paper-200); border-radius: 3px; overflow: hidden; margin-bottom: var(--space-3); }
.score-bar-fill { height: 100%; background: var(--gradient-accent); transition: width 0.4s var(--ease-spring); border-radius: 3px; box-shadow: var(--shadow-glow-sm); }
.score-checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 0.78rem; color: var(--ink-700); }
.score-checklist li { display: flex; align-items: center; gap: 6px; }
.score-checklist li.done { color: var(--ink-900); }
.score-checklist li .chk { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--rule-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 0.6rem; }
.score-checklist li.done .chk { background: var(--success); border-color: var(--success); color: white; }

/* Section Tabs */
.section-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--rule);
}
.section-tab {
  background: none; border: none;
  padding: 8px 14px;
  font-size: 0.85rem; font-weight: 600;
  color: var(--ink-700);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background 0.2s var(--ease-spring), color 0.2s ease, transform 0.2s var(--ease-spring);
}
.section-tab:hover { background: var(--paper-200); color: var(--ink-900); transform: translateY(-1px); }
.section-tab.active { background: var(--gradient-primary); color: var(--paper-50); box-shadow: var(--shadow-xs); }
.section-tab.tab-ats { color: var(--brass-600); }
.section-tab.tab-ats.active { background: var(--brass-500); color: var(--ink-900); }

/* Form Sections */
.form-section { display: none; }
.form-section.active { display: block; animation: sectionFade 0.25s ease both; }
@keyframes sectionFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.section-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.tips-trigger {
  font-family: var(--font-mono); font-size: 0.74rem; color: var(--brass-600);
  cursor: pointer; text-decoration: underline;
}
.section-desc { font-size: 0.88rem; color: var(--ink-700); margin-bottom: var(--space-5); }

/* Fields */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.field-full { grid-column: 1 / -1; }
.field-group { margin-bottom: var(--space-4); }
.field-group label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; color: var(--ink-900); }
.field-group input, .field-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-50);
  font-size: 0.92rem;
  color: var(--ink-900);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field-group input:focus, .field-group textarea:focus {
  border-color: var(--brass-500);
  box-shadow: 0 0 0 3px rgba(194,149,43,0.12);
  outline: none;
}
.field-textarea { min-height: 90px; resize: vertical; }
.char-count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-700); text-align: right; margin-top: 4px; }

/* Repeater Items */
.repeat-items { display: flex; flex-direction: column; gap: var(--space-4); margin-bottom: var(--space-5); }
.repeat-card {
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  background: var(--paper-50);
  padding: var(--space-4);
  position: relative;
}
.repeat-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-3); }
.repeat-card-title { font-weight: 700; font-size: 0.95rem; }
.repeat-remove-btn {
  background: none; border: none;
  color: var(--danger); font-size: 0.78rem; font-family: var(--font-mono);
  cursor: pointer; opacity: 0.8;
}
.repeat-remove-btn:hover { opacity: 1; text-decoration: underline; }

.add-item-btn {
  width: 100%;
  padding: 10px;
  border: 1.5px dashed var(--rule-strong);
  border-radius: var(--radius-md);
  background: transparent;
  font-weight: 600; font-size: 0.88rem;
  color: var(--ink-800);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.add-item-btn:hover { background: rgba(20,33,27,0.04); border-color: var(--ink-900); }

/* Tag input */
.tag-input-row { display: flex; gap: 8px; margin-bottom: var(--space-3); }
.tag-text-input { flex: 1; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 0.78rem;
  background: var(--paper-200); color: var(--ink-900);
  padding: 4px 10px; border-radius: 999px;
}
.tag-chip-remove { cursor: pointer; color: var(--ink-700); font-weight: 700; }
.tag-chip-remove:hover { color: var(--danger); }

/* Customization pickers */
.subsection-title { font-size: 1rem; margin: var(--space-5) 0 var(--space-3); border-bottom: 1px solid var(--rule); padding-bottom: 6px; }
.template-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tpl-option {
  position: relative;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  background: var(--paper-50);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.tpl-option:hover { border-color: var(--brass-500); transform: translateY(-2px); box-shadow: 0 4px 14px -3px rgba(20, 33, 27, 0.12); }
.tpl-option.active { border-color: var(--brass-500); background: #fbf8f0; box-shadow: 0 0 0 2px var(--brass-500); }
.tpl-option-title { font-weight: 700; font-size: 0.92rem; margin-bottom: 3px; color: var(--ink-900); }
.tpl-option-desc { font-size: 0.76rem; color: var(--ink-700); line-height: 1.3; }
.tpl-option-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.tpl-option-badge.ats-badge { background: #e8f5e9; color: var(--success); }
.tpl-option-badge.std-badge { background: var(--paper-200); color: var(--ink-800); }

.accent-picker { display: flex; flex-wrap: wrap; gap: 10px; }
.accent-dot {
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  transition: transform 0.15s ease;
}
.accent-dot:hover { transform: scale(1.15); }
.accent-dot.active { border-color: var(--ink-900); transform: scale(1.1); box-shadow: var(--shadow-card); }

.radio-pill-group { display: flex; gap: 6px; }
.radio-pill {
  flex: 1; text-align: center;
  padding: 8px; border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer; background: var(--paper-50);
  transition: background 0.15s ease;
}
.radio-pill.active { background: var(--ink-900); color: var(--paper-50); border-color: var(--ink-900); }

.font-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.font-option {
  padding: 10px; border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  cursor: pointer; background: var(--paper-50);
  font-size: 0.85rem; font-weight: 600;
}
.font-option.active { border-color: var(--brass-500); background: var(--paper-200); }

.section-toggles { display: flex; flex-direction: column; gap: 8px; }
.section-toggle-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--paper-50); border: 1px solid var(--rule); border-radius: var(--radius-sm); font-size: 0.88rem; }

/* Writing Tips Drawer */
.tips-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 340px; background: var(--paper-50);
  border-left: 1px solid var(--rule-strong);
  box-shadow: var(--shadow-pop);
  z-index: 100; transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(.22,1,.36,1);
  display: flex; flex-direction: column;
}
.tips-drawer.open { transform: translateX(0); }
.td-head { display: flex; justify-content: space-between; align-items: center; padding: var(--space-4); border-bottom: 1px solid var(--rule); }
.td-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.td-close { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--ink-700); }
.td-body { padding: var(--space-5); overflow-y: auto; flex: 1; font-size: 0.9rem; line-height: 1.6; }
.td-body h4 { font-size: 0.95rem; margin: var(--space-4) 0 var(--space-2); }
.td-body ul { padding-left: 18px; margin: 0 0 var(--space-4); }

.section-tab.tab-custom { color: var(--brass-600); border: 1px dashed rgba(176,134,40,0.5); }
.section-tab.tab-custom.active { background: var(--brass-500); color: var(--ink-900); border-style: solid; }

.custom-sec-card {
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  background: var(--paper-50);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}
.custom-sec-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--rule);
}
.custom-sec-title-input {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  background: var(--paper-100);
}

/* High-Converting SaaS Modal Styling */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  display: none !important;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: var(--space-4);
}
.modal-overlay.show {
  display: flex !important;
}

.modal-saas {
  max-width: 460px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rule-strong);
}
.modal-saas-pro {
  max-width: 500px;
  position: relative;
  overflow: hidden;
  border: 2px solid var(--brass-500);
  box-shadow: 0 16px 40px -8px rgba(20,33,27,0.3);
}
.modal-saas-wide {
  max-width: 580px;
}
.saas-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--brass-100); color: var(--brass-600);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 12px;
}
.saas-sub {
  font-size: 0.9rem; color: var(--ink-700); line-height: 1.55; margin-bottom: var(--space-4);
}

.pro-ribbon {
  position: absolute; top: 16px; right: -32px;
  background: var(--brass-500); color: var(--ink-900);
  font-family: var(--font-mono); font-size: 0.65rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 34px; transform: rotate(45deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.pricing-card-box {
  background: var(--paper-100);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  padding: 16px; margin: 16px 0;
}
.pc-price-row {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px;
}
.pc-amount {
  font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; color: var(--ink-900);
}
.pc-period { font-size: 0.9rem; font-weight: 400; color: var(--ink-700); }
.pc-guarantee { font-family: var(--font-mono); font-size: 0.74rem; color: var(--success); font-weight: 600; }

.pc-feature-list {
  list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 0.88rem; color: var(--ink-900);
}
.pc-feature-list li { display: flex; align-items: center; gap: 8px; }
.pc-feature-list svg { width: 16px; height: 16px; color: var(--success); flex-shrink: 0; }

.social-proof-bar {
  text-align: center; font-size: 0.78rem; color: var(--ink-700); margin-bottom: 12px;
}
.proof-logos { font-family: var(--font-mono); font-weight: 700; color: var(--ink-900); display: inline-block; margin-left: 4px; }

.cover-letter-textarea {
  width: 100%; height: 260px;
  font-family: var(--font-body); font-size: 0.9rem;
  padding: 12px; border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm); margin: 12px 0;
  background: var(--paper-50); color: var(--ink-900);
  line-height: 1.6; resize: vertical;
}

/* =========================================================================
   Date Picker Row (Month dropdown + Year input)
   ========================================================================= */
.date-picker-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.date-picker-row select.js-date-month {
  flex: 1;
  padding: 8px 10px;
  font-size: 0.86rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-50);
  color: var(--ink-900);
  font-family: var(--font-body);
  cursor: pointer;
  appearance: auto;
}
.date-picker-row input.js-date-year {
  width: 90px;
  padding: 8px 10px;
  font-size: 0.86rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-50);
  color: var(--ink-900);
  font-family: var(--font-mono);
  text-align: center;
}
.date-picker-row input.js-date-year::-webkit-inner-spin-button,
.date-picker-row input.js-date-year::-webkit-outer-spin-button {
  opacity: 1;
}

/* =========================================================================
   "I currently work here" Toggle Checkbox
   ========================================================================= */
.current-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--ink-700);
  cursor: pointer;
  margin-bottom: 6px;
  user-select: none;
}
.current-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--forest-500, #24463b);
  cursor: pointer;
}
.current-toggle:hover {
  color: var(--ink-900);
}

/* =========================================================================
   Drag Handles & Drag-and-Drop Visual Feedback
   ========================================================================= */
.drag-handle {
  cursor: grab;
  font-size: 1.1rem;
  color: var(--ink-500);
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  user-select: none;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.drag-handle:hover {
  color: var(--ink-900);
  background: rgba(20, 33, 27, 0.06);
}
.drag-handle:active {
  cursor: grabbing;
}

.repeat-card[draggable="true"] {
  transition: opacity 0.2s, box-shadow 0.2s, transform 0.15s;
}
.repeat-card.dragging {
  opacity: 0.5;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transform: scale(0.98);
}
.repeat-card.drag-over {
  border-top: 3px solid var(--forest-500, #24463b);
  padding-top: calc(var(--space-4, 12px) - 3px);
}

.repeat-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =========================================================================
   Rich Text Toolbar (for description textareas)
   ========================================================================= */
.rt-toolbar {
  display: flex;
  gap: 4px;
  padding: 4px 6px;
  background: var(--paper-200, #f0ede4);
  border: 1px solid var(--rule-strong);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.rt-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--ink-700);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.rt-btn:hover {
  background: var(--paper-50);
  color: var(--ink-900);
  border-color: var(--rule);
}
.rt-btn:active {
  background: var(--paper-300, #e0ddd4);
}

.rt-toolbar + .field-textarea {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* =========================================================================
   Skill Proficiency Level Dots
   ========================================================================= */
.skill-level-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 6px;
  vertical-align: middle;
}
.sl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--paper-300, #ddd);
  border: 1px solid var(--rule-strong);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.sl-dot:hover {
  transform: scale(1.3);
}
.sl-dot.active {
  background: var(--forest-500, #24463b);
  border-color: var(--forest-500, #24463b);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* =========================================================================
   Section Reorder Drag List
   ========================================================================= */
.section-reorder-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.reorder-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--paper-50);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.2s;
}
.reorder-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.reorder-item.dragging {
  opacity: 0.5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: scale(0.97);
}
.reorder-item.drag-over {
  border-color: var(--forest-500, #24463b);
  border-top: 3px solid var(--forest-500, #24463b);
}
.reorder-handle {
  color: var(--ink-500);
  font-size: 1.1rem;
  line-height: 1;
}
.reorder-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-900);
}

/* =========================================================================
   Custom Section Card improvements
   ========================================================================= */
.custom-sec-card {
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  background: var(--paper-50);
}
.custom-sec-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--rule);
}
.custom-sec-title-input {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  background: transparent;
  color: var(--ink-900);
}
.custom-sec-title-input:hover { border-color: var(--rule); }
.custom-sec-title-input:focus { border-color: var(--ink-900); background: var(--paper-50); outline: none; }

/* =========================================================================
   Responsive & Mobile Experience
   ========================================================================= */

.mobile-fab-toggle {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 999;
  background: var(--gradient-primary);
  color: var(--paper-50);
  border: 1px solid var(--brass-500);
  border-radius: var(--radius-full);
  padding: 12px 20px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow-pop), var(--shadow-glow);
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
}
.mobile-fab-toggle:active {
  transform: scale(0.94);
}

@media (max-width: 860px) {
  .mobile-fab-toggle {
    display: inline-flex;
  }

  #mobilePreviewToggle {
    display: inline-flex !important;
  }

  .editor-shell {
    height: 100vh;
    height: 100dvh;
  }

  .editor-nav .container {
    padding: 0 var(--space-3);
    gap: var(--space-2);
  }

  .title-edit {
    max-width: 140px;
    font-size: 0.9rem;
    padding: 4px 6px;
  }

  .save-status .label {
    display: none;
  }

  .nav-json-btns,
  .nav-history-btns {
    display: none;
  }

  .editor-body {
    flex-direction: column;
    height: calc(100dvh - 56px);
    overflow: hidden;
  }

  /* Form Pane vs Preview Pane View Switching */
  .editor-body[data-mobile-view="form"] .form-pane {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    flex: 1 !important;
    padding: var(--space-4) !important;
    border-right: none;
  }

  .editor-body[data-mobile-view="form"] .preview-pane {
    display: none !important;
  }

  .editor-body[data-mobile-view="preview"] .form-pane {
    display: none !important;
  }

  .editor-body[data-mobile-view="preview"] .preview-pane {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    flex: 1 !important;
    padding: var(--space-3) var(--space-2) !important;
    overflow-x: auto;
    overflow-y: auto;
  }

  .split-resizer {
    display: none !important;
  }

  /* Section Tabs touch scroll bar */
  .section-tabs {
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    margin-bottom: var(--space-4);
  }
  .section-tab {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .field-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  /* Mobile scaling for live preview sheet */
  .preview-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .paper-sheet {
    transform-origin: top center;
    max-width: 100%;
    zoom: 0.44;
  }

  .score-checklist {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .paper-sheet {
    zoom: 0.36;
  }
  .title-edit {
    max-width: 100px;
  }
}


/* =========================================================================
   Print / PDF Export Isolation Rules
   Ensure that ONLY the resume (#printArea / .resume-doc) is printed when downloading PDF.
   Hides top navigation bar, form controls, completeness cards, modals, zoom bars.
   ========================================================================= */
@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  html, body {
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  /* Hide app chrome, forms, header nav, zoom bar, split resizer, modals, toasts */
  .editor-nav,
  .form-pane,
  .split-resizer,
  .zoom-bar,
  .modal-overlay,
  .toast-container,
  #toastContainer,
  #mobilePreviewToggle,
  .tips-trigger,
  button,
  .nav-history-btns,
  .nav-json-btns,
  .score-panel {
    display: none !important;
  }

  .editor-shell,
  .editor-body,
  .preview-pane,
  .preview-wrapper {
    position: static !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
  }

  .paper-sheet,
  #printArea {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    min-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    transform: none !important;
  }

  .resume-doc {
    position: relative !important;
    width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0.35in 0.4in !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
  }

  /* Paper size specific document padding overrides */
  body[data-paper-size="letter"] .resume-doc {
    padding: 0.35in 0.35in !important;
  }

  body[data-paper-size="legal"] .resume-doc {
    padding: 0.4in 0.45in !important;
  }
}

/* Paper Size Modal & Sheet sizing */
.paper-size-card:hover {
  border-color: var(--brass-500) !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.paper-size-card.active {
  border-color: var(--brass-500) !important;
  background: var(--paper-100) !important;
  box-shadow: var(--shadow-card);
}

.paper-sheet[data-paper-size="a4"] {
  width: 816px;
  min-height: 1154px;
}
.paper-sheet[data-paper-size="letter"] {
  width: 816px;
  min-height: 1056px;
}
.paper-sheet[data-paper-size="legal"] {
  width: 816px;
  min-height: 1344px;
}




