.export-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: var(--scrim);
  display: flex;
  align-items: center;
  justify-content: center;
}

.export-panel-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 660px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px var(--shadow-lg);
  font-family: var(--font-mono);
}

.export-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-label);
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.export-panel-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: var(--fs-title-sm);
  line-height: 1;
  cursor: pointer;
  padding: 0 0.1rem;
  transition: color 0.15s;
}
.export-panel-close:hover { color: var(--text); }

.export-panel-body {
  display: flex;
  flex-direction: row;
  gap: 0;
  flex: 1;
  min-height: 0;
}

/* ── Left: form controls ── */
.export-panel-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 1.1rem;
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}

.export-panel-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.export-panel-label {
  font-size: var(--fs-meta);
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.export-panel-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--fs-label-lg);
  padding: 0.3rem 0.4rem;
  outline: none;
  cursor: pointer;
  width: 100%;
}
.export-panel-select:focus { border-color: var(--accent-border); }
.export-panel-select:disabled { opacity: 0.4; cursor: not-allowed; }

.export-panel-options-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.15rem;
}

.export-panel-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--fs-detail);
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.export-panel-checkbox {
  accent-color: var(--accent);
  cursor: pointer;
}
.export-panel-checkbox:disabled { cursor: not-allowed; }

.export-panel-location-display {
  font-size: var(--fs-secondary);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.1rem 0;
}

.export-panel-path-wrap {
  display: flex;
  gap: 0.3rem;
  align-items: stretch;
}

.export-panel-path-input {
  flex: 1;
  min-width: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--fs-detail);
  padding: 0.3rem 0.4rem;
  outline: none;
}
.export-panel-path-input:focus { border-color: var(--accent-border); }
.export-panel-path-input::placeholder { color: var(--muted); }

.export-panel-textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--fs-detail);
  padding: 0.3rem 0.4rem;
  outline: none;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.5;
}
.export-panel-textarea:focus { border-color: var(--accent-border); }
.export-panel-textarea::placeholder { color: var(--muted); }

.export-panel-browse-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--fs-subhead);
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.export-panel-browse-btn:hover { background: var(--border); color: var(--text); }

/* ── Right: preview ── */
.export-panel-preview-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.1rem;
  min-width: 0;
  overflow: hidden;
}

.export-panel-preview-label {
  font-size: var(--fs-meta);
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.export-panel-preview {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.7rem 0.85rem;
  font-size: var(--fs-secondary);
  color: var(--text);
  line-height: 1.65;
  overflow-y: auto;
  white-space: pre-wrap;
  margin: 0;
  min-height: 180px;
  opacity: 0.75;
}

/* ── Footer actions ── */
.export-panel-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.75rem 1.1rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.export-panel-export-btn {
  border-color: var(--accent-border) !important;
  color: var(--accent) !important;
}
.export-panel-export-btn:hover {
  background: var(--accent-faint) !important;
  border-color: var(--accent) !important;
}
