.drama-export-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 28px 80px rgb(12 32 26 / 28%);
}

.drama-export-dialog::backdrop {
  background: rgb(10 25 21 / 52%);
}

.drama-export-form {
  padding: 24px;
  overflow: auto;
  max-height: calc(100vh - 32px);
}

.drama-export-header,
.drama-export-actions,
.drama-export-number-range {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drama-export-header {
  justify-content: space-between;
  margin-bottom: 20px;
}

.drama-export-header h2 {
  margin: 4px 0;
}

.drama-export-header p {
  margin-bottom: 0;
}

.drama-export-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.drama-export-section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fbfefd;
}

.drama-export-section legend {
  padding: 0 6px;
  color: var(--accent-strong);
  font-weight: 800;
}

.drama-export-section > label:not(.check-row) {
  display: grid;
  gap: 8px;
}

.drama-export-section > .muted {
  margin: 8px 0 0;
  font-size: 12px;
}

.drama-export-wide,
.drama-export-full {
  grid-column: 1 / -1;
}

.drama-export-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 210px;
  overflow: auto;
  margin-top: 10px;
  padding-right: 4px;
}

.drama-export-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #d9e8e4;
  border-radius: 9px;
  background: #fff;
}

.drama-export-option input {
  width: auto;
}

.drama-export-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drama-export-option small {
  color: var(--muted);
}

.drama-export-number-range {
  justify-content: flex-start;
}

.drama-export-number-range label {
  display: grid;
  gap: 6px;
  width: min(220px, 40%);
}

.drama-export-status {
  min-height: 24px;
  margin: 16px 0 0;
  color: var(--accent-strong);
  font-weight: 700;
}

.drama-export-actions {
  justify-content: flex-end;
  padding-top: 8px;
}

@media (max-width: 700px) {
  .drama-export-grid {
    grid-template-columns: 1fr;
  }

  .drama-export-wide,
  .drama-export-full {
    grid-column: auto;
  }

  .drama-export-options {
    grid-template-columns: 1fr;
  }

  .drama-export-number-range {
    align-items: stretch;
    flex-direction: column;
  }

  .drama-export-number-range label {
    width: 100%;
  }
}
