.minimize-dialog {
  width: min(90rem, calc(100% - 2rem));
}

.minimize-panel {
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.minimizer-body {
  display: grid;
  gap: 0.8rem;
  padding: 0.8rem;
}

.minimizer-advisory {
  margin: 0;
  border-left: 3px solid var(--toolbox-accent);
  padding: 0.7rem 0.8rem;
  background: var(--toolbox-accent-soft);
  color: var(--toolbox-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.minimizer-config,
.minimizer-result {
  display: grid;
  gap: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--toolbox-border);
  border-radius: calc(var(--toolbox-radius) * 0.8);
  background: var(--toolbox-surface);
}

.minimizer-config > header,
.minimizer-result > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border-bottom: 1px solid var(--toolbox-border);
  padding: 0.7rem 0.8rem;
  background: var(--toolbox-surface-soft);
}

.minimizer-config h3,
.minimizer-result h3,
.minimizer-result header p {
  margin: 0;
}

.minimizer-config h3,
.minimizer-result h3 {
  font-size: 0.95rem;
}

.minimizer-config > header span {
  color: var(--toolbox-muted);
  font-size: 0.72rem;
}

.minimizer-control-grid,
.minimizer-variant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  align-items: end;
  gap: 0.65rem;
  padding: 0 0.8rem;
}

.minimizer-variant-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.minimizer-control-grid label:not(.check-control),
.minimizer-variant-grid label,
.minimizer-subject,
.minimizer-output {
  display: grid;
  gap: 0.3rem;
  color: var(--toolbox-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.minimizer-wide-control {
  grid-column: 1 / -1;
}

.minimizer-check {
  min-height: 2.25rem;
  align-items: center;
}

.minimizer-subject {
  padding: 0 0.8rem 0.8rem;
}

.minimizer-subject textarea {
  min-height: 8rem;
}

.minimizer-variant-grid textarea {
  min-height: 4.5rem;
}

.minimizer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.minimizer-actions p,
.minimizer-status {
  margin: 0;
  color: var(--toolbox-muted);
  font-size: 0.76rem;
}

.minimizer-progress {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  color: var(--toolbox-muted);
  font-size: 0.7rem;
}

.minimizer-progress progress {
  width: 100%;
  accent-color: var(--toolbox-accent);
}

.minimizer-result > dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  margin: 0;
  padding: 0 0.8rem;
}

.minimizer-result > dl > div {
  padding: 0.55rem;
  border-bottom: 1px solid var(--toolbox-border);
}

.minimizer-result dt {
  color: var(--toolbox-muted);
  font-size: 0.66rem;
  font-weight: 750;
  text-transform: uppercase;
}

.minimizer-result dd {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
}

.minimizer-result-badge {
  border: 1px solid currentColor;
  border-radius: 99rem;
  padding: 0.2rem 0.45rem;
  color: var(--toolbox-accent);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.minimizer-result-badge.is-partial,
.minimizer-result-badge.is-cancelled {
  color: var(--regex-warning);
}

.minimizer-result-badge.is-unsupported {
  color: var(--toolbox-danger);
}

.minimizer-observation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0 0.8rem;
}

.minimizer-observation {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
  border: 1px solid var(--toolbox-border);
  border-left: 4px solid var(--toolbox-accent);
  border-radius: calc(var(--toolbox-radius) * 0.7);
  padding: 0.65rem;
  background: var(--toolbox-surface-soft);
}

.minimizer-observation.is-timeout {
  border-left-color: var(--regex-warning);
}

.minimizer-observation.is-crash,
.minimizer-observation.is-worker-error {
  border-left-color: var(--toolbox-danger);
}

.minimizer-observation span,
.minimizer-observation p,
.minimizer-observation small {
  margin: 0;
  color: var(--toolbox-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.minimizer-observation code {
  overflow-wrap: anywhere;
  font-size: 0.68rem;
}

.minimizer-output {
  padding: 0 0.8rem;
}

.minimizer-output textarea {
  min-height: 6rem;
}

.minimizer-result > .minimizer-actions {
  padding: 0 0.8rem 0.8rem;
}

@media (max-width: 720px) {
  .minimizer-variant-grid,
  .minimizer-observation-grid {
    grid-template-columns: 1fr;
  }

  .minimizer-progress {
    grid-template-columns: 1fr;
  }
}
