.stream-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  justify-content: flex-start;
}
.stream-title-row h1 {
  min-width: 0;
  flex: 0 1 auto;
  width: auto;
  margin-right: 0;
}
.stream-edit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.stream-edit-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: none;
}
.stream-edit-button:hover,
.stream-edit-button:focus-visible { background: #ffffff14; }
.stream-edit-button:active { transform: scale(.95); }
.stream-editor-dialog {
  width: 440px;
  max-width: calc(100vw - 16px);
  max-height: 90dvh;
  margin: auto;
  padding: 24px;
  box-sizing: border-box;
  border: 0;
  border-radius: 8px;
  background: #181c1f;
  color: #f5f5f5;
  overflow: visible;
  font:
    14px/20px Arial,
    Helvetica,
    sans-serif;
  box-shadow: 0 12px 40px #0006;
}
.stream-editor-dialog::backdrop {
  background: #0009;
}
.stream-editor-dialog form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
}
.stream-editor-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  min-height: 40px;
}
.stream-editor-dialog h2 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0;
}
.stream-editor-dialog button {
  font: inherit;
  font-weight: 600;
  color: #f5f5f5;
  background: #202427;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  box-sizing: border-box;
}
.stream-editor-dialog header button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  background: transparent;
}
.stream-editor-dialog header svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}
.stream-editor-field > label {
  display: block;
  font-weight: 600;
  line-height: 20px;
  margin-bottom: 4px;
}
.stream-editor-dialog textarea {
  display: block;
  width: 100%;
  height: 64px;
  min-height: 64px;
  box-sizing: border-box;
  resize: none;
  padding: 10px;
  border: 2px solid #474b51;
  border-radius: 4px;
  background: #090c0e;
  color: #f5f5f5;
  font:
    500 14px/20px Arial,
    Helvetica,
    sans-serif;
}
.stream-editor-dialog textarea:focus {
  border-color: #fff;
  outline: 0;
}
.stream-editor-hint {
  font-size: 14px;
  line-height: 20px;
  color: #a6a8b0;
  margin: 8px 0 0;
}
.stream-editor-autocomplete {
  position: relative;
}
.stream-editor-dialog [data-category-trigger] {
  display: flex;
  width: 100%;
  height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  gap: 8px;
  text-align: left;
}
.stream-category-current {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.stream-category-current > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stream-category-current img,
.stream-category-option img {
  width: 30px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  flex: none;
}
.stream-editor-dialog [data-category-trigger] > svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  opacity: 0.5;
  flex: none;
}
.stream-category-panel {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  padding: 8px;
  border-radius: 4px;
  background: #24282b;
  box-shadow: 0 8px 20px #0005;
}
.stream-category-search {
  display: flex;
  height: 40px;
  align-items: center;
  border: 1px solid #fff;
  border-radius: 4px;
  background: #090c0e;
  padding: 0 10px;
  gap: 6px;
}
.stream-category-search > svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  flex: none;
}
.stream-category-search input {
  width: 100%;
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  color: #f5f5f5;
  font:
    14px/20px Arial,
    Helvetica,
    sans-serif;
  outline: 0;
  padding: 0;
  height: 38px;
}
.stream-category-search input::placeholder {
  color: #a6a8b0;
}
.stream-editor-dialog [data-clear-category] {
  width: 20px;
  height: 24px;
  background: transparent;
  font-size: 18px;
  font-weight: 400;
  padding: 0;
  flex: none;
}
#streamCategoryOptions {
  max-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-top: 8px;
}
.stream-editor-dialog .stream-category-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 6px;
  min-height: 52px;
  background: transparent;
}
.stream-category-option:hover,
.stream-editor-dialog .stream-category-option[aria-selected="true"] {
  background: #44484b;
}
.stream-category-option strong {
  font-size: 14px;
  line-height: 20px;
}
.stream-category-option small {
  display: block;
  font-size: 11px;
  color: #b9bcc1;
}
.stream-category-panel [data-category-selection] {
  text-align: center;
  margin: 8px 0 0;
  font-weight: 500;
}
.stream-editor-platforms {
  margin-top: 8px;
  font-size: 13px;
  color: #a6a8b0;
}
.stream-editor-platforms summary {
  cursor: pointer;
  min-height: 24px;
}
.stream-editor-connection {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #ffffff14;
}
.stream-editor-connection label {
  display: flex;
  align-items: center;
  min-width: 85px;
  color: #fff;
}
.stream-editor-dialog input[type="checkbox"] {
  accent-color: #53fc18;
  margin-right: 6px;
}
.stream-editor-connection > span {
  flex: 1;
  font-size: 12px;
}
.stream-editor-connection > button {
  padding: 6px 10px;
}
.stream-editor-dialog footer {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}
.stream-editor-dialog footer button {
  flex: 1;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 16px;
  line-height: 24px;
}
.stream-editor-dialog [type="submit"] {
  background: #53fc18;
  color: #000;
}
.stream-editor-dialog button:disabled {
  opacity: 0.4;
  cursor: wait;
}
.stream-editor-dialog:has(details[open]),
.stream-editor-dialog:has(#streamEditorResults:not([hidden])) {
  overflow-y: auto;
}
.stream-editor-dialog .stream-category-search input:focus-visible {
  outline: 0;
}
.stream-editor-dialog :focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.stream-editor-dialog .success {
  color: #a3d56c;
}
.stream-editor-dialog .error {
  color: #ff9e9e;
}
#streamEditorStatus {
  margin: 0;
  font-size: 13px;
}
#streamEditorResults {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
}
.stream-editor-dialog [hidden] {
  display: none !important;
}
@media (max-width: 480px) {
  .stream-editor-dialog {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100dvh - 24px);
  }
  .stream-editor-dialog h2 {
    font-size: 15px;
  }
  .stream-category-panel {
    position: relative;
    top: auto;
    margin-top: 4px;
  }
  #streamCategoryOptions {
    max-height: 180px;
  }
}

.stream-editor-thumbnail {
  font-size: 13px;
  color: #a6a8b0;
}
.stream-editor-thumbnail summary {
  cursor: pointer;
  min-height: 24px;
}
.stream-editor-dialog:has([data-thumbnail-section][open]) {
  overflow-y: auto;
}
[data-thumbnail-simulation] {
  display: block;
  margin-top: 12px;
}
[data-thumbnail-simulation] select {
  display: block;
  width: 100%;
  padding: 8px;
  margin-top: 6px;
  background: #202427;
  color: #fff;
  border: 1px solid #474b51;
  border-radius: 4px;
  font: inherit;
}

#streamEditorConnections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.stream-editor-connection {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  background: #24282b;
  padding: 10px 6px;
  border: 0;
  border-radius: 4px;
  min-width: 0;
}
.stream-editor-connection label {
  justify-content: center;
  min-width: 0;
  font-size: 13px;
}
.stream-editor-connection > span {
  font-size: 11px;
  text-align: center;
}
.stream-editor-connection > button {
  font-size: 11px;
  padding: 6px 4px;
}
.stream-thumbnail-card {
  position: relative;
  width: 156px;
  height: 88px;
  margin-top: 12px;
}
.stream-editor-dialog .stream-thumbnail-tile {
  display: flex;
  width: 156px;
  height: 88px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  border: 1px dashed #52565b;
  border-radius: 2px;
  background: transparent;
  color: #b8b8b8;
  font-weight: 400;
  font-size: 12px;
  line-height: 18px;
}
.stream-thumbnail-tile svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}
.stream-thumbnail-preview {
  display: block;
  width: 156px;
  height: 88px;
  object-fit: contain;
  background: #0d1012;
  border: 2px solid #fff;
  box-sizing: border-box;
}
.stream-editor-dialog [data-thumbnail-options] {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 28px;
  height: 28px;
  padding: 4px;
  background: #0009;
  border-radius: 50%;
  color: #fff;
}
[data-thumbnail-options] svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
[data-thumbnail-menu] {
  position: absolute;
  z-index: 15;
  top: 4px;
  left: 124px;
  width: 156px;
  padding: 8px 0;
  border-radius: 10px;
  background: #282828;
  box-shadow: 0 4px 14px #0006;
}
.stream-editor-dialog [data-thumbnail-menu] button,
.stream-editor-dialog [data-thumbnail-menu] a {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 16px;
  min-height: 36px;
  background: transparent;
  color: #eee;
  font:
    14px/20px Arial,
    sans-serif;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
[data-thumbnail-menu] svg {
  width: 24px;
  height: 24px;
  flex: none;
  fill: currentColor;
}
[data-thumbnail-menu] a svg,
[data-thumbnail-undo] svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stream-editor-dialog [data-thumbnail-menu] button:hover,
.stream-editor-dialog [data-thumbnail-menu] a:hover {
  background: #3d3d3d;
}
.stream-thumbnail-actions {
  margin-top: 12px;
}
.stream-editor-dialog [data-thumbnail-upload],
.stream-editor-dialog [data-thumbnail-connect] {
  padding: 8px 12px;
  min-height: 36px;
}
.stream-editor-dialog [data-thumbnail-upload] {
  background: #53fc18;
  color: #000;
}

.stream-editor-dialog[data-readonly="true"] button:disabled {opacity:1;cursor:not-allowed}
.stream-editor-dialog [data-thumbnail-download][aria-disabled="true"] {opacity:.6;cursor:not-allowed}
