.hwb-dialog {
  box-sizing: border-box;
  width: min(980px, calc(100vw - 24px));
  height: min(840px, calc(100vh - 24px));
  height: min(840px, calc(100dvh - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  min-width: 300px;
  min-height: 300px;
  margin: auto;
  padding: 0;
  border: 1px solid #51535b;
  border-radius: 16px;
  background: #1b1d22;
  color: #f1f2f5;
  color-scheme: dark;
  font:
    14px/1.6 system-ui,
    sans-serif;
  resize: both;
  overflow: hidden;
  box-shadow: 0 20px 70px #0008;
}
.hwb-dialog[open] {
  display: flex;
  flex-direction: column;
}
.hwb-dialog::backdrop {
  background: #0009;
}
.hwb-dialog * {
  box-sizing: border-box;
  font-family: system-ui, sans-serif;
  letter-spacing: normal;
  text-transform: none;
}
.hwb-dialog [hidden] {
  display: none !important;
}
.hwb-dialog.hwb-max {
  width: calc(100vw - 24px);
  height: calc(100dvh - 24px);
}
.hwb-dialog header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid #40434b;
}
.hwb-dialog h2 {
  font-size: 19px;
  color: inherit;
  margin: 0 auto 0 0;
}
.hwb-dialog h3 {
  font-size: 15px;
  color: inherit;
  margin: 10px 0;
}
.hwb-dialog p {
  color: #c9ccd4;
  margin: 8px 0;
  overflow-wrap: anywhere;
}
.hwb-dialog .hwb-context {
  padding: 0 20px;
  margin: 12px 0;
}
.hwb-dialog .hwb-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 20px 12px;
}
.hwb-dialog button,
.hwb-launch {
  min-height: 40px;
  border: 1px solid #52555f;
  border-radius: 9px;
  background: #2b2e36;
  color: #f4f5f7;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
  text-align: center;
  vertical-align: middle;
}
.hwb-dialog button:hover:not(:disabled),
.hwb-launch:hover {
  background: #3d424e;
}
.hwb-dialog button[aria-pressed="true"] {
  background: #e1e4eb;
  color: #16191f;
  border-color: #e1e4eb;
}
.hwb-dialog button[aria-pressed="true"]:hover:not(:disabled) {
  background: #e1e4eb;
  color: #16191f;
}
.hwb-dialog:focus { outline: none; }
.hwb-dialog .hwb-presets article { display: flex; flex-direction: column; }
.hwb-dialog .hwb-presets article > button { align-self: flex-start; margin-top: auto; }
.hwb-dialog .hwb-presets article > p { margin-bottom: 12px; }
.hwb-dialog button:disabled {
  opacity: 0.55;
  cursor: default;
}
.hwb-dialog :focus-visible,
.hwb-launch:focus-visible {
  outline: 2px solid #bacdff;
  outline-offset: 3px;
}
.hwb-dialog .hwb-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 4px 20px 20px;
}
.hwb-dialog .hwb-content > button {
  margin: 4px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.hwb-dialog footer {
  border-top: 1px solid #40434b;
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hwb-dialog .hwb-status {
  width: 100%;
  margin: 0 0 4px;
}
.hwb-dialog .hwb-tools {
  display: flex;
  gap: 16px;
  margin: 8px 0 16px;
}
.hwb-dialog label {
  display: block;
  color: #e3e5eb;
}
.hwb-dialog input,
.hwb-dialog select {
  display: block;
  width: 100%;
  min-height: 42px;
  border: 1px solid #595e6b;
  border-radius: 8px;
  background: #24272e;
  color: #f4f5f7;
  padding: 8px 10px;
  font: inherit;
  box-shadow: none;
}
.hwb-dialog input::placeholder {
  color: #b4b9c6;
}
.hwb-dialog .hwb-tools label {
  flex: 1;
  min-width: 0;
}
.hwb-dialog .hwb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.hwb-dialog .hwb-field {
  border: 1px solid #454954;
  border-radius: 12px;
  padding: 12px;
  min-width: 0;
}
.hwb-dialog small {
  display: block;
  color: #bcc3d1;
  margin-top: 6px;
  overflow-wrap: anywhere;
}
.hwb-dialog .hwb-review {
  border: 1px solid #818b9f;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}
.hwb-dialog .hwb-review ul {
  padding-left: 24px;
  max-height: 240px;
  overflow: auto;
}
.hwb-dialog .hwb-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.hwb-dialog article {
  border: 1px solid #454954;
  border-radius: 12px;
  padding: 12px;
}
.hwb-dialog .hwb-sample {
  padding: 22px;
  font-size: 20px;
  line-height: 1.4;
  text-align: center;
}
.hwb-dialog summary {
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
}
.hwb-dialog details > button {
  margin: 6px 6px 6px 0;
}
.hwb-dialog .hwb-user-preset {
  border-top: 1px solid #454954;
  padding: 12px 0;
}
.hwb-dialog .hwb-user-preset button {
  margin: 6px 6px 0 0;
}
.hwb-launch {
  font:
    600 12px/1.4 system-ui,
    sans-serif;
  white-space: nowrap;
  display: none;
}
body.sp-edit-mode .hwb-launch,
body.sp-editing .hwb-launch,
.sp-precision-actions .hwb-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 600px) {
  .hwb-dialog {
    resize: none;
    min-width: 0;
  }
  .hwb-dialog header {
    padding: 10px 12px;
  }
  .hwb-dialog header h2 {
    font-size: 16px;
  }
  .hwb-dialog .hwb-scroll {
    padding: 4px 12px 12px;
  }
  .hwb-dialog .hwb-nav {
    padding: 0 12px 10px;
  }
  .hwb-dialog .hwb-context {
    padding: 0 12px;
  }
  .hwb-dialog footer {
    padding: 10px 12px;
  }
  .hwb-dialog .hwb-grid,
  .hwb-dialog .hwb-presets {
    grid-template-columns: minmax(0, 1fr);
  }
  .hwb-dialog .hwb-tools {
    flex-direction: column;
    gap: 8px;
  }
  .hwb-dialog button {
    min-height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hwb-dialog,
  .hwb-dialog * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
