/* 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}
