/* ========================================
   CV Editor — App Chrome Styles
   Design: Clean flat, Inter font, neutral palette
   ======================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --surface-0: #ffffff;
  --surface-1: #f8f9fb;
  --surface-2: #f0f1f4;
  --surface-3: #e4e5ea;
  --border: #dcdee3;
  --border-light: #ecedf1;
  --text-primary: #1a1d26;
  --text-secondary: #5f6470;
  --text-muted: #8b8f9a;
  --accent: #3b5bdb;
  --accent-hover: #364fc7;
  --accent-light: rgba(59, 91, 219, 0.08);
  --danger: #e03131;
  --danger-hover: #c92a2a;
  --danger-light: rgba(224, 49, 49, 0.08);
  --success: #2f9e44;
  --success-hover: #2b8a3e;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);
  --transition: 150ms ease;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--surface-2);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ---- Editor Header ---- */

.editor-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--surface-0);
  padding: 12px 16px;
  gap: 12px;
}

.editor-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.editor-logo {
  color: var(--accent);
}


/* ---- Editor Body (scrollable form area) ---- */

.editor-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.editor-body::-webkit-scrollbar {
  width: 5px;
}

.editor-body::-webkit-scrollbar-track {
  background: transparent;
}

.editor-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.editor-body::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}


/* ---- Settings Panel ---- */

.settings-field {
  margin-bottom: 14px;
}

.settings-field:last-child {
  margin-bottom: 0;
}

.settings-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-labeled {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-0);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-labeled:hover {
  background: var(--surface-1);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-labeled:active {
  background: var(--surface-2);
}

.settings-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-0);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.settings-select:hover {
  background: var(--surface-1);
  color: var(--text-primary);
}

.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.color-picker-wrapper:hover {
  color: var(--text-primary);
}

.color-picker-wrapper input[type="color"] {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  padding: 2px;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 3px;
}

.color-picker-label {
  font-size: 12px;
  font-weight: 500;
}


/* ---- Buttons ---- */

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-0);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon:hover {
  background: var(--surface-1);
  color: var(--text-primary);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:active {
  transform: scale(0.98);
}


/* ---- CV Switcher ---- */

.cv-switcher {
  position: relative;
  flex: 1;
  max-width: 220px;
  min-width: 0;
}

.cv-switcher-current {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cv-switcher-current:hover {
  border-color: var(--text-muted);
}

.cv-switcher-current .chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.cv-switcher-current.open .chevron {
  transform: rotate(180deg);
}

.cv-switcher-name {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-align: left;
}

.cv-switcher-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 240px;
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: none;
  overflow: hidden;
}

.cv-switcher-dropdown.open {
  display: block;
}

.cv-switcher-search {
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-bottom: 1px solid var(--border-light);
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--surface-0);
  outline: none;
}

.cv-switcher-search::placeholder {
  color: var(--text-muted);
}

.cv-switcher-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.cv-switcher-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.cv-switcher-item:hover {
  background: var(--surface-1);
}

.cv-switcher-item.active {
  background: var(--accent-light);
}

.cv-switcher-item.active .cv-item-name {
  color: var(--accent);
  font-weight: 600;
}

.cv-item-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cv-item-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition);
}

.cv-switcher-item:hover .cv-item-actions {
  opacity: 1;
}

.btn-cv-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-cv-action:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.btn-cv-delete:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.cv-switcher-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-top: 1px solid var(--border-light);
}

.cv-switcher-actions button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-0);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.cv-switcher-actions button:hover {
  background: var(--surface-1);
  color: var(--text-primary);
  border-color: var(--border);
}


/* ---- Mobile Tabs ---- */

.mobile-tabs {
  display: none;
  background: var(--surface-0);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
}

.tab-btn {
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-btn:hover:not(.active) {
  color: var(--text-secondary);
}


/* ---- Split Pane ---- */

.split-pane {
  display: flex;
  height: 100vh;
}


/* ---- Editor Panel ---- */

.editor-panel {
  width: 420px;
  min-width: 360px;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}


/* ---- Preview Panel ---- */

.preview-panel {
  flex: 1;
  overflow: hidden;
  background: var(--surface-2);
  position: relative;
}

.preview-scroll {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 16px;
  display: flex;
}

.preview-canvas {
  margin: auto;
  flex-shrink: 0;
  background: var(--surface-0);
  border-radius: 2px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.08),
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  position: relative;
  /* width/height set by JS */
}

.preview-canvas iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 240mm;
  height: 327mm;
  border: none;
  background: #fff;
  transform-origin: 0 0;
  /* scale will be set by JS */
}


/* ---- Zoom Controls ---- */

.zoom-controls {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 10;
  overflow: hidden;
}

.btn-zoom,
.btn-zoom-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  border: none;
  background: var(--surface-0);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-zoom {
  width: 34px;
}

.btn-zoom:hover {
  background: var(--surface-1);
  color: var(--text-primary);
}

.btn-zoom:active {
  background: var(--surface-2);
}

.btn-zoom-level {
  padding: 0 10px;
  font-size: 12px;
  min-width: 46px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.btn-zoom-level:hover {
  background: var(--surface-1);
  color: var(--text-primary);
}


/* ---- Section Manager ---- */

.section-manager {
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  background: var(--surface-0);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.section-manager-header {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
  padding: 12px 16px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-add-section {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--success);
  border-radius: var(--radius-sm);
  background: var(--success);
  color: #fff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-add-section:hover {
  background: var(--success-hover);
  border-color: var(--success-hover);
}

.section-manager-list {
  padding: 6px;
}

.section-manager-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: grab;
  transition: background var(--transition), opacity var(--transition);
  user-select: none;
}

.section-manager-item:hover {
  background: var(--surface-1);
}

.section-manager-item.section-hidden {
  opacity: 0.45;
}

.section-manager-item.dragging {
  opacity: 0.4;
  background: var(--accent-light);
}

.section-manager-item.drag-over {
  border-top: 2px solid var(--accent);
  padding-top: 5px;
}

.drag-handle {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  cursor: grab;
  flex-shrink: 0;
}

.section-manager-label {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.section-hidden .section-manager-label {
  color: var(--text-muted);
  text-decoration: line-through;
}

.section-manager-label-input {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--accent);
  border-radius: 0;
  padding: 0;
  margin: 0;
  outline: none;
  min-width: 0;
}

.section-manager-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.btn-move {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
}

.btn-move:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text-primary);
}

.btn-move:disabled {
  opacity: 0.25;
  cursor: default;
}

.btn-remove-section {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
}

.btn-remove-section:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.btn-visibility {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
}

.btn-visibility:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.btn-visibility.is-visible {
  color: var(--accent);
}

.btn-visibility.is-visible:hover {
  color: var(--accent-hover);
}


/* ---- Form Styles ---- */

.form-section {
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  padding: 0;
  background: var(--surface-0);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.form-section-header {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
  padding: 12px 16px;
  margin: 0;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  width: 100%;
  color: var(--text-primary);
  border-bottom: 1px solid transparent;
  transition: background var(--transition);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.form-section-header:hover {
  background: var(--surface-1);
}

.collapse-toggle {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 6px;
  transition: transform var(--transition);
}

.fieldset-body {
  padding: 12px 16px 16px;
}

.form-field {
  margin-bottom: 10px;
}

.form-field label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface-0);
  transition: all var(--transition);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--text-muted);
}

.form-field input:hover,
.form-field textarea:hover,
.form-field select:hover {
  border-color: var(--text-muted);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-field textarea {
  resize: vertical;
  min-height: 60px;
}


/* ---- Date Fields ---- */

.form-field-date {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.form-field-date label:first-child {
  flex-basis: 100%;
}

.form-field-date input[type="month"] {
  flex: 1;
}

.present-label {
  display: flex !important;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-secondary);
}

.present-label input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
}


/* ---- Lists ---- */

.form-list {
  margin-bottom: 10px;
}

.form-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.form-list-header label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--success);
  border-radius: var(--radius-sm);
  background: var(--success);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: all var(--transition);
}

.btn-add:hover {
  background: var(--success-hover);
  border-color: var(--success-hover);
}

.form-list-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
  padding: 10px;
  background: var(--surface-1);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: border-color var(--transition);
}

.form-list-item:hover {
  border-color: var(--border);
}

.form-list-item > .form-subfields,
.form-list-item > input {
  flex: 1;
  min-width: 0;
}

.form-list-item-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.btn-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  transition: all var(--transition);
}

.btn-remove:hover {
  background: var(--danger-light);
  color: var(--danger);
  border-color: rgba(224, 49, 49, 0.15);
}

.form-subfields {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}


/* ---- Textarea mode (highlights) ---- */

.form-list-textarea .form-list-item {
  flex-direction: column;
  gap: 4px;
}

.form-list-textarea .form-list-item > textarea {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 48px;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface-0);
  transition: all var(--transition);
}

.form-list-textarea .form-list-item > textarea:hover {
  border-color: var(--text-muted);
}

.form-list-textarea .form-list-item > textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-list-item-actions-inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}


/* ---- Tag/chip mode (keywords) ---- */

.form-list-tags .form-list-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.form-list-tags .form-list-item {
  display: inline-flex;
  align-items: center;
  padding: 4px 6px 4px 10px;
  margin: 0;
  border-radius: 16px;
  background: var(--accent-light);
  border-color: transparent;
  width: auto;
  flex: none;
}

.form-list-tags .form-list-item > .tag-input {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-primary);
  width: auto;
  min-width: 30px;
  flex: 0 0 auto;
}

.form-list-tags .tag-input:focus {
  outline: none;
  box-shadow: none;
}

.form-list-tags .form-list-item-actions {
  flex-direction: row;
}

.form-list-tags .btn-remove {
  width: 18px;
  height: 18px;
  font-size: 13px;
  border-radius: 50%;
}

.form-list-tags .form-list-item.tag-dragging {
  opacity: 0.35;
  background: var(--surface-2);
}

.form-list-tags .form-list-item.tag-drag-over-left {
  box-shadow: -2px 0 0 0 var(--accent);
}

.form-list-tags .form-list-item.tag-drag-over-right {
  box-shadow: 2px 0 0 0 var(--accent);
}

.form-list-tags .form-list-item[draggable="true"] {
  cursor: grab;
}

.form-list-tags .form-list-item[draggable="true"]:active {
  cursor: grabbing;
}

/* Compact simple-list items (single input, no subfields) */
.form-list-item:has(> input) {
  padding: 6px 8px;
  align-items: center;
}
.form-list-item:has(> input) .form-list-item-actions {
  flex-direction: row;
  gap: 4px;
}


/* ---- Mode Toggle ---- */

.mode-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  margin: 4px 0;
  cursor: pointer;
}

.mode-toggle input {
  width: auto;
  accent-color: var(--accent);
}


/* ---- Responsive ---- */

@media (max-width: 900px) {
  .editor-panel {
    width: 340px;
    min-width: 300px;
  }
}

@media (max-width: 768px) {
  .mobile-tabs {
    display: flex;
  }

  .split-pane {
    flex-direction: column;
    height: calc(100vh - 42px);
  }

  .editor-panel,
  .preview-panel {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 100%;
  }

  .preview-panel {
    padding: 12px;
  }

  .hidden-mobile {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .btn-primary span {
    display: none;
  }
}


/* ---- Focus visible ---- */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
  outline: none;
}


/* ---- Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
