:root {
  color-scheme: dark;
  --bg: #101214;
  --panel: #181b1f;
  --panel-strong: #20242a;
  --line: #303640;
  --text: #eef2f5;
  --muted: #9da7b2;
  --accent: #38bdf8;
  --accent-strong: #14b8a6;
  --danger: #fb7185;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1040px;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(720px, 1fr);
  height: 100vh;
  background: var(--bg);
}

.project-panel,
.generate-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  padding: 16px;
  background: var(--panel);
  border-color: var(--line);
}

.project-panel {
  border-right: 1px solid var(--line);
}

.generate-panel {
  border-left: 1px solid var(--line);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow,
.section-title {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
}

.icon-button,
.tool-button,
.project-item,
.history-list button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #22272e;
  color: var(--text);
}

.icon-button {
  height: 34px;
  padding: 0 12px;
}

.icon-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.billing-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #131920;
}

.billing-head,
.usage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.billing-head span {
  color: #9ff2e8;
  font-size: 12px;
  font-weight: 800;
}

.plan-list {
  display: grid;
  gap: 8px;
}

.plan-card {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px;
  border: 1px solid #2f3b45;
  border-radius: 8px;
  background: #10161d;
  color: var(--text);
  text-align: left;
}

.plan-card span,
.plan-card small,
.empty-usage {
  color: var(--muted);
  font-size: 12px;
}

.usage-list {
  display: grid;
  gap: 8px;
}

.usage-row {
  color: var(--muted);
  font-size: 12px;
}

.usage-row strong {
  color: var(--danger);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.project-list,
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.board-list {
  display: grid;
  gap: 10px;
}

.project-item {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 11px;
  text-align: left;
}

.project-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-title span:first-child {
  font-weight: 700;
}

.project-item small {
  color: var(--muted);
}

.board-signal {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.board-signal.is-done {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12), 0 0 18px rgba(34, 197, 94, 0.36);
}

.board-signal.is-running {
  background: #facc15;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.14), 0 0 18px rgba(250, 204, 21, 0.36);
}

.board-signal.is-failed {
  background: #fb7185;
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.14), 0 0 18px rgba(251, 113, 133, 0.36);
}

.project-item.is-active,
.tool-button.is-active {
  border-color: var(--accent);
  background: #163242;
}

.board-add-button {
  display: grid;
  width: 100%;
  min-height: 48px;
  margin-top: auto;
  place-items: center;
  border: 1px dashed #3f4d5a;
  border-radius: 8px;
  background: #111820;
  color: #d8eefc;
  font-size: 26px;
  font-weight: 800;
}

.board-add-button:hover {
  border-color: var(--accent);
  background: #152331;
}

.board-add-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.board-context-menu {
  position: fixed;
  z-index: 20;
  display: grid;
  min-width: 120px;
  padding: 6px;
  border: 1px solid #3a4652;
  border-radius: 8px;
  background: #161b21;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
}

.board-context-menu.is-hidden {
  display: none;
}

.board-context-menu button {
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.board-context-menu button:hover {
  background: #26313b;
}

.account-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(8px);
}

.account-modal.is-hidden {
  display: none;
}

.account-card {
  display: grid;
  gap: 18px;
  width: min(620px, 100%);
  max-height: min(860px, 92vh);
  overflow: auto;
  padding: 18px;
  border: 1px solid #3b4654;
  border-radius: 14px;
  background: #171c22;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
}

.account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-content {
  display: grid;
  gap: 14px;
}

.account-loading {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
}

.account-summary {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
}

.account-summary div,
.account-plan {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #111820;
}

.account-summary div {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.account-summary span,
.account-section-title,
.account-plan small {
  color: var(--muted);
  font-size: 12px;
}

.account-summary strong {
  font-size: 22px;
}

.account-plans {
  display: grid;
  gap: 10px;
}

.account-auth {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #111820;
}

.account-ledger {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #111820;
}

.account-ledger-list {
  display: grid;
  gap: 8px;
}

.account-ledger-item,
.account-ledger-empty {
  padding: 10px;
  border: 1px solid #24303a;
  border-radius: 8px;
  background: #0c1218;
}

.account-ledger-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
}

.account-ledger-item div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.account-ledger-item span,
.account-ledger-item small,
.account-ledger-empty {
  color: var(--muted);
  font-size: 12px;
}

.account-ledger-item b {
  color: #76e3b6;
}

.account-ledger-item b.is-negative {
  color: #ffb4a8;
}

.account-ledger-item small {
  grid-column: 1 / -1;
}

.account-field {
  display: grid;
  gap: 6px;
}

.account-field span,
.account-signed-in span {
  color: var(--muted);
  font-size: 12px;
}

.account-field input {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #33414d;
  border-radius: 8px;
  background: #0c1218;
  color: var(--text);
}

.account-auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.account-auth-message {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.account-auth-message.is-error {
  color: #ff8c9b;
}

.account-auth-actions button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.account-secondary-button {
  min-height: 38px;
  border: 1px solid #33414d;
  border-radius: 8px;
  background: #202732;
  color: var(--text);
  font-weight: 700;
}

.account-signed-in {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
}

.account-signed-in span {
  grid-column: 1 / -1;
}

.account-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px;
  color: var(--text);
  text-align: left;
}

.account-plan span {
  display: grid;
  gap: 4px;
}

.account-plan b {
  color: #9ff2e8;
  font-size: 18px;
}

.account-plan:hover {
  border-color: var(--accent);
  background: #152331;
}

.account-plan:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.account-plan:disabled:hover {
  border-color: var(--line);
  background: #111820;
}

.account-plan.is-loading {
  border-color: var(--accent);
}

.account-payment-message {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.account-payment-message.is-error {
  color: var(--danger);
}

.redeem-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.redeem-row input {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10161d;
  color: var(--text);
}

.admin-page {
  overflow: auto;
  min-width: 1180px;
}

.admin-shell {
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.14), transparent 32rem),
    var(--bg);
}

.admin-login {
  display: grid;
  min-height: calc(100vh - 48px);
  place-items: center;
}

.admin-login.is-hidden,
.admin-dashboard.is-hidden {
  display: none;
}

.admin-login-card {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(24, 27, 31, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.admin-login-card p {
  margin: 0;
  color: var(--muted);
}

.admin-dashboard {
  display: grid;
  gap: 18px;
  max-width: 1500px;
  margin: 0 auto;
}

.admin-topbar,
.admin-section-head,
.admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-stat,
.admin-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(24, 27, 31, 0.9);
}

.admin-stat {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.admin-stat span,
.admin-stat small,
.admin-code small,
.admin-job span,
.admin-job small,
.admin-table small {
  color: var(--muted);
  font-size: 12px;
}

.admin-stat strong {
  font-size: 24px;
}

.admin-section {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.admin-two-column {
  display: grid;
  grid-template-columns: minmax(420px, 0.8fr) minmax(520px, 1fr);
  gap: 18px;
}

.admin-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 12px;
}

.admin-table td:first-child {
  display: grid;
  gap: 4px;
}

.admin-user-ledger {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.admin-user-ledger strong {
  font-size: 12px;
}

.admin-user-ledger small {
  line-height: 1.4;
}

.admin-credit-form,
.admin-code-form {
  display: grid;
  grid-template-columns: 92px minmax(120px, 1fr) auto;
  gap: 8px;
}

.admin-credit-form input,
.admin-code-form input,
.admin-login-card input {
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10161d;
  color: var(--text);
}

.admin-credit-form button,
.admin-primary {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #38bdf8, #14b8a6);
  color: #061014;
  font-weight: 800;
}

.admin-code-list,
.admin-job-list {
  display: grid;
  gap: 8px;
}

.admin-code,
.admin-job,
.admin-empty {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111820;
}

.admin-code div,
.admin-job div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-code.is-used {
  opacity: 0.62;
}

.admin-job p {
  margin: 0;
  color: var(--text);
}

.admin-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 13px;
}

.canvas-column {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
}

.tool-group,
.field-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-button {
  min-width: 36px;
  height: 34px;
  padding: 0 12px;
}

.canvas-viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    #0e1115;
  background-size: 32px 32px;
}

.canvas-surface {
  position: relative;
  width: 100%;
  min-width: 100%;
  min-height: 1180px;
}

.canvas-surface.is-dragging {
  outline: 2px solid var(--accent);
  outline-offset: -8px;
}

.canvas-image {
  position: absolute;
  display: block;
  overflow: hidden;
  padding: 0;
  border: 1px solid #41505f;
  border-radius: 8px;
  background: #11161c;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
}

.canvas-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0b1016;
}

.canvas-image > span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  overflow: hidden;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(5, 9, 14, 0.72);
  color: #dbe7ee;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-image.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.24), 0 12px 34px rgba(0, 0, 0, 0.24);
}

.canvas-image.is-result {
  border-color: var(--accent-strong);
}

.canvas-image.has-generating-status > img {
  opacity: 0;
}

.canvas-image-status {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  overflow: hidden;
  background: rgba(7, 16, 28, 0.82);
  color: #e9f6ff;
  text-align: center;
}

.canvas-image-status.is-generating {
  background:
    radial-gradient(circle at 50% 42%, rgba(56, 189, 248, 0.14), rgba(56, 189, 248, 0) 28%),
    linear-gradient(180deg, #081827, #06111e);
}

.canvas-image-status strong {
  position: relative;
  z-index: 2;
  font-size: 16px;
  line-height: 1.2;
}

.canvas-image-status span {
  position: relative;
  z-index: 2;
  color: #a7b6c4;
  font-size: 13px;
}

.canvas-image-status.is-failed {
  gap: 10px;
  background: rgba(50, 12, 18, 0.82);
}

.canvas-failure-message {
  position: relative;
  z-index: 2;
  max-width: min(260px, calc(100% - 28px));
  margin: 0;
  color: #fecdd3;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.canvas-retry-button {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  min-height: 30px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  pointer-events: auto;
}

.canvas-retry-button:hover {
  background: rgba(255, 255, 255, 0.22);
}

.canvas-generating-shimmer {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(14, 42, 62, 0.3), rgba(10, 22, 36, 0.18));
  opacity: 0.64;
  transform: translate3d(0, 0, 0);
}

.canvas-generating-shimmer::before {
  content: "";
  position: absolute;
  inset: -18% auto -18% 0;
  width: 42%;
  background: linear-gradient(100deg, transparent 0%, rgba(125, 211, 252, 0.08) 32%, rgba(255, 255, 255, 0.22) 50%, rgba(125, 211, 252, 0.08) 68%, transparent 100%);
  filter: blur(0.5px);
  transform: translate3d(-130%, 0, 0);
  will-change: transform;
  animation: generating-glide 3.8s cubic-bezier(0.45, 0, 0.2, 1) infinite;
}

.canvas-generating-mark {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(125, 211, 252, 0.36);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, rgba(125, 211, 252, 0.32), rgba(56, 189, 248, 0.08) 58%, rgba(56, 189, 248, 0) 72%),
    rgba(5, 18, 30, 0.72);
  box-shadow:
    0 0 0 1px rgba(125, 211, 252, 0.08),
    0 0 18px rgba(56, 189, 248, 0.18);
  will-change: transform, opacity;
  animation: generating-breathe 2.6s ease-in-out infinite;
}

.canvas-generating-mark span {
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #e0f7ff, #38bdf8 58%, #0ea5e9);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.48);
  transform: rotate(45deg);
}

@keyframes generating-glide {
  0% {
    transform: translate3d(-130%, 0, 0);
  }
  100% {
    transform: translate3d(240%, 0, 0);
  }
}

@keyframes generating-breathe {
  0%,
  100% {
    opacity: 0.72;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

.canvas-annotation {
  position: absolute;
  z-index: 2;
  color: #ff4d4d;
  pointer-events: none;
}

.annotation-text {
  max-width: 360px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 77, 77, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.annotation-arrow {
  height: 3px;
  transform-origin: left center;
  background: #ff4d4d;
}

.annotation-arrow::after {
  position: absolute;
  right: -2px;
  top: -5px;
  width: 10px;
  height: 10px;
  content: "";
  transform: rotate(45deg);
  border-right: 2px solid #ff4d4d;
  border-top: 2px solid #ff4d4d;
}

.annotation-point {
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border: 3px solid #fff;
  border-radius: 999px;
  background: #ff4d4d;
  box-shadow: 0 0 0 4px rgba(255, 77, 77, 0.22);
}

.canvas-surface.is-arrow-mode {
  cursor: crosshair;
}

.status-pill {
  padding: 5px 9px;
  border: 1px solid #2a554e;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.12);
  color: #9ff2e8;
  font-size: 12px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.field.compact {
  flex: 1;
}

textarea,
select,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11161c;
  color: var(--text);
  outline: none;
}

textarea {
  min-height: 150px;
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}

select,
input {
  height: 38px;
  padding: 0 10px;
}

textarea:focus,
select:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.primary-action {
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #041114;
  font-weight: 800;
}

.history-list {
  margin-top: auto;
}

.history-list button {
  padding: 11px 12px;
  text-align: left;
}

.chat-composer {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 10px 22px 16px;
  border-top: 1px solid rgba(48, 54, 64, 0.72);
  background:
    radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(16, 18, 20, 0.72), rgba(16, 18, 20, 0.96)),
    var(--panel);
}

.chat-composer-card {
  position: relative;
  display: grid;
  gap: 8px;
  width: min(920px, 100%);
  padding: 10px;
  border: 1px solid #34404c;
  border-radius: 24px;
  background: rgba(18, 23, 29, 0.98);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.chat-attachments {
  display: flex;
  gap: 12px;
  min-height: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 0 2px 4px;
}

.chat-attachments:empty {
  display: none;
}

.chat-attachment {
  position: relative;
  flex: 0 0 auto;
  width: 168px;
  height: 126px;
  overflow: hidden;
  border: 1px solid #465564;
  border-radius: 12px;
  background: #0b1016;
  cursor: pointer;
}

.chat-attachment:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.chat-attachment img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.chat-attachment-index {
  position: absolute;
  left: 5px;
  bottom: 5px;
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.92);
  color: #041114;
  font-size: 13px;
  font-weight: 900;
}

.chat-attachment-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(5, 9, 14, 0.78);
  color: #fff;
  font-size: 16px;
  line-height: 1;
}

.chat-attachment-index,
.chat-attachment-remove,
.preview-reference-card > span,
.preview-reference-card > button {
  z-index: 3;
}

.chat-attachment.is-uploading img,
.preview-reference-card.is-uploading img {
  opacity: 0.58;
}

.chat-attachment.is-failed img,
.preview-reference-card.is-failed img {
  opacity: 0.36;
}

.image-upload-state {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px;
  background: rgba(4, 10, 16, 0.52);
  color: #fff;
  text-align: center;
  pointer-events: none;
}

.image-upload-state strong {
  font-size: 13px;
  letter-spacing: 0;
}

.image-upload-state small {
  color: #cbd5e1;
  font-size: 11px;
}

.image-upload-state.is-failed {
  background: rgba(74, 12, 22, 0.72);
  color: #fecdd3;
}

.image-upload-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: image-upload-spin 0.72s linear infinite;
}

@keyframes image-upload-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .image-upload-spinner {
    animation-duration: 1.4s;
  }
}

.chat-mention-menu {
  position: absolute;
  left: 12px;
  bottom: calc(100% + 8px);
  z-index: 6;
  display: grid;
  gap: 6px;
  width: min(360px, calc(100vw - 320px));
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #3d4b57;
  border-radius: 16px;
  background: rgba(18, 23, 29, 0.98);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.45);
}

.chat-mention-menu.is-hidden {
  display: none;
}

.chat-mention-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.chat-mention-item:hover,
.chat-mention-item.is-active {
  background: #26313b;
}

.chat-mention-item img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  background: #0b1016;
}

.chat-mention-name {
  min-width: 0;
  overflow: hidden;
  color: #eef2f5;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-mention-index {
  display: grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: #38bdf8;
  color: #06121a;
  font-size: 12px;
  font-weight: 900;
}

.chat-input-row {
  display: grid;
  grid-template-columns: 38px minmax(260px, 1fr) 38px;
  align-items: end;
  gap: 8px;
}

.chat-icon-button,
.chat-generate-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  color: var(--text);
  font-weight: 900;
}

.chat-icon-button {
  background: #262b32;
  font-size: 22px;
  line-height: 1;
}

.chat-generate-button {
  background: #eef2f5;
  color: #05080c;
  font-size: 22px;
  line-height: 1;
}

.chat-generate-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.35);
  opacity: 0.62;
}

.chat-input-row textarea {
  min-height: 44px;
  max-height: 118px;
  padding: 10px 2px;
  resize: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  line-height: 1.45;
  box-shadow: none;
}

.chat-input-row textarea:focus {
  border-color: transparent;
  box-shadow: none;
}

.preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(4, 8, 12, 0.78);
}

.preview-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1600px, 96vw);
  height: min(900px, 94vh);
  overflow: hidden;
  border: 1px solid #425064;
  border-radius: 10px;
  background: #0e141b;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #151b23;
}

.preview-toolbar strong {
  min-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.preview-generate {
  height: 34px;
  padding: 0 14px;
}

.preview-generate.is-submitting {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: wait;
  opacity: 0.82;
}

.button-submit-spinner {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid rgba(4, 17, 20, 0.3);
  border-top-color: #041114;
  border-radius: 50%;
  animation: image-upload-spin 0.72s linear infinite;
}

.preview-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  overflow: hidden;
  cursor: crosshair;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    #0a0f15;
  background-size: 28px 28px;
}

.preview-image-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 0;
}

.preview-image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.preview-reference-strip {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  display: flex;
  gap: 10px;
  max-width: calc(100% - 36px);
  overflow-x: auto;
  padding: 8px;
  border: 1px solid rgba(66, 80, 100, 0.82);
  border-radius: 14px;
  background: rgba(11, 16, 22, 0.88);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.34);
  cursor: default;
}

.preview-reference-card {
  position: relative;
  flex: 0 0 auto;
  width: 86px;
  height: 86px;
  overflow: hidden;
  border: 1px solid #4a5868;
  border-radius: 10px;
  background: #071018;
  cursor: pointer;
}

.preview-reference-card.is-selected {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22);
}

.preview-reference-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview-reference-card span {
  position: absolute;
  left: 5px;
  bottom: 5px;
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.94);
  color: #041114;
  font-size: 12px;
  font-weight: 900;
}

.preview-reference-card button {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(5, 9, 14, 0.82);
  color: #fff;
  font-size: 15px;
  line-height: 1;
}

.preview-generate-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 320px;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: #151b23;
}

.preview-generate-panel textarea {
  min-height: 132px;
  max-height: 164px;
}

.preview-size-field {
  align-self: end;
}

.preview-custom-size {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.preview-custom-size.is-hidden {
  display: none;
}

.preview-custom-size .field {
  gap: 4px;
}

.preview-mark {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.preview-arrow {
  height: 3px;
  transform-origin: left center;
  background: #ff4d4d;
}

.preview-arrow::after {
  position: absolute;
  right: -2px;
  top: -5px;
  width: 10px;
  height: 10px;
  content: "";
  transform: rotate(45deg);
  border-right: 2px solid #ff4d4d;
  border-top: 2px solid #ff4d4d;
}

.preview-circle {
  border: 3px solid #ff4d4d;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(255, 77, 77, 0.14);
}

.preview-live {
  opacity: 0.72;
  filter: drop-shadow(0 0 6px rgba(255, 77, 77, 0.45));
}

.preview-circle.preview-live {
  background: rgba(255, 77, 77, 0.08);
}

.preview-freehand {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.preview-freehand polygon {
  fill: rgba(255, 77, 77, 0.08);
  stroke: #ff4d4d;
  stroke-width: 3px;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(255, 77, 77, 0.45));
}

.preview-label {
  max-width: 380px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 77, 77, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #ff3333;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.preview-number {
  display: grid;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #ff3333;
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 51, 51, 0.35);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

/* annotation palette overrides */
.annotation-color-1.preview-arrow { background: #ff3b4f; }
.annotation-color-1.preview-arrow::after { border-right-color: #ff3b4f; border-top-color: #ff3b4f; }
.annotation-color-1.preview-circle { border-color: #ff3b4f; box-shadow: 0 0 0 3px rgba(255,59,79, 0.18); }
.annotation-color-1.preview-circle.preview-live { background: rgba(255,59,79, 0.08); }
.annotation-color-1.preview-freehand polygon { fill: rgba(255,59,79, 0.08); stroke: #ff3b4f; filter: drop-shadow(0 0 6px rgba(255,59,79, 0.45)); }
.annotation-color-1.preview-label { border-color: rgba(255,59,79, 0.45); color: #ff3b4f; }
.annotation-color-1.preview-number { background: #ff3b4f; box-shadow: 0 6px 18px rgba(255,59,79, 0.35); }
.annotation-color-1.annotation-point { background: #ff3b4f; box-shadow: 0 0 0 4px rgba(255,59,79, 0.22); }
.annotation-color-2.preview-arrow { background: #20c76f; }
.annotation-color-2.preview-arrow::after { border-right-color: #20c76f; border-top-color: #20c76f; }
.annotation-color-2.preview-circle { border-color: #20c76f; box-shadow: 0 0 0 3px rgba(32,199,111, 0.18); }
.annotation-color-2.preview-circle.preview-live { background: rgba(32,199,111, 0.08); }
.annotation-color-2.preview-freehand polygon { fill: rgba(32,199,111, 0.08); stroke: #20c76f; filter: drop-shadow(0 0 6px rgba(32,199,111, 0.45)); }
.annotation-color-2.preview-label { border-color: rgba(32,199,111, 0.45); color: #20c76f; }
.annotation-color-2.preview-number { background: #20c76f; box-shadow: 0 6px 18px rgba(32,199,111, 0.35); }
.annotation-color-2.annotation-point { background: #20c76f; box-shadow: 0 0 0 4px rgba(32,199,111, 0.22); }
.annotation-color-3.preview-arrow { background: #a855f7; }
.annotation-color-3.preview-arrow::after { border-right-color: #a855f7; border-top-color: #a855f7; }
.annotation-color-3.preview-circle { border-color: #a855f7; box-shadow: 0 0 0 3px rgba(168,85,247, 0.18); }
.annotation-color-3.preview-circle.preview-live { background: rgba(168,85,247, 0.08); }
.annotation-color-3.preview-freehand polygon { fill: rgba(168,85,247, 0.08); stroke: #a855f7; filter: drop-shadow(0 0 6px rgba(168,85,247, 0.45)); }
.annotation-color-3.preview-label { border-color: rgba(168,85,247, 0.45); color: #a855f7; }
.annotation-color-3.preview-number { background: #a855f7; box-shadow: 0 6px 18px rgba(168,85,247, 0.35); }
.annotation-color-3.annotation-point { background: #a855f7; box-shadow: 0 0 0 4px rgba(168,85,247, 0.22); }
.annotation-color-4.preview-arrow { background: #2f80ff; }
.annotation-color-4.preview-arrow::after { border-right-color: #2f80ff; border-top-color: #2f80ff; }
.annotation-color-4.preview-circle { border-color: #2f80ff; box-shadow: 0 0 0 3px rgba(47,128,255, 0.18); }
.annotation-color-4.preview-circle.preview-live { background: rgba(47,128,255, 0.08); }
.annotation-color-4.preview-freehand polygon { fill: rgba(47,128,255, 0.08); stroke: #2f80ff; filter: drop-shadow(0 0 6px rgba(47,128,255, 0.45)); }
.annotation-color-4.preview-label { border-color: rgba(47,128,255, 0.45); color: #2f80ff; }
.annotation-color-4.preview-number { background: #2f80ff; box-shadow: 0 6px 18px rgba(47,128,255, 0.35); }
.annotation-color-4.annotation-point { background: #2f80ff; box-shadow: 0 0 0 4px rgba(47,128,255, 0.22); }
.annotation-color-5.preview-arrow { background: #ff9f1c; }
.annotation-color-5.preview-arrow::after { border-right-color: #ff9f1c; border-top-color: #ff9f1c; }
.annotation-color-5.preview-circle { border-color: #ff9f1c; box-shadow: 0 0 0 3px rgba(255,159,28, 0.18); }
.annotation-color-5.preview-circle.preview-live { background: rgba(255,159,28, 0.08); }
.annotation-color-5.preview-freehand polygon { fill: rgba(255,159,28, 0.08); stroke: #ff9f1c; filter: drop-shadow(0 0 6px rgba(255,159,28, 0.45)); }
.annotation-color-5.preview-label { border-color: rgba(255,159,28, 0.45); color: #ff9f1c; }
.annotation-color-5.preview-number { background: #ff9f1c; box-shadow: 0 6px 18px rgba(255,159,28, 0.35); }
.annotation-color-5.annotation-point { background: #ff9f1c; box-shadow: 0 0 0 4px rgba(255,159,28, 0.22); }
.annotation-color-6.preview-arrow { background: #00b8d9; }
.annotation-color-6.preview-arrow::after { border-right-color: #00b8d9; border-top-color: #00b8d9; }
.annotation-color-6.preview-circle { border-color: #00b8d9; box-shadow: 0 0 0 3px rgba(0,184,217, 0.18); }
.annotation-color-6.preview-circle.preview-live { background: rgba(0,184,217, 0.08); }
.annotation-color-6.preview-freehand polygon { fill: rgba(0,184,217, 0.08); stroke: #00b8d9; filter: drop-shadow(0 0 6px rgba(0,184,217, 0.45)); }
.annotation-color-6.preview-label { border-color: rgba(0,184,217, 0.45); color: #00b8d9; }
.annotation-color-6.preview-number { background: #00b8d9; box-shadow: 0 6px 18px rgba(0,184,217, 0.35); }
.annotation-color-6.annotation-point { background: #00b8d9; box-shadow: 0 0 0 4px rgba(0,184,217, 0.22); }
.annotation-color-7.preview-arrow { background: #ff5ea8; }
.annotation-color-7.preview-arrow::after { border-right-color: #ff5ea8; border-top-color: #ff5ea8; }
.annotation-color-7.preview-circle { border-color: #ff5ea8; box-shadow: 0 0 0 3px rgba(255,94,168, 0.18); }
.annotation-color-7.preview-circle.preview-live { background: rgba(255,94,168, 0.08); }
.annotation-color-7.preview-freehand polygon { fill: rgba(255,94,168, 0.08); stroke: #ff5ea8; filter: drop-shadow(0 0 6px rgba(255,94,168, 0.45)); }
.annotation-color-7.preview-label { border-color: rgba(255,94,168, 0.45); color: #ff5ea8; }
.annotation-color-7.preview-number { background: #ff5ea8; box-shadow: 0 6px 18px rgba(255,94,168, 0.35); }
.annotation-color-7.annotation-point { background: #ff5ea8; box-shadow: 0 0 0 4px rgba(255,94,168, 0.22); }
.annotation-color-8.preview-arrow { background: #8bc34a; }
.annotation-color-8.preview-arrow::after { border-right-color: #8bc34a; border-top-color: #8bc34a; }
.annotation-color-8.preview-circle { border-color: #8bc34a; box-shadow: 0 0 0 3px rgba(139,195,74, 0.18); }
.annotation-color-8.preview-circle.preview-live { background: rgba(139,195,74, 0.08); }
.annotation-color-8.preview-freehand polygon { fill: rgba(139,195,74, 0.08); stroke: #8bc34a; filter: drop-shadow(0 0 6px rgba(139,195,74, 0.45)); }
.annotation-color-8.preview-label { border-color: rgba(139,195,74, 0.45); color: #8bc34a; }
.annotation-color-8.preview-number { background: #8bc34a; box-shadow: 0 6px 18px rgba(139,195,74, 0.35); }
.annotation-color-8.annotation-point { background: #8bc34a; box-shadow: 0 0 0 4px rgba(139,195,74, 0.22); }

.preview-actions .danger-action {
  border-color: rgba(248, 113, 113, 0.75);
  background: #b91c1c;
  color: #fff;
}

.preview-actions .danger-action:hover,
.preview-actions .danger-action:focus-visible {
  border-color: #fecaca;
  background: #dc2626;
}
.preview-prompt-wrap {
  position: relative;
}

.preview-mention-menu {
  left: 0;
  bottom: calc(100% + 6px);
  width: min(360px, 100%);
}

.preview-annotation-backdrop {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 8, 14, 0.6);
}

.preview-annotation-dialog {
  display: grid;
  gap: 12px;
  width: min(480px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #151c24;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

.preview-annotation-dialog > span {
  color: var(--muted);
  font-size: 13px;
}

.preview-annotation-dialog textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
}

.preview-annotation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.preview-reference-upload-button,
.hd-save-button {
  border-color: rgba(74, 222, 128, 0.76);
  background: #15803d;
  color: #fff;
}

.preview-reference-upload-button:hover,
.preview-reference-upload-button:focus-visible,
.hd-save-button:hover,
.hd-save-button:focus-visible {
  border-color: #bbf7d0;
  background: #16a34a;
}

.preview-size-field .preview-reference-upload-button {
  width: 100%;
  margin-bottom: 8px;
}
/* Keep the reference tray only as wide as its thumbnails require. */
.preview-reference-strip {
  right: auto;
  width: max-content;
  max-width: min(720px, calc(100% - 36px));
}
/* Closed loops are painted editable regions; their boundary stays thin and translucent. */
.preview-circle { border-width: 1.5px; box-shadow: 0 0 0 1px rgba(255,77,77,.12); }
.preview-live { opacity: .62; filter: none; }
.preview-circle.preview-live { background: rgba(255,77,77,.025); }
.preview-circle:not(.preview-live) { background: rgba(255,77,77,.25); opacity: 1; }
.preview-freehand polygon { stroke-width: 1.5px; opacity: .62; filter: none; }
.preview-freehand:not(.preview-live) polygon { fill: #ff4d4d; fill-opacity: .25; opacity: 1; }
.annotation-color-1.preview-circle:not(.preview-live) { background: rgba(255,59,79,.25); }
.annotation-color-1.preview-freehand:not(.preview-live) polygon { fill: #ff3b4f; }
.annotation-color-2.preview-circle:not(.preview-live) { background: rgba(32,199,111,.25); }
.annotation-color-2.preview-freehand:not(.preview-live) polygon { fill: #20c76f; }
.annotation-color-3.preview-circle:not(.preview-live) { background: rgba(168,85,247,.25); }
.annotation-color-3.preview-freehand:not(.preview-live) polygon { fill: #a855f7; }
.annotation-color-4.preview-circle:not(.preview-live) { background: rgba(47,128,255,.25); }
.annotation-color-4.preview-freehand:not(.preview-live) polygon { fill: #2f80ff; }
.annotation-color-5.preview-circle:not(.preview-live) { background: rgba(255,159,28,.25); }
.annotation-color-5.preview-freehand:not(.preview-live) polygon { fill: #ff9f1c; }
.annotation-color-6.preview-circle:not(.preview-live) { background: rgba(0,184,217,.25); }
.annotation-color-6.preview-freehand:not(.preview-live) polygon { fill: #00b8d9; }
.annotation-color-7.preview-circle:not(.preview-live) { background: rgba(255,94,168,.25); }
.annotation-color-7.preview-freehand:not(.preview-live) polygon { fill: #ff5ea8; }
.annotation-color-8.preview-circle:not(.preview-live) { background: rgba(139,195,74,.25); }
.annotation-color-8.preview-freehand:not(.preview-live) polygon { fill: #8bc34a; }
/* plain-arabic-annotation-number */
.preview-number{width:auto!important;height:auto!important;display:block!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;padding:0!important;color:#fff!important;text-shadow:0 0 2px #000,0 0 2px #000}
.preview-number[class*=annotation-color-]{background:transparent!important;box-shadow:none!important}

/* Generating card: replace sweep with a clear, continuous circular loader. */
.canvas-generating-shimmer {
  inset: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  opacity: 1;
}

.canvas-generating-shimmer::before {
  inset: 50% auto auto 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border: 3px solid rgba(125, 211, 252, 0.22);
  border-top-color: #7dd3fc;
  border-right-color: #38bdf8;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.26);
  filter: none;
  transform: none;
  animation: generating-spinner 0.9s linear infinite;
}

.canvas-generating-mark {
  display: none;
}

@keyframes generating-spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Keep the source image visible while its replacement is generating. */
.canvas-image.has-generating-status > img {
  opacity: 0.30;
  filter: saturate(0.72) brightness(0.72);
}

.canvas-image-status.is-generating {
  background:
    radial-gradient(circle at 50% 42%, rgba(56, 189, 248, 0.12), rgba(56, 189, 248, 0) 30%),
    linear-gradient(180deg, rgba(8, 24, 39, 0.48), rgba(6, 17, 30, 0.56));
}

.preview-backdrop.is-reference-dragging .preview-dialog {
  outline: 2px solid rgba(56, 189, 248, 0.92);
  outline-offset: -2px;
}

.preview-backdrop.is-reference-dragging .preview-stage::after {
  content: "松开即可添加为参考图";
  position: absolute;
  inset: 18px;
  z-index: 8;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(125, 211, 252, 0.84);
  border-radius: 10px;
  background: rgba(4, 17, 30, 0.62);
  color: #e0f7ff;
  font-weight: 800;
  pointer-events: none;
}

/* Larger loader with its own space above the generation copy. */
.canvas-generating-shimmer::before {
  inset: 38% auto auto 50%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-width: 4px;
}

.canvas-image-status.is-generating strong {
  position: absolute;
  z-index: 2;
  top: calc(50% + 18px);
  right: 12px;
  left: 12px;
}

.canvas-image-status.is-generating > span {
  position: absolute;
  z-index: 2;
  top: calc(50% + 45px);
  right: 12px;
  left: 12px;
}
.canvas-image.has-generating-status > img { opacity: 0.50; }
