.deckpress-dialog {
  box-sizing: border-box;
  width: min(940px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel, #1a1d24);
  color: var(--text, #f3f3f6);
}

.deckpress-dialog::backdrop { background: #090a12b8; backdrop-filter: blur(4px); }
.deckpress-header, .deckpress-footer { display: flex; align-items: center; gap: 10px; padding: 15px 20px; }
.deckpress-header { justify-content: space-between; border-bottom: 1px solid var(--line); }
.deckpress-header h2 { margin: 0; font-size: 1.32rem; }
.deckpress-header p { margin: 3px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.deckpress-header .icon-button { flex: none; }

.deckpress-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, .72fr); gap: 22px; padding: 20px; }
.deckpress-stage { display: grid; justify-items: center; gap: 10px; min-width: 0; }
.deckpress-modes { width: fit-content; }
.deckpress-preview {
  display: grid;
  justify-items: center;
  align-items: center;
  width: 100%;
  min-height: 160px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 8, 16, .31);
  color: var(--muted);
  text-align: center;
}
.deckpress-preview svg { display: block; max-width: 100%; width: auto; height: auto; max-height: min(51vh, 510px); filter: drop-shadow(0 6px 14px #0006); }
.deckpress-page-controls { display: flex; align-items: center; justify-content: center; min-height: 23px; gap: 10px; color: var(--muted); font-size: .8rem; }
.deckpress-page-controls .action { min-height: 32px; }
.deckpress-fields { display: grid; align-content: start; gap: 7px; }
.deckpress-fields > .deckpress-fields { margin-top: 8px; }
.deckpress-fields label { font-weight: 650; }
.deckpress-fields :is(input:not([type=checkbox]), select, textarea) {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg, #11131a);
  color: inherit;
  font: inherit;
}
.deckpress-fields textarea { resize: vertical; }
.deckpress-check { display: flex; gap: 7px; align-items: center; }
.deckpress-footer { position: sticky; bottom: 0; justify-content: flex-end; flex-wrap: wrap; background: var(--panel, #1a1d24); border-top: 1px solid var(--line); }
.deckpress-footer p { min-width: 0; flex: 1 1 180px; margin: 0; color: var(--muted); font-size: .84rem; }
.deckpress-footer p:empty { flex: 1 1 0; }
.deckpress-downloads { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-inline-start: auto; }

@media (max-width: 640px) {
  .deckpress-dialog { width: min(100% - 12px, 470px); max-height: calc(100% - 16px); }
  .deckpress-workspace { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 14px; }
  .deckpress-preview svg { max-height: 44vh; }
  .deckpress-header, .deckpress-footer { padding: 10px 12px; }
  .deckpress-fields :is(input:not([type=checkbox]), select, textarea) { font-size: 16px; }
  .deckpress-footer > [data-deckpress-save] { flex: 1 1 100%; justify-content: center; }
  .deckpress-footer p { flex-basis: 100%; text-align: center; }
  .deckpress-footer p:empty { display: none; }
  .deckpress-downloads { flex: 1 1 100%; }
  .deckpress-downloads button { flex: 1; justify-content: center; }
}
