:root {
  --blue: #2563eb;
  --cyan: #0891b2;
  --violet: #635bff;
  --ink: #101828;
  --muted: #667085;
  --line: #d9e3f0;
  --soft: #f6f8fb;
  --panel: #ffffff;
  --danger: #e33131;
  --ok: #0f9b76;
  --shadow: 0 18px 48px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #eef6ff 0, #f8fbff 330px, #fff 100%);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

svg.icon {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  pointer-events: none;
}

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

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 120px;
  padding: 12px;
  resize: vertical;
}

label {
  display: grid;
  gap: 8px;
  color: #41516b;
  font-size: 13px;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  position: relative;
  width: 38px;
  height: 28px;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  top: 7px;
  width: 21px;
  height: 15px;
  border: 4px solid var(--blue);
  border-radius: 999px;
  transform: rotate(-18deg);
  background: #fff;
}

.brand-mark::after {
  right: 0;
  border-color: var(--violet);
  transform: rotate(18deg);
}

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 24% 12%, rgba(112, 70, 216, .16), transparent 30%),
    radial-gradient(circle at 80% 86%, rgba(79, 141, 255, .18), transparent 28%),
    #f8fbff;
}

.auth-card {
  position: relative;
  width: 460px;
  padding: 34px;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.auth-card-modal {
  display: flex;
  max-height: 100%;
  flex-direction: column;
  width: 100%;
  max-width: 460px;
  overflow: hidden;
}

.modal.auth-modal {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior-y: contain;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

.modal.auth-modal > .auth-modal-frame {
  display: flex;
  flex: 0 1 460px;
  height: 100%;
  align-items: center;
  width: min(460px, 100%);
  max-height: 100%;
  margin: 0;
  overflow: hidden;
}

.auth-card-modal .auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.auth-modal-scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.auth-modal-actions {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  padding-top: 14px;
  border-top: 1px solid rgba(217, 227, 240, .82);
  background: rgba(255, 255, 255, .96);
}

.auth-card h1 {
  margin: 22px 0 8px;
  font-size: 28px;
}

.auth-card-modal .auth-intro {
  margin: 0 0 16px;
  line-height: 1.6;
}

.auth-card p,
.page-sub,
.muted {
  color: var(--muted);
}

.tabs,
.segmented {
  display: flex;
  gap: 8px;
}

.tabs button,
.segmented button {
  flex: 1;
  height: 42px;
  color: #58687f;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.tabs button.active,
.segmented button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--violet), #9365e6);
  border-color: transparent;
}

.form-stack {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.auth-code-row {
  display: grid;
  grid-template-columns: 1fr 118px;
  gap: 10px;
  align-items: end;
}

.auth-code-row button {
  height: 42px;
  padding: 0 12px;
  white-space: nowrap;
}

.auth-code-hint {
  grid-column: 1 / -1;
  margin: -4px 0 0;
  color: #667085;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-height: 760px) {
  .auth-card.auth-card-modal {
    padding: 24px 28px;
  }

  .auth-card-modal h1 {
    margin: 16px 0 6px;
    font-size: 25px;
  }

  .auth-card-modal .auth-intro {
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.5;
  }

  .auth-card-modal .form-stack {
    gap: 10px;
    margin-top: 12px;
  }

  .auth-card-modal .auth-code-hint {
    line-height: 1.35;
  }
}

@media (max-height: 560px) {
  .modal.auth-modal {
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .auth-card.auth-card-modal {
    padding: 18px 22px;
  }

  .auth-card-modal h1 {
    margin: 10px 0 4px;
    font-size: 22px;
  }

  .auth-card-modal .auth-intro {
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.4;
  }

  .auth-card-modal .tabs button,
  .auth-card-modal input,
  .auth-card-modal .auth-code-row button {
    height: 38px;
  }

  .auth-card-modal .form-stack {
    gap: 8px;
    margin-top: 10px;
  }

  .auth-card-modal .auth-modal-actions {
    padding-top: 10px;
  }
}

@media (max-width: 640px) {
  .modal.auth-modal {
    padding:
      max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }

  .modal.auth-modal > .auth-modal-frame {
    width: 100%;
  }

  .auth-card.auth-card-modal {
    max-width: none;
    padding: 18px 16px;
    border-radius: 14px;
  }

  .auth-card-modal h1 {
    margin: 14px 0 6px;
    font-size: 23px;
  }

  .auth-card-modal .auth-intro {
    margin-bottom: 10px;
    font-size: 12.5px;
    line-height: 1.5;
  }

  .auth-card-modal .form-stack {
    gap: 8px;
    margin-top: 10px;
  }

  .auth-card-modal .auth-code-row {
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 8px;
  }

  .auth-card-modal .auth-code-row button {
    width: auto;
    min-width: 0;
    padding: 0 8px;
    font-size: 12px;
  }

  .auth-card-modal .auth-code-hint {
    margin-top: -2px;
    font-size: 11.5px;
  }

  .auth-card-modal .auth-modal-close {
    top: 10px;
    right: 10px;
  }

  .auth-card-modal .auth-modal-actions {
    padding-top: 10px;
  }
}

@media (max-width: 360px) {
  .auth-card-modal .auth-code-row {
    grid-template-columns: 1fr;
  }

  .auth-card-modal .auth-code-row button {
    width: 100%;
  }
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 8px;
  min-width: 118px;
  height: 42px;
  padding: 0 20px;
  color: #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), #4d8cff);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .22);
  font-weight: 900;
  white-space: nowrap;
}

.primary:disabled {
  cursor: not-allowed;
  opacity: .68;
  box-shadow: none;
}

.primary.block {
  width: 100%;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--violet), #9365e6);
}

.ghost,
.mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  color: #40516b;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.mini {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.mini.primary-lite {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #4d8cff);
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}

.mini.danger-lite {
  color: #b42318;
  background: #fff5f4;
  border-color: #ffc9c4;
}

.mini.danger-lite:hover:not(:disabled) {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.app-shell,
.admin-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 210px 1fr;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 210px;
  padding: 22px 16px;
  background: #fff;
  border-right: 1px solid #e6eef8;
  z-index: 20;
}

.sidebar .brand {
  margin-bottom: 20px;
}

.sidebar .brand-mark {
  width: 30px;
  height: 24px;
}

.sidebar .brand-mark::before,
.sidebar .brand-mark::after {
  width: 17px;
  height: 12px;
  border-width: 3px;
}

.recharge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 42px;
  color: #fff;
  background:
    linear-gradient(135deg, #5b6df5 0%, #7b4de0 100%);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(112,70,216,.2);
  font-size: 15px;
  font-weight: 900;
}

.recharge .icon {
  width: 16px;
  height: 16px;
}

.price-box {
  display: grid;
  gap: 4px;
  margin: 12px 0 26px;
  padding: 10px 9px;
  color: #0a3e9a;
  background: linear-gradient(180deg, #f6f9ff, #eef5ff);
  border: 1px solid #cddcff;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 900;
}

.price-box span {
  display: block;
  overflow: visible;
  white-space: nowrap;
}

.support-box {
  gap: 6px;
}

.support-box span {
  white-space: normal;
}

.support-button {
  width: 100%;
  height: 32px;
  margin-top: 4px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #0f8bc0);
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 12px;
  color: #31445f;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  user-select: none;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.nav-item:hover {
  color: #1f5fe5;
  background: #eef5ff;
  box-shadow: 0 8px 18px rgba(37,99,235,.08);
  transform: translateX(1px);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, var(--violet), #7448d8);
}

.nav-item.active:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--violet), #7448d8);
  box-shadow: 0 12px 24px rgba(37,99,235,.16);
}

.main {
  grid-column: 2;
  min-height: 100vh;
  padding: 44px 56px 52px;
}

.topbar {
  position: fixed;
  top: 18px;
  right: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 30;
  min-height: 48px;
  padding: 7px 8px 7px 10px;
  border: 1px solid #e1ebf7;
  border-radius: 18px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 30px rgba(31,89,180,.1);
}

.account-summary {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.account-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #14a3c7);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
}

.guest-avatar .icon {
  width: 17px;
  height: 17px;
}

.account-text {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.account-text em {
  color: #2563eb;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.guest-topbar {
  border-color: #d7e6fa;
  background: rgba(248, 251, 255, .94);
}

.guest-topbar .account-text em {
  color: #7b4de0;
}

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

.login-required-panel {
  width: min(680px, 100%);
  padding: 42px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,251,255,.96));
  border: 1px solid #dbe8f7;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(31, 89, 180, .13);
}

.login-required-panel h1 {
  margin: 14px 0 10px;
  font-size: 32px;
  line-height: 1.2;
}

.login-required-panel p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.login-required-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #fff;
  background: linear-gradient(135deg, #0c91c9, var(--blue));
  border-radius: 50%;
}

.user-email {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--ink);
}

.hero {
  text-align: center;
  margin: 8px 0 22px;
}

.hero h1 {
  margin: 0;
  font-size: 34px;
}

.hero span {
  color: #428fff;
}

.workflow {
  display: grid;
  grid-template-columns: minmax(780px, 1fr) 420px;
  gap: 28px;
  max-width: 1500px;
  margin: 0 auto;
}

.progress-workflow {
  margin-top: -18px;
}

.result-workflow {
  grid-template-columns: minmax(780px, 1fr) 420px;
  max-width: 1500px;
}

.ecom-progress-workflow {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1100px;
}

.panel,
.wizard-card,
.case-card {
  background: rgba(255,255,255,.95);
  border: 1px solid #dce9f8;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.wizard-card {
  min-height: 660px;
  padding: 28px 34px 24px;
}

.progress-card {
  min-height: 0;
  padding-bottom: 14px;
}

.progress-card .stepper {
  margin-bottom: 14px;
}

.stepper {
  display: grid;
  grid-template-columns: 40px 1fr 40px 1fr 40px 1fr 40px 1fr 40px;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.dot {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #738198;
  background: #dfeafd;
  border-radius: 50%;
  font-weight: 900;
}

.dot.active {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 10px 22px rgba(37,99,235,.28);
}

.dot.done {
  color: var(--blue);
}

.line {
  height: 2px;
  background: #dfe8f5;
}

.line.on {
  background: var(--blue);
}

.section-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.section-head b {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  color: #fff;
  background: var(--blue);
  border-radius: 50%;
}

.section-head h2,
.page-title {
  margin: 0;
  font-size: 30px;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.type-step-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 18px 45px;
}

.warn {
  display: inline-flex;
  margin: 0;
  padding: 8px 16px;
  color: #b84b12;
  background: #fff0e5;
  border-radius: 999px;
  font-weight: 900;
}

.type-total-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  color: #174fb5;
  background: #edf5ff;
  border: 1px solid #cfe0fb;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.type-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  min-height: 250px;
  padding: 20px;
  background: #f7fbff;
  border: 2px solid #d7e5f8;
  border-radius: 14px;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.type-card:not(.selected) {
  background: #fff;
}

.type-card.selected {
  background: #f0f5ff;
  border-color: var(--blue);
  box-shadow: 0 14px 34px rgba(37,99,235,.08);
}

.card-check {
  position: absolute;
  top: 18px;
  left: 18px;
  display: grid;
  width: 22px;
  height: 22px;
  color: transparent;
  place-items: center;
  background: #fff;
  border: 1px solid #b8c8df;
  border-radius: 6px;
}

.type-card.selected .card-check {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.card-check svg {
  width: 14px;
  height: 14px;
}

.type-thumb {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  background-color: #edf4ff;
  background-position: center;
  background-size: cover;
  border: 1px solid #d8e5f7;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(31,89,180,.10);
}

.type-thumb.thumb-main {
  background-image: url("/assets/cases/jeans-stack.jpg");
  background-position: center 70%;
}

.type-thumb.thumb-detail {
  background-image: url("/assets/cases/jeans-detail.jpg");
  background-position: center 64%;
}

.type-card-head {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 2px 4px 0 36px;
}

.type-card-head > div:last-child {
  min-width: 0;
}

.type-card h3 {
  margin: 0;
  font-size: 18px;
}

.type-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.type-options {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  opacity: 1;
  transition: opacity .16s ease;
}

.type-options small {
  display: block;
  margin-bottom: 14px;
  color: #5a6f8c;
  font-weight: 900;
}

.type-options.hidden-options {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.mini-divider {
  height: 1px;
  margin: 0;
  background: #dae5f3;
}

.radio-row,
.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

.radio-row label,
.radio-row button {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #49607f;
  font-weight: 500;
}

.radio-row button {
  padding: 0;
  font: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.radio-row button.active {
  color: var(--blue);
  font-weight: 700;
}

.type-count-tools {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: rgba(255,255,255,.72);
  border: 1px solid #dbe8f7;
  border-radius: 12px;
}

.type-count-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.type-count-head span {
  color: #5a6f8c;
  font-size: 12px;
  font-weight: 900;
}

.type-count-head b {
  color: #1f5ed5;
  font-size: 14px;
  white-space: nowrap;
}

.quick-count-row {
  gap: 12px 18px;
}

.count-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(116px, 1fr));
  gap: 10px;
}

.count-field-row label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #5a6f8c;
  font-size: 12px;
  font-weight: 900;
}

.count-field-row select,
.count-field-row input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  color: #17243a;
  background: #fff;
  border: 1px solid #cfe0f7;
  border-radius: 10px;
  font-weight: 850;
}

.radio {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid #9fb0c7;
  border-radius: 50%;
}

.radio.on {
  background: #fff;
  border: 3px solid var(--blue);
}

.feature-tags {
  gap: 8px;
  margin-top: 0;
}

.feature-tags span,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  color: #245cc4;
  background: #eaf2ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.resolution-box {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding: 16px;
  background: linear-gradient(180deg, #fbfdff, #f6faff);
  border: 1px solid #d8e7fb;
  border-radius: 12px;
}

.resolution-box b {
  margin: 0;
}

.resolution-box label,
.resolution-box button {
  display: flex;
  align-items: center;
  gap: 7px;
}

.resolution-box button {
  padding: 0;
  color: #49607f;
  font: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.resolution-box button.active {
  color: var(--blue);
  font-weight: 800;
}

.resolution-box small {
  color: var(--muted);
}

.custom-resolution {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
}

.resolution-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 0 12px;
  border-right: 0;
  border-bottom: 1px solid #dbe8f8;
}

.resolution-title > div {
  display: grid;
  gap: 10px;
  min-width: 160px;
}

.resolution-title small {
  color: var(--blue);
  font-weight: 900;
  line-height: 1.45;
}

.resolution-title p {
  flex: 1 1 auto;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.image-engine-summary {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #cfe8df;
  border-radius: 10px;
  background: linear-gradient(135deg, #f2fcf8, #f8fffd);
}

.image-engine-summary.is-compat {
  border-color: #d7e2f0;
  background: #f8fbff;
}

.image-engine-summary.is-warning {
  border-color: #f4d9a6;
  background: #fffaf0;
}

.image-engine-mark {
  display: inline-flex;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  color: #047857;
  background: #d9f7e9;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .04em;
}

.image-engine-summary.is-compat .image-engine-mark {
  color: #2563eb;
  background: #e7f0ff;
}

.image-engine-summary.is-warning .image-engine-mark {
  color: #a16207;
  background: #ffedbf;
}

.image-engine-summary > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.image-engine-summary strong {
  color: #123c35;
  font-size: 13px;
  line-height: 1.3;
}

.image-engine-summary.is-compat strong {
  color: #23446d;
}

.image-engine-summary.is-warning strong {
  color: #824c0a;
}

.image-engine-summary p {
  margin: 0;
  overflow: hidden;
  color: #55766e;
  font-size: 11.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-engine-summary.is-compat p {
  color: #64748b;
}

.image-engine-summary.is-warning p {
  color: #956b2b;
}

.image-engine-status {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 5px 8px;
  color: #047857;
  background: #e1f8ec;
  border: 1px solid #b8e8cf;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.image-engine-summary.is-compat .image-engine-status {
  color: #35618f;
  background: #edf4ff;
  border-color: #d4e2f5;
}

.image-engine-summary.is-warning .image-engine-status {
  color: #9a620d;
  background: #fff2cf;
  border-color: #f1d698;
}

.image-model-choice {
  display: grid;
  gap: 10px;
  padding: 12px;
  background:
    radial-gradient(circle at 100% 0, rgba(93, 132, 255, .12), transparent 34%),
    linear-gradient(135deg, #f7fbff, #f5f9ff 58%, #fbfdff);
  border: 1px solid #cfe0f5;
  border-radius: 12px;
}

.image-model-choice-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.image-model-choice-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.image-model-choice-kicker {
  color: #5b76a0;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .12em;
}

.image-model-choice-title strong {
  color: #16345e;
  font-size: 14px;
  line-height: 1.25;
}

.image-model-choice-title p {
  margin: 0;
  color: #6d7f98;
  font-size: 11.5px;
  line-height: 1.4;
}

.image-model-select {
  display: grid !important;
  flex: 1 1 380px;
  gap: 5px !important;
  min-width: 240px;
  color: #53677f;
  font-size: 11px;
  font-weight: 900;
}

.image-model-select select {
  min-width: 0;
  height: 40px;
  color: #1b3c69;
  background: rgba(255, 255, 255, .92);
  border-color: #bcd2ef;
  font-size: 12px;
  font-weight: 850;
}

.image-model-choice-note {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .72);
}

.image-model-choice-note > span {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 42px;
  justify-content: center;
  padding: 4px 7px;
  color: #1d5eac;
  background: #e5f0ff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 950;
}

.image-model-choice-note.standard-only > span {
  color: #a15e0b;
  background: #fff0ca;
}

.image-model-choice-note p {
  margin: 0;
  color: #55708f;
  font-size: 11.5px;
  line-height: 1.4;
}

.resolution-mode-toggle {
  flex: 0 0 auto;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: fit-content;
  padding: 4px;
  background: #eef5ff;
  border: 1px solid #d4e2f4;
  border-radius: 999px;
}

.resolution-mode-toggle button {
  min-height: 30px;
  padding: 0 14px;
  color: #4d6079;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.resolution-mode-toggle button.active {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #6d5df5);
  box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}

.resolution-control-row {
  display: flex;
  min-width: 0;
  align-items: stretch;
}

.resolution-picker {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(180px, 1fr) minmax(128px, auto);
  gap: 12px;
  width: 100%;
  align-items: end;
}

.resolution-input-mode {
  display: inline-flex;
  grid-column: 1 / -1;
  width: fit-content;
  padding: 3px;
  background: #eef5ff;
  border: 1px solid #d4e2f4;
  border-radius: 8px;
}

.resolution-input-mode button {
  min-height: 32px;
  padding: 0 14px;
  color: #4d6079;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.resolution-input-mode button.active {
  color: #fff;
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .2);
}

.resolution-custom-error {
  display: none;
  grid-column: 1 / 3;
  margin: -3px 0 0;
  color: #c23737;
  font-size: 12px;
  font-weight: 800;
}

.resolution-custom-error.show {
  display: block;
}

.resolution-picker.disabled {
  opacity: .58;
}

.resolution-select-field {
  display: grid !important;
  gap: 8px !important;
  min-width: 0;
  color: #283a55;
  font-size: 13px;
  font-weight: 900;
}

.resolution-select-field span,
.resolution-submit-size span {
  color: #53677f;
  font-size: 12px;
  font-weight: 900;
}

.resolution-select-field select,
.resolution-select-field input {
  width: 100%;
  height: 48px;
  padding: 0 42px 0 14px;
  color: #17243a;
  background: #fff;
  border: 1px solid #cbdcf1;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 10px 24px rgba(31, 58, 92, .08);
  font: inherit;
  font-size: 15px;
  outline: 0;
}

.resolution-select-field select:focus,
.resolution-select-field input:focus {
  border-color: #6d5df5;
  box-shadow: 0 0 0 3px rgba(109, 93, 245, .16), 0 12px 28px rgba(31, 58, 92, .1);
}

.resolution-submit-size {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.resolution-submit-size b {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 0 13px;
  color: #245cc4;
  background: #edf5ff;
  border: 1px solid #d2e3f8;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.resolution-submit-size b strong {
  color: inherit;
  font: inherit;
}

.resolution-submit-size b small {
  color: #526d96;
  font-size: 11px;
  font-weight: 850;
}

.wizard-size-panel {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  width: 100%;
  gap: 12px;
}

.wizard-size-targets {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.wizard-size-target {
  position: relative;
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px !important;
  min-height: 94px;
  padding: 12px !important;
  align-items: start !important;
  color: #233650 !important;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,251,255,.92)) !important;
  border: 1px solid #d7e5f7 !important;
  border-radius: 14px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
}

.wizard-size-target.active {
  color: #133463 !important;
  border-color: #2f73ff !important;
  background:
    linear-gradient(135deg, rgba(239,247,255,.98), rgba(255,255,255,.96)) !important;
  box-shadow:
    0 14px 30px rgba(37, 99, 235, .13),
    inset 0 0 0 1px rgba(47, 115, 255, .14);
}

.wizard-size-target.disabled {
  opacity: .56;
}

.wizard-size-target-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #245cc4;
  background: #eaf2ff;
  border-radius: 10px;
}

.wizard-size-target span:nth-child(2) {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.wizard-size-target b {
  color: #17243a;
  font-size: 13px;
  line-height: 1.2;
}

.wizard-size-target small {
  color: #6a7b93;
  font-size: 11px;
  line-height: 1.45;
}

.wizard-size-target em {
  grid-column: 1 / -1;
  justify-self: start;
  min-height: 24px;
  padding: 0 9px;
  color: #2563eb;
  background: #edf5ff;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 24px;
}

.wizard-size-picker {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  background: rgba(255,255,255,.76);
  border: 1px solid #d6e4f5;
  border-radius: 14px;
}

.wizard-size-picker-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.wizard-size-picker-head b {
  color: #17243a;
  font-size: 13px;
}

.wizard-size-picker-head span {
  color: #2563eb;
  font-size: 11px;
  font-weight: 900;
}

.wizard-size-picker .resolution-presets button {
  min-height: 54px;
  padding: 8px 9px;
}

.resolution-inputs {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) 16px minmax(86px, 1fr);
  gap: 8px;
  align-items: center;
}

.resolution-inputs label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #415a7a;
  font-size: 12px;
  font-weight: 850;
}

.resolution-inputs label span {
  flex: 0 0 auto;
}

.resolution-inputs input {
  height: 40px;
  min-width: 0;
  border-color: #cfe0f7;
  background: #fff;
  font-weight: 800;
}

.resolution-inputs i {
  color: #6b7d95;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.resolution-presets {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 8px;
}

.resolution-presets button {
  min-height: 68px;
  min-width: 0;
  justify-content: center;
  padding: 10px 12px;
  color: #36526f;
  background: #fff;
  border: 1px solid #d1dff0;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 850;
  text-align: left;
  flex-direction: column;
  align-items: flex-start;
}

.resolution-presets button.active {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #4387ff);
  border-color: var(--blue);
  box-shadow: 0 14px 30px rgba(37, 99, 235, .18);
}

.resolution-presets button:disabled {
  cursor: not-allowed;
}

.resolution-presets button strong {
  font-size: 14px;
  line-height: 1.2;
}

.resolution-presets button small {
  display: grid;
  gap: 2px;
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  opacity: .78;
}

.resolution-presets button small span:last-child {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
  opacity: .9;
}

.ecom-page {
  max-width: 1500px;
  margin: 0 auto;
}

.ecom-head {
  align-items: stretch;
  margin-bottom: 18px;
}

.ecom-head-stats {
  display: grid;
  place-items: center;
  min-width: 138px;
  padding: 14px 18px;
  background: #f7fbff;
  border: 1px solid #d7e6f8;
  border-radius: 8px;
}

.ecom-head-stats b {
  color: #1f5ed5;
  font-size: 30px;
  line-height: 1;
}

.ecom-head-stats span {
  color: #61738e;
  font-size: 12px;
  font-weight: 850;
}

.ecom-layout {
  display: grid;
  grid-template-columns: minmax(420px, .82fr) minmax(560px, 1.18fr);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.ecom-panel,
.ecom-plan-panel {
  background: rgba(255,255,255,.95);
  border: 1px solid #dce9f8;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(31, 55, 92, .08);
}

.ecom-panel {
  padding: 20px;
}

.ecom-form-panel {
  position: sticky;
  top: 18px;
}

.ecom-mode-panel {
  margin-bottom: 0;
}

.ecom-form-panel .resolution-ecommerce {
  grid-template-columns: 1fr;
}

.ecom-form-panel .resolution-ecommerce .resolution-title {
  padding-right: 0;
  padding-bottom: 12px;
  border-right: 0;
  border-bottom: 1px solid #dbe8f8;
}

.ecom-form-panel .resolution-ecommerce .resolution-title > div {
  justify-content: space-between;
}

.ecom-form-panel .resolution-ecommerce .resolution-presets {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ecom-form-panel .resolution-ecommerce .resolution-presets button {
  min-height: 76px;
}

.ecom-mode-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.ecom-mode-panel .ecom-mode-row {
  margin-bottom: 0;
}

.ecom-mode-row button,
.ecom-style-grid button,
.ecom-template-card {
  min-width: 0;
  text-align: left;
  cursor: pointer;
}

.ecom-mode-row button {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 14px;
  color: #3f5470;
  background: #f8fbff;
  border: 1px solid #d7e6f8;
  border-radius: 8px;
}

.ecom-mode-row button.active {
  color: #174fb5;
  background: #eef5ff;
  border-color: #2563eb;
  box-shadow: 0 10px 24px rgba(37,99,235,.10);
}

.ecom-mode-row b,
.ecom-style-grid b,
.ecom-template-card b {
  overflow-wrap: anywhere;
}

.ecom-mode-row span,
.ecom-style-grid span,
.ecom-template-card p,
.ecom-template-card small {
  color: #61738e;
  line-height: 1.45;
}

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

.ecom-field-grid .full {
  grid-column: 1 / -1;
}

.ecom-field-grid textarea {
  min-height: 92px;
  resize: vertical;
}

.ecom-lang-box {
  padding: 12px;
  background: #f8fbff;
  border: 1px solid #d8e6f7;
  border-radius: 8px;
}

.ecom-lang-box p {
  margin: 0 0 10px;
  font-size: 12.5px;
}

.ecom-lang-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 0;
}

.ecom-lang-grid button {
  height: 38px;
  border-radius: 8px;
  font-size: 12px;
}

.ecom-upload,
.ecom-style-box {
  margin-top: 16px;
}

.ecom-mini-head,
.ecom-template-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ecom-mini-head span {
  color: #72829a;
  font-size: 12px;
  font-weight: 850;
}

.ecom-upload-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.ecom-upload-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  background: #edf4ff;
  border: 1px solid #dbe8f7;
  border-radius: 8px;
}

.ecom-upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ecom-upload-thumb span {
  position: absolute;
  right: 6px;
  bottom: 6px;
  left: 6px;
  overflow: hidden;
  padding: 4px 6px;
  color: #fff;
  background: rgba(22,33,52,.62);
  border-radius: 6px;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecom-style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ecom-style-grid button {
  display: grid;
  gap: 5px;
  min-height: 82px;
  padding: 12px;
  color: #39516e;
  background: #fff;
  border: 1px solid #d8e5f7;
  border-radius: 8px;
}

.ecom-style-grid button.active {
  color: #174fb5;
  background: #eef5ff;
  border-color: #2563eb;
}

.ecom-style-grid span {
  font-size: 12px;
}

.ecom-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 14px;
  background: #f7fbff;
  border: 1px solid #d8e6f7;
  border-radius: 8px;
}

.ecom-actions div {
  display: grid;
  gap: 3px;
}

.ecom-actions span {
  color: #61738e;
  font-size: 12px;
}

.ecom-template-head h2 {
  margin: 0;
  font-size: 22px;
}

.ecom-template-head p {
  margin: 5px 0 0;
}

.ecom-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
  margin-bottom: 12px;
}

.ecom-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ecom-template-card {
  display: grid;
  gap: 8px;
  min-height: 166px;
  padding: 14px;
  color: #24344f;
  background: #fff;
  border: 1px solid #d8e5f7;
  border-radius: 8px;
}

.ecom-template-card.active {
  border-color: #2563eb;
  background: #f0f6ff;
  box-shadow: 0 12px 26px rgba(37,99,235,.10);
}

.ecom-template-card > span {
  width: fit-content;
  padding: 3px 8px;
  color: #1f5ed5;
  background: #eaf2ff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.ecom-template-card b {
  font-size: 16px;
}

.ecom-template-card p,
.ecom-template-card small {
  margin: 0;
  font-size: 12.5px;
}

.ecom-package-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ecom-package-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
  padding: 13px;
  background: #f8fbff;
  border: 1px solid #d8e6f7;
  border-radius: 8px;
}

.ecom-package-card > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #1f5ed5;
  background: #eaf2ff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.ecom-package-card b {
  display: block;
  color: #24344f;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.ecom-package-card p {
  margin: 4px 0 0;
  color: #61738e;
  font-size: 12.5px;
  line-height: 1.45;
}

.ecom-plan-panel {
  margin-top: 18px;
  padding: 20px;
}

.ecom-plan-panel .page-head {
  gap: 16px;
  margin-bottom: 14px;
}

.ecom-plan-panel .page-head > div:first-child {
  min-width: 0;
}

.ecom-plan-panel .page-actions {
  flex: 0 0 auto;
}

.ecom-plan-panel .page-actions .primary {
  min-width: 128px;
}

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

.ecom-plan-card {
  display: grid;
  gap: 8px;
  min-height: 156px;
  padding: 14px;
  background: #f8fbff;
  border: 1px solid #d8e6f7;
  border-radius: 8px;
}

.ecom-plan-card span {
  width: fit-content;
  padding: 3px 8px;
  color: #fff;
  background: #2563eb;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.ecom-plan-card b {
  color: #24344f;
  overflow-wrap: anywhere;
}

.ecom-plan-card p {
  margin: 0;
  color: #506681;
  font-size: 13px;
  line-height: 1.5;
}

.ecom-plan-card small {
  color: #718198;
}

.field-box {
  margin-top: 18px;
  padding: 18px;
  background: #f8fbff;
  border: 1px dashed #b9d5ff;
  border-radius: 12px;
}

.copy-panel {
  background: #fff;
  border-style: solid;
}

.copy-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.copy-head h3 {
  margin: 0 0 6px;
}

.copy-head p {
  margin: 0;
}

.copy-status {
  flex: 0 0 auto;
  padding: 7px 12px;
  color: #9a4a10;
  background: #fff0e5;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.copy-status.ready {
  color: #047857;
  background: #e8fbf3;
}

.copy-option-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.copy-source-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.copy-source-options button {
  display: grid;
  gap: 6px;
}

.copy-source-options button b,
.copy-source-options button span {
  display: block;
}

.copy-source-options button span {
  color: #52657f;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.45;
}

.copy-source-options button.active span {
  color: #245cc4;
}

.copy-generate-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e1ebf7;
}

.copy-option {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 12px 14px;
  color: var(--ink);
  text-align: left;
  background: #f8fbff;
  border: 1px solid #d8e6f7;
  border-radius: 10px;
}

.copy-option.active {
  background: #eef5ff;
  border: 2px solid var(--blue);
}

.copy-option b {
  color: var(--blue);
}

.copy-option span {
  color: #52657f;
  line-height: 1.55;
}

.copy-empty {
  margin: 0;
  padding: 14px;
  background: #f8fbff;
  border: 1px dashed #c8dcf8;
  border-radius: 10px;
}

.custom-copy-intro {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.custom-copy-intro b,
.custom-copy-intro span {
  display: block;
}

.custom-copy-intro b {
  color: var(--blue);
}

.copy-textarea {
  margin-top: 14px;
}

.copy-textarea textarea {
  min-height: 180px;
  line-height: 1.62;
}

.copy-review-panel {
  margin-top: 16px;
  background: #fbfdff;
}

.copy-review-layout {
  display: grid;
  grid-template-columns: minmax(220px, .42fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.copy-review-aside,
.copy-review-editor {
  min-width: 0;
}

.copy-review-aside {
  display: grid;
  align-content: start;
  gap: 12px;
}

.copy-review-aside .copy-option-list {
  margin-top: 0;
}

.copy-review-note {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 14px;
  background: #f8fbff;
  border: 1px dashed #c8dcf8;
  border-radius: 10px;
}

.copy-review-note b {
  color: var(--blue);
}

.copy-review-note span {
  color: #52657f;
  font-weight: 700;
  line-height: 1.55;
}

.copy-review-editor .copy-textarea {
  height: 100%;
  margin-top: 0;
  grid-template-rows: auto 1fr;
}

.copy-review-panel .copy-textarea textarea {
  min-height: 430px;
  height: 100%;
}

.copy-review-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.copy-review-summary div {
  padding: 14px 16px;
  background: #f8fbff;
  border: 1px solid #d9e6f5;
  border-radius: 10px;
}

.copy-review-summary b,
.copy-review-summary span {
  display: block;
}

.copy-review-summary b {
  color: var(--blue);
  font-size: 20px;
  line-height: 1.2;
}

.copy-review-summary span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 28px;
}

.lang-grid button {
  height: 54px;
  background: #fff;
  border: 1px solid #d3e1f3;
  border-radius: 12px;
  font-weight: 900;
}

.lang-grid button.active {
  background: #f0f5ff;
  border: 2px solid var(--blue);
}

.big-input {
  margin-top: 26px;
}

.big-input input {
  height: 56px;
  border: 2px solid var(--blue);
  font-size: 16px;
}

.big-input textarea {
  min-height: 180px;
  border: 2px solid var(--blue);
  font-size: 16px;
}

.field-help {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.recommendation-grid {
  margin-top: 18px;
}

.recommendation-card {
  display: grid;
  gap: 12px;
}

.recommendation-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.recommendation-card b {
  color: #17233d;
}

.recommendation-card span {
  flex: 0 0 auto;
  padding: 4px 8px;
  color: #075985;
  background: #e8f6fb;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.recommendation-card p {
  margin: 0;
}

.upload-zone,
.result-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 280px;
  text-align: center;
  background: #f8fbff;
  border: 2px dashed #cfe0f7;
  border-radius: 14px;
}

.wizard-upload-zone {
  position: relative;
  gap: 10px;
  min-height: 230px;
  padding: 28px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, transform .16s ease;
}

.wizard-upload-zone:hover,
.wizard-upload-zone.dragging {
  background: #f4f8ff;
  border-color: #2f74ed;
  box-shadow: 0 18px 42px rgba(47, 116, 237, .13);
  transform: translateY(-1px);
}

.wizard-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.wizard-upload-zone input[type="file"][disabled] {
  cursor: not-allowed;
}

.wizard-upload-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: #175cd3;
  background: #eaf2ff;
  border-radius: 12px;
}

.wizard-upload-icon svg {
  width: 22px;
  height: 22px;
}

.wizard-upload-copy {
  display: grid;
  gap: 5px;
}

.wizard-upload-copy b {
  color: #17243a;
  font-size: 18px;
  font-weight: 950;
}

.wizard-upload-copy small,
.wizard-upload-rule {
  color: #60748f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

.upload-zone input {
  width: auto;
  height: auto;
  margin-top: 12px;
  border: 0;
}

.preview-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.preview-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f7faff;
  border: 1px solid #dbe8f8;
  border-radius: 10px;
}

.preview-list-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.preview-list-head b {
  color: #17243a;
  font-size: 14px;
}

.preview-list-head span {
  color: #60748f;
  font-size: 12px;
  font-weight: 800;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.image-loading-shell {
  position: relative;
  overflow: hidden;
  background: #f3f7ff;
}

.image-loading-shell::before {
  position: absolute;
  inset: 0;
  z-index: 2;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(110deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.76) 44%, rgba(255,255,255,0) 74%) -180% 0 / 220% 100% no-repeat,
    linear-gradient(135deg, #f6f9ff, #e7f0ff);
  transition: opacity .2s ease;
  animation: imageSkeletonSweep 1.1s ease-in-out infinite;
}

.image-loading-shell.image-loaded::before {
  opacity: 0;
  animation-play-state: paused;
}

.image-loading-shell.image-load-error::before {
  display: grid;
  place-items: center;
  color: #d92d2d;
  font-size: 13px;
  font-weight: 900;
  content: "图片加载失败";
  opacity: 1;
  background:
    linear-gradient(135deg, rgba(255,255,255,.86), rgba(255,241,241,.94)),
    repeating-linear-gradient(-45deg, rgba(227,49,49,.08) 0 8px, transparent 8px 16px);
  animation: none;
}

.loading-image {
  opacity: 0;
  transform: scale(1.012);
  transition: opacity .24s ease, transform .24s ease;
}

.image-loading-shell.image-loaded .loading-image {
  opacity: 1;
  transform: none;
}

.preview-frame {
  display: grid;
  grid-template-rows: 112px auto;
  min-width: 0;
  border: 1px solid #dbe8f8;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(23, 36, 58, .07);
}

.preview-frame.image-loading-shell::before {
  inset: 0 0 auto;
  height: 112px;
}

.preview-list .preview-frame img {
  width: 100%;
  height: 100%;
  min-width: 0;
  object-fit: cover;
  border: 0;
  border-radius: 10px 10px 0 0;
}

.preview-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px 10px;
  background: #fff;
}

.preview-meta b {
  overflow: hidden;
  color: #1d2c42;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-meta span {
  color: #2f74ed;
  font-size: 11px;
  font-weight: 900;
}

.preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  color: #17243a;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(219, 232, 248, .95);
  border-radius: 999px;
  box-shadow: 0 10px 18px rgba(23, 36, 58, .15);
  cursor: pointer;
}

.preview-remove svg {
  width: 15px;
  height: 15px;
}

.preview-remove:hover {
  color: #d92d2d;
  border-color: rgba(217, 45, 45, .24);
}

.preview-remove:disabled {
  cursor: not-allowed;
  opacity: .55;
}

@keyframes imageSkeletonSweep {
  to {
    background-position: 180% 0, 0 0;
  }
}

.upload-status {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 12px 14px;
  color: #245cc4;
  background: #f1f7ff;
  border: 1px solid #cfe0f7;
  border-radius: 10px;
  font-weight: 800;
}

.upload-status span {
  color: #52657f;
  font-weight: 700;
}

.upload-status.ready-status {
  color: #047857;
  background: #f0fdf7;
  border-color: #bcebd8;
}

.upload-status.error-status {
  color: var(--danger);
  background: #fff5f5;
  border-color: #ffc9c9;
}

.source-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.source-options button {
  min-height: 66px;
  text-align: left;
  padding: 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d3e1f3;
  border-radius: 10px;
  font-weight: 900;
}

.source-options button.active {
  background: #eef5ff;
  border: 2px solid var(--blue);
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #dfe8f5;
}

.copy-upload-actions {
  align-items: center;
}

.copy-upload-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.case-card {
  padding: 22px;
  border-radius: 0;
}

.case-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.case-card-head h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.case-card-head span {
  flex: 0 0 auto;
  min-width: 48px;
  padding: 7px 12px;
  color: var(--blue);
  text-align: center;
  background: #eaf2ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.case-media {
  overflow: hidden;
  padding: 10px;
  background: #fff;
  border: 1px solid #bdd6ff;
  border-radius: 14px;
}

.case-board-real {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
  background: #f7fbff;
  border: 1px solid #d9e7f9;
  border-radius: 12px;
}

.case-title-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  padding: 0 2px;
}

.case-title-row b {
  color: #071a35;
  font-size: 13px;
}

.case-title-row small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.case-photo {
  position: relative;
  overflow: hidden;
  min-height: 122px;
  background: #fff;
  border: 1px solid #e0e9f5;
  border-radius: 10px;
}

.case-product,
.case-scene {
  min-height: 156px;
}

.case-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-product img {
  object-fit: cover;
  object-position: center 74%;
}

.case-scene img {
  object-position: center 36%;
}

.case-detail img {
  object-position: center 64%;
}

.case-flatlay img {
  object-position: center 42%;
}

.case-photo span {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 3;
  padding: 4px 8px;
  color: #fff;
  background: rgba(8, 20, 38, .74);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.case-tags {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.case-tags span {
  padding: 5px 8px;
  color: #245cc4;
  background: #eaf2ff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.generated-long-card {
  position: sticky;
  top: 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: start;
  max-height: calc(100vh - 36px);
  overflow: hidden;
}

.generated-long-head {
  align-items: center;
}

.generated-long-head .mini {
  flex: 0 0 auto;
  height: 34px;
}

.generated-long-shell {
  min-height: 0;
  overflow: hidden;
  padding: 10px;
  background: #f7fbff;
  border: 1px solid #bdd6ff;
  border-radius: 14px;
}

.generated-long-scroll {
  overflow: auto;
  max-height: min(760px, calc(100vh - 184px));
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid #d9e7f9;
  border-radius: 10px;
}

.generated-long-frame {
  position: relative;
  margin: 0;
  background: #fff;
  border-bottom: 1px solid #e6eef9;
}

.generated-long-frame:last-child {
  border-bottom: 0;
}

.generated-long-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.generated-long-frame figcaption {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 20px);
  padding: 5px 8px;
  color: #fff;
  background: rgba(8, 20, 38, .74);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  backdrop-filter: blur(8px);
}

.generated-long-frame figcaption b {
  letter-spacing: 0;
}

.generated-long-frame figcaption span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 18px;
}

.copy-editor {
  min-height: 470px;
}

.notice {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.progress-view {
  position: relative;
  display: grid;
  justify-items: center;
  text-align: center;
  overflow: hidden;
  padding: 8px 0 0;
}

.progress-view::before {
  position: absolute;
  inset: 56px 8% auto;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(37,99,235,.36), transparent);
  animation: progress-scan 2.8s ease-in-out infinite;
}

.progress-pill {
  gap: 6px;
  animation: progress-rise .5s ease both;
}

.progress-pill span {
  width: 6px;
  height: 6px;
  background: var(--blue);
  border-radius: 50%;
  box-shadow: 11px 0 0 rgba(37,99,235,.55), 22px 0 0 rgba(37,99,235,.28);
  animation: dot-drift 1.2s steps(3) infinite;
}

.progress-view h2 {
  margin: 10px 0 6px;
  animation: progress-rise .55s ease .05s both;
}

.progress-lead {
  max-width: min(620px, 100%);
  margin: 0;
  overflow: hidden;
  color: #536783;
  font-weight: 700;
  white-space: nowrap;
  animation: text-reveal 1.6s steps(24) .18s both;
}

.progress-board {
  display: grid;
  grid-template-columns: 188px minmax(360px, 1fr);
  align-items: center;
  gap: 20px;
  width: min(740px, 100%);
  margin: 12px 0 10px;
}

.ring-wrap {
  display: grid;
  place-items: center;
  min-height: 138px;
}

.ring {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 58%, transparent 59%),
    conic-gradient(from -90deg, #2563eb var(--progress-angle), #dceaff 0);
  box-shadow: 0 18px 44px rgba(37,99,235,.16), inset 0 0 0 1px rgba(37,99,235,.08);
  animation: ring-breathe 1.9s ease-in-out infinite;
}

.ring::after {
  position: absolute;
  inset: 10px;
  content: "";
  border: 1px solid rgba(37,99,235,.14);
  border-radius: 50%;
  animation: ring-sweep 2.4s linear infinite;
}

.ring b {
  position: relative;
  z-index: 1;
  font-size: 29px;
  line-height: 1;
}

.ring small {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  color: #223452;
  font-weight: 900;
}

.stage-feed {
  display: grid;
  gap: 6px;
  text-align: left;
}

.stage-line {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 9px;
  align-items: center;
  min-height: 38px;
  padding: 6px 10px;
  opacity: 0;
  background: rgba(248,251,255,.86);
  border: 1px solid #e0ebf8;
  border-radius: 12px;
  transform: translateY(8px);
  animation: progress-rise .46s ease var(--delay) both;
}

.stage-line i {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #fff;
  background: #cad8ed;
  border-radius: 50%;
  font-style: normal;
}

.stage-line i .icon {
  width: 14px;
  height: 14px;
}

.stage-line b,
.stage-line span {
  display: block;
}

.stage-line b {
  font-size: 12px;
}

.stage-line span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.stage-line.active {
  border-color: rgba(37,99,235,.36);
  background: linear-gradient(90deg, #f6faff, #eef5ff);
  box-shadow: 0 12px 26px rgba(37,99,235,.08);
}

.stage-line.active i {
  background: var(--blue);
  animation: active-pulse 1.3s ease-in-out infinite;
}

.stage-line.active i::after {
  width: 8px;
  height: 8px;
  content: "";
  background: #fff;
  border-radius: 50%;
}

.stage-line.done {
  background: #fff;
}

.stage-line.done i {
  background: var(--blue);
}

.render-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(78px, 1fr));
  gap: 9px;
  width: min(600px, 100%);
  margin: 2px 0 10px;
}

.render-tile {
  position: relative;
  overflow: hidden;
  min-height: 48px;
  padding: 7px;
  opacity: 0;
  background: linear-gradient(145deg, #f8fbff, #edf4ff);
  border: 1px solid #dce9f8;
  border-radius: 12px;
  animation: progress-rise .5s ease var(--delay) both;
}

.render-tile::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(105deg, transparent 0 32%, rgba(255,255,255,.86) 45%, transparent 58% 100%);
  transform: translateX(-100%);
  animation: tile-shimmer 1.9s ease-in-out calc(var(--delay) + .35s) infinite;
}

.render-tile span,
.render-tile b,
.render-tile em {
  position: relative;
  z-index: 1;
  display: block;
  background: #dbe7f6;
  border-radius: 999px;
}

.render-tile span {
  width: 26px;
  height: 26px;
  margin: 0 auto 6px;
  border-radius: 10px;
  background: linear-gradient(145deg, #d8efe4, #9eb8e4);
}

.render-tile b {
  width: 74%;
  height: 6px;
  margin: 0 auto 5px;
}

.render-tile em {
  width: 48%;
  height: 5px;
  margin: 0 auto;
}

.progress-stats {
  animation: progress-rise .5s ease .42s both;
}

.progress-stats div {
  padding: 12px;
}

.progress-stats h3 {
  margin: 9px 0 0;
}

.progress-view > .muted {
  margin: 10px 0 8px;
}

.stat-row,
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.stat-row div,
.card,
.admin-card {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.prompt-gallery-page {
  max-width: 1500px;
  margin: 0 auto;
}

.prompt-gallery-head {
  align-items: flex-end;
}

.prompt-gallery-count {
  display: grid;
  min-width: 126px;
  padding: 13px 16px;
  color: #15325b;
  background: #fff;
  border: 1px solid #dce8f7;
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(16, 24, 40, .07);
}

.prompt-gallery-count b {
  font-size: 24px;
  line-height: 1;
}

.prompt-gallery-count span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.prompt-gallery-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  padding: 14px;
  background: #fff;
  border: 1px solid #dce8f7;
  border-radius: 10px;
  box-shadow: 0 16px 38px rgba(16, 24, 40, .06);
}

.prompt-gallery-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}

.prompt-gallery-tags button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  color: #40516b;
  background: #fff;
  border: 1px solid #dbe7f5;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.prompt-gallery-tags button.active {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #0f8bc0);
  border-color: transparent;
}

.prompt-gallery-tags b {
  font-size: 11px;
  opacity: .78;
}

.prompt-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 16px;
}

.prompt-gallery-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid #dce8f7;
  border-radius: 10px;
  box-shadow: 0 16px 38px rgba(16, 24, 40, .07);
}

.prompt-gallery-image {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  place-items: center;
  overflow: hidden;
  color: #7a8da8;
  background: #edf4ff;
  border: 0;
  border-radius: 0;
}

.prompt-gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prompt-gallery-card-body {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 13px;
}

.prompt-gallery-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.prompt-gallery-meta span,
.prompt-gallery-tagline em {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  min-height: 22px;
  padding: 0 8px;
  overflow: hidden;
  color: #1f5ca8;
  background: #eef6ff;
  border: 1px solid #d6e9ff;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompt-gallery-card h3 {
  display: -webkit-box;
  overflow: hidden;
  min-height: 44px;
  margin: 0;
  font-size: 16px;
  line-height: 1.38;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.prompt-gallery-card p {
  display: -webkit-box;
  overflow: hidden;
  min-height: 60px;
  margin: 0;
  color: #5b6a80;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.prompt-gallery-tagline {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  min-height: 22px;
}

.prompt-gallery-tagline em {
  color: #53637a;
  background: #f7faff;
  border-color: #e1eaf6;
}

.prompt-gallery-actions {
  display: grid;
  grid-template-columns: auto auto minmax(96px, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.prompt-gallery-actions .primary {
  min-width: 0;
  width: 100%;
  padding: 0 12px;
}

.prompt-gallery-actions .mini {
  min-width: 0;
  padding: 0 10px;
}

.prompt-gallery-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 24px 0 0;
}

.prompt-gallery-pager span {
  color: #40516b;
  font-weight: 850;
}

.prompt-gallery-skeleton {
  display: grid;
  gap: 12px;
  padding: 13px;
}

.prompt-gallery-skeleton div,
.prompt-gallery-skeleton span,
.prompt-gallery-skeleton p {
  display: block;
  margin: 0;
  background: linear-gradient(90deg, #edf4ff, #f8fbff, #edf4ff);
  background-size: 220% 100%;
  border-radius: 8px;
  animation: tile-shimmer 1.5s ease-in-out infinite;
}

.prompt-gallery-skeleton div {
  aspect-ratio: 4 / 3;
}

.prompt-gallery-skeleton span {
  width: 64%;
  height: 18px;
}

.prompt-gallery-skeleton p {
  width: 100%;
  height: 44px;
}

.prompt-gallery-detail {
  width: min(1180px, calc(100vw - 68px));
}

.prompt-gallery-detail-layout {
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(420px, 1.1fr);
  gap: 18px;
}

.prompt-gallery-detail-media {
  display: grid;
  gap: 10px;
  align-content: start;
}

.prompt-gallery-detail-media .image-loading-shell {
  overflow: hidden;
  background: #edf4ff;
  border: 1px solid #dce8f7;
  border-radius: 10px;
}

.prompt-gallery-detail-preview {
  display: block;
  width: 100%;
  padding: 0;
  cursor: zoom-in;
}

.prompt-gallery-detail-media img {
  display: block;
  width: 100%;
  max-height: 64vh;
  object-fit: contain;
}

.prompt-gallery-detail-copy {
  display: grid;
  gap: 12px;
  align-content: start;
}

.prompt-gallery-detail-copy section {
  overflow: hidden;
  border: 1px solid #dce8f7;
  border-radius: 10px;
  background: #fff;
}

.prompt-gallery-detail-copy h3 {
  margin: 0;
  padding: 12px 14px;
  color: #26384f;
  background: #f7faff;
  border-bottom: 1px solid #e4edf7;
  font-size: 14px;
}

.prompt-gallery-detail-copy pre {
  max-height: 34vh;
  margin: 0;
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #17243a;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.7;
}

.prompt-gallery-detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@keyframes progress-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes text-reveal {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes ring-breathe {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 18px 44px rgba(37,99,235,.16), inset 0 0 0 1px rgba(37,99,235,.08);
  }
  50% {
    transform: scale(1.025);
    box-shadow: 0 20px 50px rgba(37,99,235,.23), inset 0 0 0 1px rgba(37,99,235,.12);
  }
}

@keyframes ring-sweep {
  from {
    transform: rotate(0deg);
    border-top-color: rgba(37,99,235,.5);
  }
  to {
    transform: rotate(360deg);
    border-top-color: rgba(37,99,235,.5);
  }
}

@keyframes active-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(37,99,235,.22);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(37,99,235,0);
  }
}

@keyframes tile-shimmer {
  0% {
    transform: translateX(-100%);
  }
  58%, 100% {
    transform: translateX(100%);
  }
}

@keyframes dot-drift {
  0% {
    opacity: .32;
  }
  100% {
    opacity: 1;
  }
}

@keyframes progress-scan {
  0%, 100% {
    opacity: .2;
    transform: scaleX(.72);
  }
  50% {
    opacity: 1;
    transform: scaleX(1);
  }
}

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

.result-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.result-card {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,255,.96));
  border: 1px solid #d9e7f7;
  border-radius: 16px;
  box-shadow: 0 16px 38px rgba(31,89,180,.09);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.result-card:hover {
  border-color: #9cc3ff;
  box-shadow: 0 22px 52px rgba(31,89,180,.15);
  transform: translateY(-2px);
}

.result-preview {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--result-aspect, 1 / 1);
  overflow: hidden;
  padding: 0;
  background: #f3f7ff;
}

.result-preview img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  background:
    linear-gradient(135deg, rgba(245,248,255,.96), rgba(233,241,253,.94)),
    repeating-linear-gradient(45deg, rgba(37,99,235,.05) 0 10px, transparent 10px 20px);
}

.result-gallery .placeholder-img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: linear-gradient(145deg, #d7efc7, #1d4b41);
}

.admin-image-thumb {
  display: grid;
  gap: 8px;
  align-content: start;
}

.admin-image-frame {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid #dfeaf7;
  border-radius: 8px;
}

.admin-image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f3f7ff;
  border-radius: 8px;
}

.result-preview::after {
  position: absolute;
  inset: 0;
  z-index: 3;
  content: "";
  opacity: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(8,20,38,.42));
  transition: opacity .18s ease;
}

.result-card:hover .result-preview::after,
.result-card:hover .zoom-badge {
  opacity: 1;
}

.zoom-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  opacity: 0;
  background: rgba(10, 24, 44, .72);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 50%;
  backdrop-filter: blur(10px);
  transition: opacity .18s ease, transform .18s ease;
}

.result-card:hover .zoom-badge {
  transform: translateY(-1px);
}

.result-preview:disabled {
  cursor: wait;
}

.result-card.is-regenerating .result-preview img {
  filter: saturate(.75) brightness(.72);
}

.regenerate-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  gap: 8px;
  align-content: center;
  color: #fff;
  background: rgba(10, 24, 48, .58);
  text-align: center;
  pointer-events: none;
}

.regenerate-overlay b {
  font-size: 16px;
}

.regenerate-overlay small {
  padding: 6px 10px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  font-weight: 900;
}

.result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 14px;
}

.result-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.result-actions .mini {
  white-space: nowrap;
}

.result-meta small,
.result-size,
.result-meta b {
  display: block;
}

.result-meta small {
  color: #5e718d;
  font-size: 12px;
  font-weight: 900;
}

.result-size {
  margin-top: 3px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

.result-meta b {
  margin-top: 2px;
  color: #0b1d38;
  font-size: 20px;
  letter-spacing: 0;
}

.result-meta .mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: auto;
  padding: 0 10px;
}

.result-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #42526b;
  text-align: center;
}

.result-empty b {
  font-size: 15px;
}

.result-empty span {
  max-width: 320px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.running-empty {
  background:
    linear-gradient(135deg, rgba(255,255,255,.86), rgba(238,245,255,.9)),
    repeating-linear-gradient(-45deg, rgba(37,99,235,.055) 0 8px, transparent 8px 16px);
}

.simple-page {
  max-width: 1700px;
  margin: 0 auto;
}

.studio-page {
  max-width: 1700px;
  margin: 0 auto;
}

.page-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 0 0 26px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.page-actions,
.result-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.task-result-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: min(760px, calc(100vh - 210px));
}

.task-result-head {
  margin-bottom: 16px;
}

.task-result-view-stack {
  min-height: 0;
  margin-top: 16px;
  overflow: hidden;
}

.task-result-view {
  min-height: 0;
  height: 100%;
}

.task-result-view[hidden],
.task-result-view.is-hidden {
  display: none;
}

.task-result-view > .result-gallery,
.task-result-view > .result-empty {
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.task-result-view.modal-long-preview .generated-long-shell {
  height: 100%;
}

.task-result-view.modal-long-preview .generated-long-scroll {
  max-height: none;
  height: 100%;
}

.pack-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.long-image-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #175cd3;
  background: #eef5ff;
  border-color: #c8dbff;
}

.long-image-download:hover:not(:disabled) {
  color: #1044a7;
  background: #e5efff;
  border-color: #a9c6ff;
}

.banner-line,
.stats-row,
.simple-page .panel {
  margin-bottom: 14px;
}

.banner-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  color: var(--violet);
  background: #fff;
  border: 1px solid #e0e6ef;
  border-radius: 8px;
  font-weight: 900;
}

.banner-line button {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 16px;
  color: #fff;
  background: var(--blue);
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(37,99,235,.18);
  font-weight: 900;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e0e6ef;
  border-radius: 10px;
}

.stats-row div {
  padding: 12px;
  border: 1px solid #e0e6ef;
  border-radius: 8px;
}

.stats-row small {
  display: block;
  color: var(--muted);
}

.stats-row b {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.simple-page .panel {
  padding: 18px;
  border-radius: 10px;
  box-shadow: none;
}

.simple-page .panel h3 {
  margin: 0 0 14px;
}

.copy-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}

.copy-row.full input {
  flex: 1;
}

.copy-row button,
.wallet-cta button {
  min-width: 84px;
  height: 42px;
  padding: 0 14px;
  color: #fff;
  background: var(--violet);
  border-radius: 8px;
  font-weight: 900;
}

.wallet-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wallet-cta button {
  width: 100px;
  background: #078b7b;
  border-radius: 999px;
}

.wallet-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.wallet-balance-card,
.wallet-pay-card,
.wallet-rules-card,
.wallet-ledger-panel {
  background: rgba(255,255,255,.96);
  border: 1px solid #dce9f8;
  border-radius: 16px;
  box-shadow: 0 18px 46px rgba(31,89,180,.08);
}

.wallet-balance-card {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  padding: 28px;
  color: #fff;
  background:
    linear-gradient(135deg, #2465f0 0%, #7046d8 58%, #0aa6c2 100%);
}

.wallet-balance-card::after {
  position: absolute;
  right: -60px;
  bottom: -90px;
  width: 220px;
  height: 220px;
  content: "";
  border: 32px solid rgba(255,255,255,.16);
  border-radius: 50%;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 5px 10px;
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.wallet-balance-card strong {
  display: block;
  font-size: 56px;
  line-height: 1;
}

.wallet-balance-card p {
  max-width: 420px;
  color: rgba(255,255,255,.86);
}

.wallet-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.wallet-actions button {
  height: 38px;
  padding: 0 16px;
  color: #173464;
  background: #fff;
  border-radius: 999px;
  font-weight: 900;
}

.wallet-actions button + button {
  color: #fff;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.36);
}

.wallet-pay-card,
.wallet-rules-card {
  padding: 24px;
}

.wallet-rules-card {
  grid-column: 1 / -1;
}

.wallet-pay-card h3,
.wallet-rules-card h3 {
  margin: 0 0 16px;
  font-size: 22px;
}

.wallet-pay-card .history-title {
  padding-bottom: 12px;
  border-bottom: 1px solid #e6edf6;
}

.wallet-pay-card .history-title h3 {
  margin: 0;
}

.wallet-pay-card .history-title span {
  color: var(--muted);
  font-size: 13px;
}

.wallet-package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.wallet-package-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 16px;
  color: var(--ink);
  text-align: left;
  background: #f8fbff;
  border: 1px solid #dce8f7;
  border-radius: 8px;
}

.wallet-package-card:disabled {
  cursor: not-allowed;
}

.wallet-package-card:hover {
  border-color: var(--blue);
  box-shadow: 0 12px 26px rgba(37,99,235,.12);
}

.wallet-package-card.disabled,
.wallet-package-card.disabled:hover {
  opacity: .66;
  background: #f2f5f9;
  border-color: #d6dee9;
  box-shadow: none;
}

.wallet-package-card span,
.wallet-package-card em {
  color: var(--muted);
  font-style: normal;
}

.wallet-package-card span {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wallet-package-card span i {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  color: #b45309;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
}

.wallet-package-card b {
  color: var(--blue);
  font-size: 24px;
}

.wallet-package-card small {
  color: #101828;
  font-size: 28px;
  font-weight: 900;
}

.wallet-rule-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.wallet-rule-grid div {
  padding: 16px;
  background: #f6f9ff;
  border: 1px solid #e0e9f6;
  border-radius: 12px;
}

.wallet-rule-grid b {
  display: block;
  margin-bottom: 6px;
  color: var(--blue);
  font-size: 28px;
}

.wallet-rule-grid span,
.wallet-rules-card p {
  color: var(--muted);
}

.wallet-ledger-panel {
  padding: 20px;
}

.wallet-ledger-panel .history-title {
  padding-bottom: 14px;
  border-bottom: 1px solid #e6edf6;
}

.wallet-ledger-panel .history-title h3 {
  margin: 0;
  font-size: 22px;
}

.wallet-ledger-panel .history-title span {
  color: var(--muted);
  font-size: 13px;
}

.ledger-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.order-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.order-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 140px 90px auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: #fff;
  border: 1px solid #e5edf7;
  border-radius: 8px;
}

.order-copy b,
.order-copy span,
.order-copy small,
.order-money b,
.order-money span {
  display: block;
}

.order-copy span,
.order-copy small,
.order-money span {
  color: var(--muted);
  font-size: 13px;
}

.order-money {
  text-align: right;
}

.order-money b {
  font-size: 20px;
}

.ledger-item {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: #fff;
  border: 1px solid #e4ecf6;
  border-radius: 12px;
}

.ledger-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 900;
}

.ledger-icon.income {
  color: #047857;
  background: #e8fbf3;
}

.ledger-icon.expense {
  color: #d52d2d;
  background: #fff0f0;
}

.ledger-copy b,
.ledger-copy span,
.ledger-copy small {
  display: block;
}

.ledger-copy b {
  margin-bottom: 4px;
}

.ledger-copy span,
.ledger-copy small {
  color: var(--muted);
  font-size: 13px;
}

.ledger-copy small {
  margin-top: 3px;
}

.ledger-item em {
  min-width: 86px;
  text-align: right;
  font-size: 20px;
  font-style: normal;
  font-weight: 900;
}

.empty-ledger {
  padding: 34px;
  color: var(--muted);
  text-align: center;
  background: #f8fbff;
  border: 1px dashed #cfe0f7;
  border-radius: 12px;
}

.studio-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}

.studio-settings,
.studio-result {
  padding: 20px;
  background: rgba(255,255,255,.95);
  border: 1px solid #dce9f8;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.toolbox-page {
  max-width: 1720px;
  margin: 0 auto;
}

.toolbox-switch {
  display: inline-flex;
  margin: 0 0 18px;
  padding: 5px;
  background: #eaf2ff;
  border-radius: 999px;
}

.toolbox-switch button {
  flex: none;
  height: 38px;
  padding: 0 20px;
  border: 0;
  background: transparent;
  color: #36526f;
  border-radius: 999px;
  font-weight: 800;
}

.toolbox-switch button.active {
  color: #fff;
  background: var(--blue);
}

.toolbox-layout {
  display: grid;
  grid-template-columns: minmax(280px, .72fr) minmax(480px, 1.18fr) minmax(360px, .86fr);
  gap: 16px;
  align-items: start;
}

.toolbox-layout.utility-layout {
  grid-template-columns: minmax(280px, .72fr) minmax(560px, 1.28fr) minmax(360px, .86fr);
}

.toolbox-card-list,
.toolbox-workbench,
.toolbox-result {
  padding: 18px;
  background: rgba(255,255,255,.96);
  border: 1px solid #dce9f8;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

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

.toolbox-section-title {
  display: grid;
  gap: 4px;
  margin-bottom: 6px;
}

.toolbox-section-title h2 {
  margin: 0;
  font-size: 22px;
}

.toolbox-section-title span,
.toolbox-free-note {
  color: var(--muted);
  font-size: 13px;
}

.toolbox-free-note {
  margin: 8px 0 14px;
  padding: 10px 12px;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  font-weight: 800;
}

.toolbox-tool-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  width: 100%;
  padding: 14px;
  text-align: left;
  background: #fff;
  border: 1px solid #dde8f6;
  border-radius: 8px;
  cursor: pointer;
}

.toolbox-tool-card.active {
  border-color: var(--blue);
  background: #f0f5ff;
  box-shadow: inset 0 0 0 1px rgba(37,99,235,.38);
}

.toolbox-tool-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.toolbox-tool-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.toolbox-tool-card b {
  align-self: start;
  padding: 4px 8px;
  color: var(--blue);
  background: #eaf2ff;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.toolbox-tool-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--blue);
  background: #eaf2ff;
  border-radius: 8px;
}

.utility-layout .toolbox-tool-card {
  grid-template-columns: 42px 1fr auto;
  align-items: start;
}

.toolbox-option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.toolbox-option-row span {
  color: var(--ink);
  font-weight: 900;
}

.toolbox-option-row button {
  height: 34px;
  padding: 0 12px;
  color: #36526f;
  background: #fff;
  border: 1px solid #d8e4f4;
  border-radius: 999px;
  font-weight: 800;
}

.toolbox-option-row button.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.toolbox-option-row button:disabled {
  cursor: not-allowed;
  opacity: .5;
  color: #7d8da3;
  background: #f3f6fa;
  border-color: #dfe6ef;
}

.toolbox-batch-options,
.toolbox-file-prompts {
  display: grid;
  gap: 12px;
}

.toolbox-file-prompts label {
  display: grid;
  gap: 6px;
}

.toolbox-upload-zone {
  margin-top: 12px;
}

.vector-tool-layout {
  display: grid;
  grid-template-columns: minmax(190px, .55fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.vector-source-block,
.vector-controls {
  display: grid;
  gap: 12px;
}

.vector-upload-zone {
  margin: 0;
}

.vector-source-preview,
.vector-source-empty {
  min-height: 196px;
  overflow: hidden;
  background: #f8fbff;
  border: 1px solid #dfeaf7;
  border-radius: 8px;
}

.vector-source-preview {
  display: grid;
  place-items: center;
  padding: 8px;
}

.vector-source-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.vector-source-empty {
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.vector-source-meta {
  display: grid;
  gap: 3px;
  padding: 0 2px;
}

.vector-source-meta b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vector-source-meta span {
  color: var(--muted);
  font-size: 12px;
}

.vector-controls {
  padding: 14px;
  background: #f8fbff;
  border: 1px solid #dfeaf7;
  border-radius: 8px;
}

.vector-controls .toolbox-option-row {
  margin: 0;
}

.vector-controls .toolbox-option-row.is-disabled {
  opacity: .5;
}

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

.vector-range {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.vector-range span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.vector-range b {
  color: var(--blue);
  font-size: 12px;
}

.vector-range input {
  width: 100%;
  accent-color: var(--blue);
}

.vector-result-panel {
  min-width: 0;
}

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

.vector-result-grid > div {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.vector-result-grid > div > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.vector-result-frame {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dfeaf7;
  border-radius: 8px;
}

.vector-result-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.toolbox-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.toolbox-thumb {
  display: grid;
  gap: 6px;
  padding: 8px;
  min-height: 86px;
  background: #f8fbff;
  border: 1px solid #dfeaf7;
  border-radius: 8px;
}

.toolbox-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}

.toolbox-thumb-image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
}

.toolbox-thumb-image img {
  height: 100%;
}

.toolbox-thumb span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbox-thumb b {
  color: var(--ink);
  font-size: 12px;
}

.toolbox-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

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

.toolbox-field-grid.two,
.toolbox-field-grid.taobao-grid {
  grid-template-columns: minmax(0, 1fr) minmax(140px, .28fr);
}

.toolbox-field-grid.compact-count {
  grid-template-columns: minmax(120px, 220px);
}

.toolbox-field-grid label,
.title-word-grid label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 800;
}

.toolbox-field-grid small,
.title-word-grid small {
  color: var(--muted);
  font-weight: 500;
}

.toolbox-sku-list {
  display: grid;
  gap: 12px;
}

.toolbox-sku-block {
  padding: 14px;
  background: #f8fbff;
  border: 1px solid #dfeaf7;
  border-radius: 8px;
}

.toolbox-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.toolbox-metrics div {
  padding: 12px;
  background: #f8fbff;
  border: 1px solid #e3edf8;
  border-radius: 8px;
}

.toolbox-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.toolbox-metrics b {
  display: block;
  margin-top: 4px;
}

.taobao-result-box {
  display: grid;
  gap: 12px;
}

.taobao-result-box img {
  width: min(100%, 280px);
  justify-self: center;
  border: 1px solid #dfeaf7;
  border-radius: 8px;
}

.taobao-qr-box {
  width: min(100%, 280px);
  justify-self: center;
  aspect-ratio: 1;
  border-radius: 8px;
}

.taobao-qr-box img {
  width: 100%;
  height: 100%;
}

.taobao-result-box textarea {
  min-height: 96px;
  font-size: 12px;
}

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

.title-result-list,
.toolbox-file-results {
  display: grid;
  gap: 10px;
}

.title-result-list div,
.toolbox-file-results div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: #f8fbff;
  border: 1px solid #e2ecf8;
  border-radius: 8px;
}

.title-result-list span,
.toolbox-file-results span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.quality-field {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  font-weight: 900;
}

.quality-field input {
  accent-color: var(--blue);
}

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

.history-title h2 {
  margin: 0;
}

.history-title span {
  color: var(--ink);
}

.studio-settings .segmented {
  display: inline-flex;
  gap: 4px;
  margin: 10px 0;
  padding: 5px;
  background: #eaf2ff;
  border-radius: 999px;
}

.studio-settings .segmented button {
  flex: none;
  height: 38px;
  padding: 0 20px;
  color: #36526f;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
}

.studio-settings .segmented button.active {
  color: #fff;
  background: var(--blue);
}

.mode-note {
  display: grid;
  min-height: 100px;
  align-content: center;
  margin: 8px 0 0;
  padding: 18px;
  background: #f8fbff;
  border: 1px dashed #b9d5ff;
  border-radius: 13px;
}

.upload-zone.compact {
  position: relative;
  min-height: 160px;
  overflow: hidden;
}

.upload-zone.compact input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.studio-reference-editor {
  display: grid;
  grid-template-columns: minmax(220px, .95fr) minmax(190px, .8fr);
  gap: 14px;
  margin-top: 8px;
  padding: 12px;
  background: #f8fbff;
  border: 1px solid #d7e7fb;
  border-radius: 14px;
}

.studio-ref-canvas {
  position: relative;
  overflow: hidden;
  background: #edf4ff;
  border: 1px solid #cfe0f7;
  border-radius: 12px;
  cursor: crosshair;
  user-select: none;
  contain: layout paint;
}

.studio-ref-canvas img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  pointer-events: none;
}

.studio-ref-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 8px;
  margin-top: 10px;
  contain: layout paint;
}

.studio-ref-thumb {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 18px 10px 10px;
  color: #40516b;
  text-align: left;
  background: #ffffff;
  border: 1px solid #d7e7fb;
  border-radius: 12px;
  cursor: pointer;
  transition: none;
}

.studio-ref-thumb:hover,
.studio-ref-thumb:focus-within {
  border-color: #9bc2ff;
}

.studio-ref-thumb.sortable {
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.studio-ref-thumb.dragging {
  opacity: .32;
  cursor: grabbing;
}

.studio-ref-thumb.drag-over {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.studio-ref-thumb.active {
  color: #174bd6;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}

.studio-ref-index {
  position: absolute;
  top: 7px;
  left: 9px;
  z-index: 2;
  display: inline-flex;
  min-width: 28px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  color: #174bd6;
  background: #eef5ff;
  border: 1px solid #c8dcff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.studio-ref-add {
  position: relative;
  display: flex;
  min-height: 114px;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  background: #f7fbff;
  border: 1px dashed #9bc2ff;
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
}

.studio-ref-add:hover,
.studio-ref-add:focus-within {
  background: #eef6ff;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .10);
}

.studio-ref-add .icon {
  width: 34px;
  height: 34px;
  stroke-width: 2.2;
}

.studio-ref-add input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.studio-ref-add.is-disabled {
  color: #9aa7ba;
  background: #f3f6fa;
  border-color: #d8e2ef;
  cursor: not-allowed;
}

.studio-ref-add.is-disabled input {
  cursor: not-allowed;
}

.studio-ref-preview {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #eef5ff;
  border-radius: 8px;
}

.studio-ref-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.studio-ref-name {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: inherit;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: transparent;
}

.studio-ref-remove {
  position: absolute;
  display: inline-flex;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #d93025;
  background: #ffffff;
  border: 1px solid rgba(242, 162, 157, .95);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(184, 45, 45, .18);
  opacity: .96;
}

.studio-ref-remove .icon {
  width: 13px;
  height: 13px;
}

.studio-ref-remove:disabled {
  color: #a7b0c0;
  opacity: .45;
  cursor: not-allowed;
}

.studio-ref-sorting,
.studio-ref-sorting * {
  cursor: grabbing !important;
}

.studio-ref-drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  pointer-events: none;
  opacity: .96;
  box-shadow: 0 18px 42px rgba(23, 57, 124, .24);
  transform-origin: 0 0;
}

.studio-ref-drag-ghost .studio-ref-remove {
  display: none;
}

.studio-reference-editor .image-loading-shell.image-loaded::before {
  display: none;
}

.studio-reference-editor .image-loading-shell::before {
  display: none;
}

.studio-reference-editor .loading-image {
  opacity: 1;
  transform: none;
  transition: none;
}

.studio-mask-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.studio-ref-canvas.brush-cursor-active .studio-mask-canvas {
  cursor: none;
}

.studio-brush-cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  width: 28px;
  height: 28px;
  border: 2px solid #2563eb;
  border-radius: 50%;
  background: rgba(37,99,235,.12);
  box-shadow: 0 0 0 1px rgba(255,255,255,.8), 0 8px 18px rgba(37,99,235,.16);
  opacity: 0;
  pointer-events: none;
  transform: translate(-999px, -999px);
}

.studio-brush-cursor.is-visible {
  opacity: 1;
}

.studio-select-box {
  position: absolute;
  z-index: 2;
  border: 2px solid #2563eb;
  border-radius: 10px;
  background: rgba(37,99,235,.12);
  box-shadow: 0 0 0 999px rgba(8,20,38,.28);
  pointer-events: none;
}

.studio-ref-tools {
  display: grid;
  align-content: start;
  gap: 10px;
  color: #40516b;
  font-size: 13px;
}

.studio-ref-tools b {
  color: var(--ink);
}

.studio-ref-tools p {
  margin: 0;
  line-height: 1.55;
}

.studio-brush-panel {
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #eef6ff;
  border: 1px solid #d5e6fb;
  border-radius: 999px;
}

.studio-brush-panel span,
.studio-brush-panel b {
  color: #244668;
  font-size: 12px;
  white-space: nowrap;
}

.studio-brush-panel input {
  width: 100%;
  accent-color: var(--blue);
}

.studio-ref-tools > div:not(.studio-brush-panel),
.studio-tool-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.studio-tool-actions {
  align-items: center;
}

.studio-ref-tools .tool-button {
  display: inline-flex;
  width: auto;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.studio-ref-tools .tool-button.is-disabled {
  color: #9aa7ba;
  cursor: not-allowed;
  background: #f3f6fa;
  border-color: #e3e8f0;
}

.file-mini {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  color: #2457d6;
  background: #f7fbff;
  border-color: #c9dcfb;
}

.file-mini input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 16px 0;
}

.studio-settings .primary {
  margin-top: 16px;
}

.studio-result {
  min-height: 520px;
}

.result-placeholder {
  display: grid;
  min-height: 430px;
  margin-top: 18px;
  place-items: center;
  color: var(--muted);
  text-align: center;
  background: #f8fbff;
  border: 2px dashed #cfe0f7;
  border-radius: 14px;
}

.studio-progress {
  display: grid;
  min-height: 430px;
  margin-top: 18px;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: #506482;
  text-align: center;
  background: linear-gradient(180deg, #f8fbff, #f3f8ff);
  border: 1px solid #d7e7fb;
  border-radius: 14px;
}

.studio-progress h3 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 18px;
}

.studio-progress p {
  max-width: 360px;
  margin: 0;
  line-height: 1.6;
}

.small-ring {
  width: 96px;
  height: 96px;
  box-shadow: 0 14px 34px rgba(37,99,235,.14), inset 0 0 0 1px rgba(37,99,235,.08);
}

.small-ring b {
  font-size: 22px;
}

.small-ring small {
  font-size: 12px;
}

.error-placeholder {
  color: #b42318;
  background: linear-gradient(135deg, #fff7f7, #fff);
  border-color: #ffd0d0;
}

.error-placeholder b {
  font-size: 18px;
}

.error-placeholder p {
  max-width: 420px;
  margin: 8px 0 0;
  color: #8a2c2c;
  line-height: 1.6;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(4, 250px);
  gap: 18px;
}

.history-filter {
  display: flex;
  gap: 10px;
  margin: -8px 0 18px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.history-filter button {
  flex: 0 0 auto;
  min-width: 154px;
  padding: 10px 16px;
  text-align: left;
  color: #38506f;
  background: rgba(255,255,255,.74);
  border: 1px solid #d7e5f5;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(31,89,180,.06);
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
}

.history-filter button b,
.history-filter button span {
  display: block;
}

.history-filter button b {
  color: #142746;
  font-size: 13px;
  line-height: 1.2;
}

.history-filter button span {
  margin-top: 3px;
  color: #6b7c94;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.history-filter button.active {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #6548f4);
  border-color: transparent;
  box-shadow: 0 16px 34px rgba(37,99,235,.2);
}

.history-filter button.active b,
.history-filter button.active span {
  color: #fff;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
  color: var(--muted);
}

.pager-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pager .mini {
  min-width: 36px;
  justify-content: center;
}

.pager .mini.active {
  color: #fff;
  background: var(--violet);
  border-color: var(--violet);
}

.pager .mini:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.task-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid #cad9ee;
  border-radius: 10px;
  box-shadow: 0 12px 26px rgba(31,89,180,.08);
}

.task-card .body {
  padding: 14px;
}

.history-actions,
.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.history-actions {
  margin-top: 12px;
}

.task-card .cover {
  width: 100%;
  aspect-ratio: 1 / 1;
}

.image-cover {
  overflow: hidden;
  background: #f6f9ff;
}

.image-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder-cover {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 22px;
  color: #536783;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(255,255,255,.8), rgba(238,245,255,.82)),
    radial-gradient(circle at 28% 22%, rgba(37,99,235,.13), transparent 34%),
    #f6f9ff;
}

.placeholder-cover span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: #2563eb;
  background: #eaf2ff;
  border: 1px solid #cfe0f7;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 900;
}

.placeholder-cover b {
  color: var(--ink);
  font-size: 16px;
}

.placeholder-cover small {
  max-width: 160px;
  color: var(--muted);
  line-height: 1.45;
}

.placeholder-cover.failed {
  background:
    linear-gradient(135deg, rgba(255,255,255,.84), rgba(255,241,241,.9)),
    repeating-linear-gradient(-45deg, rgba(227,49,49,.08) 0 8px, transparent 8px 16px);
}

.placeholder-cover.failed span {
  color: #d92d2d;
  background: #fff0f0;
  border-color: #ffd0d0;
}

.placeholder-cover.cancelled span {
  color: #7b4de0;
  background: #f2ecff;
  border-color: #ded2ff;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid #edf2f8;
  text-align: left;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 34px;
  background: rgba(7, 14, 27, .68);
  backdrop-filter: blur(8px);
  z-index: 80;
}

.modal-frame {
  position: relative;
  width: min(1180px, calc(100vw - 68px));
  max-height: min(86vh, 920px);
}

.modal-box {
  position: relative;
  width: min(1180px, calc(100vw - 68px));
  max-height: min(86vh, 920px);
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,255,.98));
  border: 1px solid rgba(213,229,248,.95);
  border-radius: 20px;
  box-shadow: 0 34px 90px rgba(3, 14, 31, .32);
  padding: 24px;
}

.modal-frame .modal-box {
  width: 100%;
  max-height: inherit;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e1eaf6;
}

.modal-head h2 {
  margin: 10px 0 6px;
  font-size: 24px;
  line-height: 1.25;
}

.regenerate-box {
  width: min(760px, calc(100vw - 48px));
}

.regenerate-editor {
  display: grid;
  gap: 10px;
  color: #334766;
  font-size: 14px;
  font-weight: 900;
}

.regenerate-editor textarea {
  width: 100%;
  min-height: 360px;
  resize: vertical;
  padding: 14px;
  color: #17243a;
  background: #f8fbff;
  border: 1px solid #cbd9ec;
  border-radius: 10px;
  line-height: 1.65;
}

.regenerate-actions {
  margin-top: 18px;
}

.modal-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.icon-only {
  display: inline-grid;
  min-width: 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  line-height: 0;
  border-radius: 999px;
}

.modal-close {
  position: static;
  z-index: 5;
  flex: 0 0 36px;
  min-width: 36px;
  width: 36px;
  height: 36px;
  color: #667792;
  background: #edf4ff;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
}

.icon-only svg.icon {
  width: 18px;
  height: 18px;
}

.modal-close:hover {
  color: #15335f;
  background: #e3efff;
  transform: none;
}

.pay-modal {
  width: min(720px, calc(100vw - 32px));
  padding: 24px;
}

.pay-modal .modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.pay-modal .modal-head h2 {
  margin: 0 0 6px;
}

.pay-modal .modal-head p {
  margin: 0;
  color: var(--muted);
}

.recharge-pay-types {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.recharge-pay-type {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 7px 14px 7px 8px;
  color: #41526b;
  background: #fff;
  border: 1px solid #d7e3f2;
  border-radius: 10px;
  box-shadow: none;
}

.recharge-pay-type span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  background: #16a34a;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
}

.recharge-pay-type[data-pay-type="alipay"] span {
  background: #1677ff;
}

.recharge-pay-type:hover,
.recharge-pay-type.active {
  color: #164e63;
  background: #f0fdfa;
  border-color: #5eead4;
  transform: none;
}

.recharge-pay-type.active {
  box-shadow: 0 0 0 2px rgba(20, 184, 166, .12);
}

.recharge-pay-unavailable {
  margin: 0 0 18px;
  padding: 11px 13px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.pay-modal-body {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 22px;
  align-items: center;
}

.pay-qr-box {
  display: grid;
  place-items: center;
  min-height: 300px;
  background: #f8fbff;
  border: 1px solid #dce8f7;
  border-radius: 8px;
}

.pay-qr-box img {
  width: 260px;
  height: 260px;
  object-fit: contain;
  background: #fff;
}

.pay-window-guide {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 24px;
  text-align: center;
  background: #f8fbff;
  border: 1px solid #dce8f7;
  border-radius: 8px;
}

.pay-window-guide b {
  font-size: 24px;
}

.pay-window-guide p {
  max-width: 240px;
  color: var(--muted);
}

.wechat-pay-guide {
  gap: 12px;
}

.pay-qr-box {
  display: block;
  width: 260px;
  height: 260px;
  border: 1px solid #dce8f7;
  border-radius: 12px;
  background: #fff;
}

.pay-qr-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pay-qr-box.alipay-pay-frame-box {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 206px;
  height: 206px;
  min-height: 0;
  padding: 12px;
  overflow: hidden;
}

.pay-alipay-frame {
  display: block;
  width: 180px;
  height: 180px;
  border: 0;
  background: #fff;
}

.pay-order-copy {
  display: grid;
  gap: 10px;
}

.pay-order-copy span,
.pay-order-copy p {
  color: var(--muted);
}

.pay-order-copy strong {
  font-size: 42px;
  line-height: 1;
}

.pay-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 34px;
  padding: 0 12px;
  color: #075985;
  background: #e0f2fe;
  border-radius: 8px;
  font-weight: 800;
}

.support-modal {
  width: min(620px, calc(100vw - 32px));
}

.support-modal-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
  align-items: center;
}

.support-qr-box {
  display: grid;
  place-items: center;
  min-height: 260px;
  background: #f8fbff;
  border: 1px solid #dce8f7;
  border-radius: 8px;
}

.support-qr-box img {
  width: 220px;
  height: 220px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
}

.support-qr-empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  font-weight: 900;
}

.support-copy {
  display: grid;
  gap: 8px;
}

.support-copy b {
  color: var(--blue);
  font-size: 24px;
}

.support-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.home-popup-modal {
  z-index: 96;
  padding: 26px;
  background:
    radial-gradient(circle at 50% 20%, rgba(103, 130, 201, .2), transparent 34%),
    rgba(18, 28, 46, .58);
}

.home-popup-box {
  width: min(620px, calc(100vw - 36px));
  max-height: min(92vh, 800px);
  padding: 0;
  overflow: visible;
  border: 1px solid rgba(174, 157, 222, .72);
  border-radius: 30px;
  background:
    radial-gradient(circle at 78% 8%, rgba(219, 207, 255, .92), transparent 32%),
    radial-gradient(circle at 8% 76%, rgba(226, 241, 255, .95), transparent 36%),
    linear-gradient(145deg, rgba(255,255,255,.99), rgba(251,248,255,.99));
  box-shadow:
    0 34px 90px rgba(13, 22, 41, .34),
    inset 0 1px 0 rgba(255,255,255,.82);
}

.home-popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  min-width: 30px;
  height: 30px;
  color: #8b96a8;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.home-popup-close:hover {
  color: #253147;
  background: rgba(31, 41, 55, .06);
}

.home-popup-inner {
  display: grid;
  gap: 16px;
  max-height: min(92vh, 800px);
  overflow: auto;
  padding: 40px 36px 30px;
}

.home-popup-copy {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 0 34px;
  text-align: center;
}

.home-popup-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 20px;
  color: #6d56ca;
  background: rgba(111, 90, 204, .11);
  border: 1px solid rgba(129, 105, 218, .12);
  border-radius: 999px;
  font-size: 16px;
  font-weight: 900;
}

.home-popup-copy h2 {
  max-width: 100%;
  margin: 2px 0 0;
  color: #132033;
  font-size: clamp(30px, 4.6vw, 42px);
  line-height: 1.1;
  letter-spacing: 0;
  word-break: break-word;
}

.home-popup-copy p {
  max-width: 560px;
  margin: 0;
  color: #506078;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.78;
  word-break: break-word;
}

.home-popup-visual {
  padding: 14px;
  background: rgba(255,255,255,.74);
  border: 1px solid rgba(215, 225, 238, .95);
  border-radius: 24px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72);
}

.home-popup-image {
  display: grid;
  place-items: center;
  min-height: 220px;
  max-height: min(43vh, 410px);
  overflow: hidden;
  background:
    linear-gradient(135deg, #f8fbff, #f2f7ff);
  border-radius: 18px;
}

.home-popup-image img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(41vh, 390px);
  object-fit: contain;
  border-radius: 14px;
}

.home-popup-actions {
  display: grid;
  justify-items: center;
  margin-top: -2px;
}

.home-popup-action {
  min-width: 172px;
  height: 44px;
  padding: 0 28px;
  background: linear-gradient(135deg, #2f75ff, #7a5af8);
  box-shadow: 0 18px 34px rgba(60, 101, 228, .28);
}

.home-popup-box.image-only {
  width: min(600px, calc(100vw - 36px));
}

.home-popup-box.image-only .home-popup-inner {
  padding: 34px;
}

.home-popup-box.image-only .home-popup-visual {
  padding: 14px;
}

.home-popup-box.image-only .home-popup-image {
  min-height: 0;
  max-height: min(78vh, 760px);
  background: #fff;
}

.home-popup-box.image-only .home-popup-image img {
  max-height: min(76vh, 740px);
}

.task-modal .modal-head {
  align-items: flex-start;
}

.task-modal-layout {
  display: grid;
  grid-template-columns: minmax(420px, .95fr) minmax(420px, 1.05fr);
  align-items: stretch;
  gap: 18px;
  --task-modal-panel-height: min(68vh, 720px);
}

.modal-copy-panel,
.modal-result-panel {
  display: grid;
  min-width: 0;
  height: var(--task-modal-panel-height);
  overflow: hidden;
  padding: 18px;
  background: #fff;
  border: 1px solid #dbe8f7;
  border-radius: 16px;
}

.modal-copy-panel {
  grid-template-rows: auto minmax(0, 1fr);
}

.modal-result-panel {
  grid-template-rows: auto minmax(0, 1fr);
}

.modal-result-head {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid #e7eef8;
}

.modal-result-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.modal-result-topline > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.modal-result-topline h3 {
  margin: 0;
  color: #10223f;
  font-size: 17px;
  line-height: 1.25;
}

.modal-result-topline span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.modal-result-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  background: #f3f7fe;
  border: 1px solid #dbe8f7;
  border-radius: 12px;
}

.modal-result-switch button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  color: #526882;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.modal-result-switch button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.modal-result-switch button span,
.modal-result-switch button b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-result-switch button b {
  color: #7a8ba3;
  font-size: 11px;
  font-weight: 900;
}

.modal-result-switch button.active {
  color: #175cd3;
  background: #fff;
  border-color: #c8dbff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .12);
}

.modal-result-switch button.active b {
  color: #175cd3;
}

.modal-result-view-stack {
  min-height: 0;
  margin-top: 14px;
  overflow: hidden;
}

.modal-result-view {
  min-height: 0;
  height: 100%;
}

.modal-result-view[hidden],
.modal-result-view.is-hidden {
  display: none;
}

.modal-long-preview {
  min-height: 0;
  overflow: hidden;
}

.modal-long-preview .generated-long-shell {
  height: 100%;
  min-height: 0;
  padding: 10px;
}

.modal-long-preview .generated-long-scroll {
  max-height: none;
  height: 100%;
}

.modal-copy-body,
.modal-result-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.modal-result-body {
  height: 100%;
}

.modal-copy-panel .history-title {
  padding-bottom: 12px;
  border-bottom: 1px solid #e7eef8;
}

.modal-copy-panel .history-title h3 {
  margin: 0;
}

.modal-copy-panel .history-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.modal-reference-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e7eef8;
}

.reference-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.reference-title h3 {
  margin: 0;
  color: #10223f;
  font-size: 15px;
}

.reference-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 10px;
}

.reference-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  color: #16345e;
  text-align: left;
  background: #f8fbff;
  border: 1px solid #dbe8f7;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.reference-card:hover {
  border-color: rgba(37, 99, 235, .5);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .12);
  transform: translateY(-1px);
}

.reference-thumb {
  display: block;
  aspect-ratio: 1;
  width: 100%;
  border-radius: 8px;
  background: #eef5ff;
}

.reference-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reference-name {
  overflow: hidden;
  color: #536783;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-result-panel .result-gallery {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.modal-result-panel .result-gallery:not(.single-result-gallery) {
  align-content: start;
  grid-auto-rows: max-content;
  min-height: 100%;
}

.modal-result-panel .single-result-gallery {
  grid-template-columns: minmax(260px, 420px);
  justify-content: center;
  min-height: 100%;
}

.modal-result-panel .single-result-gallery .result-preview img {
  max-height: clamp(360px, 56vh, 560px);
}

.modal-result-panel .result-empty {
  min-height: 250px;
  margin-top: 14px;
  border: 1px solid #dce8f7;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff, #f5f9ff);
}

.modal-result-panel .running-empty {
  border-style: solid;
  background:
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(239,246,255,.96)),
    repeating-linear-gradient(-45deg, rgba(37,99,235,.045) 0 9px, transparent 9px 18px);
}

.modal-result-panel .running-empty::before {
  content: "";
  width: 34px;
  height: 34px;
  border: 3px solid #d8e8ff;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin .9s linear infinite;
}

.copy-display {
  display: grid;
  gap: 12px;
  max-height: 62vh;
  overflow: auto;
  margin-top: 14px;
  padding-right: 4px;
}

.modal-copy-body .copy-display {
  max-height: none;
  overflow: visible;
  margin-top: 0;
  padding-right: 0;
}

.copy-display section {
  padding: 14px 16px;
  background:
    linear-gradient(180deg, #fbfdff, #f4f8ff);
  border: 1px solid #e0eaf7;
  border-radius: 14px;
}

.copy-display section.copy-display-overview {
  background:
    radial-gradient(circle at 18% 0%, rgba(37, 99, 235, .10), transparent 32%),
    linear-gradient(180deg, #fbfdff, #f6f9ff);
  border-color: #cfe0fb;
}

.copy-display section.copy-display-script {
  position: relative;
  padding-left: 18px;
}

.copy-display section.copy-display-script::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2563eb, #8b5cf6);
}

.copy-display h4 {
  margin: 0 0 10px;
  color: #16345e;
  font-size: 15px;
}

.copy-display p {
  display: grid;
  grid-template-columns: minmax(86px, 132px) 1fr;
  gap: 10px;
  margin: 8px 0 0;
  color: #4c607c;
  line-height: 1.72;
  font-size: 13px;
}

.copy-display p:first-of-type {
  margin-top: 0;
}

.copy-display strong {
  color: #1d4f9a;
  font-weight: 900;
  word-break: keep-all;
}

.copy-display span {
  min-width: 0;
  word-break: break-word;
}

.copy-display p > span:only-child {
  grid-column: 1 / -1;
}

.empty-copy {
  display: block;
  color: var(--muted);
}

.image-lightbox {
  z-index: 120;
}

.lightbox-box {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(1120px, calc(100vw - 72px));
  max-height: calc(100vh - 72px);
  padding: 18px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(221,232,246,.92);
  border-radius: 20px;
  box-shadow: 0 34px 90px rgba(3,14,31,.38);
}

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

.lightbox-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lightbox-head .lightbox-title {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.lightbox-size {
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
}

.lightbox-head .mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lightbox-box img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 174px);
  margin: 0 auto;
  object-fit: contain;
  border-radius: 14px;
  background: #f3f7ff;
}

.lightbox-image-frame {
  display: grid;
  width: fit-content;
  max-width: 100%;
  min-width: min(520px, calc(100vw - 108px));
  min-height: min(420px, calc(100vh - 220px));
  place-items: center;
  margin: 0 auto;
  border-radius: 14px;
}

.lightbox-image-frame img {
  width: auto;
  height: auto;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #173464;
  background: rgba(255,255,255,.92);
  border: 1px solid #d7e4f4;
  border-radius: 50%;
  box-shadow: 0 16px 38px rgba(3,14,31,.18);
}

.lightbox-nav.prev {
  left: 18px;
}

.lightbox-nav.next {
  right: 18px;
}

.lightbox-count {
  justify-self: center;
  color: #5e718d;
  font-size: 12px;
  font-weight: 800;
}

/* Frontend refinement layer: smaller type, quieter cards, more product-tool polish. */
button {
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

button:hover {
  transform: translateY(-1px);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(37, 99, 235, .72);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .08);
}

.app-shell,
.admin-shell {
  grid-template-columns: 202px 1fr;
}

.sidebar {
  width: 202px;
  padding: 20px 14px;
}

.canvas-page {
  left: 202px;
}

.main {
  padding: 38px 48px 46px;
}

.topbar {
  top: 16px;
  right: 20px;
  min-height: 44px;
  gap: 8px;
  padding: 6px 8px;
  font-size: 13px;
  box-shadow: 0 10px 26px rgba(16, 24, 40, .08);
}

.avatar {
  width: 30px;
  height: 30px;
}

.brand strong {
  font-size: 17px;
}

.recharge {
  height: 40px;
  background: linear-gradient(135deg, #3669f4, #7058e8);
  box-shadow: 0 12px 24px rgba(37,99,235,.18);
  font-size: 14px;
}

.price-box {
  gap: 3px;
  padding: 9px 8px;
  font-size: 11.5px;
  line-height: 1.3;
  background: #f6f9ff;
  border-color: #d4e2f6;
  border-radius: 8px;
}

.nav-item {
  height: 39px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.nav-item.active {
  background: linear-gradient(135deg, #2f67f2, #654ee8);
  box-shadow: 0 10px 22px rgba(37,99,235,.16);
}

.hero {
  max-width: 1500px;
  margin: 0 auto 18px;
  padding: 0 4px;
  text-align: left;
}

.hero h1 {
  font-size: 28px;
  line-height: 1.18;
  font-weight: 850;
}

.hero .page-sub,
.page-sub {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.55;
}

.workflow {
  grid-template-columns: minmax(760px, 1fr) 390px;
  gap: 22px;
}

.panel,
.wizard-card,
.case-card,
.studio-settings,
.studio-result,
.wallet-balance-card,
.wallet-pay-card,
.wallet-rules-card,
.wallet-ledger-panel {
  border-color: #dde7f3;
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(16, 24, 40, .075);
}

.wizard-card {
  min-height: 620px;
  padding: 26px 30px 22px;
}

.stepper {
  gap: 10px;
  margin-bottom: 24px;
}

.dot {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.section-head {
  gap: 12px;
}

.section-head b {
  width: 29px;
  height: 29px;
  font-size: 13px;
}

.section-head h2,
.page-title {
  font-size: 26px;
  line-height: 1.22;
  font-weight: 850;
}

.section-head p,
.muted {
  font-size: 13.5px;
  line-height: 1.58;
}

.type-step-toolbar {
  margin: 16px 0 18px 41px;
}

.warn {
  margin: 0;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 800;
}

.type-grid {
  gap: 16px;
}

.type-card {
  min-height: 236px;
  padding: 18px;
  border-width: 1px;
  border-radius: 10px;
}

.type-card.selected {
  border-width: 1px;
  box-shadow: 0 16px 34px rgba(37,99,235,.08), inset 0 0 0 1px rgba(37,99,235,.72);
}

.card-check {
  top: 20px;
  left: 20px;
}

.type-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
}

.type-card-head {
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 12px;
  padding-left: 34px;
}

.type-card h3 {
  font-size: 17px;
}

.type-card p {
  margin: 7px 0 0;
  font-size: 13.5px;
}

.type-options {
  min-height: 0;
}

.radio-row,
.feature-tags {
  gap: 14px;
}

.feature-tags span,
.status-pill {
  min-height: 22px;
  padding: 0 8px;
  font-size: 11.5px;
}

.resolution-box,
.field-box {
  border-radius: 10px;
  background: #f7faff;
}

.big-input input {
  height: 52px;
  font-size: 15px;
}

.big-input textarea {
  min-height: 164px;
  font-size: 15px;
}

.upload-zone,
.result-empty {
  min-height: 252px;
  border-radius: 10px;
}

.copy-panel,
.copy-option,
.source-options button,
.lang-grid button,
.stats-row,
.stats-row div,
.simple-page .panel,
.task-card,
.ledger-item,
.result-card,
.copy-display section {
  border-radius: 8px;
}

.source-options button {
  min-height: 58px;
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 800;
}

.primary {
  height: 40px;
  min-width: 112px;
  padding: 0 18px;
  font-size: 14px;
  box-shadow: 0 12px 24px rgba(37, 99, 235, .18);
}

.ghost {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.mini {
  height: 28px;
  font-size: 12px;
}

.actions {
  margin-top: 26px;
  padding-top: 18px;
}

.case-card {
  padding: 20px;
}

.case-card-head h3 {
  font-size: 19px;
  line-height: 1.25;
}

.case-card-head p {
  margin: 0;
}

.case-media {
  padding: 8px;
  border-radius: 10px;
}

.case-board-real {
  border-radius: 8px;
}

.page-top,
.page-head {
  margin-bottom: 20px;
}

.banner-line {
  padding: 16px 18px;
  font-size: 13.5px;
}

.stats-row {
  gap: 10px;
  padding: 10px;
}

.stats-row b {
  font-size: 22px;
}

.wallet-balance-card {
  min-height: 190px;
  padding: 24px;
}

.wallet-balance-card strong {
  font-size: 48px;
}

.wallet-pay-card,
.wallet-rules-card,
.wallet-ledger-panel,
.studio-settings,
.studio-result {
  padding: 20px;
}

.wallet-pay-card h3,
.wallet-rules-card h3,
.wallet-ledger-panel .history-title h3,
.history-title h2 {
  font-size: 20px;
}

.studio-grid {
  gap: 16px;
}

.history-grid {
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 16px;
}

.task-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.38;
}

.task-card .body {
  padding: 13px;
}

.recharge,
.primary,
.ghost,
.mini,
.warn,
.feature-tags span,
.status-pill,
.source-options button,
.lang-grid button,
.tabs button,
.segmented button,
.copy-status,
.case-card-head span,
.copy-row button,
.wallet-cta button,
.wallet-actions button,
.banner-line,
.banner-line button,
.admin-tabs button,
.radio-row button.active,
.resolution-box button.active {
  font-weight: 800;
}

.type-card h3,
.simple-page .panel h3,
.wallet-pay-card h3,
.wallet-rules-card h3,
.wallet-ledger-panel .history-title h3,
.history-title h2,
.history-title h3,
.task-card h3,
.modal-head h2 {
  font-weight: 850;
}

.wallet-rule-grid b,
.ledger-item em,
.stats-row b {
  font-weight: 850;
}

.table th {
  font-weight: 800;
}

.table th,
.table td {
  font-size: 13px;
}

.api-key-cell {
  max-width: 360px;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.45;
  word-break: break-all;
}

.modal-box {
  border-radius: 14px;
}

.lightbox-box {
  border-radius: 14px;
}

.admin-main {
  grid-column: 2;
  min-width: 0;
  padding: 28px 34px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.admin-tabs button {
  height: 38px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
}

.admin-tabs button.active {
  color: #fff;
  background: var(--blue);
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.admin-form textarea {
  grid-column: 1 / -1;
}

.admin-form .full {
  grid-column: 1 / -1;
}

.admin-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 8px;
}

.admin-check-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 700;
}

.api-config-panel,
.api-list-panel {
  padding: 18px;
}

.api-list-panel {
  margin-top: 16px;
}

.api-config-editor {
  display: grid;
  grid-template-columns: minmax(280px, .95fr) minmax(420px, 1.35fr);
  gap: 14px;
  align-items: start;
}

.api-editor-section {
  padding: 14px;
  background: #f8fbff;
  border: 1px solid #e3edf9;
  border-radius: 10px;
}

.api-editor-section:nth-of-type(1),
.api-editor-section:nth-of-type(2) {
  grid-column: 1;
}

.api-editor-section:nth-of-type(3) {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.api-editor-section h3 {
  margin: 0 0 12px;
  color: #18283d;
  font-size: 15px;
  line-height: 1.3;
}

.api-editor-grid {
  margin-bottom: 0;
}

.api-capability-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.api-capability-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 70px;
  padding: 12px;
  background: #fff;
  border: 1px solid #dbe7f5;
  border-radius: 10px;
}

.api-capability-option input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.api-capability-option b {
  display: block;
  color: #162437;
  font-size: 13px;
  line-height: 1.25;
}

.api-capability-option small {
  display: block;
  margin-top: 4px;
  color: #66788f;
  font-size: 11px;
  line-height: 1.2;
}

.api-capability-option.tone-chat input {
  accent-color: #2563eb;
}

.api-capability-option.tone-image input {
  accent-color: #059669;
}

.api-capability-option.tone-tool input {
  accent-color: #b45309;
}

.api-model-help {
  display: block;
  margin-top: 5px;
  color: #66788f;
  font-size: 11px;
  line-height: 1.4;
}

.api-image-model-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.api-image-model-fieldset legend {
  margin-bottom: 8px;
  padding: 0;
  color: #405575;
  font-size: 13px;
  font-weight: 700;
}

.api-image-model-fieldset legend span {
  margin-left: 5px;
  color: #66788f;
  font-size: 11px;
  font-weight: 400;
}

.api-image-model-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.api-image-model-picker .api-image-model-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 12px 10px;
  background: #fff;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  cursor: pointer;
}

.api-image-model-option:has(input:checked) {
  background: #edf4ff;
  border-color: #5685f2;
  box-shadow: inset 0 0 0 1px #5685f2;
}

.api-image-model-option:has(input:focus-visible) {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}

body.admin-page-body .api-image-model-picker .api-image-model-option > input[type="checkbox"] {
  flex: 0 0 16px;
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: #2563eb;
}

.api-image-model-option > span {
  min-width: 0;
}

.api-image-model-option b {
  display: block;
  color: #243650;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.api-image-model-option code {
  display: block;
  margin-top: 3px;
  color: #66788f;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.api-image-model-fieldset:disabled {
  opacity: .55;
}

.api-image-model-fieldset:disabled .api-image-model-option {
  cursor: default;
}

.api-config-editor [hidden] {
  display: none;
}

.api-filter-form {
  grid-template-columns: 180px 160px minmax(180px, 220px) minmax(260px, 1fr);
  margin-bottom: 12px;
}

.api-config-list {
  margin-top: 12px;
}

.api-config-table {
  min-width: 980px;
}

.api-config-table th,
.api-config-table td {
  vertical-align: middle;
  white-space: nowrap;
}

.api-config-table td:first-child,
.api-config-table td:nth-child(2) {
  white-space: normal;
  min-width: 180px;
}

.api-config-table small {
  color: #66788f;
}

.api-config-table code {
  color: #8090a5;
  font-size: 10px;
}

.api-config-row.is-disabled {
  background: #f8fafc;
  opacity: .76;
}

.api-inline-priority {
  width: 84px;
  min-width: 84px;
  padding: 7px 8px;
  border: 1px solid #cfdced;
  border-radius: 6px;
  background: #fff;
  font-weight: 700;
  color: #203451;
}

.api-inline-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; }
.api-inline-switch .api-inline-enabled { position: absolute; width: 1px; min-width: 0; height: 1px; padding: 0; opacity: 0; }
.api-switch-track { display: inline-flex; align-items: center; width: 38px; height: 22px; padding: 3px; border-radius: 20px; background: #b7c1cf; transition: background .16s; }
.api-switch-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0003; transition: transform .16s; }
.api-inline-enabled:checked + .api-switch-track { background: #1677ff; }
.api-inline-enabled:checked + .api-switch-track .api-switch-thumb { transform: translateX(16px); }
.api-inline-enabled:focus-visible + .api-switch-track { outline: 3px solid #91caff; outline-offset: 3px; }
.api-inline-enabled:disabled + .api-switch-track { opacity: .5; cursor: wait; }
.api-inline-switch[aria-busy="true"] { cursor: wait; }
.api-inline-switch em { font-size: 12px; font-style: normal; color: #65758b; }
.api-inline-enabled:checked ~ em { color: #1677ff; }

.api-inline-models {
  display: inline-block;
  max-width: 260px;
  color: #304968;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.api-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
}

.api-config-card {
  display: grid;
  gap: 12px;
  min-height: 290px;
  padding: 14px;
  background: #fff;
  border: 1px solid #dce7f4;
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(18, 36, 64, .06);
}

.api-config-card.is-disabled {
  background: #f8fafc;
  opacity: .78;
}

.api-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.api-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #172033;
}

.api-card-title strong {
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-id {
  flex: none;
  color: #66788f;
  font-size: 12px;
  font-weight: 900;
}

.api-card-provider {
  margin-top: 4px;
  color: #66788f;
  font-size: 12px;
  line-height: 1.35;
}

.api-status {
  flex: none;
  min-width: 48px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.api-status.is-on {
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
}

.api-status.is-off {
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #dbe3ef;
}

.api-card-endpoint {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 9px 10px;
  background: #f8fbff;
  border: 1px solid #e4edf8;
  border-radius: 8px;
}

.api-card-endpoint span {
  min-width: 0;
  overflow: hidden;
  color: #334155;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-card-endpoint code,
.api-model-row code {
  color: #172033;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.api-card-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 28px;
}

.api-chip,
.api-model-row > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.tone-chat {
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.tone-image {
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.tone-tool {
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.tone-neutral {
  color: #475569;
  background: #f8fafc;
  border: 1px solid #dbe3ef;
}

.api-model-list {
  display: grid;
  gap: 7px;
}

.api-model-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 32px;
}

.api-model-row code {
  min-width: 0;
  overflow: hidden;
  padding: 7px 9px;
  background: #f8fafc;
  border: 1px solid #e4edf8;
  border-radius: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-image-model-value {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 7px 9px;
  background: #f8fffc;
  border: 1px solid #d4eee1;
  border-radius: 8px;
}

.api-image-model-value.quality {
  background: #fffaf1;
  border-color: #f1dfb8;
}

.api-image-model-value.legacy,
.api-image-model-value.custom {
  background: #f8fafc;
  border-color: #e4edf8;
}

.api-image-model-value strong {
  overflow: hidden;
  color: #0f6b51;
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-image-model-value.quality strong {
  color: #9a620d;
}

.api-image-model-value.legacy strong,
.api-image-model-value.custom strong {
  color: #475569;
}

.api-image-model-value small {
  color: #5a7e70;
  font-size: 11px;
  line-height: 1.25;
}

.api-image-model-value.quality small {
  color: #9a7b45;
}

.api-image-model-value.legacy small,
.api-image-model-value.custom small {
  color: #718198;
}

.api-image-model-value code {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  color: #172033;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 11px;
  text-overflow: ellipsis;
}

.api-card-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.api-card-meta span {
  min-height: 48px;
  padding: 8px 10px;
  background: #fbfdff;
  border: 1px solid #e8f0fa;
  border-radius: 8px;
  color: #172033;
  font-size: 13px;
  font-weight: 850;
}

.api-card-meta b {
  display: block;
  margin-bottom: 4px;
  color: #718198;
  font-size: 11px;
  font-weight: 900;
}

.api-card-remark {
  min-height: 18px;
  margin: -2px 0 0;
  color: #66788f;
  font-size: 12px;
  line-height: 1.5;
}

.api-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  padding-top: 2px;
  margin-top: auto;
}

@media (max-width: 760px) {
  .api-config-panel,
  .api-list-panel {
    padding: 12px;
  }

  .api-config-editor,
  .api-filter-form,
  .api-capability-picker,
  .api-card-grid {
    grid-template-columns: 1fr;
  }

  .api-editor-section:nth-of-type(1),
  .api-editor-section:nth-of-type(2),
  .api-editor-section:nth-of-type(3) {
    grid-column: auto;
    grid-row: auto;
  }

  .api-capability-option {
    min-height: 62px;
  }

  .api-card-grid {
    gap: 10px;
  }

  .api-config-card {
    min-height: 0;
    padding: 12px;
  }

  .api-card-head,
  .api-card-endpoint {
    grid-template-columns: 1fr;
  }

  .api-card-head {
    display: grid;
  }

  .api-status {
    justify-self: start;
  }

  .api-card-endpoint code {
    justify-self: start;
  }

  .api-card-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .api-card-meta {
    grid-template-columns: 1fr;
  }

  .api-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .api-card-actions .mini {
    width: 100%;
  }
}

.toolbox-prompt-card {
  margin-bottom: 14px;
}

.toolbox-prompt-card .admin-section-head {
  padding: 0 0 12px;
}

.toolbox-prompt-card label {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  font-weight: 800;
  color: var(--text);
}

.toolbox-prompt-card textarea {
  min-height: 150px;
  resize: vertical;
}

.toolbox-prompt-card .badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  color: #1456d9;
  background: #edf4ff;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.admin-action-bar,
.admin-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-action-bar {
  margin: -4px 0 14px;
}

.billing-package-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 12px;
}

.billing-package-head h4 {
  margin: 0;
  font-size: 16px;
}

.billing-package-list {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.billing-package-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 120px 120px 150px 150px minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: #f8fbff;
  border: 1px solid #dce8f7;
  border-radius: 8px;
}

.billing-package-row .full {
  grid-column: auto;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card {
  min-height: 104px;
  padding: 18px;
}

.metric-card small {
  color: #5c6b82;
  font-size: 13px;
}

.metric-card h2 {
  margin: 14px 0 0;
  font-size: 28px;
}

.admin-section {
  padding: 0;
  overflow: hidden;
}

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
}

.admin-section-head h2 {
  margin: 0;
}

.admin-section-head p {
  margin: 4px 0 0;
}

.table-scroll {
  overflow: auto;
  border: 1px solid #edf2f8;
  border-radius: 10px;
  background: #fff;
}

.table-scroll .table {
  min-width: 920px;
  border: 0;
  border-radius: 0;
}

.admin-table {
  table-layout: fixed;
}

.admin-table th {
  color: #41516b;
  background: #f8fbff;
  font-size: 12px;
  white-space: nowrap;
}

.admin-table td {
  vertical-align: middle;
}

.admin-table .num {
  width: 78px;
  white-space: nowrap;
}

.admin-table .wide {
  width: 32%;
}

.table-scroll .video-task-admin-table {
  min-width: 1380px;
}

.video-task-admin-table th:nth-child(7),
.video-task-admin-table td:nth-child(7) {
  width: 300px;
}

.video-task-result-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.video-task-result-cell code {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #26364c;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-task-result-cell .mini {
  flex: 0 0 auto;
}

.video-task-result-missing {
  color: #c2410c;
  font-size: 12px;
  font-weight: 750;
}

.admin-url-cell,
.api-key-cell,
.log-summary {
  word-break: break-word;
}

.redeem-code-cell {
  font-family: Consolas, "Courier New", monospace;
  white-space: nowrap;
}

.table-scroll .log-table {
  min-width: 1180px;
}

.table-scroll .compact-log-table {
  min-width: 980px;
}

.admin-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}

.log-summary {
  display: block;
  max-height: 3.4em;
  overflow: hidden;
  color: #25344d;
  line-height: 1.7;
}

.admin-log-modal pre {
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-current-tab {
  display: none;
}

.admin-nav {
  margin-top: 28px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  color: #29435f;
  background: #edf4fb;
  border: 1px solid #d8e7f5;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.status-unused {
  color: #086b51;
  background: #e9f8f2;
  border-color: #bfe8d8;
}

.status-used {
  color: #4b5565;
  background: #f2f4f7;
  border-color: #d7dde8;
}

.status-success {
  color: #086b51;
  background: #e9f8f2;
  border-color: #bfe8d8;
}

.status-pending,
.status-running {
  color: #175cd3;
  background: #eff6ff;
  border-color: #bfd7ff;
}

.status-failed {
  color: #b42318;
  background: #fff1f0;
  border-color: #ffc9c4;
}

.status-expired,
.status-disabled,
.status-cancelled {
  color: #a33b11;
  background: #fff2ea;
  border-color: #ffd1bc;
}

.danger {
  color: #fff;
  background: var(--danger);
}

.ok {
  color: var(--ok);
  font-weight: 900;
}

.error {
  color: var(--danger);
  font-weight: 900;
}

.clone-page {
  display: grid;
  gap: 22px;
}

.clone-create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

.clone-main-panel,
.clone-side-panel,
.clone-submit-panel,
.clone-progress-panel {
  background: #fff;
  border: 1px solid #dfe8f5;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(37, 52, 77, .08);
}

.clone-main-panel {
  padding: 22px;
  display: grid;
  gap: 18px;
}

.clone-side-panel,
.clone-submit-panel {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.clone-mode-row {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(420px, 100%);
  gap: 8px;
  padding: 6px;
  background: #edf4fb;
  border-radius: 8px;
}

.clone-mode-row button {
  border: 0;
  background: transparent;
  color: #53677f;
  border-radius: 6px;
  padding: 10px 12px;
  font-weight: 900;
}

.clone-mode-row button.active {
  background: #fff;
  color: #175cd3;
  box-shadow: 0 8px 18px rgba(23, 92, 211, .12);
}

.clone-strength-box {
  display: grid;
  gap: 10px;
}

.clone-strength-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.clone-strength-head b {
  color: #172033;
  font-size: 14px;
}

.clone-strength-head span {
  color: #64748b;
  font-size: 12px;
  text-align: right;
}

.clone-strength-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(560px, 100%);
}

.clone-custom-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid #dbe8f8;
  border-radius: 8px;
  background: #f8fbff;
}

.clone-custom-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
}

.clone-custom-head b,
.clone-option-group > span,
.clone-custom-requirement {
  color: #172033;
  font-size: 13px;
  font-weight: 900;
}

.clone-custom-head span {
  color: #64748b;
  font-size: 12px;
  text-align: right;
}

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

.clone-option-group {
  display: grid;
  gap: 8px;
}

.clone-option-group > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.clone-option-group button {
  border: 1px solid #d5e3f4;
  background: #fff;
  color: #53677f;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
}

.clone-option-group button.active {
  border-color: #175cd3;
  color: #175cd3;
  background: #eef5ff;
}

.clone-custom-requirement {
  display: grid;
  gap: 8px;
}

.clone-custom-requirement textarea {
  min-height: 82px;
  resize: vertical;
}

.clone-upload-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.clone-upload-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dbe8f8;
  border-radius: 8px;
  background: #f8fbff;
}

.clone-upload-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.clone-upload-head h3,
.clone-side-panel h3,
.clone-submit-panel h3 {
  margin: 0;
  color: #25344d;
}

.clone-upload-head p,
.clone-side-panel p,
.clone-submit-panel p {
  margin: 4px 0 0;
  color: #68788e;
  line-height: 1.6;
}

.compact-drop {
  min-height: 132px;
}

.upload-drop {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 18px;
  overflow: hidden;
  cursor: pointer;
  text-align: center;
  background: #fff;
  border: 1px dashed #b7cff1;
  border-radius: 8px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, transform .16s ease;
}

.upload-drop:hover {
  background: #f5f9ff;
  border-color: #2f74ed;
  box-shadow: 0 12px 28px rgba(47, 116, 237, .12);
  transform: translateY(-1px);
}

.upload-drop input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-drop > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #175cd3;
  background: #eaf2ff;
  border-radius: 8px;
}

.upload-drop > span svg {
  width: 18px;
  height: 18px;
}

.upload-drop b {
  color: #172033;
  font-size: 14px;
}

.upload-drop small {
  color: #53677f;
  font-size: 12px;
  font-weight: 800;
}

.clone-upload-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: 210px;
  overflow: auto;
}

.clone-upload-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: #edf4fb;
}

.clone-upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.clone-upload-thumb span {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  padding: 4px 6px;
  color: #fff;
  background: rgba(22, 33, 52, .62);
  border-radius: 5px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clone-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 4px;
}

.clone-actions div,
.clone-cost-box {
  display: grid;
  gap: 4px;
}

.clone-actions b,
.clone-cost-box b {
  color: #25344d;
  font-size: 22px;
}

.clone-actions span,
.clone-cost-box span {
  color: #68788e;
}

.clone-steps-mini {
  display: grid;
  gap: 10px;
}

.clone-steps-mini span {
  padding: 10px 12px;
  border: 1px solid #dbe8f8;
  border-radius: 8px;
  background: #f8fbff;
  color: #53677f;
  font-weight: 800;
}

.clone-steps-mini span.done {
  color: #086b51;
  background: #e9f8f2;
  border-color: #bfe8d8;
}

.clone-progress-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.clone-progress-panel h3 {
  margin: 0 0 4px;
  color: #25344d;
}

.clone-progress-panel p {
  margin: 0;
  color: #68788e;
}

.clone-work-head {
  align-items: end;
}

.clone-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

.clone-items {
  display: grid;
  gap: 14px;
}

.clone-item-card {
  display: grid;
  grid-template-columns: minmax(260px, 42%) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  background: #fff;
  border: 1px solid #dfe8f5;
  border-radius: 8px;
}

.clone-item-media {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.clone-ref,
.clone-result,
.clone-modal-item button {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dbe8f8;
  border-radius: 8px;
  background: #f5f8fd;
}

.clone-ref img,
.clone-result img,
.clone-modal-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f2f6fb;
}

.clone-ref span {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(22, 33, 52, .68);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.clone-ref em,
.clone-result em {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #68788e;
  font-style: normal;
  font-weight: 900;
}

.clone-item-editor {
  display: grid;
  gap: 10px;
}

.clone-item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.clone-item-title b {
  color: #25344d;
}

.clone-item-title span {
  color: #175cd3;
  font-size: 12px;
  font-weight: 900;
}

.clone-item-editor textarea {
  min-height: 132px;
  resize: vertical;
}

.clone-item-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.clone-submit-panel {
  position: sticky;
  top: 24px;
}

.clone-regenerate-modal textarea {
  min-height: 220px;
}

.clone-task-modal-frame {
  width: min(1280px, calc(100vw - 68px));
}

.clone-modal-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.clone-modal-side {
  position: sticky;
  top: 0;
  display: grid;
  gap: 14px;
}

.clone-modal-param-panel,
.clone-modal-asset-panel,
.clone-modal-confirm-panel,
.clone-modal-results {
  min-width: 0;
  padding: 16px;
  background: #fff;
  border: 1px solid #dbe8f7;
  border-radius: 14px;
}

.clone-modal-param-panel .history-title,
.clone-modal-asset-panel .history-title,
.clone-modal-results .history-title {
  padding-bottom: 12px;
  border-bottom: 1px solid #e7eef8;
}

.clone-modal-confirm-panel {
  display: grid;
  gap: 12px;
  background:
    linear-gradient(180deg, #f8fbff, #eef6ff);
}

.clone-modal-confirm-panel h3 {
  margin: 0;
  color: #173158;
}

.clone-modal-confirm-panel p {
  margin: 5px 0 0;
  color: #60728d;
  font-size: 13px;
  line-height: 1.6;
}

.clone-modal-param-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.clone-modal-param-grid div {
  min-width: 0;
  padding: 10px;
  background: #f8fbff;
  border: 1px solid #e1ebf8;
  border-radius: 10px;
}

.clone-modal-param-grid span,
.clone-modal-requirement span,
.clone-modal-prompt span {
  display: block;
  margin-bottom: 4px;
  color: #6b7c95;
  font-size: 12px;
  font-weight: 900;
}

.clone-modal-param-grid b {
  display: block;
  min-width: 0;
  color: #173158;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clone-modal-requirement {
  margin-top: 12px;
  padding: 12px;
  color: #203858;
  background: #f8fbff;
  border: 1px solid #e1ebf8;
  border-radius: 10px;
}

.clone-modal-requirement p,
.clone-modal-prompt p {
  margin: 0;
  color: #263a58;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.clone-modal-asset-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.clone-modal-asset-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  color: #173158;
  text-align: left;
  background: #f8fbff;
  border: 1px solid #dbe8f7;
  border-radius: 10px;
}

.clone-modal-asset-card span {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f1f6fd;
  border-radius: 8px;
}

.clone-modal-asset-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.clone-modal-asset-card b {
  min-width: 0;
  color: #25344d;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clone-modal-result-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.clone-modal-item-card {
  display: grid;
  grid-template-columns: minmax(250px, 36%) minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 14px;
  background: #f8fbff;
  border: 1px solid #dbe8f7;
  border-radius: 12px;
}

.clone-modal-image-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-self: start;
}

.clone-modal-image-pair .clone-result span,
.clone-modal-image-pair .clone-ref span {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(22, 33, 52, .68);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.clone-modal-item-info {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.clone-modal-subtitle,
.clone-modal-badges {
  margin: 0;
  color: #435875;
  line-height: 1.55;
}

.clone-modal-badges {
  color: #175cd3;
  font-size: 13px;
  font-weight: 900;
}

.clone-modal-prompt {
  max-height: 150px;
  overflow: auto;
  padding: 12px;
  background: #fff;
  border: 1px solid #e1ebf8;
  border-radius: 10px;
}

.clone-modal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-height: 66vh;
  overflow: auto;
}

.clone-modal-item {
  display: grid;
  gap: 8px;
}

.clone-modal-item div {
  display: grid;
  gap: 2px;
}

.clone-modal-item b {
  color: #25344d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clone-modal-item span {
  color: #68788e;
  font-size: 12px;
}

.canvas-page {
  position: fixed;
  inset: 0 0 0 202px;
  z-index: 20;
  overflow: hidden;
  background: #f8fbff;
}

.canvas-workbench {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #f8fbff;
}

.canvas-floating-head {
  position: absolute;
  top: 16px;
  left: 18px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 430px);
  padding: 8px;
  background: rgba(255,255,255,.9);
  border: 1px solid #dbe6f4;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(16,24,40,.1);
  backdrop-filter: blur(16px);
}

.canvas-project-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.canvas-project-switch select {
  width: 220px;
  max-width: 32vw;
  height: 32px;
  padding: 0 30px 0 10px;
  color: #24364f;
  background-color: #fff;
  border-color: #d2e1f2;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
}

.canvas-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.canvas-inspector {
  position: absolute;
  top: 76px;
  right: 18px;
  z-index: 9;
  display: grid;
  gap: 10px;
  width: min(300px, calc(100vw - 258px));
  max-height: calc(100vh - 170px);
  overflow: auto;
  pointer-events: auto;
}

.canvas-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: rgba(255,255,255,.88);
  border: 1px solid #dfe8f5;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(16,24,40,.1);
  backdrop-filter: blur(16px);
}

.canvas-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.canvas-panel-head b {
  font-size: 15px;
}

.canvas-panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.canvas-project-list {
  display: grid;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
}

.canvas-project-list button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  color: #24364f;
  background: #f7faff;
  border: 1px solid #dfe8f5;
  border-radius: 8px;
}

.canvas-project-list button.active {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #635bff);
  border-color: transparent;
}

.canvas-project-list span,
.canvas-empty,
.canvas-tip {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.canvas-node-tools,
.canvas-node-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.canvas-node-tools .mini,
.canvas-node-actions .mini {
  width: 100%;
}

.canvas-preview-small {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #eef5ff;
  border: 1px solid #dfe8f5;
  border-radius: 8px;
}

.canvas-preview-small img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.canvas-task-box {
  display: grid;
  gap: 5px;
  padding: 10px;
  background: #f7faff;
  border: 1px solid #dfe8f5;
  border-radius: 8px;
}

.canvas-task-box span {
  color: var(--muted);
  font-size: 12px;
}

.canvas-inspector-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  padding: 10px;
  color: #40516b;
  background: #f7faff;
  border: 1px solid #dfe8f5;
  border-radius: 8px;
  font-size: 12px;
}

.canvas-inspector-kv span {
  color: var(--muted);
  font-weight: 800;
}

.canvas-inspector-kv b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  background-color: #f8fbff;
}

.canvas-stage.select-mode {
  cursor: crosshair;
}

.canvas-stage.pan-mode {
  cursor: grab;
}

.canvas-stage.pan-mode:active {
  cursor: grabbing;
}

.canvas-stage.dots {
  background-image: radial-gradient(circle, rgba(49,68,95,.2) 1px, transparent 1px);
  background-size: 24px 24px;
}

.canvas-stage.lines {
  background-image:
    linear-gradient(rgba(49,68,95,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49,68,95,.12) 1px, transparent 1px);
  background-size: 36px 36px;
}

.canvas-stage.blank {
  background-image: none;
}

.canvas-world,
.canvas-edges {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}

.canvas-world {
  width: 1px;
  height: 1px;
}

.canvas-edges {
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: auto;
  transform-origin: 0 0;
}

.canvas-edge-path {
  fill: none;
  stroke: rgba(37,99,235,.52);
  stroke-width: 2;
  stroke-linecap: round;
  filter: drop-shadow(0 2px 5px rgba(37,99,235,.16));
  pointer-events: none;
}

.canvas-edge-path.selected {
  stroke: #f97316;
  stroke-width: 3;
}

.canvas-edge-path.related {
  stroke: rgba(37,99,235,.82);
  stroke-width: 2.5;
}

.canvas-edge-path.draft {
  stroke: rgba(249,115,22,.72);
  stroke-dasharray: 7 7;
  filter: none;
}

.canvas-edge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 16;
  cursor: pointer;
  pointer-events: stroke;
}

.canvas-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  overflow: visible;
  color: #24364f;
  background: rgba(255,255,255,.96);
  border: 2px solid #dbe6f4;
  border-radius: 6px;
  box-shadow: 0 14px 34px rgba(16,24,40,.12);
  cursor: move;
  user-select: none;
}

.canvas-node.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12), 0 18px 42px rgba(37,99,235,.18);
}

.canvas-node.related {
  box-shadow: 0 0 0 2px rgba(16,185,129,.12), 0 14px 34px rgba(16,24,40,.12);
}

.canvas-node-hoverbar {
  position: absolute;
  left: 50%;
  top: -38px;
  z-index: 5;
  display: none;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(22,31,49,.92);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15,23,42,.22);
  transform: translateX(-50%);
}

.canvas-node:hover .canvas-node-hoverbar,
.canvas-node.selected .canvas-node-hoverbar {
  display: flex;
}

.canvas-stage.multi-selecting .canvas-node-hoverbar {
  display: none;
}

.canvas-node.selected .canvas-node-hoverbar:empty {
  display: none;
}

.canvas-node-hoverbar button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.canvas-node-hoverbar button:hover {
  background: rgba(255,255,255,.14);
}

.canvas-multi-hoverbar {
  position: absolute;
  z-index: 18;
  align-items: center;
  gap: 4px;
  padding: 5px;
  color: #fff;
  background: rgba(22,31,49,.94);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 9px;
  box-shadow: 0 12px 28px rgba(15,23,42,.24);
  transform: translateX(-50%);
}

.canvas-multi-hoverbar span {
  padding: 0 8px;
  color: rgba(255,255,255,.78);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.canvas-multi-hoverbar button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.canvas-multi-hoverbar button:hover {
  background: rgba(255,255,255,.14);
}

.canvas-context-menu {
  position: absolute;
  z-index: 30;
  display: grid;
  gap: 3px;
  width: 196px;
  padding: 6px;
  color: #1f2f46;
  background: rgba(255,255,255,.96);
  border: 1px solid #dbe6f4;
  border-radius: 10px;
  box-shadow: 0 18px 42px rgba(15,23,42,.18);
  backdrop-filter: blur(14px);
}

.canvas-context-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 32px;
  padding: 0 9px;
  color: #24364f;
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 850;
  text-align: left;
}

.canvas-context-menu button:hover:not(:disabled) {
  color: #fff;
  background: #2563eb;
}

.canvas-context-menu button:disabled {
  color: #9aa8bd;
  cursor: not-allowed;
}

.canvas-context-menu kbd {
  min-width: 22px;
  color: #7b8aa2;
  font: 700 11px/1 system-ui, sans-serif;
  text-align: right;
}

.canvas-context-menu button:hover:not(:disabled) kbd {
  color: rgba(255,255,255,.78);
}

.canvas-group-overlay {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  background: rgba(99,91,255,.045);
  border: 1px dashed rgba(99,91,255,.42);
  border-radius: 12px;
}

.canvas-group-overlay span {
  position: absolute;
  left: 10px;
  top: -24px;
  padding: 3px 7px;
  color: #4f46e5;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.canvas-img-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #eef5ff;
  border-radius: 6px 6px 0 0;
}

.canvas-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.canvas-node-caption,
.canvas-node-title {
  flex: 0 0 auto;
  padding: 8px 10px;
  overflow: hidden;
  color: #24364f;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-text-node pre {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0 12px 12px;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  color: #40516b;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
}

.canvas-text-node.editing {
  cursor: text;
}

.canvas-node-textarea {
  flex: 1;
  min-height: 0;
  margin: 0 10px 10px;
  padding: 10px;
  color: #24364f;
  background: #f7faff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  resize: none;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: inset 0 0 0 1px rgba(37,99,235,.08);
  user-select: text;
}

.canvas-node-textarea:focus {
  outline: 2px solid rgba(37,99,235,.18);
  outline-offset: 0;
}

.canvas-port {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  border: 2px solid #2563eb;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
  box-shadow: 0 4px 10px rgba(37,99,235,.22);
  opacity: 0;
  transition: opacity .12s ease, transform .12s ease;
}

.canvas-port.in {
  left: -8px;
}

.canvas-port.out {
  right: -8px;
  cursor: crosshair;
}

.canvas-node:hover .canvas-port,
.canvas-node.selected .canvas-port,
.canvas-node.connecting .canvas-port {
  opacity: 1;
}

.canvas-port:hover {
  transform: translateY(-50%) scale(1.18);
}

.canvas-resize-handle {
  position: absolute;
  z-index: 4;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 2px solid #2563eb;
  border-radius: 3px;
  opacity: 0;
}

.canvas-node:hover .canvas-resize-handle,
.canvas-node.selected .canvas-resize-handle {
  opacity: 1;
}

.canvas-resize-handle.nw { left: -6px; top: -6px; cursor: nwse-resize; }
.canvas-resize-handle.ne { right: -6px; top: -6px; cursor: nesw-resize; }
.canvas-resize-handle.sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.canvas-resize-handle.se { right: -6px; bottom: -6px; cursor: nwse-resize; }

.canvas-config-node {
  gap: 3px;
  padding: 7px;
  border-color: #c8d7ee;
  background: rgba(255,255,255,.98);
}

.canvas-config-node.status-loading {
  border-color: #f59e0b;
}

.canvas-config-node.status-success {
  border-color: #10b981;
}

.canvas-config-node.status-failed {
  border-color: #ef4444;
}

.canvas-config-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.canvas-config-head div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.canvas-config-head b {
  overflow: hidden;
  color: #1f2f46;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-config-head span,
.canvas-config-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.canvas-config-prompt {
  flex: 1;
  min-height: 42px;
  resize: none;
  font-size: 12px;
  line-height: 1.45;
}

.canvas-config-inputs {
  display: flex;
  gap: 5px;
  min-height: 24px;
  overflow: hidden;
  flex-wrap: wrap;
}

.canvas-config-inputs.empty {
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.canvas-config-inputs span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  height: 24px;
  padding: 0 5px 0 7px;
  color: #1d314b;
  background: #eef5ff;
  border: 1px solid #cfe0fb;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.canvas-config-inputs span.image {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.canvas-config-inputs b {
  color: #2563eb;
  font-size: 10px;
}

.canvas-config-inputs span.image b {
  color: #059669;
}

.canvas-config-inputs button {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  padding: 0;
  color: #64748b;
  background: rgba(255,255,255,.72);
  border: 0;
  border-radius: 999px;
}

.canvas-config-inputs button:hover {
  color: #ef4444;
  background: #fff;
}

.canvas-config-inputs .icon {
  width: 11px;
  height: 11px;
}

.canvas-config-reference-map {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 5px;
  background: linear-gradient(135deg, #f0fdf8 0%, #f7fbff 100%);
  border: 1px solid #ccefe0;
  border-radius: 9px;
}

.canvas-config-reference-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.canvas-config-reference-map-head > div {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

.canvas-config-reference-map-head b {
  flex: none;
  color: #075e54;
  font-size: 10px;
  font-weight: 950;
}

.canvas-config-reference-map-head span {
  overflow: hidden;
  color: #5c7185;
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-config-reference-map-head em {
  flex: none;
  padding: 2px 6px;
  color: #047857;
  background: #dcfce7;
  border-radius: 999px;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.canvas-config-reference-list {
  display: flex;
  gap: 5px;
  min-width: 0;
  padding: 1px 1px 3px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.canvas-config-reference-item {
  position: relative;
  display: grid;
  flex: 0 0 150px;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
  min-height: 54px;
  padding: 4px 23px 4px 4px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid #d5e8e2;
  border-radius: 7px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.canvas-config-reference-item:hover,
.canvas-config-reference-item:focus-visible {
  border-color: #34b88a;
  box-shadow: 0 5px 13px rgba(16, 185, 129, .14);
  outline: none;
  transform: translateY(-1px);
}

.canvas-config-reference-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  background: #eaf5f1;
  border: 1px solid #cce7dc;
  border-radius: 6px;
}

.canvas-config-reference-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.canvas-config-reference-thumb > .icon {
  width: 18px;
  height: 18px;
  color: #0f9f76;
}

.canvas-config-reference-no-preview {
  display: grid;
  place-items: center;
  gap: 2px;
  color: #0f9f76;
  font-size: 7px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.canvas-config-reference-no-preview small {
  color: #6b8290;
  font-size: 7px;
  white-space: nowrap;
}

.canvas-config-reference-badge {
  position: absolute;
  left: 3px;
  top: 3px;
  display: inline-flex;
  align-items: center;
  min-height: 16px;
  padding: 0 4px;
  color: #fff;
  background: rgba(5, 150, 105, .94);
  border-radius: 4px;
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
}

.canvas-config-reference-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.canvas-config-reference-meta strong,
.canvas-config-reference-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-config-reference-meta strong {
  color: #183b4d;
  font-size: 11px;
  font-weight: 900;
}

.canvas-config-reference-meta small {
  color: #6b8290;
  font-size: 9px;
  font-weight: 800;
}

.canvas-config-reference-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  padding: 0;
  color: #6b8290;
  background: #fff;
  border: 0;
  border-radius: 999px;
}

.canvas-config-reference-remove:hover {
  color: #dc2626;
  background: #fef2f2;
}

.canvas-config-reference-remove .icon {
  width: 9px;
  height: 9px;
}

.canvas-config-inline {
  display: grid;
  grid-template-columns: .72fr 1.28fr;
  gap: 8px;
}

.canvas-config-inline label {
  gap: 2px;
  font-size: 11px;
}

.canvas-config-inline .canvas-config-model {
  grid-column: 1 / -1;
  min-width: 0;
}

.canvas-config-inline select {
  height: 28px;
  padding: 0 28px 0 8px;
  font-size: 12px;
}

.canvas-config-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.canvas-config-actions .primary {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.canvas-result-placeholder-node {
  gap: 10px;
  padding: 14px;
  background: rgba(255,255,255,.98);
  border-color: #c8d7ee;
}

.canvas-result-placeholder-node.status-loading {
  border-color: #f59e0b;
}

.canvas-result-placeholder-node.status-success {
  border-color: #10b981;
}

.canvas-result-placeholder-node.status-failed {
  border-color: #ef4444;
}

.canvas-result-loading {
  display: grid;
  place-items: center;
  gap: 8px;
  flex: 1;
  min-height: 0;
  padding: 20px;
  text-align: center;
  background: #f7faff;
  border: 1px dashed #bfdbfe;
  border-radius: 8px;
}

.canvas-result-loading b {
  color: #24364f;
  font-size: 15px;
}

.canvas-result-loading em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.canvas-result-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #dbeafe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: canvasSpin .8s linear infinite;
}

@keyframes canvasSpin {
  to { transform: rotate(360deg); }
}

.canvas-selection-box {
  position: absolute;
  z-index: 7;
  display: none;
  pointer-events: none;
  background: rgba(37,99,235,.08);
  border: 1px solid rgba(37,99,235,.45);
  border-radius: 4px;
}

.canvas-toolbar {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: calc(100% - 36px);
  padding: 8px;
  overflow-x: auto;
  background: rgba(255,255,255,.92);
  border: 1px solid #dbe6f4;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(16,24,40,.12);
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

.canvas-toolbar .mini {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
}

.canvas-toolbar-divider {
  width: 1px;
  height: 22px;
  margin: 0 3px;
  background: #dbe6f4;
}

.canvas-toolbar .mini.active {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
}

.canvas-minimap {
  position: absolute;
  left: 16px;
  bottom: 18px;
  z-index: 8;
  width: 210px;
  height: 138px;
  overflow: hidden;
  background: rgba(255,255,255,.9);
  border: 1px solid #dbe6f4;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(16,24,40,.12);
  cursor: crosshair;
  pointer-events: auto;
}

.canvas-minimap span {
  position: absolute;
  display: block;
  border-radius: 2px;
  opacity: .78;
}

.canvas-minimap span.image {
  background: #10b981;
}

.canvas-minimap span.text {
  background: #635bff;
}

.canvas-minimap span.config {
  background: #f59e0b;
}

.canvas-minimap span.resultPlaceholder {
  background: #2563eb;
}

.canvas-minimap-viewport {
  position: absolute;
  display: block;
  border: 2px solid #f97316;
  border-radius: 3px;
  background: rgba(249,115,22,.08);
  pointer-events: none;
}

.canvas-preview-modal {
  max-width: 980px;
}

.canvas-reference-explainer {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  padding: 10px 12px;
  color: #31566a;
  background: linear-gradient(100deg, #effcf7 0%, #f3f8ff 100%);
  border: 1px solid #cfe8df;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.45;
}

.canvas-reference-explainer b {
  flex: none;
  color: #087f63;
  font-size: 12px;
  font-weight: 950;
}

.canvas-reference-explainer span {
  color: #557184;
  font-weight: 750;
}

.canvas-preview-layout {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 14px;
}

.canvas-preview-layout h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.canvas-input-order {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.canvas-input-order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.canvas-input-order-head h3 {
  margin-bottom: 0;
}

.canvas-input-order-head > div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.canvas-input-order-mode {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.canvas-input-order-mode.manual {
  color: #9a3412;
  background: #fff7ed;
  border-color: #fed7aa;
}

.canvas-input-order-help {
  margin: 0 0 8px;
  font-size: 11px;
}

.canvas-input-order-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  background: #f7faff;
  border: 1px solid #dfe8f5;
  border-radius: 8px;
}

.canvas-input-order-item span {
  min-width: 0;
  overflow: hidden;
  color: #40516b;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-preview-refs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.canvas-preview-refs button {
  display: grid;
  gap: 5px;
  padding: 6px;
  background: #f7faff;
  border: 1px solid #dfe8f5;
  border-radius: 8px;
}

.canvas-preview-reference-map {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.canvas-preview-reference-card {
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.canvas-preview-reference-card:hover,
.canvas-preview-reference-card:focus-visible {
  border-color: #34b88a;
  box-shadow: 0 7px 16px rgba(16, 185, 129, .13);
  outline: none;
  transform: translateY(-1px);
}

.canvas-preview-refs img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
}

.canvas-preview-refs span {
  display: flex;
  gap: 5px;
  align-items: center;
  overflow: hidden;
  color: #40516b;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-preview-refs span b {
  flex: none;
  color: #059669;
  font-size: 10px;
  font-weight: 900;
}

.canvas-preview-reference-card small {
  overflow: hidden;
  color: #6b8290;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-preview-texts {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  max-height: 230px;
  overflow: auto;
}

.canvas-preview-texts label {
  display: grid;
  gap: 5px;
  padding: 9px;
  background: #f7faff;
  border: 1px solid #dfe8f5;
  border-radius: 8px;
}

.canvas-preview-texts span {
  color: #40516b;
  font-size: 12px;
  font-weight: 900;
}

.canvas-preview-texts textarea,
.canvas-preview-config-text {
  width: 100%;
  resize: vertical;
  font-size: 12px;
  line-height: 1.5;
}

.canvas-preview-config-text {
  margin-top: 8px;
}

.canvas-preview-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.canvas-preview-summary span {
  padding: 6px 9px;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.canvas-history-box {
  max-width: 960px;
}

.canvas-info-modal {
  max-width: 760px;
}

.canvas-info-tabs {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: #eef5ff;
  border: 1px solid #dbe6f4;
  border-radius: 8px;
}

.canvas-info-tabs button {
  height: 32px;
  padding: 0 14px;
  color: #40516b;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.canvas-info-tabs button.active {
  color: #fff;
  background: #2563eb;
}

.canvas-info-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid #dfe8f5;
  border-radius: 8px;
}

.canvas-info-grid span,
.canvas-info-grid b {
  min-width: 0;
  padding: 10px 12px;
  border-bottom: 1px solid #edf3fb;
  font-size: 12px;
}

.canvas-info-grid span {
  color: var(--muted);
  background: #f7faff;
  font-weight: 900;
}

.canvas-info-grid b {
  overflow: hidden;
  color: #24364f;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-info-grid span:nth-last-child(-n+2),
.canvas-info-grid b:nth-last-child(-n+1) {
  border-bottom: 0;
}

.canvas-delete-backdrop {
  z-index: 120;
  background: rgba(9, 18, 33, .56);
  backdrop-filter: blur(10px);
}

.canvas-delete-modal {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  width: min(460px, calc(100vw - 40px));
  padding: 22px;
  overflow: visible;
  border-radius: 16px;
}

.canvas-rename-modal {
  display: grid;
  gap: 16px;
  width: min(440px, calc(100vw - 40px));
  padding: 22px;
  overflow: visible;
  border-radius: 16px;
}

.canvas-rename-field {
  display: grid;
  gap: 8px;
  color: #51627c;
  font-size: 12px;
  font-weight: 900;
}

.canvas-rename-field input {
  height: 42px;
  padding: 0 12px;
  color: #1d314b;
  background: #fff;
  border: 1px solid #d2e1f2;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 900;
  outline: none;
}

.canvas-rename-field input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

.canvas-tips-modal {
  display: grid;
  gap: 18px;
  width: min(760px, calc(100vw - 40px));
  max-height: min(760px, calc(100vh - 44px));
  padding: 24px;
  overflow: auto;
  border-radius: 16px;
}

.canvas-tips-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.canvas-tips-grid section {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: #f7faff;
  border: 1px solid #dfe8f5;
  border-radius: 10px;
}

.canvas-tips-grid h3 {
  margin: 0;
  color: #17243a;
  font-size: 14px;
}

.canvas-tips-grid ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: #51627c;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.canvas-delete-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: #b42318;
  background: #fff1f0;
  border: 1px solid #ffc9c4;
  border-radius: 14px;
}

.canvas-delete-icon .icon {
  width: 22px;
  height: 22px;
}

.canvas-delete-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.canvas-delete-copy .status-pill {
  width: fit-content;
  color: #b42318;
  background: #fff1f0;
  border-color: #ffc9c4;
}

.canvas-delete-copy h2 {
  margin: 0;
  color: #17243a;
  font-size: 20px;
  line-height: 1.25;
}

.canvas-delete-copy p {
  margin: 0;
  color: #51627c;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.7;
}

.canvas-delete-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}

.canvas-delete-actions .primary.danger {
  border-color: transparent;
}

.canvas-info-json {
  max-height: 52vh;
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: #dbeafe;
  background: #111827;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.canvas-info-text {
  margin-top: 12px;
}

.canvas-info-text textarea {
  width: 100%;
  resize: vertical;
  font-size: 12px;
  line-height: 1.5;
}

.canvas-info-image {
  width: min(320px, 100%);
  margin-top: 12px;
  padding: 8px;
  background: #f7faff;
  border: 1px solid #dfe8f5;
  border-radius: 8px;
}

.canvas-info-image img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  display: block;
  border-radius: 6px;
}

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

.canvas-history-item {
  display: grid;
  gap: 8px;
  padding: 8px;
  text-align: left;
  background: #f7faff;
  border: 1px solid #dfe8f5;
  border-radius: 8px;
}

.canvas-history-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
}

.canvas-history-item span {
  color: #40516b;
  font-size: 12px;
  font-weight: 800;
}

.canvas-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 1300px) {
  .workflow {
    grid-template-columns: 1fr;
  }
  .clone-create-grid,
  .clone-workspace,
  .ecom-layout {
    grid-template-columns: 1fr;
  }
  .canvas-inspector {
    width: 320px;
    max-height: calc(100vh - 160px);
  }
  .ecom-form-panel {
    position: static;
  }
  .ecom-plan-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .clone-modal-layout {
    grid-template-columns: 1fr;
  }
  .clone-modal-side {
    position: static;
  }
  .clone-submit-panel {
    position: static;
  }
  .toolbox-layout,
  .toolbox-layout.utility-layout {
    grid-template-columns: 1fr;
  }
  .toolbox-card-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .toolbox-section-title {
    grid-column: 1 / -1;
  }
  .case-card {
    display: none;
  }
  .generated-long-card {
    display: grid;
    position: static;
  }
}

@media (max-width: 900px) {
  .custom-resolution {
    grid-template-columns: 1fr;
  }
  .resolution-picker {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .resolution-submit-size {
    grid-column: 1 / -1;
  }
  .clone-upload-columns,
  .clone-custom-grid,
  .clone-item-card,
  .clone-item-media,
  .clone-modal-grid,
  .canvas-history-grid,
  .ecom-field-grid,
  .ecom-package-grid,
  .ecom-template-grid,
  .ecom-plan-grid {
    grid-template-columns: 1fr;
  }
  .ecom-head,
  .ecom-actions,
  .ecom-template-head,
  .ecom-mini-head {
    align-items: stretch;
    flex-direction: column;
  }
  .canvas-page {
    left: 0;
  }
  .canvas-floating-head {
    left: 10px;
    right: 10px;
    max-width: none;
    flex-wrap: wrap;
  }
  .canvas-project-switch select {
    width: 160px;
    max-width: 48vw;
  }
  .canvas-tips-grid {
    grid-template-columns: 1fr;
  }
  .canvas-inspector {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 76px;
    width: auto;
    max-height: 42vh;
  }
  .canvas-preview-layout {
    grid-template-columns: 1fr;
  }
  .canvas-input-order-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .canvas-preview-refs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .canvas-reference-explainer {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
  .canvas-preview-reference-map {
    grid-template-columns: 1fr;
  }
  .canvas-minimap {
    display: none;
  }
  .canvas-toolbar {
    left: 14px;
    right: 14px;
    transform: none;
    bottom: 12px;
  }
  .ecom-mode-row,
  .ecom-style-grid,
  .ecom-lang-grid,
  .ecom-filter-row {
    grid-template-columns: 1fr;
  }
  .ecom-upload-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .clone-actions,
  .clone-progress-panel {
    align-items: stretch;
    flex-direction: column;
  }
  .clone-upload-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .resolution-title {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding-right: 0;
    padding-bottom: 12px;
    border-right: 0;
    border-bottom: 1px solid #dbe8f8;
  }
  .resolution-title > div {
    gap: 4px;
    min-width: 0;
  }
  .resolution-title p {
    flex: none;
    width: 100%;
  }
  .image-engine-summary {
    align-items: flex-start;
  }
  .image-engine-summary p {
    white-space: normal;
  }
  .image-model-choice-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
  .image-model-select {
    flex: none;
    min-width: 0;
    width: 100%;
  }
  .resolution-mode-toggle {
    width: 100%;
  }
  .wizard-size-targets {
    grid-template-columns: 1fr;
  }
  .resolution-presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .progress-board {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .render-preview {
    grid-template-columns: repeat(2, 1fr);
  }
  .cards-grid,
  .copy-source-options,
  .copy-review-layout,
  .copy-review-summary,
  .prompt-gallery-toolbar,
  .prompt-gallery-detail-layout {
    grid-template-columns: 1fr;
  }
  .prompt-gallery-head {
    align-items: flex-start;
  }
  .prompt-gallery-grid {
    grid-template-columns: 1fr;
  }
  .prompt-gallery-actions {
    grid-template-columns: 1fr 1fr;
  }
  .prompt-gallery-actions .primary {
    grid-column: 1 / -1;
  }
  .prompt-gallery-detail {
    width: calc(100vw - 28px);
  }
  .copy-review-panel .copy-textarea textarea {
    min-height: 320px;
  }
  .progress-lead {
    white-space: normal;
    animation: progress-rise .45s ease .18s both;
  }
  .modal {
    padding: 14px;
  }
  .modal-frame {
    width: calc(100vw - 28px);
  }
  .modal-box,
  .lightbox-box {
    width: calc(100vw - 28px);
  }
  .modal-frame .modal-box {
    width: 100%;
  }
  .modal-close {
    width: 36px;
    height: 36px;
  }
  .task-modal .modal-head {
    align-items: flex-start;
  }
  .task-modal-layout {
    grid-template-columns: 1fr;
    --task-modal-panel-height: min(68vh, 620px);
  }
  .modal-result-topline {
    align-items: stretch;
    flex-direction: column;
  }
  .clone-modal-item-card {
    grid-template-columns: 1fr;
  }
  .clone-modal-param-grid,
  .clone-modal-asset-list {
    grid-template-columns: 1fr;
  }
  .pay-modal-body {
    grid-template-columns: 1fr;
  }
  .support-modal-body {
    grid-template-columns: 1fr;
  }
  .home-popup-modal {
    padding: 14px;
  }
  .home-popup-box {
    width: calc(100vw - 28px);
    border-radius: 22px;
  }
  .home-popup-inner {
    gap: 16px;
    max-height: calc(100vh - 28px);
    padding: 38px 18px 22px;
  }
  .home-popup-close {
    top: 12px;
    right: 12px;
    width: 28px;
    min-width: 28px;
    height: 28px;
  }
  .home-popup-copy {
    gap: 10px;
    padding: 0 28px;
  }
  .home-popup-kicker {
    min-height: 30px;
    padding: 0 16px;
    font-size: 14px;
  }
  .home-popup-copy h2 {
    font-size: 28px;
  }
  .home-popup-copy p {
    font-size: 15px;
    line-height: 1.7;
  }
  .home-popup-visual {
    padding: 10px;
    border-radius: 18px;
  }
  .home-popup-image {
    min-height: 0;
    max-height: min(54vh, 430px);
    border-radius: 14px;
  }
  .home-popup-image img {
    max-height: min(52vh, 410px);
  }
  .home-popup-action {
    width: 100%;
    min-width: 0;
  }
  .home-popup-box.image-only .home-popup-inner {
    padding: 28px 14px 14px;
  }
  .home-popup-box.image-only .home-popup-image {
    max-height: calc(100vh - 84px);
  }
  .home-popup-box.image-only .home-popup-image img {
    max-height: calc(100vh - 88px);
  }
  .pay-qr-box {
    min-height: 260px;
  }
  .order-item {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .order-money {
    text-align: left;
  }
  .billing-package-row {
    grid-template-columns: 1fr;
  }
  .billing-package-row .full {
    grid-column: 1;
  }
  .studio-reference-editor {
    grid-template-columns: 1fr;
  }
  .toolbox-card-list,
  .toolbox-field-grid,
  .toolbox-field-grid.two,
  .toolbox-field-grid.taobao-grid,
  .title-word-grid {
    grid-template-columns: 1fr;
  }
  .modal-result-panel .result-gallery,
  .result-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .copy-display {
    max-height: 46vh;
  }
  .modal-result-panel .result-gallery:not(.single-result-gallery) {
    height: auto;
    max-height: none;
  }
  .copy-display p {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    background: linear-gradient(180deg, #eef6ff 0, #f8fbff 280px, #fff 100%);
  }

  .app-shell,
  .admin-shell {
    display: block;
    min-width: 0;
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    height: calc(76px + env(safe-area-inset-bottom));
    display: grid;
    align-content: center;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.96);
    border-top: 1px solid #d9e5f4;
    border-right: 0;
    box-shadow: 0 -12px 30px rgba(16, 24, 40, .12);
    backdrop-filter: blur(16px);
    z-index: 70;
  }

  .sidebar .brand,
  .sidebar .recharge,
  .sidebar .price-box {
    display: none;
  }

  .sidebar nav {
    display: flex;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 0 2px 2px;
    scrollbar-width: none;
  }

  .sidebar nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    min-width: 68px;
    height: 58px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 6px 9px;
    border-radius: 12px;
    font-size: 11px;
    line-height: 1.15;
    white-space: nowrap;
    transform: none;
  }

  .nav-item:hover {
    transform: none;
  }

  .nav-item .icon {
    width: 18px;
    height: 18px;
  }

  .main,
  .admin-main {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    padding: 86px 16px calc(110px + env(safe-area-inset-bottom));
    grid-column: auto;
  }

  .topbar {
    top: 10px;
    right: 12px;
    left: 12px;
    width: auto;
    min-height: 48px;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(16, 24, 40, .1);
  }

  .account-summary {
    min-width: 0;
  }

  .account-avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .account-text {
    max-width: calc(100vw - 190px);
  }

  .user-email {
    max-width: 100%;
    font-size: 12px;
  }

  .account-text em {
    font-size: 11px;
  }

  .topbar-actions {
    flex: 0 0 auto;
  }

  .topbar-actions .mini {
    height: 30px;
    padding: 0 9px;
    font-size: 11px;
  }

  .hero {
    margin: 0 0 14px;
    padding: 0;
  }

  .hero h1 {
    font-size: 24px;
    line-height: 1.24;
  }

  .hero .page-sub,
  .page-sub {
    font-size: 13px;
    line-height: 1.5;
  }

  .workflow,
  .studio-grid,
  .wallet-layout,
  .toolbox-layout,
  .toolbox-layout.utility-layout,
  .clone-create-grid,
  .clone-workspace,
  .ecom-layout,
  .prompt-gallery-detail-layout {
    grid-template-columns: 1fr;
    gap: 14px;
    max-width: 100%;
  }

  .progress-workflow {
    margin-top: 0;
  }

  .case-card {
    display: none;
  }
  .generated-long-card {
    display: grid;
    position: static;
    max-height: min(620px, 72vh);
  }
  .generated-long-scroll {
    max-height: min(500px, 56vh);
  }

  .panel,
  .wizard-card,
  .simple-page .panel,
  .studio-settings,
  .studio-result,
  .toolbox-card-list,
  .toolbox-workbench,
  .toolbox-result,
  .wallet-balance-card,
  .wallet-pay-card,
  .wallet-rules-card,
  .wallet-ledger-panel,
  .clone-main-panel,
  .clone-side-panel,
  .clone-submit-panel,
  .clone-progress-panel,
  .ecom-panel,
  .ecom-plan-panel {
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(16, 24, 40, .06);
  }

  .wizard-card {
    min-height: 0;
    padding: 18px 16px;
  }

  .section-head {
    gap: 10px;
  }

  .section-head b {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
  }

  .section-head h2,
  .page-title {
    font-size: 22px;
  }

  .section-head p,
  .muted {
    font-size: 13px;
    line-height: 1.5;
  }

  .stepper {
    grid-template-columns: 32px 1fr 32px 1fr 32px 1fr 32px 1fr 32px;
    gap: 7px;
    margin-bottom: 18px;
  }

  .dot {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .line {
    min-width: 12px;
  }

  .warn {
    display: flex;
    width: 100%;
    margin: 14px 0;
    justify-content: center;
    border-radius: 12px;
    text-align: center;
  }

  .type-grid,
  .ecom-template-grid,
  .ecom-package-grid,
  .ecom-style-grid,
  .wallet-rule-grid,
  .copy-review-summary,
  .copy-source-options,
  .source-options {
    grid-template-columns: 1fr;
  }

  .type-card {
    min-height: 0;
    padding: 18px 16px 18px 58px;
    border-radius: 12px;
  }

  .card-check {
    top: 18px;
    left: 18px;
  }

  .type-thumb {
    width: 54px;
    height: 54px;
  }

  .type-options {
    min-height: 0;
  }

  .type-options.hidden-options {
    display: none;
  }

  .radio-row {
    gap: 12px 16px;
  }

  .count-field-row {
    grid-template-columns: 1fr;
  }

  .lang-grid,
  .ecom-lang-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 18px;
  }

  .source-options button,
  .lang-grid button,
  .ecom-mode-row button,
  .ecom-style-grid button,
  .ecom-template-card,
  .ecom-package-card,
  .ecom-plan-card,
  .wallet-package-card {
    min-height: auto;
    border-radius: 10px;
  }

  .big-input {
    margin-top: 18px;
  }

  .big-input input {
    height: 48px;
    font-size: 14px;
  }

  .big-input textarea,
  .copy-textarea textarea,
  .copy-review-panel .copy-textarea textarea {
    min-height: 150px;
    font-size: 14px;
  }

  .upload-zone,
  .result-empty {
    min-height: 210px;
    border-radius: 10px;
  }

  .actions,
  .copy-upload-actions,
  .clone-actions,
  .wallet-actions,
  .wallet-cta,
  .banner-line,
  .page-top,
  .page-head,
  .copy-head,
  .ecom-actions,
  .ecom-head,
  .ecom-mini-head,
  .ecom-template-head,
  .history-title,
  .clone-custom-head,
  .clone-upload-head,
  .clone-item-title,
  .billing-package-head,
  .admin-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .actions,
  .copy-upload-actions,
  .wallet-actions,
  .page-actions,
  .result-title-actions,
  .copy-upload-action-group,
  .history-actions,
  .modal-head-actions,
  .admin-action-bar,
  .admin-row-actions {
    justify-content: stretch;
  }

  .actions .primary,
  .actions .ghost,
  .copy-upload-action-group button,
  .wallet-actions button,
  .wallet-cta button,
  .ecom-actions .primary,
  .page-actions .primary,
  .result-title-actions .primary {
    width: 100%;
  }

  .primary,
  .ghost {
    min-width: 0;
  }

  .copy-row,
  .copy-row.full {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .copy-row button {
    width: 100%;
  }

  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-grid {
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
    gap: 12px;
  }

  .history-filter {
    margin: 0 0 14px;
  }

  .history-filter button {
    min-width: 132px;
  }

  .task-card .body {
    padding: 12px;
  }

  .wallet-balance-card {
    min-height: 176px;
    padding: 20px;
  }

  .wallet-balance-card strong {
    font-size: 40px;
  }

  .wallet-pay-card,
  .wallet-rules-card,
  .wallet-ledger-panel,
  .studio-settings,
  .studio-result,
  .toolbox-card-list,
  .toolbox-workbench,
  .toolbox-result,
  .clone-main-panel,
  .clone-side-panel,
  .clone-submit-panel,
  .ecom-panel,
  .ecom-plan-panel {
    padding: 16px;
  }

  .wallet-package-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wallet-package-card small {
    font-size: 24px;
  }

  .ledger-item {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
  }

  .ledger-item em {
    min-width: 0;
    text-align: left;
  }

  .ecom-field-grid,
  .ecom-mode-row,
  .ecom-filter-row,
  .custom-resolution {
    grid-template-columns: 1fr;
  }

  .ecom-head-stats {
    place-items: start;
    min-width: 0;
  }

  .ecom-form-panel,
  .clone-submit-panel {
    position: static;
  }

  .ecom-upload-preview,
  .clone-upload-preview,
  .render-preview,
  .result-gallery,
  .modal-result-panel .result-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ecom-plan-panel .page-actions,
  .ecom-plan-panel .page-actions .primary {
    width: 100%;
  }

  .modal-result-switch {
    grid-template-columns: 1fr;
  }

  .resolution-title {
    padding-right: 0;
    padding-bottom: 12px;
    border-right: 0;
    border-bottom: 1px solid #dbe8f8;
  }

  .resolution-control-row {
    display: block;
  }

  .resolution-presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .resolution-presets button {
    min-height: 62px;
  }

  .prompt-gallery-head {
    align-items: stretch;
    flex-direction: column;
  }

  .prompt-gallery-toolbar {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .prompt-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .prompt-gallery-card h3 {
    min-height: 40px;
    font-size: 14px;
  }

  .prompt-gallery-card p {
    min-height: 54px;
    font-size: 12px;
  }

  .prompt-gallery-actions {
    grid-template-columns: 1fr;
  }

  .prompt-gallery-actions .primary {
    grid-column: auto;
  }

  .toolbox-switch {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
  }

  .toolbox-switch button {
    flex: 1 0 auto;
    padding: 0 14px;
  }

  .toolbox-card-list {
    grid-template-columns: 1fr;
  }

  .clone-item-card,
  .clone-item-media,
  .clone-modal-item-card,
  .clone-modal-image-pair,
  .clone-modal-layout,
  .clone-modal-grid,
  .clone-modal-param-grid,
  .clone-modal-asset-list {
    grid-template-columns: 1fr;
  }

  .clone-modal-side {
    position: static;
  }

  .clone-task-modal-frame {
    width: calc(100vw - 28px);
  }

  .canvas-page {
    inset: 0;
    left: 0;
  }

  .canvas-floating-head {
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    border-radius: 12px;
  }

  .canvas-project-switch,
  .canvas-top-actions {
    width: 100%;
  }

  .canvas-project-switch select {
    width: 100%;
    max-width: none;
  }

  .canvas-top-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .canvas-top-actions .mini {
    width: 100%;
    padding: 0 8px;
  }

  .canvas-inspector {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: calc(86px + env(safe-area-inset-bottom));
    width: auto;
    max-height: 42vh;
  }

  .canvas-toolbar {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    transform: none;
    overflow-x: auto;
  }

  .canvas-node {
    max-width: calc(100vw - 28px);
  }

  .admin-main {
    padding-top: 18px;
  }

  .admin-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .admin-tabs button {
    flex: 0 0 auto;
  }

  .admin-form,
  .billing-package-row {
    grid-template-columns: 1fr;
  }

  .billing-package-row .full {
    grid-column: 1;
  }

  .table,
  .table-scroll {
    max-width: 100%;
  }

  .simple-page .panel {
    overflow-x: auto;
  }

  .simple-page .panel > .table:not(.admin-table),
  .wallet-ledger-panel > .table:not(.admin-table) {
    min-width: 680px;
  }

  .table-scroll .table {
    min-width: 760px;
  }

  .modal {
    padding: 12px;
  }

  .modal-frame,
  .modal-box,
  .lightbox-box,
  .prompt-gallery-detail {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .modal-box {
    border-radius: 12px;
  }

  .modal-head,
  .lightbox-head {
    gap: 10px;
  }

  .modal-head h2,
  .lightbox-head h2 {
    font-size: 20px;
  }

  .notice {
    right: 12px !important;
    left: 12px !important;
    top: 70px !important;
  }

  footer.muted {
    margin-top: 38px !important;
    padding-top: 20px !important;
  }
}

@media (max-width: 640px) {
  .vector-tool-layout,
  .vector-range-grid,
  .vector-result-grid {
    grid-template-columns: 1fr;
  }

  body {
    font-size: 13px;
  }

  .auth-page {
    min-height: 100svh;
    place-items: start center;
    padding: 18px 14px;
  }

  .auth-card {
    width: 100%;
    max-width: 460px;
    padding: 22px 18px;
    border-radius: 12px;
  }

  .auth-card h1 {
    margin-top: 18px;
    font-size: 24px;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .tabs button {
    min-width: 0;
    height: 38px;
    padding: 0 6px;
    font-size: 12px;
  }

  .auth-code-row {
    grid-template-columns: 1fr;
  }

  .auth-code-row button {
    width: 100%;
  }

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

  textarea {
    min-height: 108px;
    padding: 10px;
  }

  label {
    gap: 6px;
    font-size: 12.5px;
  }

  .resolution-picker {
    grid-template-columns: 1fr;
  }

  .resolution-select-field select {
    height: 44px;
    font-size: 14px;
  }

  .resolution-submit-size b {
    min-height: 42px;
    white-space: normal;
  }

  .main {
    padding: 78px 12px calc(104px + env(safe-area-inset-bottom));
  }

  .topbar {
    top: 8px;
    right: 10px;
    left: 10px;
    min-height: 44px;
    padding: 6px 7px;
    border-radius: 12px;
  }

  .account-avatar {
    width: 28px;
    height: 28px;
  }

  .account-text {
    max-width: calc(100vw - 176px);
  }

  .topbar-actions .mini {
    height: 28px;
    padding: 0 8px;
  }

  .sidebar {
    height: calc(72px + env(safe-area-inset-bottom));
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  }

  .sidebar nav {
    gap: 6px;
  }

  .nav-item {
    min-width: 62px;
    height: 56px;
    padding: 6px 8px;
    font-size: 10.5px;
    border-radius: 10px;
  }

  .nav-item .icon {
    width: 17px;
    height: 17px;
  }

  .hero h1 {
    font-size: 22px;
  }

  .hero .page-sub,
  .page-sub {
    font-size: 12.5px;
  }

  .wizard-card,
  .simple-page .panel,
  .wallet-pay-card,
  .wallet-rules-card,
  .wallet-ledger-panel,
  .studio-settings,
  .studio-result,
  .toolbox-card-list,
  .toolbox-workbench,
  .toolbox-result,
  .clone-main-panel,
  .clone-side-panel,
  .clone-submit-panel,
  .ecom-panel,
  .ecom-plan-panel {
    padding: 14px;
  }

  .section-head h2,
  .page-title {
    font-size: 20px;
  }

  .stepper {
    grid-template-columns: 28px 1fr 28px 1fr 28px 1fr 28px 1fr 28px;
    gap: 5px;
  }

  .dot {
    width: 28px;
    height: 28px;
  }

  .type-card {
    padding: 16px 14px 16px 52px;
  }

  .card-check {
    top: 16px;
    left: 16px;
  }

  .source-options button {
    min-height: 54px;
  }

  .primary,
  .ghost {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    font-size: 13px;
  }

  .icon-only,
  .modal-close,
  .ghost.icon-only {
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    flex: 0 0 auto;
  }

  .mini {
    height: 30px;
    padding: 0 10px;
    font-size: 11.5px;
  }

  .actions,
  .page-top,
  .page-head {
    gap: 10px;
  }

  .stats-row,
  .wallet-package-grid,
  .resolution-presets,
  .result-gallery,
  .modal-result-panel .result-gallery {
    grid-template-columns: 1fr;
  }

  .history-grid,
  .prompt-gallery-grid {
    grid-template-columns: 1fr;
  }

  .wallet-balance-card {
    min-height: 156px;
    padding: 18px;
  }

  .wallet-balance-card strong {
    font-size: 34px;
  }

  .wallet-package-card {
    min-height: 132px;
  }

  .wallet-package-card small {
    font-size: 22px;
  }

  .ecom-upload-preview,
  .clone-upload-preview,
  .render-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ecom-package-card {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
  }

  .ecom-package-card > span {
    width: 30px;
    height: 30px;
  }

  .copy-status {
    width: 100%;
    text-align: center;
  }

  .prompt-gallery-pager,
  .pager {
    flex-wrap: wrap;
    gap: 8px;
  }

  .modal {
    padding: 8px;
  }

  .modal-frame,
  .modal-box,
  .lightbox-box,
  .prompt-gallery-detail {
    width: calc(100vw - 16px);
    max-height: calc(100svh - 16px);
  }

  .modal-box,
  .modal-frame .modal-box {
    padding: 14px;
  }

  .modal-close {
    top: 8px;
    right: 8px;
  }

  .home-popup-close {
    top: 12px;
    right: 12px;
    width: 28px;
    min-width: 28px;
    height: 28px;
    background: transparent;
    box-shadow: none;
  }

  .canvas-floating-head {
    top: 8px;
    left: 8px;
    right: 8px;
  }

  .canvas-top-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .canvas-inspector {
    left: 8px;
    right: 8px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    max-height: 45vh;
  }
}

/* AI video module */
.video-page {
  max-width: 1700px;
  margin: 0 auto;
}

.video-page > .page-head {
  margin-bottom: 8px;
}

.video-page > .page-head .page-title {
  font-size: 24px;
}

.video-page > .page-head .page-sub {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.45;
}

.video-page .page-title .icon {
  color: var(--blue);
}

.video-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(108px, 1fr));
  gap: 4px;
  margin: 0 0 10px;
  padding: 4px;
  border: 1px solid #dbe7f5;
  border-radius: 10px;
  background: #edf4fb;
}

.video-tabs button {
  min-width: 0;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  color: #53677f;
  background: transparent;
  font-weight: 900;
  transform: none;
}

.video-tabs button:hover {
  color: #175cd3;
  background: rgba(255,255,255,.66);
  transform: none;
}

.video-tabs button.active {
  color: #175cd3;
  background: #fff;
  box-shadow: 0 8px 18px rgba(23, 92, 211, .12);
}

.video-tabs button.active:hover {
  color: #175cd3;
  background: #fff;
}

.video-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.video-form-panel,
.video-queue-panel,
.video-tasks-panel,
.video-detail-page,
.video-empty-state {
  border: 1px solid #dde7f3;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(16, 24, 40, .075);
}

.video-form-panel {
  padding: 14px;
}

.video-form-panel h2,
.video-form-panel h3,
.video-queue-panel h3,
.video-detail-page h2,
.video-detail-page h3,
.video-tasks-panel h3 {
  margin: 0;
}

.video-form-intro {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5edf7;
}

.video-form-intro-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 10px 22px rgba(37, 99, 235, .22);
}

.video-form-intro-icon .icon {
  width: 19px;
  height: 19px;
}

.video-form-intro > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 10px;
  min-width: 0;
}

.video-form-eyebrow {
  display: block;
  grid-column: 1 / -1;
  margin-bottom: 1px;
  color: #2563eb;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}

.video-form-intro h2 {
  color: #1c2c45;
  font-size: 18px;
}

.video-form-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.video-create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  gap: 14px;
  align-items: start;
}

.video-create-main {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.video-create-card,
.video-settings-panel {
  min-width: 0;
  border: 1px solid #dfe8f4;
  border-radius: 10px;
  background: #f9fbff;
}

.video-create-card {
  padding: 14px;
}

.video-create-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.video-create-card-head > div {
  min-width: 0;
}

.video-create-card-head h3 {
  color: #21344d;
  font-size: 15px;
  line-height: 1.4;
}

.video-create-card-head p {
  margin: 3px 0 0;
  color: #748399;
  font-size: 12px;
  line-height: 1.45;
}

.video-create-card-head > span {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid #d2e0f1;
  border-radius: 999px;
  color: #536b87;
  background: #fff;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.video-create-card-body {
  min-width: 0;
}

.video-create-card-body > .video-upload-section:first-child,
.video-create-card-body > .video-field:first-child {
  margin-top: 0;
}

.video-create-content-fields {
  display: grid;
  gap: 13px;
}

.video-create-content-fields > .video-field {
  margin-top: 0;
}

.video-primary-prompt textarea {
  height: 154px;
  min-height: 140px;
  line-height: 1.65;
}

.video-settings-panel {
  position: sticky;
  top: 18px;
  display: grid;
  align-content: start;
  padding: 14px;
  background: #f7faff;
  box-shadow: 0 12px 30px rgba(25, 67, 124, .07);
}

.video-settings-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  padding-bottom: 11px;
  border-bottom: 1px solid #dfe8f4;
}

.video-settings-head > div {
  min-width: 0;
}

.video-settings-head > div > span {
  display: block;
  margin-bottom: 2px;
  color: #2563eb;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .12em;
}

.video-settings-head h3 {
  color: #1d314a;
  font-size: 16px;
}

.video-settings-head p {
  margin: 0;
  color: #79899d;
  font-size: 11.5px;
  white-space: nowrap;
}

.video-settings-panel .video-model-section {
  gap: 10px;
  margin-top: 0;
}

.video-settings-panel .video-selected-model-info {
  display: grid;
  align-items: start;
  justify-content: stretch;
  gap: 7px;
  background: #fff;
}

.video-settings-panel .video-selected-model-info > div {
  display: grid;
  align-items: start;
  gap: 3px;
}

.video-settings-panel .video-selected-model-info span,
.video-settings-panel .video-selected-model-info small {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.video-settings-panel .video-selected-model-info span {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.video-settings-panel .video-control-grid {
  grid-template-columns: 1fr;
}

.video-settings-panel .video-spec-controls {
  gap: 9px;
}

.video-settings-panel .video-upload-label {
  align-items: flex-start;
}

.video-settings-footer {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid #dfe8f4;
}

.video-settings-cost {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.video-settings-cost span {
  color: #53677f;
  font-size: 12px;
  font-weight: 750;
}

.video-settings-cost b {
  color: #175cd3;
  font-size: 19px;
  line-height: 1.2;
}

.video-settings-footer > small {
  color: #8491a2;
  font-size: 11px;
  line-height: 1.4;
}

.video-settings-footer .video-generate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  height: 44px;
  gap: 7px;
  margin-top: 2px;
  font-weight: 850;
}

.video-active-task-strip {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #cfe0fb;
  border-radius: 9px;
  background: #f3f7ff;
}

.video-active-task-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
}

.video-active-task-icon .icon {
  width: 17px;
  height: 17px;
}

.video-active-task-copy {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 6px;
}

.video-active-task-copy > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 12px;
}

.video-active-task-copy b {
  overflow: hidden;
  color: #2b415d;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-active-task-copy span {
  flex: 0 0 auto;
  color: #536b87;
  font-size: 12px;
}

.video-form-sections {
  display: grid;
  gap: 10px;
}

.video-form-columns {
  grid-template-columns: minmax(260px, .82fr) minmax(380px, 1.18fr);
  align-items: start;
}

.video-form-column {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.video-form-section {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e0e9f5;
  border-radius: 10px;
  background: #f9fbff;
}

.video-form-section-head {
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  margin-bottom: 10px;
}

.video-form-section-head > span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #cfe0fb;
  border-radius: 8px;
  color: #175cd3;
  background: #edf5ff;
  font-size: 11px;
  font-weight: 900;
}

.video-form-section-head h3 {
  color: #233750;
  font-size: 15px;
  line-height: 1.35;
}

.video-form-section-head p {
  margin: 2px 0 0;
  color: #748399;
  font-size: 12px;
  line-height: 1.4;
}

.video-form-section-body {
  min-width: 0;
}

.video-upload-section,
.video-model-section,
.video-field {
  display: grid;
  gap: 7px;
  margin-top: 13px;
}

.video-form-section-body > .video-upload-section:first-child,
.video-form-section-body > .video-model-section:first-child,
.video-form-section-body > .video-field:first-child {
  margin-top: 0;
}

.video-field-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #263b54;
  font-weight: 800;
}

.video-field-label em {
  padding: 2px 7px;
  border: 1px solid #d4dfed;
  border-radius: 999px;
  color: #718198;
  background: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.video-title-field small {
  color: #78889b;
  font-size: 12px;
  line-height: 1.4;
}

.video-upload-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.video-upload-label b {
  color: #1b2a42;
}

.video-upload-label span {
  color: var(--muted);
  font-size: 12px;
}

.video-image-mode-select {
  display: grid;
  gap: 9px;
  margin-top: 0;
  padding-bottom: 13px;
  border-bottom: 1px solid #e4ebf2;
}

.video-image-mode-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.video-image-mode-options > label {
  position: relative;
  display: block;
  min-width: 0;
  padding: 10px;
  border: 1px solid #d7e2ed;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.video-image-mode-options > label:hover {
  border-color: #9ab7d5;
  background: #f8fbff;
}

.video-image-mode-options > label.active {
  border-color: #4b87c5;
  background: #eff6fd;
  box-shadow: inset 0 0 0 1px rgba(45, 108, 172, .08);
}

.video-image-mode-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.video-image-mode-options span,
.video-image-mode-options b,
.video-image-mode-options small {
  display: block;
  min-width: 0;
}

.video-image-mode-options b {
  color: #233d57;
  font-size: 12.5px;
}

.video-image-mode-options small {
  margin-top: 4px;
  color: #75869a;
  font-size: 10.5px;
  line-height: 1.4;
}

.video-image-drop-zone {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 76px;
  gap: 10px;
  padding: 3px 11px 3px 3px;
  border: 1px dashed #d1dfef;
  border-radius: 10px;
  background: #fbfdff;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.video-image-list {
  display: flex;
  min-width: 0;
  min-height: 72px;
  gap: 8px;
  overflow-x: auto;
  padding: 4px;
}

.video-drop-guidance {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 148px;
  gap: 7px;
  color: #667a92;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
  text-align: left;
}

.video-drop-guidance .icon {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  color: #3b73b9;
}

.video-image-drop-zone.is-full .video-drop-guidance {
  color: #8a97a8;
}

.video-image-drop-zone.is-disabled {
  border-style: solid;
  background: #f8fafc;
  opacity: .72;
}

.video-image-item,
.video-add-image {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  min-width: 64px;
  height: 64px;
  overflow: visible;
  border: 1px solid #cbd9ea;
  border-radius: 8px;
  background: #fff;
}

.video-image-item img {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  object-fit: cover;
}

.video-image-item.is-over-limit {
  border-color: #e59a93;
  background: #fff4f3;
  opacity: .68;
}

.video-image-role {
  position: absolute;
  right: 3px;
  bottom: 3px;
  max-width: calc(100% - 6px);
  padding: 2px 5px;
  overflow: hidden;
  border-radius: 4px;
  color: #fff;
  background: rgba(20, 40, 62, .82);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-image-item button,
.video-reference-ready > button {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #d92d20;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .14);
}

.video-image-item button .icon,
.video-reference-ready > button .icon {
  width: 12px;
  height: 12px;
}

.video-add-image {
  color: #2563eb;
  border-style: dashed;
  background: #f3f7ff;
  cursor: pointer;
}

.video-add-image:hover {
  color: #174fb5;
  border-color: #80aaf2;
  background: #edf4ff;
}

.video-add-image .icon {
  width: 24px;
  height: 24px;
}

.video-add-image small {
  color: currentColor;
  font-size: 9.5px;
  font-weight: 800;
}

.video-image-count-error {
  color: #b43b31;
  font-size: 11.5px;
  font-weight: 700;
}

.video-reference-paused {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #e7d8b7;
  border-radius: 8px;
  color: #725a27;
  background: #fffaf0;
}

.video-reference-paused b {
  font-size: 12px;
}

.video-reference-paused span {
  font-size: 11px;
  line-height: 1.45;
}

.video-add-image input,
.video-video-drop input {
  display: none;
}

.video-video-drop,
.video-reference-ready {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 60px;
  gap: 10px;
  padding: 10px 13px;
  border: 1px dashed #a9bfdf;
  border-radius: 8px;
  color: #405b78;
  background: #fff;
  cursor: pointer;
}

.video-video-drop-target {
  isolation: isolate;
  transition: color .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.video-video-drop:hover {
  color: #175cd3;
  border-color: #80aaf2;
  background: #f5f8ff;
}

.video-video-drop > .icon,
.video-reference-ready > .icon,
.video-reference-ready > span .icon {
  width: 25px;
  height: 25px;
  color: #2563eb;
}

.video-reference-ready {
  cursor: default;
}

.video-reference-ready > span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #2563eb;
  background: #edf4ff;
}

.video-video-drop > span {
  display: grid;
  gap: 3px;
}

.video-video-drop > span b {
  color: #304b68;
  font-size: 12.5px;
}

.video-video-drop > span small {
  color: #7b8da2;
  font-size: 11px;
}

.video-reference-ready > div:not(.video-drop-overlay) {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.video-reference-ready small {
  color: var(--muted);
}

.video-drop-overlay {
  position: absolute;
  inset: 3px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  visibility: hidden;
  border: 1px solid #75a4e7;
  border-radius: 8px;
  color: #164f9d;
  background: rgba(238, 246, 255, .97);
  box-shadow: 0 10px 28px rgba(31, 93, 177, .16);
  opacity: 0;
  pointer-events: none;
  transform: scale(.985);
  transition: opacity .12s ease, transform .12s ease, visibility .12s ease;
  backdrop-filter: blur(7px);
}

.video-drop-overlay .icon {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
}

.video-drop-overlay b {
  color: #164f9d;
  font-size: 12.5px;
  white-space: nowrap;
}

.video-drop-overlay small {
  color: #5f7898;
  font-size: 10.5px;
  white-space: nowrap;
}

.video-image-drop-zone.is-drag-over,
.video-video-drop-target.is-drag-over {
  border-color: #3d7fd3;
  background: #f1f7ff;
  box-shadow: 0 0 0 3px rgba(61, 127, 211, .11);
}

.video-image-drop-zone.is-drag-over .video-drop-overlay,
.video-video-drop-target.is-drag-over .video-drop-overlay {
  visibility: visible;
  opacity: 1;
  transform: scale(1);
}

.video-image-drop-zone.is-uploading,
.video-video-drop-target.is-uploading {
  cursor: wait;
}

.video-model-select-field {
  display: grid;
  gap: 7px;
}

.video-model-select {
  height: 42px;
  color: #233750;
  font-weight: 750;
  background-color: #fff;
}

.video-selected-model-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 10px 18px;
  padding: 9px 11px;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: #fff;
}

.video-selected-model-info > div {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.video-selected-model-info b {
  flex: 0 0 auto;
  color: #405772;
  font-size: 12px;
}

.video-selected-model-info span {
  min-width: 0;
  overflow: hidden;
  color: #6c7e93;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-selected-model-info small {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #175cd3;
  font-size: 11.5px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-spec-controls {
  display: grid;
  gap: 7px;
  margin-top: 2px;
  padding-top: 11px;
  border-top: 1px solid #e2eaf4;
}

.video-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.video-control-grid select {
  height: 38px;
}

.video-control-grid .video-audio-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #d4dfed;
  border-radius: 8px;
  background: #fff;
}

.video-control-grid .video-audio-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #2563eb;
}

.video-cost-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 11px;
  padding: 9px 12px;
  border: 1px solid #cfe0fb;
  border-radius: 8px;
  color: #536b87;
  background: #f3f7ff;
}

.video-cost-line b {
  color: #175cd3;
  font-size: 17px;
}

.video-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.video-actions .primary {
  min-width: 190px;
}

.video-prompt-section textarea {
  height: 80px;
  min-height: 76px;
}

.video-prompt-section .video-form-section-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.video-prompt-section .video-field {
  grid-column: 1 / -1;
}

.video-prompt-section .video-cost-line,
.video-prompt-section .video-actions {
  margin-top: 0;
}

.video-queue-panel {
  position: sticky;
  top: 18px;
  padding: 14px;
}

.video-queue-card {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #e0e8f3;
  border-radius: 8px;
  background: #f9fbff;
}

.video-queue-card > div:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
}

.video-queue-card p {
  margin: 0;
  color: #273c54;
  font-weight: 800;
}

.video-queue-card small {
  color: var(--muted);
}

.video-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4ecf8;
}

.video-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--violet));
  transition: width .25s ease;
}

.video-empty-state {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-height: 230px;
  padding: 44px 24px;
  text-align: center;
  color: #53677b;
}

.video-empty-state h2,
.video-empty-state p {
  margin: 0;
}

.video-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.video-tasks-panel {
  padding: 18px;
}

.video-task-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.video-task-toolbar select {
  width: 150px;
}

.video-task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.video-task-card {
  overflow: hidden;
  border: 1px solid #dce8ee;
  border-radius: 7px;
  background: #fff;
}

.video-task-cover {
  position: relative;
  display: grid;
  place-items: center;
  height: 165px;
  overflow: hidden;
  color: #7c91a0;
  background: #eef5f6;
}

.video-task-cover > .icon {
  width: 38px;
  height: 38px;
}

.video-task-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-task-cover .status-badge {
  position: absolute;
  z-index: 1;
  top: 10px;
  left: 10px;
}

.video-task-card-body {
  display: grid;
  gap: 8px;
  padding: 13px;
}

.video-task-card-body h3,
.video-task-card-body p {
  margin: 0;
}

.video-task-card-body p,
.video-task-card-body > div {
  color: var(--muted);
  font-size: 12px;
}

.video-task-card-body > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.video-detail-page {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 18px;
}

.video-detail-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e3ebef;
}

.video-detail-back {
  flex: 0 0 auto;
}

.video-detail-title {
  min-width: 0;
}

.video-detail-title h2 {
  margin: 0;
  color: #1d3248;
  font-size: 20px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.video-detail-title > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 10px;
  min-width: 0;
  margin-top: 5px;
}

.video-detail-title code,
.video-detail-title > div > span:not(.status-badge) {
  min-width: 0;
  color: #718296;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.video-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.video-detail-result-card,
.video-detail-spec-card,
.video-detail-script,
.video-detail-assets {
  min-width: 0;
  padding: 14px;
  border: 1px solid #dfe8ed;
  border-radius: 8px;
  background: #fff;
}

.video-detail-card-head,
.video-detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 10px;
}

.video-detail-card-head > div,
.video-detail-section-head > div {
  min-width: 0;
}

.video-detail-card-head span,
.video-detail-section-head span,
.video-detail-section-head small {
  display: block;
  margin-bottom: 3px;
  color: #7a8a9b;
  font-size: 11.5px;
}

.video-detail-card-head h3,
.video-detail-section-head h3 {
  margin: 0;
  color: #273d53;
  font-size: 15px;
  line-height: 1.35;
}

.video-result-stage,
.video-result-placeholder {
  display: grid;
  width: 100%;
  height: clamp(320px, calc(100dvh - 374px), 580px);
  min-width: 0;
  overflow: hidden;
  place-items: center;
  border-radius: 7px;
  background: #101820;
}

.video-result-stage {
  position: relative;
  display: block;
}

.video-result-player {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #101820;
}

.video-result-placeholder {
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  color: #dce8ea;
  text-align: center;
}

.video-result-placeholder span {
  max-width: min(560px, 100%);
  max-height: 120px;
  overflow: auto;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.video-result-placeholder .icon {
  width: 46px;
  height: 46px;
}

.video-spec-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.video-spec-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 9px 0;
  border-bottom: 1px solid #e7edf1;
}

.video-spec-list > div:last-child {
  border-bottom: 0;
}

.video-spec-list dt {
  color: var(--muted);
  font-size: 12px;
}

.video-spec-list dd {
  min-width: 0;
  margin: 0;
  color: #23384e;
  font-weight: 800;
  text-align: right;
  overflow-wrap: anywhere;
}

.video-detail-script,
.video-detail-assets {
  margin-top: 0;
}

.video-detail-side-stack {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 12px;
}

.video-detail-side-stack .video-spec-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.video-detail-side-stack .video-spec-list > div {
  display: grid;
  align-content: center;
  justify-content: stretch;
  min-height: 46px;
  gap: 3px;
  padding: 7px 9px;
  border: 1px solid #e3eaf0;
  border-radius: 7px;
  background: #f8fbfc;
}

.video-detail-side-stack .video-spec-list dt,
.video-detail-side-stack .video-spec-list dd {
  text-align: left;
}

.video-detail-copy {
  width: 100%;
  max-height: 180px;
  min-height: 64px;
  padding: 10px 12px;
  overflow: auto;
  color: #344b61;
  background: #f8fbfc;
  border: 1px solid #e3eaee;
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.video-detail-message {
  min-width: 0;
  margin-top: 0;
  padding: 11px 13px;
  border: 1px solid #ead7d5;
  border-radius: 8px;
  background: #fff9f8;
}

.video-detail-message > div {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #8e332d;
}

.video-detail-message > div span {
  font-size: 11px;
}

.video-detail-message p {
  max-height: 150px;
  margin: 8px 0 0;
  overflow: auto;
  color: #85403b;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.video-detail-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 8px;
  min-width: 0;
}

.video-detail-side-stack .video-detail-asset-grid {
  display: flex;
  max-height: none;
  padding: 0 0 3px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
}

.video-detail-side-stack .video-detail-asset-card {
  flex: 0 0 180px;
}

.video-detail-side-stack .video-detail-assets-empty {
  flex: 1 0 100%;
}

.video-detail-asset-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid #dce8ee;
  border-radius: 6px;
  background: #fbfdfe;
}

.video-detail-asset-preview {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  overflow: hidden;
  border-radius: 5px;
  background: #edf3f5;
}

.video-detail-asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-detail-asset-icon {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #4d657a;
}

.video-detail-asset-icon .icon {
  width: 26px;
  height: 26px;
}

.video-detail-asset-card figcaption {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
}

.video-detail-asset-card figcaption b {
  color: #2c4359;
  font-size: 12px;
}

.video-detail-asset-card figcaption span,
.video-detail-asset-card figcaption small {
  min-width: 0;
  overflow: hidden;
  color: #708193;
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-detail-assets-empty {
  display: grid;
  grid-column: 1 / -1;
  min-height: 68px;
  place-items: center;
  color: #7d8c9b;
  border: 1px dashed #d8e3e8;
  border-radius: 7px;
  background: #fbfdfe;
}

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

.video-config-editor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.video-config-editor .api-editor-section {
  grid-column: auto;
  grid-row: auto;
  min-width: 0;
}

.video-connection-grid {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.video-capability-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(145px, 1fr));
  gap: 8px;
}

.video-capability-picker > label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid #dbe5ed;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.video-capability-picker input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: #1677ff;
}

.video-capability-picker span,
.video-capability-picker b,
.video-capability-picker small {
  display: block;
  min-width: 0;
}

.video-capability-picker small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.video-duration-pricing {
  display: grid;
  gap: 10px;
  min-width: 0;
}

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

.video-duration-pricing-head b,
.video-duration-pricing-head span {
  display: block;
}

.video-duration-pricing-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.video-duration-price-rows {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.video-price-table-head {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(110px, .7fr) minmax(130px, .8fr) 36px;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #d5e0e9;
  color: #607486;
  font-size: 12px;
  font-weight: 700;
}

.video-duration-price-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(110px, .7fr) minmax(130px, .8fr) 36px;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px 0;
  border-bottom: 1px solid #dfe9f4;
}

.video-duration-price-row label {
  min-width: 0;
  margin: 0;
}

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

.video-duration-remove {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #d7e1ec;
  border-radius: 6px;
  color: #b42318;
  background: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.video-config-table td {
  vertical-align: top;
}

.video-api-url {
  display: inline-block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-capability-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 5px;
}

.video-capability-chips span {
  padding: 2px 6px;
  border: 1px solid #d5e0e9;
  border-radius: 4px;
  color: #354b5e;
  background: #f7fafc;
  font-size: 12px;
  white-space: nowrap;
}

.video-price-summary {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 6px;
  margin-bottom: 4px;
  font-size: 12px;
  line-height: 1.45;
}

.video-price-summary b {
  color: #1f3d52;
}

.video-price-summary span {
  color: #52687a;
}

.video-price-summary.is-unconfigured {
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 7px 9px;
  border: 1px solid #ead6aa;
  border-radius: 7px;
  background: #fffaf0;
}

.video-price-summary.is-unconfigured b {
  color: #775819;
}

.video-price-summary.is-unconfigured span {
  color: #96702a;
  font-size: 11.5px;
}

.video-duration-remove:hover {
  border-color: #f2b8b5;
  background: #fff5f4;
}

.video-admin-editor {
  min-width: 0;
  padding: 16px;
  border: 1px solid #dce8ee;
  border-radius: 7px;
  background: #fbfdfe;
}

.video-admin-editor h3,
.video-admin-list-panel h4 {
  margin: 0 0 14px;
}

.video-admin-list-panel {
  margin-top: 16px;
}

body.modal-open {
  overflow: hidden;
}

.video-config-overview-panel {
  overflow: hidden;
}

.video-config-overview-head {
  align-items: flex-start;
}

.video-config-overview-head > div:first-child {
  min-width: 0;
}

.video-section-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 7px;
  padding: 0 9px;
  border: 1px solid #cfe0f4;
  border-radius: 999px;
  color: #245985;
  background: #f2f7fc;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
}

.video-config-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 2px 0 18px;
  overflow: hidden;
  border: 1px solid #dce6f0;
  border-radius: 9px;
  background: #dce6f0;
}

.video-config-guide > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 13px 15px;
  border-radius: 8px;
  background: #f8fbfe;
}

.video-config-guide b {
  color: #233c54;
  font-size: 13px;
}

.video-config-guide span {
  color: #6a7c8f;
  font-size: 12px;
  line-height: 1.5;
}

.video-config-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.video-config-list-head h3,
.video-config-list-head p {
  margin: 0;
}

.video-config-list-head p {
  margin-top: 4px;
  font-size: 12px;
}

.video-list-hint {
  color: #7b8999;
  font-size: 12px;
  white-space: nowrap;
}

.video-config-list-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.video-provider-fold-actions {
  display: inline-flex;
  gap: 7px;
}

.video-config-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 210px;
  padding: 30px;
  text-align: center;
  border: 1px dashed #bfd0e0;
  border-radius: 9px;
  background: #f9fbfd;
}

.video-config-empty b {
  color: #263d54;
  font-size: 17px;
}

.video-config-empty span {
  max-width: 520px;
  color: #6a7c8f;
  line-height: 1.6;
}

.video-config-empty .primary {
  margin-top: 5px;
}

.video-provider-list {
  display: grid;
  gap: 14px;
}

.video-provider-card {
  overflow: hidden;
  border: 1px solid #d6e1eb;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(31, 51, 73, .045);
}

.video-provider-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 18px;
  border-bottom: 1px solid #e1e8ef;
  background: #f8fbfd;
}

.video-provider-card.is-collapsed > header {
  border-bottom: 0;
}

.video-provider-card > header > div:first-child {
  min-width: 0;
}

.video-provider-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.video-provider-title h3,
.video-provider-card > header p,
.video-provider-card > header small {
  margin: 0;
}

.video-provider-note {
  display: flex;
  align-items: flex-start;
  max-width: 780px;
  gap: 7px;
  margin-top: 9px;
  padding: 7px 9px;
  border: 1px solid #e4d8b8;
  border-radius: 7px;
  color: #735b26;
  background: #fffaf0;
  font-size: 11.5px;
  line-height: 1.45;
}

.video-provider-note b {
  flex: 0 0 auto;
  color: #6f5317;
}

.video-provider-note span {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.video-provider-title h3 {
  color: #20384f;
  font-size: 16px;
}

.video-provider-card > header p {
  max-width: 760px;
  margin-top: 7px;
  overflow: hidden;
  color: #52687a;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-provider-card > header small {
  display: block;
  margin-top: 6px;
  color: #7c8b99;
  font-size: 11.5px;
}

.video-provider-actions {
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.video-provider-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #245985;
  border-color: #bed2e6;
  background: #eef5fb;
}

.video-provider-toggle:hover {
  color: #174d78;
  border-color: #9fbedb;
  background: #e6f0f9;
}

.video-provider-chevron {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transform-origin: center;
}

.video-provider-card.is-expanded .video-provider-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.video-provider-models {
  padding: 0 14px 14px;
}

.video-provider-models[hidden] {
  display: none;
}

.video-provider-model-table {
  min-width: 920px !important;
  margin-top: 12px;
}

.video-provider-model-table th:nth-child(1) { width: 15%; }
.video-provider-model-table th:nth-child(2) { width: 22%; }
.video-provider-model-table th:nth-child(3) { width: 22%; }
.video-provider-model-table th:nth-child(4) { width: 13%; }
.video-provider-model-table th:nth-child(5) { width: 10%; }
.video-provider-model-table th:nth-child(6) { width: 18%; }

.video-provider-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 16px;
  border: 1px dashed #c7d6e4;
  border-radius: 8px;
  color: #6a7c8f;
  background: #fbfcfe;
  font-size: 12px;
}

.video-provider-modal-box {
  width: min(760px, calc(100vw - 48px));
}

.video-adapter-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border: 1px solid #bdd7d0;
  border-radius: 999px;
  color: #246454;
  background: #edf8f4;
  font-size: 10.5px;
  font-weight: 800;
}

.video-adapter-summary {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #d8e4ee;
  border-left: 3px solid #5e83a5;
  border-radius: 8px;
  background: #f8fbfd;
}

.video-adapter-summary b {
  color: #223c53;
  font-size: 12.5px;
}

.video-adapter-summary span {
  color: #687b8d;
  font-size: 11.5px;
  line-height: 1.55;
}

.video-adapter-details {
  overflow: visible;
  border: 1px solid #d8e3ed;
  border-radius: 9px;
  background: #fff;
}

.video-adapter-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  color: #2c465e;
  background: #f8fbfd;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.video-adapter-details > summary::-webkit-details-marker {
  display: none;
}

.video-adapter-details > summary span,
.video-adapter-details > summary b,
.video-adapter-details > summary small {
  display: block;
}

.video-adapter-details > summary b {
  font-size: 13px;
}

.video-adapter-details > summary small {
  margin-top: 3px;
  color: #7a8998;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
}

.video-adapter-details > summary i {
  width: 8px;
  height: 8px;
  border-right: 2px solid #6b7e90;
  border-bottom: 2px solid #6b7e90;
  transform: rotate(45deg) translate(-2px, 2px);
}

.video-adapter-details[open] > summary {
  border-bottom: 1px solid #dfe7ef;
  border-radius: 8px 8px 0 0;
}

.video-adapter-details[open] > summary i {
  transform: rotate(225deg) translate(-1px, -1px);
}

.video-adapter-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 14px;
  padding: 15px;
}

.video-adapter-field {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.video-adapter-field > label {
  color: #344b61;
  font-size: 12px;
  font-weight: 800;
}

.video-adapter-field > label em {
  margin-left: 4px;
  color: #b42318;
  font-size: 10px;
  font-style: normal;
}

.video-adapter-field > small {
  color: #82909f;
  font-size: 11.5px;
  line-height: 1.45;
}

.video-adapter-field input,
.video-adapter-field select {
  width: 100%;
}

.video-adapter-boolean {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 39px;
  padding: 0 11px;
  border: 1px solid #d7e1ec;
  border-radius: 7px;
  background: #fbfdfe;
}

.video-adapter-boolean input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #245985;
}

.video-adapter-boolean span {
  color: #53677a;
  font-size: 12px;
  font-weight: 700;
}

.video-adapter-empty {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border: 1px dashed #c9d6e2;
  border-radius: 7px;
  color: #687b8d;
  background: #fafcfe;
  font-size: 12px;
  line-height: 1.5;
}

.video-adapter-empty.is-error {
  color: #9a2d25;
  border-color: #e6c1bd;
  background: #fff7f6;
}

.video-model-adapter-details {
  background: #fff;
}

.video-config-table {
  min-width: 980px !important;
}

.video-config-table th:nth-child(1) { width: 14%; }
.video-config-table th:nth-child(2) { width: 17%; }
.video-config-table th:nth-child(3) { width: 18%; }
.video-config-table th:nth-child(4) { width: 19%; }
.video-config-table th:nth-child(5) { width: 11%; }
.video-config-table th:nth-child(6) { width: 8%; }
.video-config-table th:nth-child(7) { width: 13%; }

.video-model-name {
  display: inline-block;
  margin-bottom: 4px;
  color: #1b344b;
  font-size: 14px;
}

.video-model-public-remark {
  display: block;
  max-width: 240px;
  margin-top: 7px;
  color: #52687a;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}

.video-model-public-remark.is-empty {
  color: #97a3af;
}

.video-scene-text,
.video-script-price {
  display: block;
  margin-bottom: 6px;
  color: #52687a;
}

.video-config-actions {
  align-items: stretch;
}

.video-config-modal {
  z-index: 180;
  padding: 24px;
}

.video-config-modal-box {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1040px, calc(100vw - 48px));
  max-height: min(92vh, 960px);
  padding: 0;
  overflow: hidden;
  border: 1px solid #cfdae6;
  border-radius: 14px;
  background: #f5f8fb;
  box-shadow: 0 30px 90px rgba(12, 28, 46, .34);
}

.video-config-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: 20px 24px 17px;
  border-bottom: 1px solid #dce5ee;
  background: #fff;
}

.video-config-modal-head > div {
  min-width: 0;
}

.video-config-modal-head h2,
.video-config-modal-head p {
  margin: 0;
}

.video-config-modal-head h2 {
  color: #182e43;
  font-size: 22px;
  line-height: 1.3;
}

.video-config-modal-head p {
  margin-top: 7px;
  color: #66788a;
  font-size: 12.5px;
  line-height: 1.55;
}

.video-config-modal-head code {
  color: #315b82;
  background: #edf4fa;
}

.video-config-modal-close {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #d9e2eb;
  border-radius: 8px;
  color: #53677a;
  background: #f8fafc;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
}

.video-config-modal-close:hover {
  color: #a62b24;
  border-color: #e7c2bf;
  background: #fff6f5;
}

.video-config-modal-body {
  display: grid;
  gap: 14px;
  min-height: 0;
  padding: 18px 24px 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.video-config-form-section {
  padding: 18px;
  border: 1px solid #dce5ed;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(31, 51, 73, .035);
}

.video-config-section-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  margin-bottom: 16px;
}

.video-config-section-head > span {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  color: #245985;
  background: #eaf2f9;
  font-size: 12px;
  font-weight: 900;
}

.video-config-section-head h3,
.video-config-section-head p {
  margin: 0;
}

.video-config-section-head h3 {
  color: #20384f;
  font-size: 15px;
  line-height: 1.3;
}

.video-config-section-head p {
  margin-top: 4px;
  color: #718294;
  font-size: 12px;
  line-height: 1.45;
}

.video-config-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 14px;
  margin: 0;
}

.video-config-form-grid label {
  align-content: start;
}

.video-config-form-grid label > span {
  color: #344b61;
}

.video-config-form-grid label > small {
  margin-top: -3px;
  color: #82909f;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
}

.video-model-provider-summary {
  display: grid;
  grid-column: 1 / -1;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #dce5ed;
  border-radius: 8px;
  background: #f8fbfd;
}

.video-model-provider-summary > span {
  color: #344b61;
  font-size: 12px;
  font-weight: 800;
}

.video-model-provider-summary > b {
  color: #20384f;
  font-size: 14px;
}

.video-model-provider-summary > code {
  overflow-wrap: anywhere;
  color: #53677a;
  font-size: 12px;
}

.video-model-provider-summary > small {
  color: #82909f;
  font-size: 11.5px;
  line-height: 1.4;
}

.video-config-form-grid input:focus,
.video-config-form-grid select:focus,
.video-config-form-grid textarea:focus,
.video-duration-price-row input:focus {
  border-color: #5e83a5;
  box-shadow: 0 0 0 3px rgba(63, 105, 143, .11);
}

.video-config-subtitle {
  margin: 4px 0 8px;
  color: #344b61;
  font-size: 12px;
  font-weight: 850;
}

.video-image-mode-configuration {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #dce6ee;
  border-radius: 9px;
  background: #fbfdff;
  transition: opacity .16s ease, background .16s ease;
}

.video-image-mode-configuration.is-disabled {
  opacity: .58;
  background: #f5f7f9;
}

.video-image-mode-lead {
  margin: -3px 0 10px;
  color: #74879a;
  font-size: 11.5px;
  line-height: 1.5;
}

.video-image-mode-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.video-image-mode-picker > label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #dfe7ee;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.video-image-mode-picker > label:has(input:checked) {
  border-color: #7da8cd;
  background: #eef6fc;
  box-shadow: inset 0 0 0 1px rgba(48, 101, 145, .08);
}

.video-image-mode-picker input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: #315f88;
}

.video-image-mode-picker span,
.video-image-mode-picker b,
.video-image-mode-picker small {
  display: block;
  min-width: 0;
}

.video-image-mode-picker b {
  color: #29445c;
  font-size: 12.5px;
}

.video-image-mode-picker small {
  margin-top: 3px;
  color: #75889a;
  font-size: 11px;
  line-height: 1.4;
}

.video-image-mode-settings {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.video-scene-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 16px;
}

.video-scene-picker > label,
.video-config-modal .video-capability-picker > label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid #dce5ed;
  border-radius: 8px;
  background: #f9fbfd;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.video-scene-picker > label:has(input:checked),
.video-config-modal .video-capability-picker > label:has(input:checked) {
  border-color: #8eb2d2;
  background: #f1f7fc;
  box-shadow: inset 0 0 0 1px rgba(64, 112, 154, .08);
}

.video-scene-picker input,
.video-config-modal .video-capability-picker input {
  width: 17px;
  height: 17px;
  min-width: 17px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: #315f88;
}

.video-scene-picker b,
.video-scene-picker small,
.video-config-modal .video-capability-picker b,
.video-config-modal .video-capability-picker small {
  display: block;
}

.video-scene-picker b,
.video-config-modal .video-capability-picker b {
  color: #2d465d;
  font-size: 13px;
}

.video-scene-picker small,
.video-config-modal .video-capability-picker small {
  margin-top: 3px;
  color: #77899a;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
}

.video-config-modal .video-capability-picker {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.video-config-modal .video-duration-pricing {
  padding: 0;
}

.video-config-modal .video-duration-pricing-head {
  margin-bottom: 2px;
}

.video-config-modal .video-price-table-head {
  padding-right: 0;
  padding-left: 0;
}

.video-config-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px;
  border-top: 1px solid #d7e1ea;
  background: #fff;
  box-shadow: 0 -8px 22px rgba(24, 46, 67, .05);
}

.video-config-modal-actions > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.video-config-modal-actions > div:first-child b {
  color: #344b61;
  font-size: 12px;
}

.video-config-modal-actions > div:first-child span {
  color: #7a8998;
  font-size: 11.5px;
}

.video-config-modal-actions > div:last-child {
  display: flex;
  gap: 9px;
  flex: 0 0 auto;
}

.video-config-modal-actions button {
  min-width: 92px;
}

.video-config-modal-actions button:disabled {
  cursor: wait;
  opacity: .65;
}

@media (max-width: 960px) {
  .video-workspace,
  .video-create-grid,
  .video-detail-grid,
  .video-admin-grid,
  .video-config-editor {
    grid-template-columns: 1fr;
  }

  .video-settings-panel {
    position: static;
  }

  .video-settings-panel .video-control-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  }

  .video-connection-grid {
    grid-template-columns: 1fr;
  }

  .video-capability-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-config-guide {
    grid-template-columns: 1fr;
  }

  .video-config-modal .video-capability-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-duration-price-rows {
    grid-template-columns: 1fr;
  }

  .video-queue-panel {
    position: static;
  }
}

@media (max-width: 1280px) {
  .video-form-columns {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1400px) {
  .video-detail-grid {
    grid-template-columns: minmax(0, 1fr) minmax(500px, 520px);
  }

  .video-detail-side-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-detail-side-stack .video-detail-spec-card,
  .video-detail-side-stack .video-detail-message {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .video-capability-picker {
    grid-template-columns: 1fr;
  }

  .video-config-overview-head,
  .video-config-list-head,
  .video-provider-card > header,
  .video-config-modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .video-config-overview-head .primary,
  .video-config-modal-actions button {
    width: 100%;
  }

  .video-list-hint {
    white-space: normal;
  }

  .video-config-list-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .video-provider-fold-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .video-provider-actions {
    justify-content: flex-start;
  }

  .video-provider-empty {
    align-items: stretch;
    flex-direction: column;
  }

  .video-config-modal {
    padding: 8px;
  }

  .video-config-modal-box {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 10px;
  }

  .video-config-modal-head,
  .video-config-modal-body,
  .video-config-modal-actions {
    padding-right: 14px;
    padding-left: 14px;
  }

  .video-config-form-section {
    padding: 14px;
  }

  .video-config-form-grid,
  .video-adapter-fields,
  .video-scene-picker,
  .video-config-modal .video-capability-picker,
  .video-image-mode-picker,
  .video-image-mode-settings {
    grid-template-columns: 1fr;
  }

  .video-config-modal-actions > div:last-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .video-price-table-head {
    grid-template-columns: minmax(0, 1fr) minmax(85px, .7fr) minmax(95px, .8fr) 36px;
    font-size: 11px;
  }

  .video-duration-price-row {
    grid-template-columns: minmax(0, 1fr) minmax(85px, .7fr) minmax(95px, .8fr) 36px;
  }
}

@media (max-width: 640px) {
  .video-page .page-head,
  .video-detail-head,
  .video-task-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .video-control-grid {
    grid-template-columns: 1fr;
  }

  .video-settings-panel .video-control-grid {
    grid-template-columns: 1fr;
  }

  .video-create-card,
  .video-settings-panel {
    padding: 12px;
  }

  .video-create-card-head {
    flex-wrap: wrap;
    margin-bottom: 10px;
  }

  .video-primary-prompt textarea {
    height: 150px;
  }

  .video-settings-head {
    align-items: flex-start;
  }

  .video-active-task-strip {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .video-active-task-copy {
    min-width: calc(100% - 46px);
  }

  .video-active-task-copy > div:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .video-active-task-strip > button {
    width: 100%;
  }

  .video-selected-model-info,
  .video-selected-model-info > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .video-selected-model-info > div {
    gap: 3px;
  }

  .video-selected-model-info span,
  .video-selected-model-info small {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .video-tabs {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .video-tabs button {
    padding: 0 8px;
    font-size: 12px;
  }

  .video-task-toolbar select {
    width: 100%;
  }

  .video-form-panel,
  .video-tasks-panel,
  .video-detail-page {
    padding: 14px;
  }

  .video-form-section {
    padding: 12px;
  }

  .video-form-intro {
    gap: 11px;
  }

  .video-form-intro-icon {
    width: 40px;
    height: 40px;
  }

  .video-form-section-head {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 9px;
  }

  .video-form-section-head > span {
    width: 29px;
    height: 29px;
  }

  .video-actions .primary {
    width: 100%;
    min-width: 0;
  }

  .video-prompt-section .video-form-section-body {
    grid-template-columns: 1fr;
  }

  .video-prompt-section .video-cost-line,
  .video-prompt-section .video-actions {
    grid-column: 1;
  }

  .video-result-stage,
  .video-result-placeholder {
    height: min(58vh, 520px);
    min-height: 280px;
  }

  .video-result-player {
    min-height: 0;
  }

  .video-detail-card-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

.video-page + footer {
  margin-top: 26px !important;
  padding-top: 16px !important;
}

@media (max-width: 900px) {
  body.admin-page-body {
    overflow-x: hidden;
    background: #f5f8fc;
  }

  body.admin-page-body .admin-shell {
    display: block;
    min-width: 0;
  }

  body.admin-page-body .admin-sidebar {
    position: sticky;
    top: 0;
    inset: auto;
    z-index: 90;
    width: 100%;
    height: auto;
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    background: rgba(255,255,255,.98);
    border-right: 0;
    border-bottom: 1px solid #dbe6f5;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
    backdrop-filter: blur(16px);
  }

  body.admin-page-body .admin-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
  }

  body.admin-page-body .admin-sidebar .brand {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
  }

  body.admin-page-body .admin-sidebar .brand small {
    display: block;
  }

  body.admin-page-body .admin-front-link {
    display: inline-flex;
    flex: 0 0 auto;
    width: auto;
    height: 34px;
    padding: 0 12px;
    font-size: 12px;
    box-shadow: none;
  }

  body.admin-page-body .admin-nav {
    display: flex;
    gap: 7px;
    min-width: 0;
    margin-top: 0 !important;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 0 2px 2px;
    scrollbar-width: none;
  }

  body.admin-page-body .admin-nav::-webkit-scrollbar {
    display: none;
  }

  body.admin-page-body .admin-nav .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    height: 34px;
    padding: 0 12px;
    flex-direction: row;
    gap: 0;
    border: 1px solid #e0e9f6;
    border-radius: 999px;
    background: #f8fbff;
    color: #40536f;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    transform: none;
  }

  body.admin-page-body .admin-nav .nav-item.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #2563eb, #6548f4);
    box-shadow: 0 8px 18px rgba(37,99,235,.18);
  }

  body.admin-page-body .admin-main {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 14px 12px 28px;
    grid-column: auto;
  }

  body.admin-page-body .admin-page-head {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e3edf8;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
  }

  body.admin-page-body .admin-page-head > div:first-child {
    min-width: 0;
  }

  body.admin-page-body .admin-current-tab {
    display: inline-flex;
    align-items: center;
    height: 24px;
    margin-bottom: 6px;
    padding: 0 9px;
    color: #1456d9;
    background: #edf4ff;
    border: 1px solid #cfe0ff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 850;
  }

  body.admin-page-body .admin-page-head .page-title {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
  }

  body.admin-page-body .admin-page-head .page-sub {
    margin-top: 6px;
    font-size: 12px;
  }

  body.admin-page-body .admin-topbar {
    position: static;
    inset: auto;
    width: 100%;
    min-height: 0;
    justify-content: space-between;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body.admin-page-body .admin-topbar .user-email {
    min-width: 0;
    max-width: calc(100vw - 118px);
    overflow: hidden;
    color: #52657d;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.admin-page-body .panel,
  body.admin-page-body .admin-card {
    padding: 14px;
    border-radius: 10px;
  }

  body.admin-page-body .panel > h2,
  body.admin-page-body .panel > h3,
  body.admin-page-body .admin-card > h3 {
    margin-top: 0;
    font-size: 18px;
    line-height: 1.3;
  }

  body.admin-page-body .admin-section-head {
    gap: 10px;
    padding: 0 0 12px;
  }

  body.admin-page-body .admin-section-head h2,
  body.admin-page-body .admin-section-head h3 {
    font-size: 18px;
    line-height: 1.3;
  }

  body.admin-page-body .admin-form {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 12px;
  }

  body.admin-page-body .admin-form input,
  body.admin-page-body .admin-form select,
  body.admin-page-body .admin-form textarea {
    width: 100%;
  }

  body.admin-page-body .video-capability-picker > label > input[type="checkbox"] {
    flex: 0 0 16px;
    width: 16px;
    min-width: 16px;
  }

  body.admin-page-body .video-capability-picker > label > span {
    flex: 1 1 auto;
  }

  body.admin-page-body .admin-action-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 12px;
  }

  body.admin-page-body .admin-action-bar .primary,
  body.admin-page-body .admin-action-bar .ghost,
  body.admin-page-body .admin-action-bar .mini {
    width: 100%;
  }

  body.admin-page-body .admin-action-bar .muted,
  body.admin-page-body .admin-action-bar a.ghost {
    grid-column: 1 / -1;
  }

  body.admin-page-body .admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.admin-page-body .metric-card {
    min-height: 86px;
    padding: 13px;
  }

  body.admin-page-body .metric-card h2 {
    margin-top: 9px;
    font-size: 22px;
    line-height: 1.2;
    word-break: break-word;
  }

  body.admin-page-body .admin-table-scroll {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  body.admin-page-body .admin-table {
    display: block;
    min-width: 0;
    width: 100%;
    border: 0;
    background: transparent;
  }

  body.admin-page-body .admin-table thead {
    display: none;
  }

  body.admin-page-body .admin-table tbody,
  body.admin-page-body .admin-table tr,
  body.admin-page-body .admin-table td {
    display: block;
    width: 100%;
  }

  body.admin-page-body .admin-table tr {
    margin-bottom: 10px;
    padding: 10px 11px;
    background: #fff;
    border: 1px solid #e3edf8;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
  }

  body.admin-page-body .admin-table td {
    min-height: 34px;
    padding: 8px 0;
    border-bottom: 1px solid #eef3f9;
    color: #26364c;
    font-size: 12.5px;
    line-height: 1.45;
    word-break: break-word;
  }

  body.admin-page-body .admin-table td:last-child {
    border-bottom: 0;
  }

  body.admin-page-body .admin-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: #718197;
    font-size: 11px;
    font-weight: 850;
    line-height: 1.2;
  }

  body.admin-page-body .admin-table td[colspan]::before {
    display: none;
  }

  body.admin-page-body .admin-table td:not([data-label])::before {
    display: none;
  }

  body.admin-page-body .admin-table .num,
  body.admin-page-body .admin-table .wide {
    width: auto;
    white-space: normal;
  }

  body.admin-page-body .admin-row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 7px;
  }

  body.admin-page-body .admin-row-actions .mini {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  body.admin-page-body .pager {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    margin-top: 14px;
    text-align: center;
  }

  body.admin-page-body .pager-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  body.admin-page-body .pager-actions .mini {
    width: 100%;
    min-width: 0;
    padding: 0 6px;
  }

  body.admin-page-body .billing-package-row {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  body.admin-page-body .billing-package-row .full {
    grid-column: 1;
  }

  body.admin-page-body .cards-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.admin-page-body .admin-log-modal pre,
  body.admin-page-body .modal-box pre {
    max-height: 240px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
  }

  body.admin-page-body .modal {
    padding: 10px;
    align-items: start;
    overflow-y: auto;
  }

  body.admin-page-body .modal-box,
  body.admin-page-body .modal-frame,
  body.admin-page-body .lightbox-box {
    width: calc(100vw - 20px);
    max-height: none;
  }

  body.admin-page-body .modal-box {
    padding: 14px;
    border-radius: 12px;
  }

  body.admin-page-body .modal-box .page-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 640px) {
  body.admin-page-body .admin-sidebar {
    padding-right: 10px;
    padding-left: 10px;
  }

  body.admin-page-body .admin-main {
    padding: 12px 10px 24px;
  }

  body.admin-page-body .admin-page-head,
  body.admin-page-body .panel,
  body.admin-page-body .admin-card {
    padding: 12px;
  }

  body.admin-page-body .admin-front-link {
    height: 32px;
    padding: 0 10px;
  }

  body.admin-page-body .admin-nav .nav-item {
    height: 32px;
    padding: 0 10px;
    font-size: 11.5px;
  }

  body.admin-page-body .admin-metrics {
    grid-template-columns: 1fr;
  }

  body.admin-page-body .admin-action-bar {
    grid-template-columns: 1fr;
  }

  body.admin-page-body .admin-row-actions {
    grid-template-columns: 1fr;
  }

  body.admin-page-body .pager-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-page-body .admin-table tr {
    padding: 9px 10px;
  }

  body.admin-page-body .redeem-code-cell,
  body.admin-page-body .api-key-cell {
    white-space: normal;
    word-break: break-all;
  }
}

@media (max-width: 900px) {
  body.admin-page-body .video-config-table {
    min-width: 0 !important;
  }

  body.admin-page-body .video-config-modal {
    align-items: center;
    padding: 12px;
    overflow: hidden;
  }

  body.admin-page-body .video-config-modal-box {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
  }

  body.admin-page-body .video-config-modal-body {
    overflow-y: auto;
  }

  body.admin-page-body .video-config-modal-actions {
    display: flex;
  }
}

@media (max-width: 640px) {
  body.admin-page-body .video-config-modal {
    padding: 8px;
  }

  body.admin-page-body .video-config-modal-box {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 0;
    border-radius: 10px;
  }

  body.admin-page-body .video-config-modal-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* 后台视频任务详情：所有长文本都限制在弹窗内部，避免撑破整页。 */
body.admin-page-body .video-task-detail-modal {
  align-items: center;
  padding: 24px;
  overflow: hidden;
}

body.admin-page-body .video-task-detail-box {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(980px, calc(100vw - 48px));
  height: min(860px, calc(100dvh - 48px));
  max-height: none;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
}

.video-task-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  padding: 20px 24px 18px;
  border-bottom: 1px solid #dce5ed;
  background: #fff;
}

.video-task-detail-head > div {
  min-width: 0;
}

.video-task-detail-head h2 {
  margin: 5px 0 6px;
  color: #1f354b;
  font-size: 21px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.video-task-detail-head code {
  display: block;
  max-width: 100%;
  color: #6a7c8e;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.video-task-detail-body {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  padding: 18px 24px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.video-task-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.video-task-overview-grid > div {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  min-height: 84px;
  padding: 12px 13px;
  border: 1px solid #dfe8f1;
  border-radius: 9px;
  background: #f8fafc;
}

.video-task-overview-grid span,
.video-task-overview-grid small {
  color: #77889a;
  font-size: 11.5px;
  line-height: 1.35;
}

.video-task-overview-grid b {
  min-width: 0;
  color: #253d55;
  font-size: 13.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.video-task-detail-section {
  min-width: 0;
  padding: 15px;
  border: 1px solid #dfe8f1;
  border-radius: 10px;
  background: #fff;
}

.video-task-detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 10px;
}

.video-task-detail-section-head h3 {
  margin: 0;
  color: #263d54;
  font-size: 14px;
}

.video-task-detail-section-head span {
  min-width: 0;
  color: #8190a0;
  font-size: 11.5px;
  text-align: right;
  overflow-wrap: anywhere;
}

body.admin-page-body .video-task-detail-text,
body.admin-page-body .video-task-attempt-card pre {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  max-height: 220px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  color: #344b61;
  background: #f7f9fc;
  border: 1px solid #e1e8f0;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.video-task-user-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(290px, .85fr);
  gap: 12px;
  min-width: 0;
}

.video-task-user-content-block {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e0e8f0;
  border-radius: 9px;
  background: #fbfcfe;
}

.video-task-user-content-block > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  margin-bottom: 9px;
}

.video-task-user-content-block > header b {
  color: #2d455d;
  font-size: 12.5px;
}

.video-task-user-content-block > header span {
  min-width: 0;
  color: #8190a0;
  font-size: 11px;
  text-align: right;
  overflow-wrap: anywhere;
}

body.admin-page-body .video-task-user-content-block .video-task-detail-text {
  min-height: 164px;
  max-height: 260px;
}

.video-task-user-assets {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  max-height: 260px;
  padding-right: 3px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.video-task-user-asset {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #e2e9f1;
  border-radius: 8px;
  background: #fff;
}

.video-task-user-asset-preview {
  position: relative;
  display: grid;
  width: 96px;
  height: 72px;
  place-items: center;
  overflow: hidden;
  color: #54718d;
  border: 1px solid #dce6ef;
  border-radius: 7px;
  background: #eef4f8;
  text-decoration: none;
}

.video-task-user-asset-preview:hover {
  border-color: #8ab8df;
  box-shadow: 0 4px 12px rgba(37, 89, 133, .12);
}

.video-task-user-asset-preview img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-task-user-asset-preview.is-missing {
  border-style: dashed;
}

.video-task-user-asset-preview .video-task-asset-kind {
  position: relative;
  z-index: 0;
  color: #54718d;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}

.video-task-user-asset-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.video-task-user-asset-meta b,
.video-task-user-asset-meta span,
.video-task-user-asset-meta small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-task-user-asset-meta b {
  color: #2b455d;
  font-size: 12px;
}

.video-task-user-asset-meta span {
  color: #53697f;
  font-size: 11.5px;
}

.video-task-user-asset-meta small {
  color: #8a98a7;
  font-size: 10.5px;
}

.video-task-user-video-url {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 3px;
}

.video-task-user-video-url code {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #526b82;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-task-user-video-url .mini {
  min-height: 26px;
  padding: 4px 8px;
  font-size: 10.5px;
  white-space: nowrap;
}

.video-task-error-section {
  border-color: #f0d5d2;
  background: #fffafa;
}

.video-task-error-section .video-task-detail-text {
  color: #8f302a;
  background: #fff6f5;
  border-color: #f0d5d2;
}

.video-task-attempt-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.video-task-attempt-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid #e0e8f0;
  border-radius: 9px;
  background: #fbfcfe;
}

.video-task-attempt-card.is-first {
  border-left: 3px solid #7aa8ce;
}

.video-task-attempt-card.is-last,
.video-task-attempt-card.is-only {
  border-left: 3px solid #2f8b72;
}

.video-task-attempt-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.video-task-attempt-card > header > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.video-task-attempt-card > header span,
.video-task-attempt-card > header b {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.video-task-attempt-card > header b {
  color: #245985;
}

.video-task-attempt-boundary {
  padding: 3px 7px;
  color: #315d83;
  border-radius: 999px;
  background: #e8f2fa;
  font-size: 10.5px !important;
  font-weight: 850;
  white-space: nowrap;
}

.video-task-attempt-card.is-last .video-task-attempt-boundary,
.video-task-attempt-card.is-only .video-task-attempt-boundary {
  color: #216650;
  background: #e4f4ee;
}

.video-task-attempt-metrics {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  color: #7b8998;
}

.video-task-attempt-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  min-width: 0;
  margin-top: 9px;
  color: #637588;
  font-size: 11.5px;
}

.video-task-attempt-meta span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.video-task-inline-error {
  min-width: 0;
  margin-top: 10px;
  padding: 10px 11px;
  color: #8f302a;
  border: 1px solid #f0d5d2;
  border-radius: 8px;
  background: #fff6f5;
}

.video-task-inline-error b,
.video-task-inline-error p {
  margin: 0;
  font-size: 12px;
}

.video-task-inline-error p {
  max-height: 104px;
  margin-top: 5px;
  overflow: auto;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.video-task-attempt-payloads {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  margin-top: 10px;
}

.video-task-attempt-payloads details {
  min-width: 0;
  border: 1px solid #e1e8f0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.video-task-attempt-payloads summary {
  padding: 9px 11px;
  color: #425971;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.video-task-attempt-payloads details[open] summary {
  border-bottom: 1px solid #e1e8f0;
}

body.admin-page-body .video-task-attempt-card pre {
  max-height: 240px;
  border: 0;
  border-radius: 0;
}

.video-task-detail-empty {
  display: grid;
  min-height: 90px;
  place-items: center;
  color: #8391a0;
  border: 1px dashed #d8e2ec;
  border-radius: 9px;
  background: #fafcfe;
}

.video-task-detail-empty.is-compact {
  min-height: 164px;
}

@media (max-width: 900px) {
  body.admin-page-body .video-task-detail-modal {
    align-items: center;
    padding: 12px;
    overflow: hidden;
  }

  body.admin-page-body .video-task-detail-box {
    width: calc(100vw - 24px);
    height: calc(100dvh - 24px);
    max-height: none;
    padding: 0;
  }

  .video-task-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .video-task-user-content-grid {
    grid-template-columns: 1fr;
  }

  body.admin-page-body .video-task-user-content-block .video-task-detail-text,
  .video-task-user-assets {
    min-height: 0;
    max-height: 220px;
  }
}

@media (max-width: 640px) {
  body.admin-page-body .video-task-detail-modal {
    padding: 8px;
  }

  body.admin-page-body .video-task-detail-box {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    border-radius: 10px;
  }

  .video-task-detail-head,
  .video-task-detail-body {
    padding-right: 13px;
    padding-left: 13px;
  }

  .video-task-detail-head {
    padding-top: 14px;
    padding-bottom: 13px;
  }

  .video-task-detail-head h2 {
    font-size: 17px;
  }

  .video-task-detail-body {
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 14px;
  }

  .video-task-overview-grid,
  .video-task-attempt-payloads {
    grid-template-columns: 1fr;
  }

  .video-task-detail-section {
    padding: 12px;
  }

  .video-task-detail-section-head,
  .video-task-attempt-card > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .video-task-detail-section-head span {
    text-align: left;
  }

  .video-task-attempt-metrics {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

body.admin-page-body .sidebar-menu-order-card {
  position: relative;
  margin-bottom: 16px;
  overflow: hidden;
  border-color: #cddff5;
  background:
    linear-gradient(135deg, rgba(236, 245, 255, .9), rgba(255, 255, 255, .98) 42%),
    #fff;
}

body.admin-page-body .sidebar-menu-order-card::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 170px;
  height: 170px;
  background: radial-gradient(circle at top right, rgba(59, 130, 246, .12), transparent 68%);
  content: "";
  pointer-events: none;
}

.sidebar-menu-order-head,
.sidebar-menu-order-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.sidebar-menu-order-head h3 {
  margin: 4px 0 5px;
}

.sidebar-menu-order-head p,
.sidebar-menu-order-footer span {
  margin: 0;
  color: #65758b;
  font-size: 13px;
  line-height: 1.55;
}

.sidebar-menu-order-head > b {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid #cfe0f5;
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  color: #31557e;
  font-size: 12px;
}

.sidebar-menu-order-kicker {
  color: #3575c7;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
}

.sidebar-menu-order-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  width: min(100%, 760px);
  margin: 18px 0;
}

.sidebar-menu-order-row {
  display: grid;
  grid-template-columns: 32px 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 13px 8px 10px;
  border: 1px solid #dbe7f5;
  border-radius: 11px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 4px 12px rgba(43, 73, 111, .045);
  cursor: grab;
  user-select: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, opacity .16s ease;
}

.sidebar-menu-order-row:hover {
  border-color: #9fc5ef;
  box-shadow: 0 7px 18px rgba(43, 91, 145, .1);
  transform: translateY(-1px);
}

.sidebar-menu-order-row:focus-visible {
  border-color: #4285d4;
  outline: 3px solid rgba(66, 133, 212, .16);
  outline-offset: 1px;
}

.sidebar-menu-order-row:active {
  cursor: grabbing;
}

.sidebar-menu-order-row.is-dragging {
  z-index: 3;
  border-color: #4e91df;
  opacity: .45;
  box-shadow: 0 12px 24px rgba(40, 94, 157, .18);
}

.sidebar-menu-order-list.is-sorting .sidebar-menu-order-row:not(.is-dragging) {
  transition: transform .1s ease, border-color .1s ease;
}

.sidebar-menu-order-index {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: #edf5ff;
  color: #3975b8;
  font-size: 12px;
  font-weight: 900;
}

.sidebar-menu-drag-handle {
  width: 16px;
  height: 24px;
  opacity: .62;
  background-image: radial-gradient(circle, #58718f 1.45px, transparent 1.6px);
  background-position: 0 0;
  background-size: 7px 7px;
}

.sidebar-menu-order-name {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.sidebar-menu-order-name strong {
  overflow: hidden;
  color: #18283d;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-menu-order-name small {
  color: #8796a9;
  font-size: 11px;
  letter-spacing: .02em;
}

.sidebar-menu-order-hint {
  color: #8392a6;
  font-size: 12px;
}

.sidebar-menu-order-footer {
  width: min(100%, 760px);
  padding-top: 2px;
}

.sidebar-menu-order-footer .primary {
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .sidebar-menu-order-head,
  .sidebar-menu-order-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .sidebar-menu-order-head > b {
    position: absolute;
    top: 0;
    right: 0;
  }

  .sidebar-menu-order-row {
    grid-template-columns: 30px 18px minmax(0, 1fr);
    gap: 9px;
  }

  .sidebar-menu-order-hint {
    display: none;
  }

  .sidebar-menu-order-footer .primary {
    width: 100%;
  }
}

body.admin-page-body .settings-page-head {
  align-items: center;
  margin-bottom: 16px;
}

.settings-fold-toolbar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.settings-fold-toolbar .mini {
  min-width: 82px;
  background: #f8fbff;
}

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

body.admin-page-body .settings-fold-card,
body.admin-page-body .settings-fold-card.sidebar-menu-order-card {
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border-color: #d8e4f2;
  border-radius: 12px;
  box-shadow: 0 5px 16px rgba(38, 66, 101, .045);
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

body.admin-page-body .settings-fold-card.is-collapsed:hover {
  border-color: #afc9e7;
  box-shadow: 0 7px 20px rgba(38, 79, 126, .08);
}

.settings-fold-head,
.sidebar-menu-order-head.settings-fold-head {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 17px;
  cursor: pointer;
}

.settings-fold-title,
.sidebar-menu-order-head.settings-fold-head > div:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

body.admin-page-body .settings-fold-head h3,
.sidebar-menu-order-head.settings-fold-head h3 {
  margin: 0;
  color: #17263a;
  font-size: 16px;
  line-height: 1.35;
}

.settings-fold-title p,
.sidebar-menu-order-head.settings-fold-head p {
  overflow: hidden;
  margin: 0;
  color: #718197;
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-menu-order-head.settings-fold-head .sidebar-menu-order-kicker {
  margin-bottom: -1px;
}

.settings-fold-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.settings-fold-head-actions > b {
  padding: 6px 10px;
  border: 1px solid #d4e2f2;
  border-radius: 999px;
  background: rgba(255, 255, 255, .84);
  color: #466786;
  font-size: 11px;
  white-space: nowrap;
}

.settings-fold-toggle.mini {
  display: inline-flex;
  min-width: 72px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-color: #d3e0ef;
  background: #fff;
  color: #45627f;
  box-shadow: none;
}

.settings-fold-toggle.mini:hover {
  border-color: #91b9e6;
  background: #f5f9ff;
  color: #2466ad;
}

.settings-fold-chevron {
  width: 7px;
  height: 7px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform .18s ease;
}

.settings-fold-card:not(.is-collapsed) .settings-fold-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.settings-fold-body {
  position: relative;
  z-index: 1;
  padding: 18px;
  border-top: 1px solid #e2ebf5;
  background: rgba(255, 255, 255, .72);
}

.settings-fold-body[hidden] {
  display: none !important;
}

.settings-fold-card.is-collapsed .settings-fold-head {
  min-height: 66px;
}

.settings-raw-card .settings-fold-body {
  padding: 0;
}

.settings-raw-card .admin-table-scroll {
  border: 0;
  border-radius: 0;
}

@media (max-width: 640px) {
  body.admin-page-body .settings-page-head {
    align-items: stretch;
  }

  .settings-fold-toolbar {
    width: 100%;
  }

  .settings-fold-toolbar .mini {
    flex: 1 1 0;
  }

  .settings-fold-head,
  .sidebar-menu-order-head.settings-fold-head {
    min-height: 68px;
    gap: 10px;
    padding: 12px;
  }

  .settings-fold-title p,
  .sidebar-menu-order-head.settings-fold-head p {
    max-width: 62vw;
  }

  .settings-fold-head-actions > b,
  .settings-fold-toggle-text {
    display: none;
  }

  .settings-fold-toggle.mini {
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
  }

  .settings-fold-body {
    padding: 13px;
  }
}

@media (max-width: 900px) {
  .video-image-mode-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .video-image-mode-options {
    grid-template-columns: 1fr;
  }

  .video-image-drop-zone {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 3px;
  }

  .video-drop-guidance {
    max-width: none;
    justify-content: flex-start;
    padding: 0 8px 7px;
  }

  .video-drop-overlay {
    flex-wrap: wrap;
    align-content: center;
    line-height: 1.25;
  }

  .video-drop-overlay small {
    width: 100%;
    text-align: center;
  }
}

/* Admin operations analytics dashboard */
.analytics-dashboard {
  --analytics-ink: #132338;
  --analytics-muted: #6e7f94;
  --analytics-line: #dbe6f1;
  --analytics-soft: #f4f8fc;
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 18px;
  padding-bottom: 28px;
}

.analytics-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  overflow: hidden;
  padding: 26px;
  border: 1px solid #263b54;
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px),
    radial-gradient(circle at 82% 10%, rgba(49, 196, 170, .22), transparent 31%),
    linear-gradient(118deg, #0d1c2f 0%, #152b43 58%, #123b45 100%);
  background-size: 28px 28px, 28px 28px, auto, auto;
  box-shadow: 0 22px 54px rgba(22, 47, 72, .2);
  color: #f7fbff;
}

.analytics-hero::before,
.analytics-hero::after {
  position: absolute;
  border: 1px solid rgba(157, 220, 211, .13);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.analytics-hero::before {
  top: -180px;
  right: -72px;
  width: 420px;
  height: 420px;
}

.analytics-hero::after {
  top: -120px;
  right: -12px;
  width: 300px;
  height: 300px;
}

.analytics-hero-copy,
.analytics-hero-actions,
.analytics-snapshot {
  position: relative;
  z-index: 1;
}

.analytics-hero-copy {
  max-width: 760px;
}

.analytics-eyebrow {
  display: block;
  margin-bottom: 7px;
  color: #79d7c7;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .2em;
}

.analytics-hero h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.12;
  letter-spacing: -.04em;
}

.analytics-hero-copy > p {
  max-width: 650px;
  margin: 10px 0 0;
  color: #b9c9da;
  font-size: 13px;
  line-height: 1.65;
}

.analytics-section-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 17px;
}

.analytics-section-jumps button {
  min-width: 58px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(190, 218, 231, .2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .065);
  color: #dce9f3;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.analytics-section-jumps button:hover {
  border-color: rgba(113, 217, 198, .52);
  background: rgba(60, 190, 164, .14);
  color: #fff;
  transform: translateY(-1px);
}

.analytics-hero-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.analytics-hero-actions > span {
  padding-top: 10px;
  color: #91a7bb;
  font-size: 11px;
  white-space: nowrap;
}

.analytics-refresh {
  display: inline-flex;
  height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(133, 221, 205, .35);
  border-radius: 10px;
  background: rgba(54, 193, 168, .13);
  color: #e9fffa;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.analytics-refresh i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #65dfca;
  box-shadow: 0 0 0 4px rgba(101, 223, 202, .12);
}

.analytics-refresh:hover {
  background: rgba(54, 193, 168, .22);
}

.analytics-snapshot {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  margin-top: 2px;
}

.analytics-snapshot-card {
  min-width: 0;
  padding: 13px 14px 12px;
  border: 1px solid rgba(192, 215, 231, .13);
  border-radius: 12px;
  background: rgba(255, 255, 255, .055);
  backdrop-filter: blur(8px);
}

.analytics-snapshot-card > span,
.analytics-snapshot-card > small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-snapshot-card > span {
  color: #9eb1c3;
  font-size: 10px;
  font-weight: 750;
}

.analytics-snapshot-card > strong {
  display: block;
  overflow: hidden;
  margin: 5px 0 4px;
  color: #fff;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-snapshot-card > small {
  color: #8399ad;
  font-size: 9px;
}

.analytics-snapshot-card.tone-revenue strong { color: #74e2cf; }
.analytics-snapshot-card.tone-calls strong { color: #7dd3fc; }
.analytics-snapshot-card.tone-images strong { color: #93b4ff; }
.analytics-snapshot-card.tone-videos strong { color: #c4b5fd; }
.analytics-snapshot-card.tone-users strong { color: #f7c873; }
.analytics-snapshot-card.tone-warning strong { color: #ff9f8d; }
.analytics-snapshot-card.tone-stable strong { color: #6ee7b7; }

.analytics-grid {
  display: grid;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.analytics-module {
  --module-accent: #3f6f9d;
  --module-accent-rgb: 63, 111, 157;
  min-width: 0;
  position: relative;
  scroll-margin-top: 18px;
  overflow: hidden;
  border: 1px solid #d5e1ec;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(38, 63, 91, .08);
}

.analytics-module::before {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 22px;
  left: 22px;
  height: 3px;
  border-radius: 0 0 5px 5px;
  background: linear-gradient(90deg, var(--module-accent), rgba(var(--module-accent-rgb), .12));
  content: "";
}

.analytics-module-revenue { --module-accent: #079c86; --module-accent-rgb: 7, 156, 134; }
.analytics-module-calls { --module-accent: #0797ba; --module-accent-rgb: 7, 151, 186; }
.analytics-module-images { --module-accent: #356ee6; --module-accent-rgb: 53, 110, 230; }
.analytics-module-videos { --module-accent: #7958dc; --module-accent-rgb: 121, 88, 220; }
.analytics-module-users { --module-accent: #d98a17; --module-accent-rgb: 217, 138, 23; }
.analytics-module-usage { --module-accent: #e76447; --module-accent-rgb: 231, 100, 71; }

.analytics-module-users,
.analytics-module-usage {
  grid-column: 1 / -1;
}

.analytics-module-head {
  position: relative;
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px 16px 34px;
  border-bottom: 1px solid #e1eaf3;
  background:
    radial-gradient(circle at 94% 0%, rgba(var(--module-accent-rgb), .105), transparent 35%),
    linear-gradient(90deg, rgba(246, 249, 252, .98), rgba(255, 255, 255, .99)),
    #fff;
}

.analytics-module-head::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 18px;
  width: 4px;
  border-radius: 999px;
  background: var(--module-accent);
  content: "";
}

.analytics-module-head > div {
  min-width: 0;
}

.analytics-module-head > div > span {
  color: var(--module-accent);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .15em;
}

.analytics-module-head h3 {
  margin: 2px 0 3px;
  color: var(--analytics-ink);
  font-size: 17px;
  line-height: 1.25;
}

.analytics-module-head p {
  overflow: hidden;
  margin: 0;
  color: #8190a2;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-range {
  display: grid;
  flex: 0 0 auto;
  gap: 4px;
}

.analytics-range > span {
  color: #8a98a9;
  font-size: 9px;
  font-weight: 800;
}

.analytics-range select {
  width: 118px;
  height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid #cfdeec;
  border-radius: 9px;
  background-color: #fff;
  color: #2c435e;
  font-size: 11px;
  font-weight: 750;
}

.analytics-module-body {
  min-height: 420px;
  min-width: 0;
  max-width: 100%;
  padding: 16px;
  container-name: analytics-module-body;
  container-type: inline-size;
}

.analytics-metric-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.analytics-metric-row.is-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.analytics-metric {
  position: relative;
  min-width: 0;
  min-height: 89px;
  overflow: hidden;
  padding: 12px;
  border: 1px solid #dfe8f0;
  border-radius: 12px;
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--module-accent-rgb), .08), transparent 43%),
    linear-gradient(145deg, #fff, #f8fbfd);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.analytics-metric:hover {
  border-color: rgba(var(--module-accent-rgb), .32);
  box-shadow: 0 8px 20px rgba(var(--module-accent-rgb), .1);
  transform: translateY(-2px);
}

.analytics-metric::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 3px;
  border-radius: 0 0 0 4px;
  background: var(--module-accent);
  content: "";
}

.analytics-metric.tone-strong::after { background: #173b5f; }
.analytics-metric.tone-success::after { background: #14a38b; }
.analytics-metric.tone-accent::after { background: #e49a28; }
.analytics-metric.tone-danger::after { background: #e86655; }

.analytics-metric > span,
.analytics-metric > small,
.analytics-metric > strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-metric > span {
  color: #7d8d9f;
  font-size: 9px;
  font-weight: 800;
}

.analytics-metric > strong {
  margin: 7px 0 5px;
  color: #172a41;
  font-size: 18px;
  line-height: 1;
  letter-spacing: -.025em;
}

.analytics-metric.tone-success > strong { color: #087b69; }
.analytics-metric.tone-danger > strong { color: #c7473a; }
.analytics-metric.tone-accent > strong { color: #a85f08; }

.analytics-metric > small {
  color: #9aa7b5;
  font-size: 8.5px;
}

.analytics-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(230px, .7fr);
  gap: 12px;
  margin-top: 10px;
}

.analytics-chart-card,
.analytics-ranking-card,
.analytics-channel-card,
.analytics-dimension-card,
.analytics-feature-card,
.analytics-hourly-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dce7f0;
  border-radius: 14px;
  background: linear-gradient(150deg, #fff, rgba(var(--module-accent-rgb), .025));
}

.analytics-chart-card {
  position: relative;
  min-height: 278px;
  padding: 13px 13px 9px;
  background:
    linear-gradient(rgba(var(--module-accent-rgb), .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--module-accent-rgb), .03) 1px, transparent 1px),
    radial-gradient(circle at 92% 4%, rgba(var(--module-accent-rgb), .1), transparent 33%),
    #fff;
  background-size: 24px 24px, 24px 24px, auto, auto;
}

.analytics-card-title {
  display: flex;
  min-height: 34px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.analytics-card-title > div {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.analytics-card-title b {
  overflow: hidden;
  color: #263a51;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-card-title span {
  color: #96a3b2;
  font-size: 8.5px;
}

.analytics-card-title > em {
  padding: 4px 7px;
  border-radius: 6px;
  background: #eef4fa;
  color: #6c8298;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .08em;
}

.analytics-card-title > button {
  padding: 4px 0;
  border: 0;
  background: none;
  color: #3276bc;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.analytics-chart-wrap {
  position: relative;
  min-height: 236px;
  min-width: 0;
}

.analytics-line-chart {
  display: block;
  width: 100%;
  height: 236px;
  max-height: none;
  overflow: visible;
  cursor: crosshair;
  outline: none;
}

.analytics-grid-lines line {
  stroke: #e5edf4;
  stroke-dasharray: 3 5;
  stroke-width: 1;
}

.analytics-grid-lines text,
.analytics-axis-label {
  fill: #a4b0be;
  font-size: 8px;
}

.analytics-series-line {
  fill: none;
  stroke: var(--series);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.7;
  vector-effect: non-scaling-stroke;
}

.analytics-series-area {
  pointer-events: none;
}

.analytics-series-marker {
  fill: #fff;
  stroke: var(--series);
  stroke-width: 1.8;
  opacity: .72;
  vector-effect: non-scaling-stroke;
}

.analytics-chart-hover {
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}

.analytics-chart-hover.is-visible { opacity: 1; }

.analytics-chart-hover line {
  stroke: #6e8297;
  stroke-dasharray: 4 4;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.analytics-chart-hover circle {
  fill: #fff;
  stroke: var(--series);
  stroke-width: 3;
  filter: drop-shadow(0 2px 3px rgba(27, 48, 68, .2));
  vector-effect: non-scaling-stroke;
}

.analytics-chart-hitarea {
  fill: transparent;
  pointer-events: none;
}

.analytics-chart-legend {
  position: absolute;
  top: -27px;
  right: 0;
  display: flex;
  gap: 10px;
}

.analytics-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #798a9c;
  font-size: 8px;
  font-weight: 700;
}

.analytics-chart-legend i {
  width: 13px;
  height: 2px;
  border-radius: 2px;
}

.analytics-chart-legend small {
  padding-left: 8px;
  border-left: 1px solid #dbe4ec;
  color: #a3afbb;
  font-size: 7.5px;
  font-weight: 700;
}

.analytics-chart-tooltip {
  position: absolute;
  z-index: 8;
  width: max-content;
  min-width: 164px;
  max-width: 220px;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 11px;
  background: rgba(15, 31, 49, .96);
  box-shadow: 0 12px 30px rgba(15, 31, 49, .25);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease;
}

.analytics-chart-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.analytics-tooltip-period {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.analytics-tooltip-period b { font-size: 10px; }
.analytics-tooltip-period span { color: #8fa6ba; font-size: 8px; }

.analytics-tooltip-values {
  display: grid;
  gap: 6px;
  margin-top: 7px;
}

.analytics-tooltip-values > div {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.analytics-tooltip-values i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.analytics-tooltip-values span { color: #b9c9d7; font-size: 8.5px; }
.analytics-tooltip-values strong { color: #fff; font-size: 10px; }

.analytics-side-stack {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.analytics-ranking-card {
  min-height: 278px;
  padding: 13px;
}

.analytics-side-stack .analytics-ranking-card {
  min-height: 0;
}

.analytics-channel-card {
  min-height: 74px;
  padding: 11px 12px;
}

.analytics-channel-card .analytics-card-title {
  min-height: 26px;
}

.analytics-channel-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #60a5fa;
}

.analytics-channel-track > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #19a5bb;
}

.analytics-channel-legend {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
}

.analytics-channel-legend span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  color: #748599;
  font-size: 8px;
}

.analytics-channel-legend span > i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #19a5bb;
}

.analytics-channel-legend span:nth-child(2) > i { background: #60a5fa; }
.analytics-channel-legend b { margin-left: auto; color: #30465d; }

.analytics-ranking-list {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.analytics-ranking-item {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
}

.analytics-ranking-item > b {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 5px;
  background: #edf3f8;
  color: #71859a;
  font-size: 8px;
}

.analytics-ranking-item:nth-child(-n+3) > b {
  background: #173a5e;
  color: #fff;
}

.analytics-ranking-item > div {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1px 6px;
}

.analytics-ranking-item > div > span {
  overflow: hidden;
  color: #34495f;
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-ranking-item > div > small {
  grid-column: 1 / -1;
  overflow: hidden;
  color: #97a4b2;
  font-size: 7.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-ranking-item > div > i {
  grid-column: 1 / -1;
  height: 2px;
  overflow: hidden;
  border-radius: 3px;
  background: #edf2f6;
}

.analytics-ranking-item > div > i > em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3d789f, #2eb49e);
}

.analytics-ranking-item > strong {
  color: #263c54;
  font-size: 9px;
  white-space: nowrap;
}

.analytics-breakdown-list {
  display: grid;
  gap: 13px;
  margin-top: 13px;
}

.analytics-breakdown-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 8px;
}

.analytics-breakdown-list span,
.analytics-breakdown-list b {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #3e536a;
  font-size: 9px;
}

.analytics-breakdown-list span > i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #2f83c7;
}

.analytics-breakdown-list span > i.dot-1 { background: #10a68b; }
.analytics-breakdown-list span > i.dot-2 { background: #d88a1f; }
.analytics-breakdown-list span > i.dot-3 { background: #8b67d8; }
.analytics-breakdown-list b small { color: #99a6b3; font-size: 7px; }

.analytics-breakdown-list > div > em {
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f6;
}

.analytics-breakdown-list > div > em > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2f83c7;
}

.analytics-breakdown-list > div:nth-child(2) > em > i { background: #10a68b; }
.analytics-breakdown-list > div:nth-child(3) > em > i { background: #d88a1f; }
.analytics-breakdown-list > div:nth-child(4) > em > i { background: #8b67d8; }

.analytics-dimension-card,
.analytics-feature-card,
.analytics-hourly-card {
  padding: 13px;
}

.analytics-dimension-groups {
  display: grid;
  gap: 10px;
  margin-top: 7px;
}

.analytics-dimension-groups section {
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid #e8eef4;
}

.analytics-dimension-groups section:first-child {
  padding-top: 0;
  border-top: 0;
}

.analytics-dimension-groups header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.analytics-dimension-groups header span {
  color: #52677c;
  font-size: 8.5px;
  font-weight: 850;
}

.analytics-dimension-groups header small {
  color: #9aa8b5;
  font-size: 7.5px;
}

.analytics-dimension-groups section > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.analytics-dimension-groups section > div > span {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border: 1px solid rgba(var(--module-accent-rgb), .13);
  border-radius: 7px;
  background: rgba(var(--module-accent-rgb), .055);
}

.analytics-dimension-groups section > div b {
  overflow: hidden;
  color: #42586e;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-dimension-groups section > div em {
  color: var(--module-accent);
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
}

.analytics-dimension-groups p {
  margin: 0;
  color: #9aa7b5;
  font-size: 8px;
}

.analytics-usage-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.analytics-usage-trend { grid-column: span 8; }
.analytics-feature-card { grid-column: span 4; }
.analytics-hourly-card { grid-column: span 7; }
.analytics-usage-grid > .analytics-ranking-card { grid-column: span 5; min-height: 286px; }

.analytics-feature-card,
.analytics-hourly-card {
  position: relative;
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--module-accent-rgb), .1), transparent 38%),
    linear-gradient(145deg, #fff, #fbfcfe);
}

.analytics-feature-list {
  display: grid;
  gap: 11px;
  margin-top: 10px;
}

.analytics-feature-row > div {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
}

.analytics-feature-row > div > i {
  width: 7px;
  height: 22px;
  border-radius: 4px;
  background: #e76447;
}

.analytics-feature-row > div > i.tone-1 { background: #0f9f8f; }
.analytics-feature-row > div > i.tone-2 { background: #356ee6; }
.analytics-feature-row > div > i.tone-3 { background: #7958dc; }
.analytics-feature-row > div > i.tone-4 { background: #d98a17; }
.analytics-feature-row > div > i.tone-5 { background: #0797ba; }

.analytics-feature-row span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.analytics-feature-row span b {
  overflow: hidden;
  color: #33495f;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-feature-row span small {
  overflow: hidden;
  color: #96a4b2;
  font-size: 7.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-feature-row strong {
  color: #283f55;
  font-size: 10px;
}

.analytics-feature-row > em {
  display: block;
  height: 3px;
  margin: 6px 0 0 15px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f6;
}

.analytics-feature-row > em > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--module-accent), rgba(var(--module-accent-rgb), .48));
}

.analytics-hourly-card { min-height: 286px; }

.analytics-hour-bars {
  display: grid;
  height: 172px;
  grid-template-columns: repeat(24, minmax(4px, 1fr));
  align-items: end;
  gap: clamp(2px, .5vw, 6px);
  margin-top: 14px;
  padding: 13px 8px 0;
  border-bottom: 1px solid #dfe8f0;
  background: linear-gradient(to top, rgba(var(--module-accent-rgb), .035), transparent 60%);
}

.analytics-hour-bar {
  position: relative;
  display: grid;
  height: 100%;
  min-width: 0;
  align-items: end;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.analytics-hour-bar > i {
  display: block;
  width: 100%;
  height: var(--bar-height);
  min-height: 2px;
  border-radius: 4px 4px 1px 1px;
  background: linear-gradient(180deg, #f18a68, var(--module-accent));
  box-shadow: 0 -4px 12px rgba(var(--module-accent-rgb), .08);
  transition: filter .15s ease, transform .15s ease;
}

.analytics-hour-bar:hover > i,
.analytics-hour-bar:focus > i {
  filter: saturate(1.18) brightness(.96);
  transform: scaleX(1.2);
}

.analytics-hour-bar > span {
  position: absolute;
  right: -5px;
  bottom: -17px;
  left: -5px;
  color: #98a6b4;
  font-size: 7px;
  text-align: center;
}

.analytics-hour-bar::after {
  position: absolute;
  z-index: 5;
  bottom: calc(var(--bar-height) + 8px);
  left: 50%;
  width: max-content;
  max-width: 180px;
  padding: 6px 8px;
  border-radius: 7px;
  background: #13263a;
  box-shadow: 0 7px 18px rgba(19, 38, 58, .2);
  color: #fff;
  content: attr(data-tip);
  font-size: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity .12s ease, transform .12s ease;
  white-space: nowrap;
}

.analytics-hour-bar:hover::after,
.analytics-hour-bar:focus::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.analytics-hour-bar:nth-child(-n+3)::after {
  left: 0;
  transform: translate(0, 4px);
}

.analytics-hour-bar:nth-child(-n+3):hover::after,
.analytics-hour-bar:nth-child(-n+3):focus::after {
  transform: translate(0, 0);
}

.analytics-hour-bar:nth-last-child(-n+3)::after {
  right: 0;
  left: auto;
  transform: translate(0, 4px);
}

.analytics-hour-bar:nth-last-child(-n+3):hover::after,
.analytics-hour-bar:nth-last-child(-n+3):focus::after {
  transform: translate(0, 0);
}

.analytics-hour-scale {
  display: flex;
  justify-content: space-between;
  margin: 24px 7px 0;
  color: #94a3b1;
  font-size: 8px;
}

.analytics-empty-chart,
.analytics-empty-small {
  display: grid;
  place-items: center;
  align-content: center;
  color: #94a2b2;
  text-align: center;
}

.analytics-empty-chart {
  min-height: 220px;
  gap: 3px;
}

.analytics-empty-chart i {
  width: 54px;
  height: 22px;
  margin-bottom: 7px;
  border-bottom: 2px solid #cad7e3;
  background: linear-gradient(145deg, transparent 45%, #dbe6ef 46% 53%, transparent 54%);
}

.analytics-empty-chart b { color: #6f8194; font-size: 11px; }
.analytics-empty-chart span { font-size: 9px; }
.analytics-empty-small { min-height: 205px; font-size: 10px; }

.analytics-module-loading {
  display: grid;
  gap: 10px;
}

.analytics-skeleton-card,
.analytics-skeleton-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(209, 222, 233, .18);
  border-radius: 10px;
  background: rgba(223, 233, 241, .08);
}

.analytics-module-body .analytics-skeleton-card {
  min-height: 89px;
  border-color: #e4ebf2;
  background: #f8fafc;
}

.analytics-skeleton-card::after,
.analytics-skeleton-panel::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, .55) 42%, transparent 64%);
  content: "";
  transform: translateX(-100%);
  animation: analytics-shimmer 1.25s infinite;
}

.analytics-skeleton-card i,
.analytics-skeleton-card b,
.analytics-skeleton-card span {
  display: block;
  height: 6px;
  margin: 11px 12px 0;
  border-radius: 5px;
  background: rgba(160, 181, 201, .18);
}

.analytics-skeleton-card b { width: 48%; height: 15px; }
.analytics-skeleton-card span { width: 70%; }
.analytics-skeleton-panel { min-height: 278px; border-color: #e4ebf2; background: #f8fafc; }

@keyframes analytics-shimmer {
  to { transform: translateX(100%); }
}

.analytics-inline-error {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  border: 1px dashed #e8b7ae;
  border-radius: 11px;
  background: #fff8f6;
}

.analytics-inline-error > i {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #e96755;
  color: #fff;
  font-style: normal;
  font-weight: 900;
}

.analytics-inline-error > div { display: grid; gap: 3px; }
.analytics-inline-error b { color: #8e342a; font-size: 12px; }
.analytics-inline-error span { color: #a46e68; font-size: 9px; }
.analytics-inline-error button {
  height: 32px;
  margin-left: 8px;
  padding: 0 12px;
  border: 1px solid #e0aca5;
  border-radius: 8px;
  background: #fff;
  color: #a84438;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.admin-log-filter-form {
  grid-template-columns: minmax(230px, 1.25fr) minmax(130px, .65fr) minmax(240px, 1.25fr) minmax(100px, .45fr);
}

@container analytics-module-body (max-width: 760px) {
  .analytics-metric-row,
  .analytics-metric-row.is-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .analytics-content-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .analytics-side-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-usage-grid > *,
  .analytics-usage-grid > .analytics-ranking-card {
    grid-column: 1 / -1;
  }

  .analytics-ranking-card,
  .analytics-side-stack .analytics-ranking-card,
  .analytics-usage-grid > .analytics-ranking-card {
    min-height: 0;
  }
}

@container analytics-module-body (max-width: 520px) {
  .analytics-metric-row,
  .analytics-metric-row.is-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-side-stack {
    grid-template-columns: minmax(0, 1fr);
  }

  .analytics-chart-legend small {
    display: none;
  }
}

@media (max-width: 1380px) {
  .analytics-snapshot { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .analytics-grid { grid-template-columns: 1fr; }
  .analytics-module-users,
  .analytics-module-usage { grid-column: auto; }
  .analytics-metric > strong { font-size: 20px; }
}

@media (max-width: 980px) {
  .analytics-hero { grid-template-columns: 1fr; padding: 21px; }
  .analytics-hero-actions { justify-content: space-between; }
  .analytics-content-grid { grid-template-columns: 1fr; }
  .analytics-metric-row.is-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .analytics-usage-grid > * { grid-column: 1 / -1; }
  .analytics-usage-grid > .analytics-ranking-card { grid-column: 1 / -1; min-height: 0; }
  .analytics-ranking-card { min-height: 0; }
  .analytics-side-stack .analytics-ranking-card { min-height: 0; }
  .analytics-empty-small { min-height: 120px; }
  .admin-log-filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .analytics-dashboard { gap: 12px; }
  .analytics-hero { gap: 16px; padding: 17px; border-radius: 14px; }
  .analytics-hero-actions { align-items: center; }
  .analytics-hero-actions > span { padding: 0; }
  .analytics-snapshot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-module-head { align-items: flex-start; padding: 14px 14px 14px 28px; }
  .analytics-module-head::before { top: 15px; bottom: 15px; left: 14px; }
  .analytics-module-head p { max-width: 58vw; }
  .analytics-module-body { min-height: 0; padding: 12px; }
  .analytics-metric-row,
  .analytics-metric-row.is-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-metric-row .analytics-metric:first-child { grid-column: 1 / -1; }
  .analytics-metric { min-height: 82px; }
  .analytics-chart-card { min-height: 250px; padding: 11px; }
  .analytics-chart-wrap { min-height: 200px; }
  .analytics-chart-legend small { display: none; }
  .analytics-hour-bars { gap: 3px; }
  .admin-log-filter-form { grid-template-columns: 1fr; }
}

@media (max-width: 470px) {
  .analytics-hero-actions { align-items: stretch; flex-direction: column; }
  .analytics-refresh { justify-content: center; }
  .analytics-snapshot { grid-template-columns: 1fr; }
  .analytics-module-head { flex-direction: column; }
  .analytics-module-head p { max-width: 82vw; }
  .analytics-range { width: 100%; }
  .analytics-range select { width: 100%; }
  .analytics-metric-row,
  .analytics-metric-row.is-6 { grid-template-columns: 1fr; }
  .analytics-metric-row .analytics-metric:first-child { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .analytics-skeleton-card::after,
  .analytics-skeleton-panel::after { animation: none; }
  .analytics-section-jumps button { transition: none; }
}
