#output-preview-dialog { box-sizing: border-box; }
.output-preview-page { width: 100%; min-width: 0; margin-top: 12px; }
.output-preview-page > svg { display: block; width: 100%; height: auto; max-height: calc(90dvh - 100px); }

.export-options {
  --export-panel: color-mix(in srgb, var(--panel, #202421) 92%, #fff 8%);
  --export-border: color-mix(in srgb, currentColor 16%, transparent);
  display: grid;
  gap: 14px;
  color: var(--text, #e9ece8);
}

.export-options-head,
.export-page-options > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.export-options-head h2 {
  margin: 0;
  font-size: 17px;
}

.export-options-head p,
.export-readonly-note {
  margin: 4px 0 0;
  color: var(--muted, #aab0ab);
  font-size: 12px;
  line-height: 1.5;
}

.export-page-count,
.export-car-count,
.export-include small {
  color: var(--muted, #aab0ab);
  font-size: 11px;
  white-space: nowrap;
}

.export-page-list {
  display: grid;
  gap: 10px;
}

.export-page-options {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--export-border);
  border-radius: 12px;
  background: var(--export-panel);
}

.export-page-options.is-current {
  border-color: color-mix(in srgb, var(--accent, #8fae9b) 65%, transparent);
  box-shadow: inset 3px 0 0 var(--accent, #8fae9b);
}

.export-include,
.export-toggle-grid label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  cursor: pointer;
}

.export-include > span {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.export-page-options fieldset {
  min-width: 0;
  margin: 0;
  padding: 10px 12px 12px;
  border: 1px solid var(--export-border);
  border-radius: 9px;
}

.export-page-options legend,
.export-select-grid label > span {
  padding: 0 4px;
  color: var(--muted, #aab0ab);
  font-size: 11px;
}

.export-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 4px 10px;
}

.export-toggle-grid label {
  min-height: 36px;
  font-size: 12px;
}

.export-page-options input[type="checkbox"] {
  inline-size: 17px;
  block-size: 17px;
  accent-color: var(--accent, #8fae9b);
}

.export-select-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.export-select-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.export-select-grid select,
.export-preview-button {
  min-height: 40px;
  border: 1px solid var(--export-border);
  border-radius: 8px;
  color: inherit;
  background: color-mix(in srgb, var(--export-panel) 88%, #000 12%);
  font: inherit;
}

.export-select-grid select {
  width: 100%;
  padding: 0 30px 0 10px;
}

.export-preview-button {
  justify-self: end;
  padding: 0 14px;
  cursor: pointer;
}

.export-preview-button:hover:not(:disabled) {
  border-color: var(--accent, #8fae9b);
  background: color-mix(in srgb, var(--accent, #8fae9b) 15%, var(--export-panel));
}

.export-page-options :is(input, select, button):focus-visible {
  outline: 2px solid var(--accent, #8fae9b);
  outline-offset: 2px;
}

.export-options[data-readonly="true"] .export-page-options {
  opacity: .82;
}

.export-options[data-readonly="true"] .export-preview-button {
  opacity: 1;
}

.export-page-options :disabled {
  cursor: not-allowed;
}

.export-readonly-note {
  padding: 9px 11px;
  border: 1px solid var(--export-border);
  border-radius: 8px;
}

@media (max-width: 720px) {
  .export-select-grid {
    grid-template-columns: 1fr;
  }

  .export-toggle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .export-preview-button {
    width: 100%;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .export-page-options,
  .export-preview-button {
    transition: border-color .16s ease, background-color .16s ease, opacity .16s ease;
  }
}

/* Compact per-drawing physical paper controls. */
.export-page-options header .export-include{flex:1;min-width:0}
.export-page-options header .export-include strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.export-page-options header select.export-paper-choice{width:52px;min-width:52px;padding:3px;font-size:11px}
.export-page-options header select.export-orientation-choice{width:86px;min-width:86px;padding:3px;font-size:11px}
