.resume-editor-page { background: #e9ecf0 !important; height: 100%; min-height: 100%; overflow: hidden; }
/* A gutter at the screen edges only; the three panels stay flush with each other. */
.editor-main { flex: 1; min-height: 0; padding: 0 12px; display: flex; flex-direction: column; }
.editor-form { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.editor-bar { flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #eceef2; }
.icon-btn { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex-shrink: 0; border: 1px solid #e0e4eb; border-radius: 8px; background: #fff; color: #4a4f61; font-size: 16px; }
.icon-btn:hover, .icon-btn:focus-visible { background: #fff5e7; border-color: #f4ba6d; color: #925b12; }
.editor-title { flex-shrink: 0; position: relative; min-width: 0; padding: 12px 14px; border-bottom: 1px solid #eceef2; }
.resume-name { max-width: 100%; border: 0; padding: 0; background: none; text-align: left; color: #252641; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.resume-name i { margin-left: 6px; font-size: 12px; color: #9397a1; }
.editor-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.editor-actions .btn { padding-left: 1rem; padding-right: 1rem; white-space: nowrap; }
.editor-workspace { --preview-width: 537px; --appearance-width: 320px; position: relative; flex: 1; min-height: 0; display: grid;
  grid-template-columns: minmax(260px, 1fr) var(--preview-width) var(--appearance-width); grid-template-rows: minmax(0, 1fr); align-items: stretch; }
.col-resizer { position: absolute; top: 0; bottom: 0; width: 7px; z-index: 3; cursor: col-resize; background: transparent; }
.col-resizer[data-edge="markdown"] { right: calc(var(--preview-width) + var(--appearance-width) - 3px); }
.col-resizer[data-edge="appearance"] { right: calc(var(--appearance-width) - 3px); }
/* The handle stays invisible; only the cursor says it can be dragged. */
.col-resizer:focus-visible { background: #d7dce4; outline: none; }
body.resizing-columns { cursor: col-resize; user-select: none; }
.editor-panel { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #fff; overflow: hidden; }
.editor-panel { border-left: 1px solid #e0e3e8; }
/* Inset from the top and bottom of the screen, but flush against the preview. */
.markdown-panel { margin: 12px 0; border: 1px solid #e0e3e8; border-right: 0; }
.appearance-panel { border-right: 1px solid #e0e3e8; }
.markdown-panel .CodeMirror { border: 0 !important; border-radius: 0; padding: 16px 10px 16px 14px; line-height: 1.65; flex: 1; min-height: 0; height: auto; }
/* The scrollbar belongs beside the paper, not against the appearance panel. */
.preview-stage { background: #e9ecf0; padding: 14px 6px; overflow: hidden; flex: 1; min-height: 0; display: flex; justify-content: center; }
.preview-scroll { max-height: 100%; overflow-y: auto; overflow-x: hidden; }
.preview-sheet { position: relative; margin: 0 auto; background: white; box-shadow: 0 3px 16px #242c3c18; }
.page-break { position: absolute; left: 0; right: 0; border-top: 1px dashed #98a0ae; pointer-events: none; }
#preview { display: block; border: 0; background: white; transform-origin: top left; width: 210mm; height: 297mm; }
.appearance-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.style-section { min-width: 0; margin: 0; padding: 16px; border: 0; border-bottom: 1px solid #eceef2; }
.style-section legend { float: left; width: 100%; margin: 0 0 12px; font-size: 12px; font-weight: 650; color: #35394f; }
.style-section legend + div { clear: both; }
.style-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.style-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.style-switch button { border: 1px solid #e2e5eb; border-radius: 6px; background: white; color: #555b6e; padding: 8px 2px; font-size: 12px; }
.style-switch button:hover, .style-switch button:focus-visible { background: #fff8ed; border-color: #f4ba6d; }
.style-switch button[aria-checked="true"] { background: #fff5e7; color: #925b12; border-color: #f4ba6d; font-weight: 600; }
.style-presets button { border: 1px solid #e2e5eb; border-radius: 6px; background: white; color: #555b6e; padding: 8px 2px; font-size: 11px; }
.style-presets button:hover, .style-presets button:focus-visible { background: #fff8ed; border-color: #f4ba6d; }
.style-presets button[aria-pressed="true"] { background: #fff5e7; color: #925b12; border-color: #f4ba6d; }
.style-field + .style-field { margin-top: 14px; }
.style-field label { display: block; font-size: 11px; color: #687085; margin-bottom: 6px; }
.style-label-row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.style-field output { font-size: 11px; color: #565e72; font-variant-numeric: tabular-nums; }
.style-field select { width: 100%; font-size: 12px; padding: 8px 28px 8px 9px; border: 1px solid #e0e4eb; border-radius: 6px; background-color: #f9fafc; color: #35394f; }
.style-field input[type="range"] { appearance: none; width: 100%; height: 18px; background: transparent; cursor: pointer; display: block; }
.style-field input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: #e2e6ec; }
.style-field input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: #c87810; }
.style-field input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: #e2e6ec; }
.style-field input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #c87810; }
.style-color { display: flex; align-items: center; gap: 9px; }
.style-field input[type="color"] { width: 30px; height: 28px; padding: 2px; border: 1px solid #e0e4eb; border-radius: 5px; cursor: pointer; background: white; }
.color-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.color-fields .style-field { margin: 0; }
.reset-style { border: none; background: none; color: #687085; font-size: 11px; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.advanced-css { border-bottom: 0; }
.advanced-css summary { font-size: 12px; color: #596175; cursor: pointer; }
.advanced-css p { font-size: 11px; color: #858b99; line-height: 1.5; margin: 10px 0; }
.advanced-css .CodeMirror { padding: 4px; font-size: 11px; height: 260px; border: 1px solid #e0e3e8 !important; }
.advanced-css .CodeMirror-line { font-size: 11px; }
.editor-title #name-input { width: 100%; padding: 0; font-size: 18px; font-weight: 600; line-height: 1.35; resize: none; overflow: hidden; }
/* Stacked panels no longer fit one screen, so narrow layouts scroll the page. */
@media (max-width: 1150px) {
  .resume-editor-page { height: auto; min-height: 100vh; overflow: visible; }
  .editor-workspace { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); grid-template-rows: none; align-items: start; }
  .col-resizer { display: none; }
  /* Leave the save bar and name in view below the editor and preview. */
  .markdown-panel .CodeMirror { flex: none; height: calc(100vh - 150px); min-height: 420px; }
  .preview-stage { flex: none; height: calc(100vh - 150px); min-height: 420px; }
  .preview-scroll { max-height: none; height: 100%; }
  .preview-panel { border-right: 1px solid #e0e3e8; }
  .markdown-panel { margin: 12px 0 0; }
  .appearance-panel { border-top: 1px solid #e0e3e8; }
  .appearance-panel { grid-column: 1 / -1; }
  .appearance-scroll { display: grid; grid-template-columns: 1fr 2fr; min-height: 0; overflow: visible; }
  #style-controls { grid-row: span 3; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .style-section { border-right: 1px solid #eceef2; }
}
@media (max-width: 650px) {
  .editor-workspace { grid-template-columns: minmax(0, 1fr); }
  .editor-panel { border-right: 1px solid #e0e3e8; }
  .preview-panel { border-top: 1px solid #e0e3e8; }
  .appearance-panel { grid-column: auto; }
  .appearance-scroll { display: block; }
  #style-controls { display: block; }
  .markdown-panel .CodeMirror { flex: none; height: 300px; min-height: 0; }
  .preview-stage { flex: none; height: 430px; min-height: 0; padding: 12px 6px; }
  .style-section { border-right: 0; }
}
