/* Kimg workspace layout, measured from observed desktop and mobile UI. */
.rw-workspace {
  --rw-panel: #24252e;
  --rw-card: #1b1c22;
  --rw-border: rgba(77, 77, 86, 0.5);
  --rw-muted: #b0b0b5;
  --rw-gold: #f6d640;
  --rw-primary: #f5df73;
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
  width: 100%;
  font-family: inherit;
}
.rw-workspace *,
.rw-dialog * {
  box-sizing: border-box;
}
.rw-workspace button,
.rw-workspace input,
.rw-workspace textarea,
.rw-workspace select,
.rw-dialog button,
.rw-dialog input,
.rw-dialog textarea {
  font: inherit;
}
.rw-workspace button,
.rw-dialog button {
  cursor: pointer;
  color: inherit;
}
.rw-workspace button:focus-visible,
.rw-dialog button:focus-visible {
  outline: 2px solid var(--rw-gold, #f6d640);
  outline-offset: 2px;
}
.rw-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.rw-hidden {
  display: none !important;
}
.rw-layout {
  display: flex;
  gap: 24px;
  width: 100%;
  align-items: stretch;
}
.rw-form-panel {
  flex: 0 0 420px;
  width: 420px;
  min-width: 0;
  height: 645px;
  max-height: 800px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rw-border);
  border-radius: 12px;
  background: var(--rw-panel);
  box-shadow: 0 10px 15px -3px #0002;
  overflow: hidden;
}
.rw-panel-heading {
  padding: 24px 24px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}
.rw-panel-heading :is(h1,h2) {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0;
  line-height: 28px;
}
.rw-model-trigger {
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 220px;
  min-width: 0;
  background: #1b1c22;
  border: 1px solid var(--rw-border);
  border-radius: 3px;
  padding: 8px 12px;
  height: 36px;
  font-size: 14px;
  font-weight: 500;
}
.rw-model-trigger img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.rw-model-trigger span {
  color: var(--rw-gold);
  min-width: 0;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.rw-model-trigger > .rw-icon {
  width: 14px;
  height: 14px;
  color: var(--rw-muted);
}
.rw-form-body {
  padding: 8px 24px 24px;
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}
.rw-mode-tabs {
  display: flex;
  border-bottom: 1px solid var(--rw-border);
  margin-bottom: 16px;
  flex-shrink: 0;
}
.rw-mode-tabs button {
  flex: 1;
  text-align: center;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  font-weight: 600;
  color: #ffffff66;
  padding: 10px 4px 7px;
  white-space: nowrap;
  font-size: 14px;
}
.rw-mode-tabs .rw-selected {
  color: #fff;
  border-bottom-color: #fff;
}
.rw-form {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
.rw-fields {
  overflow-y: auto;
  min-height: 0;
  flex: 1;
  padding: 0 0 8px;
  margin-bottom: 16px;
  scrollbar-width: thin;
  scrollbar-color: #505159 transparent;
}
.rw-field {
  margin-bottom: 16px;
}
.rw-field > label {
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 8px;
}
.rw-field > label .rw-icon {
  width: 14px;
  height: 14px;
  color: var(--rw-muted);
}
.rw-prompt-wrap {
  position: relative;
}
.rw-prompt-wrap textarea {
  width: 100%;
  height: 140px;
  min-height: 100px;
  border: 1px solid var(--rw-border);
  background: var(--rw-card);
  color: #fff;
  border-radius: 3px;
  padding: 8px 40px 36px 12px;
  resize: vertical;
  outline: 0;
  font-size: 14px;
  line-height: 20px;
  display: block;
}
.rw-prompt-wrap textarea:focus {
  border-color: var(--rw-gold);
  box-shadow: 0 0 0 1px var(--rw-gold);
}
.rw-prompt-wrap textarea::placeholder {
  color: var(--rw-muted);
  opacity: 1;
}
.rw-prompt-tools {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: flex;
  gap: 8px;
}
.rw-prompt-tools button,
.rw-clear-prompt {
  border: 0;
  background: none;
  padding: 2px;
  color: var(--rw-muted);
  display: flex;
  align-items: center;
}
.rw-prompt-tools .rw-icon {
  width: 18px;
  height: 18px;
}
.rw-clear-prompt {
  position: absolute;
  right: 8px;
  top: 8px;
}
.rw-clear-prompt .rw-icon {
  width: 16px;
  height: 16px;
}
.rw-counter {
  font-size: 12px;
  line-height: 16px;
  text-align: right;
  color: var(--rw-muted);
  margin-top: 4px;
}
.rw-assistant-fee {
  min-height: 3em;
  line-height: 1.5;
  text-align: left;
  overflow-wrap: anywhere;
}
.rw-buttons button:disabled,
.rw-ratio:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.rw-frame-slot > button[data-rw-action="select-assets"] {
  margin-top: 6px;
  border: 0;
  background: transparent;
  color: var(--rw-muted);
  font-size: 12px;
  text-decoration: underline;
}
.rw-assistant-dialog textarea {
  display: block;
  width: 100%;
  min-height: 180px;
  padding: 12px;
  border: 1px solid #363636;
  border-radius: 10px;
  color: inherit;
  background: #191919;
  resize: vertical;
}
.rw-prompt-tools button[aria-busy="true"] {
  position: relative;
}
.rw-prompt-tools button[aria-busy="true"] .rw-icon {
  opacity: .3;
}
.rw-ratio-shell {
  position: relative;
}
.rw-ratios {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
  padding: 0 1px;
}
.rw-ratios::-webkit-scrollbar {
  display: none;
}
.rw-ratio {
  min-width: 50px;
  flex: 0 0 50px;
  height: 75px;
  padding: 8px 4px 5px;
  border: 1px solid var(--rw-border);
  border-radius: 3px;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--rw-muted) !important;
  font-size: 12px !important;
}
.rw-ratio-shape {
  display: block;
  max-width: 34px;
  max-height: 31px;
  width: 30px;
  box-sizing: content-box;
  border: 2px solid #b0b0b5;
  border-radius: 3px;
}
.rw-ratio.rw-selected {
  color: var(--rw-gold) !important;
  border-color: var(--rw-gold);
  box-shadow: inset 0 0 0 1px var(--rw-gold);
}
.rw-ratio.rw-selected .rw-ratio-shape {
  border-color: var(--rw-gold);
}
.rw-ratio-arrow {
  position: absolute;
  z-index: 2;
  right: 0;
  top: 24px;
  border: 0;
  border-radius: 50%;
  background: #394246cc;
  color: #ccc !important;
  width: 25px;
  height: 25px;
  padding: 4px;
}
.rw-ratio-arrow .rw-icon {
  width: 16px;
  height: 16px;
}
.rw-ratio-left {
  left: 0;
  right: auto;
  transform: rotate(180deg);
}
.rw-buttons {
  display: grid;
  grid-template-columns: repeat(var(--rw-cols, 3), minmax(0, 1fr));
  gap: 8px;
}
.rw-buttons button,
.rw-count-options button {
  background: transparent;
  border: 1px solid var(--rw-border);
  border-radius: 3px;
  min-height: 36px;
  padding: 7px 9px;
  color: var(--rw-muted);
  font-size: 14px;
}
.rw-buttons button.rw-selected,
.rw-count-options button.rw-selected {
  background: #f6d64015;
  border-color: var(--rw-gold);
  color: var(--rw-gold);
}
.rw-count-options {
  display: flex;
  gap: 8px;
}
.rw-count-options button {
  width: 44px;
  min-height: 34px;
}
.rw-field select,
.rw-field input[type="number"],
.rw-seed input,
.rw-shot input {
  background: var(--rw-card);
  color: #fff;
  border: 1px solid var(--rw-border);
  border-radius: 3px;
  min-height: 35px;
  width: 100%;
  padding: 6px 10px;
}
.rw-field input[type="range"] {
  width: 100%;
  accent-color: var(--rw-gold);
  height: 14px;
}
.rw-field output {
  margin-inline-start: auto;
  color: var(--rw-gold);
}
.rw-range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--rw-muted);
  font-size: 12px;
}
.rw-toggle-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rw-toggle-field > label {
  margin: 0;
}
.rw-switch {
  position: relative;
  width: 38px;
  height: 21px;
  flex: 0 0 38px !important;
  display: block !important;
}
.rw-switch input {
  opacity: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.rw-switch > span {
  display: block;
  border-radius: 20px;
  background: #55565e;
  width: 38px;
  height: 21px;
  transition: background 0.2s;
}
.rw-switch > span:after {
  content: "";
  display: block;
  position: absolute;
  left: 3px;
  top: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s;
}
.rw-switch input:checked + span {
  background: var(--rw-gold);
}
.rw-switch input:checked + span:after {
  transform: translateX(17px);
  background: #18191c;
}
.rw-switch input:focus-visible + span {
  outline: 2px solid white;
  outline-offset: 3px;
}
.rw-seed {
  margin: 0 0 16px;
  color: var(--rw-muted);
}
.rw-seed summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.rw-seed-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.rw-seed-row button {
  border: 1px solid var(--rw-border);
  background: var(--rw-card);
  border-radius: 3px;
  padding: 6px;
}
.rw-seed small {
  font-size: 11px;
  display: block;
  margin-top: 6px;
}
.rw-submit-area {
  border-top: 1px solid var(--rw-border);
  padding-top: 16px;
  flex-shrink: 0;
}
.rw-credit-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #f6d64022;
  background: #f2e09b1a;
  border-radius: 4px;
  padding: 14px 12px;
  margin-bottom: 16px;
  min-height: 50px;
  font-size: 14px;
  font-weight: 600;
}
.rw-credit-line > span {
  display: flex;
  gap: 8px;
  align-items: center;
}
.rw-credit-line .rw-icon {
  color: var(--rw-gold);
  width: 17px;
  height: 17px;
}
.rw-credit-line strong {
  color: var(--rw-gold);
  font-size: 16px;
}
.rw-generate {
  width: 100%;
  border: 0;
  border-radius: 3px;
  padding: 9px 12px;
  min-height: 36px;
  background: linear-gradient(110deg, #edbd43, #f9e776);
  color: #16171a !important;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.rw-generate:disabled {
  opacity: 0.65;
  cursor: wait;
}
.rw-error,
.rw-quote-error,
.rw-field-error {
  font-size: 12px;
  color: #ffadad;
  margin: 0 0 9px;
  overflow-wrap: anywhere;
}
.rw-quote-error {
  color: #d7bd80;
}
.rw-history {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--rw-border);
  border-radius: 12px;
  background: var(--rw-card);
  padding: 24px;
  min-height: 645px;
  position: relative;
}
.rw-history-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--rw-gold);
  margin-bottom: 22px;
  height: 22px;
}
.rw-history-heading .rw-icon {
  width: 20px;
  height: 20px;
}
.rw-history-heading h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.rw-history-heading button {
  margin-inline-start: auto;
  color: var(--rw-muted);
  border: 0;
  background: none;
  opacity: 0;
}
.rw-history:hover .rw-history-heading button,
.rw-history-heading button:focus-visible {
  opacity: 1;
}
.rw-preview-note {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #f6d64033;
  background: #f6d6400d;
  color: #c8c8cc;
  border-radius: 3px;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
  margin-bottom: 12px;
}
.rw-preview-note .rw-icon {
  color: var(--rw-gold);
  width: 14px;
  height: 14px;
}
.rw-history-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  gap: 10px;
  color: var(--rw-muted);
}
.rw-output-layout {
  display: flex;
  gap: 20px;
}
.rw-output-main {
  flex: 1;
  min-width: 0;
}
.rw-task {
  border: 1px solid var(--rw-border);
  border-radius: 12px;
  background: #111217;
  padding: 16px;
}
.rw-task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--rw-muted);
  gap: 10px;
}
.rw-task-meta > div {
  display: flex;
  gap: 8px;
  align-items: center;
}
.rw-task-mode {
  background: #f5df73;
  color: #111217;
  border-radius: 2px;
  padding: 2px 10px;
  line-height: 16px;
  font-size: 12px;
}
.rw-task-ratio {
  border: 1px solid var(--rw-border);
  border-radius: 3px;
  font-size: 12px;
  padding: 1px 7px;
  min-height: 20px;
}
.rw-task-prompt {
  margin: 8px 0 16px;
  font-size: 14px;
  color: #fff;
  line-height: 20px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.rw-output-media {
  position: relative;
  text-align: center;
  min-width: 0;
  margin: 0 0 8px;
}
.rw-output-media > button {
  display: block;
  background: none;
  border: 0;
  margin: auto;
  padding: 0;
  max-width: 100%;
}
.rw-output-media img,
.rw-output-media video {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 335px);
  object-fit: contain;
  margin: auto;
}
.rw-media-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
}
.rw-output-media:hover .rw-media-actions,
.rw-output-media:focus-within .rw-media-actions {
  opacity: 1;
}
.rw-media-actions a,
.rw-media-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: #111b;
  border: 1px solid #ffffff33;
  border-radius: 4px;
  color: #fff;
  text-decoration: none;
}
.rw-media-actions .rw-icon {
  width: 16px;
  height: 16px;
}
.rw-thumb-rail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 84px;
  flex: 0 0 84px;
}
.rw-thumb-rail button {
  border: 2px solid transparent;
  border-radius: 0;
  background: #14151a;
  padding: 0;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rw-thumb-rail button.rw-selected {
  border-color: var(--rw-gold);
}
.rw-thumb-rail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rw-pending,
.rw-failed {
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-direction: column;
  color: #b0b0b5;
}
.rw-failed {
  color: #f2a5a5;
}
.rw-pending strong {
  color: #fff;
}
.rw-spinner {
  border: 2px solid #ffffff30;
  border-top-color: #f6d640;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: inline-block;
  animation: rw-spin 0.8s linear infinite;
}
.rw-pending > .rw-spinner {
  width: 30px;
  height: 30px;
  border-width: 3px;
}
@keyframes rw-spin {
  to {
    transform: rotate(360deg);
  }
}
.rw-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.rw-upload-zone {
  background: var(--rw-card);
  border: 1px dashed #666771;
  border-radius: 4px;
  min-height: 142px;
  padding: 12px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-direction: column;
  color: var(--rw-muted) !important;
}
.rw-upload-zone .rw-icon {
  width: 26px;
  height: 26px;
}
.rw-upload-zone strong {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}
.rw-upload-zone > span {
  font-size: 12px;
}
.rw-upload-grid > .rw-upload-zone:only-child {
  grid-column: 1/-1;
}
.rw-upload-small {
  min-height: 112px;
}
.rw-reference {
  position: relative;
  min-width: 0;
  height: 138px;
  overflow: hidden;
  border: 1px solid var(--rw-border);
  border-radius: 3px;
  background: var(--rw-card);
}
.rw-reference img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.rw-reference > button {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #111c;
  border: 1px solid #fff3;
  border-radius: 50%;
  color: #fff;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rw-reference > button .rw-icon {
  width: 15px;
  height: 15px;
}
.rw-reference > .rw-reference-crop {
  top: auto;
  bottom: 4px;
}
.rw-upload-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  color: var(--rw-muted);
}
.rw-upload-meta button {
  border: 0;
  background: transparent;
  text-decoration: underline;
  padding: 0;
  color: var(--rw-gold);
  font-size: 12px;
}
.rw-upload-meta small {
  font-size: 12px;
}
.rw-reference-mode {
  display: flex;
  border: 1px solid var(--rw-border);
  border-radius: 4px;
  margin-bottom: 8px;
}
.rw-reference-mode button {
  width: 50%;
  border: 0;
  background: none;
  padding: 7px;
  color: var(--rw-muted);
}
.rw-reference-mode button.rw-selected {
  background: #f6d64015;
  color: var(--rw-gold);
}
.rw-frame-slot > span {
  display: block;
  font-size: 12px;
  color: var(--rw-muted);
  margin: 0 0 5px;
}
.rw-frame-slot .rw-upload-zone {
  width: 100%;
  min-height: 138px;
}
.rw-shot {
  border: 1px solid var(--rw-border);
  border-radius: 4px;
  padding: 9px;
  margin-bottom: 8px;
}
.rw-shot > label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--rw-gold);
  font-size: 12px;
}
.rw-shot > label button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--rw-muted);
}
.rw-shot textarea {
  width: 100%;
  min-height: 70px;
  background: var(--rw-card);
  border: 1px solid var(--rw-border);
  border-radius: 3px;
  color: white;
  padding: 8px;
  resize: vertical;
  margin: 5px 0;
}
.rw-add-shot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 1px solid var(--rw-border);
  background: transparent;
  border-radius: 3px;
  padding: 8px;
  color: var(--rw-muted);
}
.rw-dialog {
  --rw-gold: #f6d640;
  --rw-border: rgba(77, 77, 86, 0.5);
  --rw-card: #1b1c22;
  --rw-muted: #b0b0b5;
  background: #24252b;
  color: #fff;
  border: 1px solid var(--rw-border);
  border-radius: 12px;
  box-shadow: 0 20px 40px #0007;
  padding: 0;
  width: min(640px, calc(100vw - 24px));
  max-height: min(760px, 85dvh);
  font-family: inherit;
  font-size: 14px;
  overflow: auto;
}
.rw-dialog::backdrop {
  background: #0009;
}
.rw-dialog-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #ffffff1a;
  gap: 12px;
}
.rw-dialog-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.rw-dialog-title button {
  border: 0;
  background: none;
  color: #aaa;
  padding: 2px;
  display: flex;
}
.rw-model-dialog {
  width: min(660px, calc(100vw - 24px));
  max-height: min(740px, 85dvh);
  overflow: hidden;
}
.rw-model-dialog > .rw-dialog-title {
  display: none;
}
.rw-model-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px;
  background: #0002;
  border: 1px solid #ffffff1a;
  border-radius: 8px;
  padding: 8px 10px;
}
.rw-model-search > .rw-icon {
  color: #ffffff80;
  width: 16px;
  height: 16px;
}
.rw-model-search input {
  background: none;
  border: 0;
  outline: 0;
  color: #fff;
  min-width: 0;
  flex: 1;
  font-size: 14px;
}
.rw-model-search input::placeholder {
  color: #ffffff73;
}
.rw-model-brands {
  display: flex;
  gap: 6px;
  overflow: auto;
  padding: 0 12px 12px;
  border-bottom: 1px solid #ffffff1a;
  scrollbar-width: none;
}
.rw-model-brands button {
  flex-shrink: 0;
  border: 1px solid #ffffff1a;
  border-radius: 6px;
  background: none;
  color: #aaa;
  padding: 5px 9px;
  font-size: 12px;
}
.rw-model-brands button.rw-selected {
  border-color: #f6d64060;
  background: #f6d6401a;
  color: #f6d640;
}
.rw-model-options {
  overflow: auto;
  max-height: calc(min(740px, 85dvh) - 112px);
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: #505159 transparent;
}
.rw-model-option {
  display: flex;
  gap: 12px;
  width: 100%;
  text-align: start;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  padding: 12px;
  align-items: center;
  color: white;
}
.rw-model-option:hover {
  background: #ffffff0d;
}
.rw-model-option.rw-selected {
  border-color: #f6d6404d;
  background: #f6d6401a;
}
.rw-model-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #ffffff0d;
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rw-model-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.rw-model-summary {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.rw-model-summary strong {
  font-size: 15px;
  font-weight: 500;
  line-height: 19px;
}
.rw-model-summary em {
  font-style: normal;
  border-radius: 3px;
  background: #f6d6401a;
  color: #f6d640;
  padding: 2px 4px;
  font-size: 9px;
  white-space: nowrap;
}
.rw-model-description {
  font-size: 12px;
  color: #ffffff99;
  line-height: 17px;
}
.rw-model-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 1px;
}
.rw-model-tags small {
  display: flex;
  gap: 4px;
  align-items: center;
  border: 1px solid #ffffff1a;
  background: #0002;
  color: #ffffff99;
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 10px;
  line-height: 12px;
  min-height: 18px;
}
.rw-model-tags .rw-icon {
  width: 12px;
  height: 12px;
}
.rw-model-option > .rw-icon {
  width: 16px;
  height: 16px;
  color: var(--rw-gold);
}
.rw-model-popover {
  width: 380px;
  max-height: min(620px, 75dvh);
  position: fixed;
}
.rw-model-popover::backdrop {
  background: transparent;
}
.rw-model-popover .rw-model-options {
  max-height: calc(min(620px, 75dvh) - 68px);
}
.rw-model-popover .rw-model-option {
  gap: 10px;
  padding: 10px;
}
.rw-model-popover .rw-model-icon {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}
.rw-model-popover .rw-model-icon img {
  width: 20px;
  height: 20px;
}
.rw-model-popover .rw-model-description {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rw-model-popover .rw-model-summary strong {
  font-size: 14px;
}
.rw-model-none {
  padding: 30px;
  text-align: center;
  color: #b0b0b5;
}
/* Keep preview controls visible; only the prompt owns text scrolling. */
.rw-preview-dialog {
  width: min(1160px, calc(100vw - 32px));
  max-height: min(800px, calc(100dvh - 32px));
  overflow: hidden;
}
.rw-preview-dialog[open] {
  display: flex;
  flex-direction: column;
  height: min(800px, calc(100dvh - 32px));
}
.rw-preview-dialog > .rw-dialog-title {
  flex: 0 0 auto;
  min-width: 0;
  padding: 12px 16px;
}
.rw-preview-dialog > .rw-dialog-title h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}
.rw-preview-dialog > .rw-dialog-title button {
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}
.rw-preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.rw-preview-dialog .rw-large-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 20px;
  overflow: hidden;
  border-inline-end: 1px solid var(--rw-border);
  background: var(--rw-card);
}
.rw-preview-dialog .rw-large-preview > img,
.rw-preview-dialog .rw-large-preview > video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.rw-preview-dialog .rw-large-preview .rw-stream-preview {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  aspect-ratio: auto;
}
.rw-preview-dialog .rw-large-preview .rw-stream > [data-media-video],
.rw-preview-dialog .rw-large-preview .rw-stream > [data-media-cover] {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.rw-preview-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  gap: 16px;
  padding: 20px;
  overflow: hidden;
}
.rw-preview-details > :not(.rw-preview-prompt) {
  flex-shrink: 0;
}
.rw-preview-dialog .rw-preview-prompt {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  line-height: 1.65;
  scrollbar-gutter: stable;
}
.rw-preview-details > .rw-field {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--rw-border);
}
.rw-preview-details > .rw-error {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.rw-preview-dialog .rw-preview-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 0 0 auto;
  gap: 10px;
  margin-top: auto;
  padding: 12px 0 0;
  border-top: 1px solid var(--rw-border);
}
.rw-preview-dialog .rw-preview-actions a,
.rw-preview-dialog .rw-preview-actions button {
  justify-content: center;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  overflow-wrap: anywhere;
}
@media (max-width: 767px) {
  .rw-preview-dialog,
  .rw-preview-dialog[open] {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
  .rw-preview-dialog[open] {
    height: calc(100dvh - 16px);
  }
  .rw-preview-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, .8fr);
  }
  .rw-preview-dialog .rw-large-preview {
    padding: 12px;
    border-inline-end: 0;
    border-bottom: 1px solid var(--rw-border);
  }
  .rw-preview-details {
    gap: 12px;
    padding: 12px;
  }
  .rw-preview-dialog .rw-preview-actions {
    gap: 8px;
    padding-top: 10px;
  }
}
@media (min-width: 600px) and (max-height: 500px) {
  .rw-preview-layout {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    grid-template-rows: minmax(0, 1fr);
  }
  .rw-preview-dialog .rw-large-preview {
    border-inline-end: 1px solid var(--rw-border);
    border-bottom: 0;
  }
}

.rw-preview-actions,
.rw-crop-actions {
  padding: 0 20px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.rw-preview-actions a,
.rw-preview-actions button,
.rw-crop-actions button {
  background: none;
  border: 1px solid #666771;
  border-radius: 4px;
  color: #fff;
  padding: 8px 14px;
  display: flex;
  gap: 6px;
  align-items: center;
  text-decoration: none;
}
.rw-preview-actions a,
.rw-crop-actions button:last-child {
  background: #f5df73;
  border-color: #f5df73;
  color: #17181c;
}
.rw-asset-dialog {
  width: min(800px, calc(100vw - 24px));
}
.rw-asset-loading {
  padding: 45px;
  text-align: center;
  color: #b0b0b5;
}
.rw-asset-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}
.rw-asset-picker button {
  background: #17181e;
  border: 1px solid #4d4d56;
  border-radius: 4px;
  padding: 4px;
  color: white;
  min-width: 0;
}
.rw-asset-picker img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.rw-asset-picker span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 4px;
  font-size: 11px;
}
.rw-crop-help {
  padding: 0 20px;
  color: #aaa;
}
.rw-crop-stage {
  padding: 0 20px;
  display: flex;
  justify-content: center;
  overflow: hidden;
}
.rw-crop-stage canvas {
  max-width: 100%;
  max-height: 420px;
  touch-action: none;
  background: repeating-conic-gradient(#333 0 25%, #25262c 0 50%) 50%/20px 20px;
  outline: none;
  cursor: crosshair;
}
.rw-crop-stage canvas:focus-visible {
  outline: 2px solid var(--rw-gold);
}
.rw-crop-dimensions {
  text-align: center;
  color: #bbb;
  font-size: 12px;
  padding: 10px 20px 16px;
}
.rw-crop-actions button:disabled {
  opacity: 0.5;
  cursor: wait;
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .rw-form-panel {
    width: 380px;
    flex-basis: 380px;
  }
  .rw-thumb-rail {
    width: 64px;
    flex-basis: 64px;
  }
}
@media (max-width: 1023px) {
  .rw-layout {
    gap: 16px;
  }
  .rw-form-panel {
    width: 360px;
    flex-basis: 360px;
  }
  .rw-panel-heading {
    padding: 20px;
  }
  .rw-form-body {
    padding: 8px 20px 20px;
  }
  .rw-history {
    padding: 20px;
  }
  .rw-thumb-rail {
    display: none;
  }
}
@media (max-width: 767px) {
  .rw-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .rw-form-panel {
    width: 100%;
    flex: auto;
    height: auto;
    max-height: none;
    min-height: 0;
    border-radius: 10px;
  }
  .rw-panel-heading {
    padding: 20px;
    min-height: 65px;
    gap: 10px;
  }
  .rw-panel-heading :is(h1,h2) {
    font-size: 18px;
    line-height: 24px;
  }
  .rw-model-trigger {
    font-size: 13px;
    padding: 6px 8px;
    max-width: 195px;
  }
  .rw-form-body {
    padding: 8px 20px 20px;
  }
  .rw-form {
    display: block;
  }
  .rw-fields {
    max-height: none;
    overflow: visible;
    padding: 0;
    margin-bottom: 16px;
  }
  .rw-prompt-wrap textarea {
    height: 112px;
    min-height: 100px;
    font-size: 16px;
  }
  .rw-field {
    margin-bottom: 18px;
  }
  .rw-mode-tabs button {
    font-size: 14px;
  }
  .rw-history {
    min-height: 380px;
    padding: 18px;
    border-radius: 10px;
  }
  .rw-history-empty {
    min-height: 260px;
  }
  .rw-output-layout {
    gap: 0;
  }
  .rw-task {
    padding: 12px;
  }
  .rw-task-meta {
    font-size: 12px;
    gap: 5px;
  }
  .rw-task-mode {
    padding: 2px 6px;
  }
  .rw-task-prompt {
    font-size: 13px;
  }
  .rw-output-media img,
  .rw-output-media video {
    max-height: 70vh;
  }
  .rw-preview-note {
    font-size: 11px;
    align-items: flex-start;
  }
  .rw-history-heading {
    margin-bottom: 16px;
  }
  .rw-model-dialog,
  .rw-model-popover {
    width: calc(100vw - 24px);
    position: fixed;
    left: auto !important;
    top: auto !important;
    margin: auto !important;
    max-height: 80dvh;
  }
  .rw-model-options {
    max-height: calc(80dvh - 122px);
  }
  .rw-model-popover .rw-model-options {
    max-height: calc(75dvh - 68px);
  }
  .rw-model-option {
    gap: 9px;
    padding: 10px;
  }
  .rw-model-icon {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }
  .rw-model-summary strong {
    font-size: 14px;
  }
  .rw-model-description {
    font-size: 11px;
  }
  .rw-model-brands {
    padding-bottom: 10px;
  }
  .rw-asset-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rw-media-actions {
    opacity: 1;
  }
  .rw-pending,
  .rw-failed {
    min-height: 260px;
  }
  .rw-credit-line {
    margin-bottom: 12px;
  }
  .rw-submit-area {
    padding-top: 16px;
  }
  .rw-crop-actions {
    padding: 0 14px 16px;
    gap: 6px;
  }
  .rw-crop-actions button {
    padding: 8px 10px;
  }
  .rw-preview-actions {
    justify-content: center;
  }
  .rw-model-trigger > .rw-icon {
    width: 12px;
    height: 12px;
  }
}

/* Private result streams stay inert until the shared media controller receives an explicit play. */
.rw-stream {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  max-height: calc(100vh - 335px);
  overflow: hidden;
  background: #08090c;
  border-radius: 3px;
}
.rw-stream > [data-media-video],
.rw-stream > [data-media-cover] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  margin: 0;
}
.rw-stream > [data-media-cover] {
  z-index: 1;
}
.rw-stream-play {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: calc(100% - 24px);
  padding: 10px 15px;
  border: 1px solid #ffffff80;
  border-radius: 30px;
  background: #101116d9;
  color: #fff;
  font-size: 13px;
  line-height: 20px;
  white-space: nowrap;
  cursor: pointer;
}
.rw-stream-play svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}
.rw-stream-play:hover {
  border-color: #f6d640;
  color: #f6d640;
}
.rw-stream > [hidden] {
  display: none !important;
}
.rw-stream-preview {
  max-height: 65dvh;
  min-height: 160px;
}
@media (max-width: 767px) {
  .rw-stream {
    max-height: 70vh;
  }
  .rw-stream-play {
    padding: 8px 12px;
    font-size: 12px;
  }
}
.rw-stream > .rw-stream-play {
  width: auto;
  height: auto;
  right: auto;
  bottom: auto;
}
.rw-stream > .rw-stream-play::before {
  content: none;
}
.rw-stream[data-media-state="error"] > .rw-stream-play .rw-stream-label,
.rw-stream[data-media-state="error"] > .rw-stream-play svg {
  display: none;
}
.rw-stream[data-media-state="error"] > .rw-stream-play::before {
  content: "↻";
  font-size: 20px;
}
.rw-stream[data-media-state="error"] > .rw-stream-play::after {
  content: attr(data-media-retry-label);
}

/* Source ImageCard382305: grouped images, clamped prompt and estimated progress70519. */
.rw-task-prompt {display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;white-space:normal}
.rw-result-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-height:40vh;overflow:hidden;grid-auto-rows:1fr}
.rw-result-grid[data-rw-result-count="1"] {grid-template-columns:minmax(0,1fr);max-height:50vh}
.rw-result-grid:is([data-rw-result-count="3"],[data-rw-result-count="6"]) {grid-template-columns:repeat(3,minmax(0,1fr))}
.rw-output-slot,.rw-output-media {min-height:22vh;position:relative;border-radius:8px;overflow:hidden;display:flex;align-items:center;justify-content:center;margin:0}
.rw-output-slot>.rw-pending {position:absolute;inset:0}
.rw-pending,.rw-output-slot.rw-failed {min-height:22vh;padding:8px;background:hsl(232 12% 12% / .9);backdrop-filter:blur(4px);gap:8px}
.rw-pending>span {font-size:12px;color:#fffc;margin-top:4px}
.rw-progress {display:flex;flex-direction:column;align-items:center;gap:4px}
.rw-progress-ring {width:100px;height:100px;transform:rotate(-90deg);transform-origin:center;animation:rw-progress-spin 1.6s linear infinite}
[data-rw-document-hidden="true"] .rw-progress-ring{animation-play-state:paused}
@keyframes rw-progress-spin{from{transform:rotate(-90deg)}to{transform:rotate(270deg)}}
.rw-progress-ring circle {stroke-width:8px}
[data-rw-progress-arc] {transition:stroke-dashoffset .3s ease-out;filter:drop-shadow(0 0 3px #f8d24b66)}
.rw-progress>strong {font-size:16px;letter-spacing:.5px;background:linear-gradient(110deg,#e9ba49,#f8e877,#e9ba49);background-size:200% 200%;color:transparent;background-clip:text;text-shadow:0 0 10px #ffffff1a;animation:rw-progress-gradient 3s ease infinite}
.rw-pending[data-rw-progress-count]:not([data-rw-progress-count="1"]):not([data-rw-progress-count="2"]) .rw-progress-ring {width:60px;height:60px}
.rw-pending[data-rw-progress-count]:not([data-rw-progress-count="1"]):not([data-rw-progress-count="2"]) .rw-progress>strong {font-size:14px}
.rw-failed>button {border:1px solid #ffffff30;border-radius:4px;background:transparent;padding:5px 12px;color:#f6d640}
.rw-output-main {overflow-y:auto;scrollbar-width:thin;scrollbar-color:#505159 transparent;max-height:calc(100dvh - 330px);min-height:260px;scroll-behavior:smooth;display:flex;flex-direction:column;gap:16px}
.rw-task {flex-shrink:0}
.rw-thumb-rail {width:80px;flex-basis:80px;overflow-y:auto;max-height:calc(100dvh - 240px);scrollbar-width:none}
.rw-thumb-rail button {flex-shrink:0;background:#353d40}
@keyframes rw-progress-gradient {0%,100%{background-position:0 0}50%{background-position:100% 100%}}
@media(min-width:768px){.rw-result-grid:not([data-rw-result-count="1"]):not([data-rw-result-count="2"]):not([data-rw-result-count="3"]):not([data-rw-result-count="6"]){grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(min-width:1280px){.rw-thumb-rail{width:96px;flex-basis:96px}}
@media(max-width:767px){.rw-progress-ring{width:60px;height:60px}.rw-pending[data-rw-progress-count]:not([data-rw-progress-count="1"]):not([data-rw-progress-count="2"]) .rw-progress-ring{width:40px;height:40px}.rw-progress>strong{font-size:14px}.rw-pending[data-rw-progress-count]:not([data-rw-progress-count="1"]):not([data-rw-progress-count="2"]) .rw-progress>strong{font-size:12px}.rw-output-main{max-height:70dvh}.rw-pending,.rw-output-slot.rw-failed{min-height:22vh}}
@media(prefers-reduced-motion:reduce){.rw-progress-ring,.rw-progress>strong{animation:none}[data-rw-progress-arc]{transition:none}.rw-output-main{scroll-behavior:auto}}

.rw-history {background:var(--rw-panel)}
.rw-task {background:hsl(230 12% 8%)}
.rw-result-grid[data-rw-result-count="0"] {grid-template-columns:minmax(0,1fr)}
@media(min-width:1536px){.rw-progress>strong{margin-top:16px}}

.rw-thumb-rail {gap:8px;padding:8px}
.rw-type-switch {display:flex;flex-shrink:0;border-radius:999px;padding:2px;background:#121316;border:1px solid #0005;min-height:36px}
.rw-type-switch button {white-space:nowrap;border:0;background:none;border-radius:999px;padding:5px 16px;color:#777981;transition:background-color .2s,color .2s}
.rw-type-switch button.rw-selected {color:#fff;background:#3d3e43}
@media(min-width:1024px){
 .rw-history:has(.rw-thumb-rail) {--rw-rail-width:80px;background:none;border:0;padding-right:0;isolation:isolate}
 .rw-history:has(.rw-thumb-rail)::before {content:"";position:absolute;inset:0 calc(var(--rw-rail-width) + 16px) 0 0;border:1px solid var(--rw-border);border-radius:12px;background:var(--rw-panel);z-index:-1}
 .rw-history:has(.rw-thumb-rail) .rw-history-heading,.rw-history:has(.rw-thumb-rail) .rw-preview-note {margin-right:calc(var(--rw-rail-width) + 40px)}
 .rw-history:has(.rw-thumb-rail) .rw-output-layout {display:block;padding-right:calc(var(--rw-rail-width) + 40px)}
 .rw-history:has(.rw-thumb-rail) .rw-thumb-rail {position:absolute;top:4px;right:0;margin:0}
}
@media(min-width:1280px){.rw-history:has(.rw-thumb-rail){--rw-rail-width:96px}}

@media(max-width:390px){.rw-type-switch button{padding-inline:10px}.rw-panel-heading:has(.rw-type-switch){gap:8px}.rw-panel-heading:has(.rw-type-switch) .rw-model-trigger{padding-inline:8px;flex:1}.rw-panel-heading:has(.rw-type-switch) .rw-model-trigger img{flex-shrink:0}}

.rw-creation-queue{border:1px solid #b39439;border-radius:10px;padding:12px;margin:0 0 16px;background:#28251d;color:var(--rw-text)}
.rw-creation-queue>header,.rw-queue-item>div:first-child,.rw-queue-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.rw-creation-queue>header{justify-content:space-between}.rw-creation-queue>header span{font-weight:400;color:var(--rw-muted)}
.rw-creation-queue button{border:1px solid var(--rw-border);border-radius:6px;padding:5px 9px;background:#191a20;font-size:12px;white-space:nowrap}.rw-queue-item{margin-top:10px;padding-top:10px;border-top:1px solid #fff2;min-width:0}.rw-queue-item p{margin:6px 0;overflow-wrap:anywhere;font-size:13px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.rw-queue-item strong{font-size:13px}.rw-queue-item small{color:var(--rw-muted)}.rw-queue-error{font-size:12px!important;color:#f4c6a8}.rw-queue-item[data-rw-queue-state="unknown"]{border-top-color:#bc8b43}.rw-queue-actions{justify-content:flex-end;margin-top:6px}

.rw-login-pending{padding:18px;border:1px solid #8d783c;border-radius:10px;background:#29251e;margin-bottom:16px}.rw-login-pending>strong{color:var(--rw-gold)}.rw-login-pending p{font-size:13px;overflow-wrap:anywhere;margin:10px 0}.rw-login-pending>div{display:flex;gap:8px;flex-wrap:wrap}.rw-login-pending button,.rw-polling-paused button{border:1px solid var(--rw-border);background:#191a20;border-radius:5px;padding:6px 10px;font-size:12px}.rw-polling-paused{font-size:13px;color:var(--rw-muted);padding:10px 0;margin:0 0 10px}.rw-polling-paused button{margin-inline-start:8px;color:var(--rw-gold)}

@media(max-width:767px){.rw-panel-heading:has(.rw-type-switch){flex-direction:column;align-items:stretch;gap:12px}.rw-panel-heading .rw-type-switch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}.rw-type-switch button{padding:8px 14px;white-space:nowrap}.rw-panel-heading:has(.rw-type-switch) .rw-model-trigger{max-width:none;width:100%;flex:none;justify-content:space-between}}

.rw-member-lock{display:inline-flex;color:var(--rw-gold);vertical-align:middle;margin-inline-start:auto;margin-inline-end:8px}.rw-toggle-field>label:first-child{display:flex;align-items:center;gap:4px;flex:1}

/* Keep the entire output inside its frame; the history viewport owns scrolling. */
.rw-result-grid{grid-auto-rows:minmax(0,1fr)}
.rw-result-grid:has(.rw-output-media){height:40vh}
.rw-result-grid[data-rw-result-count="1"]:has(.rw-output-media){height:50vh}
.rw-result-grid:has(.rw-output-media)>.rw-output-slot,.rw-result-grid>.rw-output-media{min-height:0}
.rw-result-grid .rw-output-media>button[data-rw-action="preview"]{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:0}
.rw-result-grid .rw-output-media>button[data-rw-action="preview"]>img{width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain}

/* Source normal image upload uses independent visible slots, never placeholder files. */
.rw-upload-slots{display:grid;grid-template-columns:repeat(var(--rw-upload-cols,2),minmax(0,1fr));gap:12px}
.rw-upload-slot,.rw-upload-add{position:relative;aspect-ratio:1;min-width:0;border:2px dashed var(--rw-border);border-radius:12px;background:var(--rw-card);overflow:hidden;transition:border-color .3s,background-color .3s}
.rw-upload-slot:hover,.rw-upload-add:hover{border-color:var(--rw-gold);background:#f6d64008}
.rw-upload-slot:not(.rw-upload-filled){display:flex;flex-direction:column;align-items:center;justify-content:center;padding:8px;gap:3px}
.rw-upload-open{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;gap:4px;border:0;background:transparent;padding:0;color:var(--rw-muted)!important;min-height:0}
.rw-upload-cloud{display:flex;align-items:center;justify-content:center;width:40px;height:40px;flex-shrink:0;border-radius:50%;background:#f6d6401a;color:var(--rw-gold)}
.rw-upload-cloud .rw-icon{width:20px;height:20px}.rw-upload-open strong{font-size:12px;font-weight:500;color:#fff}.rw-upload-open>span:last-child{font-size:10px;line-height:14px}
.rw-slot-assets{border:0;background:transparent;color:var(--rw-gold)!important;text-decoration:underline;text-underline-offset:3px;font-size:12px!important;padding:0 4px;line-height:18px}
.rw-upload-add{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:8px;color:var(--rw-muted)!important}.rw-upload-add>.rw-icon{width:24px;height:24px}.rw-upload-add strong{font-size:12px;font-weight:500}.rw-upload-add small{font-size:10px}
.rw-ordinary-upload .rw-reference{width:100%;height:100%;border:0;border-radius:10px}.rw-ordinary-upload .rw-reference img{object-fit:cover}
.rw-upload-filled{border-style:solid}.rw-ordinary-upload .rw-reference>button{opacity:0;padding:6px;transition:opacity .2s,transform .2s}.rw-ordinary-upload .rw-reference:hover>button,.rw-ordinary-upload .rw-reference:focus-within>button{opacity:1}.rw-ordinary-upload .rw-reference>button:hover{transform:scale(1.1)}
.rw-single-upload .rw-upload-slot{aspect-ratio:16/9}.rw-single-upload .rw-upload-open{gap:6px}
@media(hover:none){.rw-ordinary-upload .rw-reference>button{opacity:1}}
/* Source <=5 options are a grid; overflow controls only appear at real scroll edges. */
.rw-ratios-grid{display:grid;grid-template-columns:repeat(var(--rw-ratio-cols),minmax(0,1fr));overflow:visible}
.rw-ratios-grid .rw-ratio{min-width:0;width:100%;flex:auto}.rw-ratio-edge{position:absolute;top:0;bottom:0;width:32px;z-index:2;pointer-events:none}
.rw-ratio-edge-previous{inset-inline-start:0;background:linear-gradient(to right,var(--rw-panel),transparent)}.rw-ratio-edge-next{inset-inline-end:0;background:linear-gradient(to left,var(--rw-panel),transparent)}
.rw-ratio-edge .rw-ratio-arrow{pointer-events:auto;top:50%;left:auto;right:auto;transform:translateY(-50%);width:24px;height:24px}
.rw-ratio-edge-previous .rw-ratio-arrow{inset-inline-start:0;transform:translateY(-50%) rotate(180deg)}.rw-ratio-edge-next .rw-ratio-arrow{inset-inline-end:0}
.rw-ratio-edge[hidden]{display:none!important}[dir=rtl] .rw-ratio-edge-previous{background:linear-gradient(to left,var(--rw-panel),transparent)}[dir=rtl] .rw-ratio-edge-next{background:linear-gradient(to right,var(--rw-panel),transparent)}
.rw-history-skeletons{display:flex;flex-direction:column;gap:24px;min-height:0;overflow:hidden}.rw-history-skeleton{display:flex;flex-direction:column;gap:12px;flex-shrink:0}.rw-skeleton{border-radius:4px;background:#ffffff1a;animation:rw-skeleton-pulse 2s cubic-bezier(.4,0,.6,1) infinite}.rw-skeleton-media{height:200px;width:100%;border-radius:8px}.rw-skeleton-lines{display:flex;flex-direction:column;gap:8px}.rw-skeleton-line{height:16px;width:250px;max-width:100%}.rw-skeleton-line-short{width:200px}
[data-rw-document-hidden=true] .rw-skeleton{animation-play-state:paused}@keyframes rw-skeleton-pulse{50%{opacity:.5}}
/* Source stacks at lg, preserving natural document flow for tablet controls and footer. */
@media(max-width:1023px){.rw-layout{flex-direction:column;gap:24px}.rw-form-panel{width:100%;flex:auto;height:auto;max-height:none}.rw-form{display:block}.rw-fields{max-height:none;overflow:visible}.rw-panel-heading{padding:24px 24px 16px}.rw-form-body{padding:8px 24px 24px}}
@media(min-width:768px){.rw-prompt-wrap textarea{min-height:140px}}
@media(max-width:767px){.rw-layout{gap:16px}.rw-prompt-wrap textarea{height:100px;min-height:100px}.rw-panel-heading{padding:24px 24px 16px}.rw-form-body{padding:8px 24px 24px}}
@media(prefers-reduced-motion:reduce){.rw-skeleton{animation:none}.rw-upload-slot,.rw-upload-add,.rw-ordinary-upload .rw-reference>button{transition:none}.rw-ratios{scroll-behavior:auto}}

/* Unmapped models remain visible without presenting an actionable choice. */
.rw-model-option:disabled{opacity:.45;cursor:not-allowed}

.rw-pending[data-rw-submission-uncertain] button{padding:.45rem .8rem;border:1px solid #f7da67;border-radius:6px;background:transparent;color:#f7da67;cursor:pointer}

/* Separate public-display explanation from the membership benefit. */
.rw-publication-heading,.rw-publication-controls{display:flex;align-items:center;gap:8px;min-width:0}
.rw-publication-heading>label{margin:0;white-space:nowrap}
.rw-publication-controls{flex-shrink:0}
.rw-help-button{display:inline-flex!important;align-items:center;justify-content:center;flex:0 0 20px;width:20px;height:24px;padding:0!important;border:0!important;background:transparent!important;color:var(--rw-muted);cursor:help;line-height:1}
.rw-help-button svg{display:block;width:16px;height:16px;flex-shrink:0}
.rw-help-button:hover,.rw-help-button:focus-visible{color:var(--rw-gold)}
.rw-help-button:focus-visible{outline:2px solid var(--rw-gold);outline-offset:2px;border-radius:4px}
.rw-member-help{color:var(--rw-gold)}
.rw-help-tooltip{position:fixed;z-index:2147483000;max-width:min(290px,calc(100vw - 24px));box-sizing:border-box;padding:9px 12px;border:1px solid #b49b5380;border-radius:7px;background:#f3d568;color:#171717;font:500 12px/1.6 system-ui,sans-serif;box-shadow:0 8px 28px #0005;pointer-events:none;overflow-wrap:anywhere}
.rw-model-tags small.rw-model-membership{color:var(--rw-gold);border-color:#b49b5366;background:#b49b531a;font-weight:600}
.rw-model-membership svg{width:12px;height:12px;flex-shrink:0}

/* Bounded recent navigation and the paginated, owned creation library. */
.rw-thumb-rail > button:not(.rw-thumb-more) { height: clamp(44px, calc((100dvh - 310px) / 7), 76px); }
.rw-thumb-rail > .rw-thumb-more { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; min-height:56px; padding:6px 3px; color:var(--rw-gold); background:var(--rw-card); }
.rw-thumb-more svg { width:18px; height:18px; flex-shrink:0; }
.rw-thumb-more span { font-size:11px; line-height:1.3; overflow-wrap:anywhere; }
.rw-history-heading h2 { min-width:0; }
.rw-history-heading .rw-library-trigger { width:auto; max-width:45%; padding:6px 8px; font-size:12px; color:var(--rw-gold); overflow-wrap:anywhere; }
.rw-preview-actions .rw-back-library { grid-column:1 / -1; }
.rw-creation-library-dialog { width:min(1100px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); padding:0; overflow:hidden; }
.rw-creation-library-dialog[open] { display:flex; flex-direction:column; }
.rw-creation-library-dialog > .rw-dialog-title { flex-shrink:0; padding:16px 20px; }
.rw-creation-library-dialog > [data-rw-creation-library] { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; padding:20px; }
.rw-creation-library-tools { display:flex; flex-wrap:wrap; align-items:center; gap:16px; }
.rw-creation-library-tools form { display:flex; flex:1; gap:8px; min-width:min(260px,100%); }
.rw-creation-library input { min-width:0; width:100%; padding:10px 12px; color:inherit; border:1px solid var(--rw-border); background:var(--rw-card); border-radius:6px; }
.rw-creation-library button { color:inherit; background:var(--rw-card); border:1px solid var(--rw-border); border-radius:6px; padding:8px 12px; cursor:pointer; }
.rw-creation-library button:focus-visible { outline:2px solid var(--rw-gold); outline-offset:3px; }
.rw-creation-library button:disabled { opacity:.55; cursor:wait; }
.rw-creation-library-filters { display:flex; gap:8px; }
.rw-creation-library-filters [aria-pressed="true"] { color:var(--rw-gold); border-color:var(--rw-gold); }
.rw-creation-library-status { margin:18px 0; font-size:13px; color:var(--rw-muted); }
.rw-creation-library-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
.rw-creation-library-grid > article { min-width:0; }
.rw-creation-library-grid .rw-creation-library-item { display:flex; flex-direction:column; gap:8px; width:100%; height:100%; padding:0 0 12px; overflow:hidden; text-align:start; }
.rw-creation-library-media { position:relative; display:block; aspect-ratio:1; width:100%; overflow:hidden; background:var(--rw-card); }
.rw-creation-library-media img,.rw-creation-library-media video { display:block; width:100%; height:100%; object-fit:cover; }
.rw-creation-library-video-label { position:absolute; inset-inline-end:8px; bottom:8px; padding:4px 6px; background:#000b; color:white; border-radius:4px; font-size:11px; }
.rw-creation-library-caption { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; padding:0 10px; line-height:1.5; font-size:13px; }
.rw-creation-library-item small { padding:0 10px; color:var(--rw-muted); overflow-wrap:anywhere; }
.rw-creation-library .rw-creation-library-more { display:block; margin:20px auto 0; color:var(--rw-gold); }
@media(max-width:767px) {
 .rw-creation-library-dialog { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); }
 .rw-creation-library-dialog > [data-rw-creation-library] { padding:14px; }
 .rw-creation-library-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
 .rw-creation-library-tools { gap:12px; }
}

.rw-creation-library-tools form > button { flex-shrink:0; white-space:nowrap; }

/* Account-wide concurrency and persisted failure details. No inferred plan limits. */
.rw-concurrency-area{flex:0 0 auto;margin:0 24px 12px;min-width:0}
.rw-concurrency-note{border:1px solid var(--rw-border);border-radius:8px;padding:10px 12px;background:#191a20;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.rw-concurrency-note strong{display:block;color:var(--rw-gold);font-size:13px;font-weight:600}
.rw-concurrency-note p{margin:4px 0 0;color:var(--rw-muted)}
.rw-concurrency-note button{margin-top:7px;border:1px solid var(--rw-border);border-radius:5px;padding:4px 8px;background:transparent;color:var(--rw-gold);cursor:pointer}
.rw-failure-feedback{width:100%;min-width:0;max-width:640px;padding:16px;text-align:left;line-height:1.5;overflow-wrap:anywhere}
.rw-failure-feedback>strong{display:block;font-size:16px;color:#f2a5a5}
.rw-failure-feedback .rw-failure-reason{margin:8px 0;color:var(--rw-text);white-space:pre-wrap}
.rw-failure-feedback dl{margin:10px 0 0;font-size:12px;color:var(--rw-muted)}
.rw-failure-feedback dl>div{display:flex;flex-wrap:wrap;gap:4px 8px;margin-top:4px;min-width:0}
.rw-failure-feedback dt{font-weight:600;flex-shrink:0}
.rw-failure-feedback dd{margin:0;min-width:0;overflow-wrap:anywhere}
.rw-failure-feedback .rw-failure-credit{margin:10px 0 0;font-size:12px;color:var(--rw-gold)}
.rw-failure-feedback .rw-failure-support{margin:8px 0 0;font-size:12px;color:var(--rw-muted)}
.rw-thumb-rail [data-rw-thumb-state="pending"]{flex-direction:column;gap:6px;cursor:default;opacity:.75}
.rw-thumb-state{max-width:100%;padding:0 3px;font-size:10px;line-height:1.2;overflow-wrap:anywhere}
.rw-thumb-video{display:block;width:100%;height:100%;overflow:hidden}
.rw-thumb-video video{display:block;width:100%;height:100%;object-fit:cover;pointer-events:none}
@media(max-width:767px){.rw-concurrency-area{margin-bottom:10px}.rw-concurrency-note{padding:8px 10px}.rw-failure-feedback{padding:12px}.rw-failure-feedback>strong{font-size:14px}}

.rw-creation-library-video{display:block;width:100%;height:100%}

/* The library entry is a persistent action, including on touch screens. */
.rw-history-heading .rw-library-trigger{opacity:1;visibility:visible}

/* 2026-11-07: keep queue, feedback and media inside their actual results panel. */
.rw-history:has(.rw-thumb-rail){min-width:0}
@media(min-width:1024px){
 .rw-history:has(.rw-thumb-rail){padding-right:calc(var(--rw-rail-width,80px) + 40px)}
 .rw-history:has(.rw-thumb-rail)::before{inset:0}
 .rw-history:has(.rw-thumb-rail) .rw-history-heading,.rw-history:has(.rw-thumb-rail) .rw-preview-note{margin-right:0}
 .rw-history:has(.rw-thumb-rail) .rw-output-layout{padding-right:0}
 .rw-history:has(.rw-thumb-rail) .rw-thumb-rail{top:24px;right:16px;max-height:calc(100% - 48px);overflow:auto}
}
.rw-creation-queue,.rw-task,.rw-preview-note{max-width:100%;min-width:0;overflow-wrap:anywhere}
.rw-history-heading{height:auto;min-height:22px;flex-wrap:wrap}
.rw-history-heading h2{flex:1;min-width:100px}
.rw-output-main{min-height:0;max-height:none;overflow:visible}
.rw-task:has(.rw-failed),.rw-failed{height:auto;max-height:none;overflow:visible}
.rw-parameter-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.rw-parameter-choices.rw-boolean-choices{grid-template-columns:repeat(2,minmax(0,1fr))}
.rw-parameter-choices button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:76px;padding:10px 6px;border:1px solid var(--rw-border);border-radius:9px;background:var(--rw-card);color:var(--rw-muted)}
.rw-parameter-choices button.rw-selected{border-color:var(--rw-gold);background:#f6d64012;color:var(--rw-primary)}
.rw-parameter-choices button:focus-visible{outline:2px solid var(--rw-gold);outline-offset:2px}
.rw-parameter-choices button:disabled{opacity:.4;cursor:not-allowed}
.rw-parameter-choices strong{font-size:13px;font-weight:600;line-height:1.4}
.rw-parameter-choices small{font-size:11px;line-height:1.3;white-space:normal;text-align:center}
.rw-parameter-shape{display:block;width:22px;max-height:23px;border:1.5px solid currentColor;border-radius:3px}
.rw-boolean-choices button{min-height:40px}

/* One results scroll region keeps queued requests and full failure details reachable. */
.recon-show-workspace .rw-history-content{display:block;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain}
.recon-show-workspace .rw-output-layout{display:block;flex:none;overflow:visible}
.recon-show-workspace .rw-output-main{height:auto;max-height:none;overflow:visible}

.rw-result-grid:has(>.rw-failed):not(:has(>.rw-output-media)){height:auto;max-height:none;grid-auto-rows:auto;overflow:visible}
.rw-result-grid:has(>.rw-output-media)>.rw-failed{min-height:0;max-height:100%;overflow-y:auto}

.rw-creation-library-size {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  font-size: .8rem;
}
.rw-creation-library-size input { width: min(7rem, 100%); accent-color: var(--rw-gold); }
.rw-creation-library-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(24px + var(--rcl-size, 5) * 28px)), 1fr));
}
@media (max-width: 767px) {
  .rw-creation-library-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(64px + var(--rcl-size, 5) * 14px)), 1fr));
  }
}

/* The shared creation surface uses an independently scrolling editor and gallery. */
main.recon-show-workspace:has(> [data-rw-studio-stage]) {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--recon-header-height, 108px));
  max-height: calc(100dvh - var(--recon-header-height, 108px));
  padding: 0;
  overflow: hidden;
  background: #0b0d10;
}
.recon-show-workspace > [data-rw-studio-stage] {
  flex: 1;
  min-height: 0;
  padding: 0 8px 8px;
}
[data-rw-studio-stage] > div { height: 100%; min-height: 0; }
.rw-studio-workspace {
  --rw-panel: #131415;
  --rw-card: #202123;
  --rw-border: #ffffff15;
  --rw-muted: #a8a9af;
  --rw-gold: #d8d4f1;
  --rw-primary: #f5f5f6;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  color: #f5f5f6;
}
.rw-studio-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 3px 4px;
  gap: 8px;
}
.rw-studio-toolbar nav, .rw-studio-scope {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.rw-studio-toolbar nav :is(a, span),
.rw-studio-workspace :is(.rw-studio-works,.rw-studio-scope button,.rw-history-heading > button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 12px;
  border-radius: 999px;
  color: #d6d7db;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 650;
  white-space: nowrap;
}
.rw-studio-toolbar nav a:hover,
.rw-studio-toolbar nav [aria-current],
.rw-studio-workspace :is(.rw-studio-works,.rw-studio-scope button[aria-pressed="true"],.rw-history-heading > button:hover) {
  background: #28292b;
  color: #f5f5f6;
}
.rw-studio-toolbar .rw-icon, .rw-studio-scope .rw-icon { width: 16px; height: 16px; }
.rw-studio-workspace .rw-layout {
  --editor-column: clamp(320px, var(--rw-editor-width, 480px), min(900px, 56%));
  position: relative;
  display: grid;
  grid-template-columns: var(--editor-column) minmax(0, 1fr);
  grid-template-rows: minmax(0,1fr);
  flex: 1;
  gap: 8px;
  height: auto;
  min-height: 0;
}
.rw-studio-workspace .rw-form-panel, .rw-studio-workspace .rw-history {
  position: relative;
  width: auto;
  min-width: 0;
  height: 100%;
  min-height: 0;
  max-height: none;
  padding: 0;
  border: 1px solid var(--rw-border);
  border-radius: 20px;
  background: var(--rw-panel);
  box-shadow: none;
  overflow: hidden;
}
.rw-studio-workspace .rw-form {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.rw-studio-workspace .rw-fields {
  display: block;
  flex: 1;
  min-height: 0;
  max-height: none;
  padding: 8px 9px 14px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.rw-studio-workspace .rw-fields > * + * { margin-top: 8px; }
.rw-studio-workspace .rw-submit-area {
  display: grid;
  flex: none;
  gap: 7px;
  margin: 0;
  padding: 9px 12px 10px;
  border: 0;
  border-top: 1px solid #ffffff0d;
  background: #18191a;
}
.rw-studio-workspace .rw-submit-area .rw-toggle-field {
  display: flex;
  justify-content: space-between;
  min-height: 26px;
  gap: 8px;
  margin: 0;
}
.rw-studio-status:has(> :not(.rw-hidden)) { padding-block: 2px; }
.rw-studio-status :is(.rw-error,.rw-quote-error) { margin: 0; font-size: 12px; }
.rw-studio-mode, .rw-studio-output { position: relative; }
.rw-studio-mode > summary, .rw-studio-mode-single, .rw-studio-model, .rw-studio-output > summary {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: none;
  min-height: 62px;
  height: auto;
  padding: 8px 10px;
  border: 1px solid var(--rw-border);
  border-radius: 16px;
  text-align: start;
  background: #202123;
  cursor: pointer;
}
.rw-studio-mode > summary { background: #161719; }
.rw-studio-mode > summary > .rw-icon:first-child,
.rw-studio-mode-single > .rw-icon:first-child {
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: 12px;
  color: #252335;
  background: linear-gradient(140deg,#dfdbef,#9189ad);
}
.rw-studio-workspace summary { list-style: none; }
.rw-studio-workspace summary::-webkit-details-marker { display: none; }
.rw-studio-mode[open] summary > :last-child, .rw-studio-output[open] summary > :last-child { transform: rotate(90deg); }
.rw-studio-model img {
  width: 42px;
  height: 42px;
  padding: 8px;
  border-radius: 11px;
  background: #ffffff0c;
}
.rw-studio-model > span { display: grid; gap: 2px; min-width: 0; color: #f5f5f6; }
.rw-studio-model small, .rw-studio-output small { color: #a8a9af; font-size: 12px; font-weight: 500; }
.rw-studio-model strong { overflow: hidden; text-overflow: ellipsis; }
.rw-studio-model:hover, .rw-studio-mode > summary:hover, .rw-studio-output > summary:hover { background: #292a2c; }
.rw-studio-menu {
  position: absolute;
  z-index: 4;
  inset-inline: 0;
  inset-block-start: calc(100% + 4px);
  display: grid;
  padding: 5px;
  border: 1px solid #ffffff29;
  border-radius: 14px;
  background: #222325;
  box-shadow: 0 12px 26px #0009;
}
.rw-studio-menu button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 43px;
  padding: 7px 9px;
  border-radius: 8px;
  text-align: start;
}
.rw-studio-menu button:hover, .rw-studio-menu [aria-pressed="true"] { background: #ffffff13; }
.rw-studio-composer {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--rw-border);
  border-radius: 15px;
  background: #111213;
}
.rw-studio-composer .rw-field { margin: 0; }
.rw-studio-composer .rw-prompt-wrap textarea {
  min-height: 118px;
  height: clamp(118px,18vh,180px);
  padding: 10px 12px 36px;
  resize: none;
  border-color: #ffffff16;
  border-radius: 10px;
  background: #171819;
}
.rw-studio-composer .rw-prompt-wrap:focus-within textarea { border-color: #b9afe090; }
.rw-studio-composer .rw-prompt-tools { inset-inline-start: 8px; inset-block-end: 7px; }
.rw-studio-composer .rw-counter { margin: 3px 0 0; }
.rw-studio-reference-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  padding: 8px;
  border: 1px solid var(--rw-border);
  border-radius: 9px;
  background: #202123;
}
.rw-studio-reference-entry > :is(div,span) { display: flex; align-items: center; gap: 6px; }
.rw-studio-reference-entry small { color: var(--rw-muted); }
.rw-studio-reference-entry button { padding: 5px 8px; border-radius: 7px; background: #ffffff0d; font-size: 12px; }
.rw-studio-reference-entry button:hover { background: #ffffff20; }
.rw-studio-reference-entry .rw-icon { width: 16px; height: 16px; }
.rw-studio-output > summary { grid-template-columns: minmax(0,1fr) auto auto; min-height: 48px; border-radius: 11px; }
.rw-studio-output > summary span { display: flex; gap: 7px; align-items: center; }
.rw-studio-output > summary small { overflow: hidden; max-width: min(48vw,215px); white-space: nowrap; text-overflow: ellipsis; }
.rw-studio-output-fields {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--rw-border);
  border-radius: 12px;
  margin-block-start: 4px;
  background: #171819;
}
.rw-studio-output-fields .rw-field { margin: 0; }
.rw-studio-submit-line { display: flex; gap: 8px; min-width: 0; }
.rw-studio-quantity, .rw-studio-workspace .rw-generate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 46px;
  padding: 2px 4px;
  border-radius: 999px;
}
.rw-studio-quantity { gap: 3px; border: 1px solid #ffffff1a; background: #232426; }
.rw-studio-quantity button {
  display: grid;
  place-items: center;
  width: 35px;
  height: 36px;
  border-radius: 999px;
  font-size: 18px;
}
.rw-studio-quantity button:hover:not(:disabled) { background: #ffffff16; }
.rw-studio-quantity button:disabled { opacity: .35; cursor: default; }
.rw-studio-quantity strong { padding: 0 3px; font-size: 13px; font-variant-numeric: tabular-nums; }
.rw-studio-quantity small { color: var(--rw-muted); }
.rw-studio-workspace .rw-generate {
  flex: 1;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding-inline: 12px;
  background: #eeedf0;
  color: #111214;
  line-height: 1.2;
}
.rw-studio-workspace .rw-generate:disabled { background: #37383b; color: #dbdbe0; opacity: 1; }
.rw-studio-credit { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; }
.rw-studio-credit .rw-icon { width: 14px; height: 14px; }
.rw-studio-concurrency { color: #b5b6bf; font-size: 11px; }
.rw-studio-concurrency summary { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.rw-studio-concurrency summary .rw-icon { width: 13px; height: 13px; }
.rw-studio-concurrency .rw-concurrency-area { margin: 4px 0 0; }
.rw-studio-divider {
  position: absolute;
  z-index: 3;
  inset-block: 0;
  inset-inline-start: calc(var(--editor-column) - 3px);
  width: 14px;
  cursor: col-resize;
  touch-action: none;
}
.rw-studio-divider::before {
  position: absolute;
  inset: 25% 5px;
  border-radius: 5px;
  background: transparent;
  content: "";
}
.rw-studio-divider:is(:hover,:focus-visible)::before,.rw-studio-workspace[data-rw-resizing] .rw-studio-divider::before { background: #85868d; }
.rw-studio-workspace .rw-history { display: flex; flex-direction: column; }
.rw-studio-workspace .rw-history-heading { flex: none; gap: 6px; margin: 0; padding: 9px 11px; min-height: 50px; border-bottom: 1px solid #ffffff0d; }
.rw-studio-workspace .rw-history-heading > button { opacity: 1; border: 0; padding: 4px 8px; }
.rw-studio-workspace .rw-history-heading > button[hidden] { display: none; }
.rw-studio-workspace .rw-history-content, .rw-studio-workspace .rw-studio-library {
  display: block;
  flex: 1;
  height: auto;
  min-height: 0;
  padding: 12px;
  overflow: auto;
  overscroll-behavior: contain;
}
.rw-studio-workspace :is(.rw-history-content,.rw-studio-library)[hidden] { display: none; }
.rw-studio-empty {
  display: grid;
  min-height: 100%;
  place-items: center;
  color: #e9e9ed;
  text-align: center;
}
.rw-studio-empty > div:not([data-media-frame]) { display: grid; gap: 12px; justify-items: center; padding: 18px; }
.rw-studio-empty h2 { font-size: 16px; }
.rw-studio-empty [data-rw-action="studio-auth"] {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: 999px;
  background: #ffffff15;
}
/* Public showcase uses paired covers; private creations stay in the owner's library. */
.rw-studio-showcase { padding:clamp(13px,2vw,26px); color:#eceef3; }
.rw-studio-showcase-intro { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; margin-bottom:14px; }
.rw-studio-showcase-intro h2 { font-size:clamp(16px,1.5vw,21px); }
.rw-studio-showcase-intro button { display:inline-flex; align-items:center; gap:6px; border-radius:999px; padding:7px 12px; background:#24262d; }
.rw-studio-sample-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.rw-studio-sample { min-width:0; margin:0; overflow:hidden; border-radius:12px; background:#181a20; }
.rw-studio-sample figcaption { padding:8px 10px; color:#c7cad3; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rw-studio-sample-media { position:relative; display:grid; aspect-ratio:16/10; background:#101116; overflow:hidden; }
.rw-studio-sample[data-still-orientation="portrait"] .rw-studio-sample-media { aspect-ratio:9/16; }
.rw-studio-sample-media :is(img,video) { grid-area:1/1; width:100%; height:100%; min-height:0; object-fit:contain; }
.rw-studio-sample-media video { visibility:hidden; }
.rw-studio-sample-media[data-media-state="playing"] video,
.rw-studio-sample-media[data-media-state="buffering"] video { visibility:visible; }
.rw-studio-sample-media[data-media-state="playing"] [data-media-play] { display:none; }
.rw-studio-sample-media [data-media-play] {
 position:absolute; inset:auto auto 10px 10px; display:grid; place-items:center;
 width:42px; height:42px; border:1px solid #ffffff75; border-radius:50%; background:#15171cd9; color:white;
}
.rw-studio-sample-media [data-media-play]:focus-visible { outline:2px solid #d6d8ff; outline-offset:2px; }
@media(max-width:680px){
 .rw-studio-sample-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .rw-studio-sample-grid > :first-child:last-child { grid-column:1/-1; }
}
.rw-studio-activity {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(236px,100%),1fr));
  align-items: start;
  gap: 10px;
}
.rw-studio-activity .rw-task { margin: 0; min-width: 0; height: auto; }
.rw-studio-activity .rw-result-grid { height: auto; }
.rw-studio-workspace .rw-studio-mobile-close, .rw-studio-mobile-results:not([open]) { display: none; }

@media (max-width: 1023px) {
  .rw-studio-workspace .rw-layout { display: flex; flex-direction: column; }
  .rw-studio-workspace .rw-layout > .rw-form-panel { flex: 1; }
  .rw-studio-workspace .rw-layout > .rw-history, .rw-studio-divider { display: none; }
  .rw-studio-workspace .rw-studio-mobile-close { display: inline-flex; }
  .rw-studio-mobile-results[open] {
    display: block;
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    height: min(90dvh,820px);
    max-height: none;
    border: 0;
    border-radius: 20px 20px 0 0;
    background: var(--rw-panel);
    color: inherit;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .rw-studio-mobile-results::backdrop { background: #000a; }
  .rw-studio-workspace .rw-studio-mobile-results .rw-history { border: 0; }
}
@media (max-width: 767px) {
  .recon-show-workspace > [data-rw-studio-stage] { padding-inline: 5px; padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
  .rw-studio-workspace .rw-form-panel { border-radius: 16px; }
  .rw-studio-workspace .rw-fields { padding: 6px 7px 12px; }
  .rw-studio-workspace .rw-submit-area { padding: 7px 8px 8px; }
  .rw-studio-toolbar nav :is(a,span), .rw-studio-workspace .rw-studio-works { padding-inline: 9px; }
  .rw-studio-composer .rw-prompt-wrap textarea { height: 122px; }
}

.rw-studio-workspace .rw-studio-status:has(>.rw-error.rw-hidden):has(>.rw-quote-error.rw-hidden),
.rw-studio-workspace [data-rw-studio-guest="true"] .rw-quote-error,
.rw-studio-workspace [hidden] { display: none; }
.rw-studio-reference-format { margin: 3px 0 0; color: #a8a9af; font-size: 11px; }
.rw-studio-reference-preview {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
}
.rw-studio-reference-preview img { width: 100%; height: 100%; object-fit: cover; }
.rw-studio-gallery-actions, .rw-studio-gallery-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.rw-studio-gallery-card-actions { padding: 5px 0; }
.rw-studio-gallery-actions button, .rw-studio-gallery-card-actions button {
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--rw-border);
  border-radius: 8px;
  background: #202123;
  font-size: 12px;
}
.rw-studio-gallery-actions button[aria-pressed="true"], .rw-studio-gallery-card-actions button[aria-pressed="true"] {
  background: #353342;
  color: #eeeaff;
}
.rw-studio-workspace .rw-creation-library-item[aria-pressed="true"] { outline: 2px solid #c5bae6; outline-offset: -2px; }
.rw-studio-workspace .rw-reference > .rw-studio-reference-preview,
.rw-studio-workspace .rw-reference > .rw-studio-reference-preview:hover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  display: block;
  opacity: 1;
  transform: none;
  border: 0;
  border-radius: inherit;
  background: transparent;
}

.recon-show-workspace > .rw-studio-full-stage { padding-inline: 0; }
.rw-studio-host {
  --studio-sidebar-width: 244px;
  display: grid;
  grid-template-columns: var(--studio-sidebar-width) minmax(0,1fr);
  height: 100%;
  min-height: 0;
  min-width: 0;
  background: #0b0d10;
  color: #f3f4f6;
}
.rw-studio-host[data-collapsed="true"] { --studio-sidebar-width: 62px; }
.rw-studio-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  border-inline-end: 1px solid #ffffff12;
  background: #101113;
}
.rw-studio-side-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  min-height: 49px;
  border-bottom: 1px solid #ffffff0c;
}
.rw-studio-side-brand > a { min-width: 0; }
.rw-studio-side-brand img { max-width: 104px; max-height: 28px; object-fit: contain; object-position: inline-start; }
.rw-studio-side-brand button,
.rw-studio-appbar button,
.rw-studio-shell-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  min-height: 34px;
  border-radius: 8px;
  color: #ebecf0;
}
.rw-studio-side-scroll { display: grid; align-content: start; gap: 12px; overflow: auto; padding: 8px; scrollbar-width: thin; }
.rw-studio-side-scroll :is(a,button,summary) {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  min-height: 35px;
  max-width: 100%;
  border-radius: 7px;
  font-size: 13px;
  text-align: start;
  color: #c8cad1;
  cursor: pointer;
}
.rw-studio-side-scroll :is(a,button,summary):hover,
.rw-studio-side-scroll [aria-current="page"],
.rw-studio-shell-tabs a[aria-current="page"],.rw-studio-tool-tabs a[aria-current="page"] { background: #292b2e; color: #fff; }
.rw-studio-side-scroll summary::-webkit-details-marker { display: none; }
.rw-studio-side-scroll strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rw-studio-side-scroll svg,.rw-studio-side-scroll img { flex: 0 0 17px; }
.rw-studio-side-scroll section > p,.rw-studio-side-models > p { margin: 4px 8px; color: #9b9ca5; font-size: 11px; }
.rw-studio-side-categories { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
@media (min-width: 1024px) {
  .rw-studio-host[data-collapsed="true"] .rw-studio-side-brand > a,
  .rw-studio-host[data-collapsed="true"] .rw-studio-side-scroll :is(strong,p,summary > span) { display: none; }
  .rw-studio-host[data-collapsed="true"] .rw-studio-side-brand { justify-content: center; }
  .rw-studio-host[data-collapsed="true"] .rw-studio-side-categories { grid-template-columns: 1fr; }
  .rw-studio-host[data-collapsed="true"] .rw-studio-side-scroll :is(a,button,summary) { width: 100%; justify-content: center; }
}
.rw-studio-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.rw-studio-appbar {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid #ffffff0c;
}
.rw-studio-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.rw-studio-breadcrumb span::before { content: '›'; color: #a8a9af; margin-inline-end: 8px; }
.rw-studio-appbar > button[data-studio-mobile] { display: none; }
.rw-studio-shell-tabs { display: flex; align-items: center; justify-content: space-between; min-height: 42px; gap: 6px; padding: 3px 8px; }
.rw-studio-shell-tabs nav,.rw-studio-tool-tabs { display: flex; gap: 3px; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.rw-studio-shell-tabs :is(a,button),.rw-studio-tool-tabs a {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-radius: 8px;
  color: #e2e3e7;
  font-size: 13px;
}
.rw-studio-shell-tabs nav svg { display: none; }
.rw-studio-shell-tabs button { background: #252628; }
.rw-studio-tool-tabs { align-items: center; padding: 2px 8px 6px; }
.rw-studio-tool-tabs a { background: #18191b; }
.rw-studio-canvases { flex: 1; min-height: 0; min-width: 0; padding-inline: 8px; }
.rw-studio-canvas { height: 100%; min-height: 0; }
.rw-studio-host .rw-studio-toolbar { display: none; }
.rw-studio-host [hidden] { display: none; }
.rw-studio-tool {
  display: grid;
  grid-template-columns: minmax(300px, min(480px, 48%)) minmax(0,1fr);
  height: 100%;
  gap: 8px;
  min-height: 0;
}
.rw-studio-tool :is(.rw-studio-tool-editor,.rw-studio-tool-result) {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px;
  background: #131415;
  border: 1px solid #ffffff16;
  border-radius: 20px;
}
.rw-studio-tool h2 { margin: 0 0 14px; font-size: 17px; }
.rw-studio-tool-result > p { color: #a8a9af; font-size: 13px; }
.rw-studio-tool-media { display: grid; gap: 8px; }
.rw-studio-tool-input { display: grid; gap: 8px; min-width: 0; max-width: 100%; padding: 12px; border: 1px dashed #ffffff38; border-radius: 12px; }
.rw-studio-tool-input input,.rw-studio-tool-input img,.rw-studio-tool-input video,.rw-studio-tool-input audio { max-width: 100%; }
.rw-studio-tool-input :is(img,video) { max-height: 180px; object-fit: contain; }
.rw-studio-tool-input p { font-size: 12px; color: #bbb; overflow-wrap: anywhere; }
.rw-studio-tool-editor fieldset { display: grid; gap: 8px; margin-block: 12px; padding: 9px; border: 1px solid #ffffff18; border-radius: 12px; }
.rw-studio-tool-editor fieldset label { display: grid; gap: 5px; font-size: 13px; }
.rw-studio-tool-editor :is(select,input[type=number],textarea) { background: #222326; border: 1px solid #ffffff20; border-radius: 6px; padding: 7px; color: inherit; }
.rw-studio-tool-editor footer { margin-top: 12px; }
.rw-studio-tool-editor footer button { padding: 7px 15px; border-radius: 999px; background: #303135; color: #d5d6dc; }
.rw-studio-tool-editor footer p { margin-top: 6px; font-size: 12px; color: #bbb; }
@media (max-width: 1023px) {
 .rw-studio-host { display: block; }
 .rw-studio-pane { height: 100%; }
 .rw-studio-sidebar {
   display: none;
   position: fixed;
   z-index: 120;
   inset: 0 auto 0 0;
   width: min(320px,85vw);
 }
 .rw-studio-host[dir=rtl] .rw-studio-sidebar { inset: 0 0 0 auto; }
 .rw-studio-host[data-mobile-open] .rw-studio-sidebar { display: flex; }
 .rw-studio-sidebar-backdrop:not([hidden]) { position: fixed; inset: 0; z-index: 119; background: #000a; }
 .rw-studio-appbar > button[data-studio-mobile] { display: inline-flex; margin-inline-end: 4px; }
 .rw-studio-sidebar [data-studio-collapse] { display: none; }
 .rw-studio-tool { grid-template-columns: 1fr; overflow: auto; grid-template-rows: auto auto; }
 .rw-studio-tool :is(.rw-studio-tool-editor,.rw-studio-tool-result) { overflow: visible; }
}
@media (max-width: 480px) {
 .rw-studio-shell-tabs { padding-inline: 4px; }
 .rw-studio-shell-tabs :is(a,button) { padding-inline: 6px; font-size: 12px; }
 .rw-studio-shell-tabs button svg { display: none; }
 .rw-studio-canvases { padding-inline: 5px; }
}

.rw-creation-library-grid[data-rcl-marquee] { cursor: crosshair; user-select: none; }
.rw-creation-library-grid[data-rcl-marquee] :is(button,img,video) { cursor: crosshair; -webkit-user-drag: none; }
.rw-studio-selection-box { position: fixed; z-index: 200; pointer-events: none; border: 1px solid #e7d573; background: #e7d57326; }
.rw-studio-gallery-menu { flex: 1 0 100%; font-size: 12px; }
.rw-studio-gallery-menu summary { cursor: pointer; }
.rw-studio-gallery-menu[open] { background: #1b1c20; padding: 6px; border-radius: 7px; }
.rw-studio-gallery-menu form { display: flex; align-items: end; gap: 5px; margin-block: 6px; }
.rw-studio-gallery-menu form label { flex: 1; min-width: 0; display: grid; gap: 3px; }
.rw-studio-gallery-menu input { width: 100%; min-width: 0; border: 1px solid #ffffff36; border-radius: 4px; background: #151619; color: inherit; }
.rw-studio-gallery-actions { flex-wrap: wrap; }

.rw-studio-tool-works { position: relative; min-height: 100%; }
.rw-studio-tool-works > button:first-child, .rw-studio-tool-preview > button { display: block; margin-inline-start: auto; font-size: 20px; padding-inline: 8px; }
.rw-studio-tool-works:is(dialog), .rw-studio-tool-preview { color: #f1f1f2; background: #17181a; border: 1px solid #ffffff22; border-radius: 14px; }
.rw-studio-tool-works:is(dialog) { position: fixed; inset: 0; width: min(680px, 95vw); min-height: min(560px, 88dvh); max-height: 92dvh; margin: auto; padding: 10px; }
.rw-studio-tool-works::backdrop, .rw-studio-tool-preview::backdrop { background: #000a; }
.rw-studio-tool-preview :is(img,video) { max-width: min(820px, 86vw); max-height: 72dvh; margin: auto; }
.rw-studio-tool-preview:is(div) { position: sticky; bottom: 0; background: #17181a; }

/* The studio bar owns navigation. Original account controls keep their actions. */
body:has(.rw-studio-content-host,main.recon-show-workspace > [data-rw-studio-stage]) {
 --recon-studio-bar-height: 48px;
}
body:has(.rw-studio-content-host,main.recon-show-workspace > [data-rw-studio-stage]) > div > header.fixed,
body:has(.rw-studio-content-host,main.recon-show-workspace > [data-rw-studio-stage]) header.fixed:has(> .bg-background > .h-16) {
 height: 0;
 overflow: visible;
 pointer-events: none;
}
body:has(.rw-studio-content-host,main.recon-show-workspace > [data-rw-studio-stage]) header.fixed:has(> .bg-background > .h-16) > :not(.bg-background),
body:has(.rw-studio-content-host,main.recon-show-workspace > [data-rw-studio-stage]) header.fixed > .bg-background > :not(.h-16),
body:has(.rw-studio-content-host,main.recon-show-workspace > [data-rw-studio-stage]) header.fixed > .bg-background > .h-16 > :not(:last-child) {
 display: none !important;
}
body:has(.rw-studio-content-host,main.recon-show-workspace > [data-rw-studio-stage]) header.fixed > .bg-background > .h-16 {
 height: 0;
 padding: 0;
 border: 0;
 background: transparent;
}
body:has(.rw-studio-content-host,main.recon-show-workspace > [data-rw-studio-stage]) header.fixed > .bg-background > .h-16 > :last-child {
 position: fixed;
 inset-block-start: 0;
 inset-inline-end: 10px;
 height: var(--recon-studio-bar-height);
 pointer-events: auto;
}
body:has(.rw-studio-content-host,main.recon-show-workspace > [data-rw-studio-stage]) header.fixed [data-reconstruction-action="menu"] { display: none; }
body:has(.rw-studio-content-host,main.recon-show-workspace > [data-rw-studio-stage]) div.flex.bg-background:has(main) { padding-top: 0 !important; }
.rw-studio-appbar { min-height: var(--recon-studio-bar-height,48px); padding-inline-end: clamp(155px,22vw,256px); }
.rw-studio-breadcrumb { overflow: hidden; white-space: nowrap; }
.rw-studio-breadcrumb [data-studio-crumb] { overflow: hidden; text-overflow: ellipsis; }
.rw-studio-initials { width: 17px; flex: 0 0 17px; text-align: center; font-size: 8px; }
.rw-studio-content-host { height: 100dvh; }
.rw-studio-content-host .rw-studio-appbar { flex-shrink: 0; background: #131416; }
.rw-studio-content-host main { min-width: 0; min-height: 0; overflow: auto; }
@media (max-width: 1023px) {
 .rw-studio-content-host .rw-studio-pane { height: 100%; }
}
@media (max-width: 540px) {
 .rw-studio-appbar { padding-inline-end: 144px; }
 .rw-studio-breadcrumb > strong,.rw-studio-breadcrumb span:not([data-studio-crumb]) { display: none; }
}

.rw-studio-workspace [data-rw-studio-settings] {
 box-sizing: border-box;
 color: #f5f5f6;
 background: #15171b;
 border: 1px solid #ffffff2a;
 border-radius: 15px;
 box-shadow: 0 14px 50px #0009;
}
@supports selector(:popover-open) {
 .rw-studio-workspace [data-rw-studio-settings]:not(:popover-open) { display:none; }
 .rw-studio-workspace [data-rw-studio-settings]:popover-open {
  position: fixed;
  inset: auto;
  margin: 0;
  max-height: min(27rem,calc(100dvh - 24px));
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
 }
 .rw-studio-menu:popover-open { display: grid; width: min(290px,calc(100vw - 24px)); }
 .rw-studio-output-fields:popover-open { width: min(480px,calc(100vw - 24px)); }
}
.rw-studio-settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 6px; font-size: 14px; }
.rw-studio-settings-heading button { padding: 7px; border-radius: 8px; }
.rw-studio-settings-heading button:hover { background: #ffffff16; }
.rw-studio-workspace :is(summary,button,a):focus-visible { outline: 2px solid #e3d8ff; outline-offset: 2px; }
.rw-studio-output-fields .rw-buttons { gap: 4px; background: #101114; padding: 4px; border-radius: 10px; }
.rw-studio-output-fields .rw-buttons button { border-color: transparent; min-height: 36px; padding-inline: 8px; border-radius: 8px; }
.rw-studio-output-fields .rw-buttons :is(button.rw-selected,button[aria-pressed="true"]) { border-color: #bdb1e5; background: #bdb1e525; color: #fff; }
main.recon-show-workspace > .rw-studio-full-stage { padding: 0; }
/* The overview and active editor share the same main node. */
.rw-studio-content-host:has(main.recon-show-workspace),
.rw-studio-content-host:has(main.recon-show-workspace) > .rw-studio-pane { display: contents; }
.rw-studio-content-host:has(main.recon-show-workspace) > :not(.rw-studio-pane),
.rw-studio-content-host:has(main.recon-show-workspace) > .rw-studio-pane > .rw-studio-appbar { display: none; }
.rw-studio-appbar .rw-studio-back { display: inline-flex; flex: none; align-items: center; gap: 6px; min-height: 34px; margin-inline-end: 6px; padding-inline: 8px; border-radius: 6px; font-size: 13px; font-weight: 650; }
[dir="rtl"] .rw-studio-back svg { transform: scaleX(-1); }
@media (max-width: 540px) { .rw-studio-appbar .rw-studio-back { min-width: 34px; justify-content: center; } .rw-studio-back > span { display: none; } }
.rw-studio-appbar .rw-studio-back:hover { background: #ffffff15; }

/* Tool editors use the same input/work-result framing as the studio. */
.rw-studio-tool :is(.rw-studio-tool-editor,.rw-studio-tool-result) {
 display:flex; flex-direction:column; overflow:hidden; padding:0; border-radius:16px; background:#15181e;
}
.rw-studio-tool .rw-studio-tool-heading {
 display:flex; align-items:center; gap:10px; min-height:56px; margin:0; padding:10px 15px;
 border-bottom:1px solid #ffffff14; flex:0 0 auto;
}
.rw-studio-tool-heading > span,.rw-studio-tool-empty > span {
 display:grid; place-items:center; color:#c8cbff; background:#8094ff18; width:36px; height:36px; border-radius:10px; flex:none;
}
.rw-studio-tool-heading h2 { margin:0; font-size:15px; }
.rw-studio-tool-heading > button { margin-inline-start:auto; border-radius:8px; padding:6px 10px; background:#ffffff13; font-size:12px; }
.rw-studio-tool-fields { display:grid; align-content:start; gap:12px; padding:15px; overflow:auto; overscroll-behavior:contain; flex:1; min-height:0; }
.rw-studio-tool-media { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
.rw-studio-tool-media[data-input-count="1"] { grid-template-columns:1fr; }
.rw-studio-tool-media[data-input-count="3"] > :last-child { grid-column:1/-1; }
.rw-studio-tool-input { position:relative; gap:7px; display:grid; padding:10px; border:1px solid #ffffff25; border-radius:13px; background:#1b2028; }
.rw-studio-tool-source-head { display:flex; align-items:center; justify-content:space-between; min-height:25px; font-size:13px; }
.rw-studio-tool-source-head > button { margin-inline-start:auto; padding:0 7px; background:#ffffff12; border-radius:5px; font-size:18px; }
.rw-studio-tool-input[data-dragging] { border-color:#a3b6ff; background:#242c42; }
.rw-studio-tool-input .rw-tool-file-input {
 position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap;
}
.rw-studio-tool-drop { display:grid; place-items:center; gap:4px; min-height:101px; padding:8px; border:1px dashed #ffffff38; border-radius:10px; }
.rw-studio-tool-drop:hover { background:#ffffff0c; border-color:#a3b6ff; }
.rw-studio-tool-drop > span { color:#d7dcff; }
.rw-studio-tool-drop strong { font-size:13px; }
.rw-studio-tool-drop small,.rw-studio-tool-hint { font-size:11px; color:#b9bbc8; }
.rw-studio-tool-input [data-tool-status]:empty { display:none; }
.rw-studio-tool-fields .rw-studio-tool-settings { display:grid; gap:9px; }
.rw-studio-tool-settings label { display:grid; gap:6px; color:#e9ebf4; font-size:13px; }
.rw-studio-tool-settings label.rw-studio-tool-switch,.rw-studio-tool-fixed {
 display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 11px; min-height:42px;
 background:#1d222b; border:1px solid #ffffff20; border-radius:9px;
}
.rw-studio-tool-settings label.rw-studio-tool-switch[hidden] { display:none; }
.rw-studio-tool-switch input[type=checkbox] {
 appearance:none; position:relative; width:36px; height:20px; flex:none; border:1px solid #8b92a9; border-radius:999px; background:#343944;
}
.rw-studio-tool-switch input[type=checkbox]::before {
 content:""; position:absolute; inset:2px auto auto 2px; width:14px; height:14px; border-radius:50%; background:#e8eaf4;
}
.rw-studio-tool-switch input[type=checkbox]:checked { border-color:#8f9aff; background:#777ee5; }
.rw-studio-tool-switch input[type=checkbox]:checked::before { transform:translateX(16px); }
.rw-studio-tool .rw-studio-tool-transcript { margin:0; }
.rw-studio-tool .rw-studio-tool-footer { margin:0; padding:11px 15px; flex:none; border-top:1px solid #ffffff15; background:#191d24; }
.rw-studio-tool .rw-studio-tool-footer button { width:100%; min-height:42px; border-radius:10px; color:#cacedb; background:#333842; }
.rw-studio-tool .rw-studio-tool-empty { display:grid; align-content:center; justify-items:center; flex:1; gap:8px; min-height:220px; padding:24px; text-align:center; }
.rw-studio-tool-empty p { color:#c0c2cd; font-size:13px; }
.rw-studio-tool input:focus-visible,.rw-studio-tool button:focus-visible { outline:2px solid #adb6ff; outline-offset:2px; }
@media(max-width:380px){ .rw-studio-tool-media { grid-template-columns:1fr; } }
@media(max-width:1023px){ .rw-studio-tool-fields { overflow:visible; } }

.rw-queue-capacity { margin: 6px 0; }
.rw-queue-capacity button { color: #f5d477; text-decoration: underline; text-underline-offset: .2em; }

.rw-studio-status .rw-studio-limit-action {
  color: #f4d567;
  font-size: .8rem;
  font-weight: 650;
  text-align: start;
  text-decoration: underline;
  text-underline-offset: 3px;
}
[data-studio-reference-editor] :is(select,textarea){width:100%;margin-top:.4rem;padding:.75rem;border:1px solid #ffffff26;border-radius:.65rem;background:#17191e;color:inherit}
[data-studio-reference-editor] .rw-reference-model-preview{display:grid;justify-items:center;align-content:center;gap:1rem;padding:clamp(1rem,5%,3rem)}
[data-studio-reference-editor] .rw-reference-model-preview img{width:min(100%,34rem);height:auto;border-radius:.8rem}
[data-studio-reference-editor] .rw-reference-model-preview a{color:#ead060;text-underline-offset:.2em;text-decoration:underline}

/* Seedance video workbench editor controls, adapted to this renderer's form. */
[data-rw-model-heading] {
  font-size: clamp(2.6rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.04em;
}

.rw-studio-workspace [data-rw-shared-workbench] {
  --studio-accent: #ff17af;
  --studio-pane: #131415;
  --studio-card: #18191a;
  --studio-border: #d6e1ff09;
  border: 1px solid var(--studio-border);
  border-radius: 20px;
  background: var(--studio-pane);
}

[data-rw-shared-workbench] .rw-fields { padding: 8px; scrollbar-color: #323438 transparent; }
[data-rw-shared-workbench] .rw-studio-mode > summary {
  min-height: 64px;
  gap: 12px;
  padding: 7px 12px 7px 8px;
  border-color: #d6e1ff0a;
  border-radius: 19px;
  background: linear-gradient(102deg,#393438 0%,#303442 60%,#232c37 100%);
  font-size: 16px;
  font-weight: 680;
}
[data-rw-shared-workbench] .rw-studio-mode > summary:hover { filter: brightness(1.12); }
[data-rw-shared-workbench] .rw-studio-mode > summary > .rw-icon:first-child {
  width: 46px;
  height: 46px;
  padding: 12px;
  border-radius: 13px;
  background: linear-gradient(145deg,#b7d2de,#6c8caf 60%,#e6c5b1);
  color: #172133;
}
[data-rw-shared-workbench] .rw-studio-mode > summary > .rw-icon:last-child { color: #9ea3a9; }
[data-rw-shared-workbench] .rw-studio-menu { padding: 6px; border-color: #ffffff24; border-radius: 12px; background: #1b1d20; }
[data-rw-shared-workbench] .rw-studio-menu button { min-height: 38px; padding: 8px 10px; }
[data-rw-shared-workbench] .rw-studio-menu button[aria-pressed=true] { background: #ffffff16; }
[data-rw-shared-workbench] :is(.rw-studio-model,.rw-studio-output > summary) {
  min-height: 58px;
  padding: 4px 14px 4px 5px;
  border: 1px solid var(--studio-border);
  border-radius: 16px;
  background: var(--studio-card);
}
[data-rw-shared-workbench] :is(.rw-studio-model,.rw-studio-output > summary):hover { background: #202224; }
[data-rw-shared-workbench] :is(.rw-studio-model img,.rw-workbench-output-icon) {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: #242729;
}
[data-rw-shared-workbench] .rw-studio-output > summary {
  position: relative;
  grid-template: auto auto / minmax(0,1fr) auto;
  column-gap: 8px;
  row-gap: 3px;
  padding-inline-start: 65px;
}
[data-rw-shared-workbench] .rw-studio-output > summary > .rw-icon { grid-column: 2; grid-row: 1/3; color: #a3a7ad; }
[data-rw-shared-workbench] .rw-workbench-output-icon { position: absolute; inset-inline-start: 5px; inset-block-start: 4px; display: grid; place-items: center; }
[data-rw-shared-workbench] .rw-workbench-output-summary { grid-column: 1; max-width: 100%; color: #fff; font-size: .85rem; font-weight: 600; }
.rw-workbench-output-summary bdi+bdi::before { content: "|"; padding-inline: 5px; color: #a3a7ad; }
[data-rw-shared-workbench] .rw-studio-composer { padding: 6px; border: 1px solid var(--studio-border); border-radius: 18px; background: var(--studio-card); }
[data-rw-shared-workbench] .rw-studio-reference-entry {
  min-height: 60px;
  margin: 0 5px 5px;
  padding: 6px 12px;
  border: 1px solid #fa18ae;
  border-radius: 8px;
  background: linear-gradient(104deg,#422337,#35182e 55%,#2b1827);
  box-shadow: inset 0 0 14px #fd21aa29;
}
[data-rw-shared-workbench] .rw-studio-reference-entry small { color: #c9a9c3; }
[data-rw-shared-workbench] .rw-studio-reference-entry > span > .rw-icon { width: 42px; height: 42px; padding: 9px; border-radius: 8px; background: #ffffff1b; color: #ffd1ee; }
[data-rw-shared-workbench] .rw-prompt-wrap textarea { min-height: 132px; padding: 10px 12px 32px; border-color: #24272a; border-radius: 12px; background: #111213; font-size: 13px; line-height: 1.55; resize: vertical; }
[data-rw-shared-workbench] .rw-prompt-wrap:focus-within textarea { border-color: #914476; }
[data-rw-shared-workbench] .rw-studio-output-fields {
  width: min(540px,calc(100vw - 24px));
  gap: 12px;
  padding: 12px;
  border-color: #ffffff20;
  border-radius: 17px;
  background: #1c1e20;
}
[data-rw-shared-workbench] .rw-studio-output-fields :is(.rw-buttons,.rw-ratios) {
  display: grid;
  gap: 4px;
  padding: 4px;
  overflow: visible;
  border: 1px solid #ffffff09;
  border-radius: 12px;
  background: #24272a;
}
[data-rw-shared-workbench] .rw-studio-output-fields .rw-ratios { grid-template-columns: repeat(auto-fit,minmax(3.1rem,1fr)); }
[data-rw-shared-workbench] .rw-studio-output-fields .rw-ratio-edge { display: none; }
[data-rw-shared-workbench] .rw-studio-output-fields :is(.rw-buttons,.rw-ratios)>button {
  min-height: 42px;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  color: #ffffffb8;
  font-size: 13px;
  font-weight: 600;
}
[data-rw-shared-workbench] .rw-studio-output-fields :is(.rw-buttons,.rw-ratios)>button:hover { background: #ffffff12; color: #fff; }
[data-rw-shared-workbench] .rw-studio-output-fields :is(.rw-buttons,.rw-ratios)>button[aria-pressed=true] {
  border-color: #ffffff0a;
  background: #41474d;
  color: #fff;
  box-shadow: none;
}
[data-rw-shared-workbench] .seedance-output-duration-heading {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 2px 10px; margin-bottom: 8px; color: #fff9; font-size: .75rem; font-weight: 600;
}
[data-rw-shared-workbench] .seedance-output-duration-heading label { margin: 0; }
[data-rw-shared-workbench] .seedance-output-duration-track {
  position: relative; display: flex; align-items: center; height: 44px; isolation: isolate;
  border: 1px solid #ffffff09; border-radius: 11px; background: #24272a;
}
[data-rw-shared-workbench] .seedance-output-duration-fill {
  position: absolute; inset-block: 0; inset-inline-start: 0;
  border-radius: inherit; background: #41474d; pointer-events: none;
}
[data-rw-shared-workbench] .seedance-output-duration-value {
  position: absolute; inset-inline-start: 12px; z-index: 1;
  color: #f1f5ff; font-size: .8125rem; font-weight: 700;
  font-variant-numeric: tabular-nums; pointer-events: none;
}
[data-rw-shared-workbench] .seedance-output-duration-track > input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0;
  appearance: none; border-radius: inherit; background: transparent; cursor: ew-resize; touch-action: none;
}
[data-rw-shared-workbench] .seedance-output-duration-track > input:focus-visible { outline: 2px solid #91b7ff; outline-offset: 2px; }
[data-rw-shared-workbench] .seedance-output-duration-track > input::-webkit-slider-thumb { appearance: none; width: 4px; height: 32px; border-radius: 3px; background: #b9d2ff; }
[data-rw-shared-workbench] .seedance-output-duration-track > input::-moz-range-thumb { width: 4px; height: 32px; border: 0; border-radius: 3px; background: #b9d2ff; }
[data-rw-shared-workbench] .rw-workbench-audio {
  display: flex; align-items: center; justify-content: space-between; min-height: 58px;
  width: 100%; padding: 5px 9px; gap: 6px; text-align: start;
  background: #232629; border: 1px solid #d6e1ff09; border-radius: 15px;
}
.rw-workbench-audio small, .rw-workbench-audio strong { display: block; }
.rw-workbench-audio small { color: #a3a7ad; }
.rw-workbench-audio-switch { position: relative; display: block; width: 34px; height: 20px; border-radius: 999px; background: #6b7078; }
.rw-workbench-audio[aria-pressed=true] .rw-workbench-audio-switch { background: #963473; }
.rw-workbench-audio-switch > span { position: absolute; inset-block-start: 3px; inset-inline-start: 3px; width: 14px; height: 14px; border-radius: 50%; background: #f1eff3; }
.rw-workbench-audio[aria-pressed=true] .rw-workbench-audio-switch > span { inset-inline-start: 17px; }

[data-rw-shared-workbench] .rw-submit-area { padding: 10px 8px 0; border: 0; background: #18191a; }
[data-rw-shared-workbench] .rw-studio-submit-line { gap: 16px; }
[data-rw-shared-workbench] .rw-studio-submit-line > .rw-generate {
  min-height: 45px;
  border: 1px solid #ff74d642;
  border-radius: 13px;
  background: var(--studio-accent);
  color: #fff;
  font-size: 15px;
  font-weight: 720;
  box-shadow: inset 0 -4px 0 #9c146e88;
}
[data-rw-shared-workbench] .rw-studio-submit-line > .rw-generate:hover:not(:disabled) { background: #ff48c3; }
[data-rw-shared-workbench] .rw-studio-submit-line > .rw-generate:disabled { opacity: .45; }
[data-rw-shared-workbench] .seedance-output-duration-credits { color: #cdd0da; font-variant-numeric: tabular-nums; }
[data-rw-shared-workbench] .rw-frames-grid {
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px;
  align-items: start;
  padding: 10px;
  border: 1px solid #ffffff13;
  border-radius: 12px;
  background: #191d21;
}
[data-rw-shared-workbench] .rw-frame-slot button:disabled { opacity: .46; cursor: not-allowed; }
[data-rw-shared-workbench] [data-rw-action="studio-swap-frames"] { border: 1px solid #ffffff23; background: #242932; color: #dce8fa; }
[data-rw-shared-workbench] [data-rw-action="studio-swap-frames"]:hover:not(:disabled) { background: #343d4d; }

/* Published video models use the Seedance InnerPageHero layout. */
.rw-model-intro {
  padding: 78px 32px 64px;
  color: #f7f8fb;
  background: #080a11;
  border-bottom: 1px solid #ffffff1a;
}
.rw-model-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: start;
  gap: 40px;
  max-width: 1280px;
  margin-inline: auto;
}
.rw-model-intro-copy { min-width: 0; }
.rw-model-intro ol,
.rw-model-intro li,
.rw-model-intro-actions { display: flex; align-items: center; gap: 10px; }
.rw-model-intro ol { flex-wrap: wrap; margin: 0 0 10px; padding: 0; color: #aab2bf; font-size: .875rem; }
.rw-model-intro [aria-current="page"] { color: #eef0f5; }
.rw-model-intro a:focus-visible { outline: 2px solid #f0cf63; outline-offset: 4px; }
.rw-model-intro nav a:hover { color: #fff; }
.rw-model-intro svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rw-model-intro nav svg { width: 12px; height: 12px; }
.rw-model-intro-badge {
  display: inline-flex;
  padding: 7px 16px;
  border: 1px solid #ffffff38;
  border-radius: 999px;
  background: #ffffff14;
  color: #d0d1d6;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .24em;
}
.rw-model-intro h1 {
  margin: 7px 0 0;
  font-size: clamp(2.25rem, 4vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -.035em;
  font-weight: 750;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.rw-model-intro-lead { margin: 24px 0 0; max-width: 48rem; color: #b9bcc5; line-height: 2; }
.rw-model-intro-actions { flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.rw-model-intro-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 23px;
  border: 1px solid #ffffff4a;
  border-radius: 999px;
  background: #ffffff0d;
}
.rw-model-intro-actions a:first-child { background: #f2d275; color: #141318; border-color: transparent; font-weight: 650; }
.rw-model-intro-actions a:hover { filter: brightness(1.15); }
.rw-model-intro-poster {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 1px solid #ffffff29;
  border-radius: 22px;
  background: #11151c;
  box-shadow: 0 16px 32px #0004;
}
.rw-model-intro-poster img { display: block; width: 100%; height: 100%; object-fit: contain; }
.rw-model-example-video[data-media-frame] { width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; }
main:has(.rw-model-intro) #start-creating { overflow-x: clip; }
@media (max-width: 900px) {
  .rw-model-intro { padding: 48px 24px; }
  .rw-model-intro-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .rw-model-intro-poster { margin-inline-start: 0; }
}
@media (max-width: 480px) {
  .rw-model-intro { padding-inline: 20px; }
  .rw-model-intro h1 { font-size: 2rem; }
}
