body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 15px;
}

/* visually hidden helper for accessibility */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

header h1 {
  text-align: center;
  margin-bottom: 15px;
}

/* side-by-side editor & preview */
.editor-preview {
  display: flex;
  gap: 10px;
  height: calc(100vh - 160px);
}

/* editor panel */
.editor {
  flex: 1;
  display: flex;
  flex-direction: column;
}

textarea#htmlInput {
  flex: 1;
  border: 1px solid #ccc;
  padding: 10px;
  font-family: monospace;
  font-size: 0.9rem;
  resize: none;
  outline: none;
  overflow: auto;
}

.editor-actions {
  text-align: right;
  margin-top: 5px;
}

.editor-actions button {
  margin-left: 5px;
  padding: 6px 12px;
  font-size: 0.9rem;
  cursor: pointer;
}

/* preview panel */
.preview {
  flex: 1;
  background: white;
  padding: 20mm 15mm;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
  overflow: auto;
  position: relative;
  width: 100%;
  max-width: 210mm;
  aspect-ratio: 210 / 297;
}

/* CV preview styles */
.preview h1 { font-size: 2em; margin-bottom: 0.5em; }
.preview h2 { font-size: 1.5em; margin-top: 1em; margin-bottom: 0.5em; }
.preview p { margin: 0.2em 0; }
.preview ul { list-style-type: disc; margin: 0.5em 0 1em 1.5em; }
.preview li { margin-bottom: 0.3em; }
.preview a { color: inherit; text-decoration: underline; }

/* page-break helper */
.page-break {
  display: block;
  page-break-after: always;
}

/* action buttons */
.actions {
  text-align: center;
  margin-top: 10px;
}

.actions button {
  margin: 5px;
  padding: 10px 20px;
  font-size: 1rem;
  cursor: pointer;
}

/* responsive adjustments */
@media (max-width: 768px) {
  .editor-preview {
    flex-direction: column;
    height: auto;
  }
  .preview {
    aspect-ratio: auto;
    max-width: 100%;
    padding: 20px;
    height: auto;
  }
}

/* print fallback */
@media print {
  @page { size: A4; margin: 0; }
  body, .preview {
    width: 210mm;
    height: auto;
    margin: 0;
    box-shadow: none;
    overflow: visible;
  }
  .page-break { page-break-after: always; }
}
