:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --surface-tint: #f1edff;
  --text: #151a27;
  --text-strong: #242838;
  --muted: #697186;
  --muted-strong: #4f586d;
  --line: #e1e6f0;
  --line-strong: #cfd7e6;
  --primary: #6d3eeb;
  --primary-dark: #5c35d8;
  --primary-soft: #f0eeff;
  --danger: #e03131;
  --danger-soft: #fff1f1;
  --warn: #d47b12;
  --warn-soft: #fff6e9;
  --success: #42b883;
  --blue: #4d8cff;
  --orange: #f4a12f;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --radius: 8px;
  --shadow-card: 0 10px 24px rgba(26, 36, 58, 0.07);
  --shadow-button: 0 6px 14px rgba(45, 55, 82, 0.16);
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, #f8f9fd 0%, #f0f3f9 100%);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

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

button,
a,
input,
select,
textarea,
.file-button,
.preview-dropzone,
.preview-dropzone-box {
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

.maker-app {
  min-height: 100vh;
}

.maker-shell[hidden],
.creator-mode-entry[hidden] {
  display: none;
}

.creator-mode-entry,
.creator-page {
  min-height: 100vh;
  padding: 36px 28px;
  background:
    radial-gradient(circle at top left, rgba(109, 62, 235, 0.12), transparent 32%),
    linear-gradient(180deg, #fbfcff 0%, #eef3fb 100%);
}

.creator-entry-inner,
.creator-page-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.creator-entry-head,
.creator-page-hero {
  display: grid;
  gap: var(--space-6);
  margin-bottom: 30px;
}

.creator-entry-brand,
.creator-page-brand {
  width: max-content;
}

.creator-entry-kicker,
.creator-page-kicker {
  color: var(--primary);
  font-size: 14px;
  font-weight: 900;
}

.creator-entry-head h1,
.creator-page-hero h1 {
  margin-top: var(--space-2);
  color: var(--text-strong);
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.08;
}

.creator-entry-head p,
.creator-page-hero p {
  max-width: 720px;
  color: var(--muted-strong);
  font-size: 17px;
}

.creator-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}

.creator-mode-card,
.creator-flow-step,
.creator-api-card,
.reference-upload-panel,
.reference-quota-panel {
  display: grid;
  gap: var(--space-4);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.creator-mode-card {
  min-height: 280px;
  align-content: space-between;
}

.creator-mode-card.primary {
  border-color: rgba(109, 62, 235, 0.28);
  background: linear-gradient(180deg, #ffffff 0%, #f4f1ff 100%);
}

.creator-mode-card.code {
  border-color: rgba(37, 99, 235, 0.2);
}

.creator-mode-card.ai {
  border-color: rgba(15, 118, 110, 0.2);
}

.creator-mode-index {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.creator-mode-card h2,
.creator-flow-step h2,
.creator-api-card h2,
.reference-upload-panel h2,
.reference-quota-panel h2 {
  color: var(--text-strong);
  font-size: 22px;
  line-height: 1.25;
}

.creator-mode-card p,
.creator-flow-step p,
.creator-api-card p,
.reference-upload-panel p,
.reference-quota-panel p {
  color: var(--muted-strong);
}

.creator-mode-action {
  width: 100%;
  min-height: 46px;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.creator-section-heading {
  display: grid;
  gap: var(--space-2);
  margin: 28px 0 16px;
}

.creator-section-heading h2 {
  color: var(--text-strong);
  font-size: 26px;
}

.creator-section-heading p {
  color: var(--muted-strong);
}

.entry-back-button {
  border: 1px solid #dbe2ed;
  background: #fff;
  color: var(--muted-strong);
  padding: 8px 14px;
  box-shadow: none;
  font-weight: 800;
}

.entry-back-button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.creator-page-actions,
.reference-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.creator-page-actions .button,
.reference-form-actions .button {
  min-height: 44px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.creator-flow-grid,
.creator-api-grid,
.reference-builder-grid {
  display: grid;
  gap: var(--space-5);
}

.creator-flow-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.creator-api-grid,
.reference-builder-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
}

.creator-flow-step small,
.creator-api-card small,
.reference-quota-tier small {
  color: var(--muted);
  font-weight: 800;
}

.creator-code-block {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151a27;
  color: #eef4ff;
  padding: 16px;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.creator-api-list,
.reference-quota-list,
.reference-output-list {
  display: grid;
  gap: var(--space-3);
  padding: 0;
  margin: 0;
  list-style: none;
}

.creator-api-list li,
.reference-output-list li {
  border-left: 3px solid var(--primary);
  padding-left: var(--space-3);
  color: var(--muted-strong);
}

.reference-upload-drop {
  display: grid;
  min-height: 280px;
  place-items: center;
  border: 2px dashed #cfd7e6;
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 24px;
  text-align: center;
}

.reference-upload-drop input {
  width: min(100%, 360px);
}

.reference-preview-frame {
  display: grid;
  min-height: 220px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.reference-preview-frame img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.reference-placeholder {
  color: var(--muted);
  font-weight: 800;
}

.reference-account-panel {
  display: grid;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
}

.reference-account-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.reference-account-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid #dbe2ed;
  background: #fff;
  color: var(--muted-strong);
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 900;
}

.reference-account-badge[data-mode="plus"] {
  border-color: rgba(37, 99, 235, 0.22);
  background: #eff6ff;
  color: #1d4ed8;
}

.reference-account-badge[data-mode="max"] {
  border-color: rgba(180, 83, 9, 0.28);
  background: #fff7ed;
  color: #9a3412;
}

.reference-account-badge[data-mode="free"] {
  border-color: rgba(15, 118, 110, 0.22);
  background: #ecfdf5;
  color: #047857;
}

.reference-account-panel small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.55;
}

.reference-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.reference-account-actions .button {
  min-height: 42px;
  flex: 1 1 150px;
  justify-content: center;
}

.reference-quota-tier {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.reference-quota-tier strong {
  color: var(--text-strong);
}

.reference-status {
  min-height: 24px;
  color: var(--muted-strong);
  font-weight: 800;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e7f1;
  background: rgba(255, 255, 255, 0.96);
  padding: 0 28px;
  box-shadow: 0 8px 20px rgba(28, 38, 59, 0.08);
  overflow: visible;
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-strong);
  text-decoration: none;
}

.brand strong {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
}

.brand-logo {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.top-actions,
.preview-controls,
.binding-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.top-actions {
  position: relative;
  min-width: 0;
}

.top-actions::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 44;
  width: min(768px, calc(100vw - 48px));
  height: 14px;
  pointer-events: none;
}

.top-actions:hover::after,
.top-actions:focus-within::after {
  pointer-events: auto;
}

.top-help-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  padding: 8px 10px;
  text-decoration: none;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 800;
}

.help-mark {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #edf2f8;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.login-button,
.max-upgrade-button,
.import-petpack-button,
.clear-draft-button {
  min-height: 42px;
  gap: 9px;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.import-petpack-input {
  display: none;
}

.import-petpack-button {
  border: 1px solid #dbe2ed;
  background: #fff;
  color: var(--text);
  padding: 8px 14px;
  box-shadow: none;
  font-weight: 800;
}

.import-petpack-button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 4px rgba(83, 94, 246, 0.12);
}

.clear-draft-button {
  border: 1px solid #dbe2ed;
  background: #fff;
  color: var(--muted-strong);
  padding: 8px 14px;
  box-shadow: none;
  font-weight: 700;
}

.clear-draft-button:hover:not(:disabled) {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
  box-shadow: none;
}

.clear-draft-button.is-confirming {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(224, 49, 49, 0.16);
}

.login-button {
  border: 2px solid var(--primary);
  background: #fff;
  color: var(--primary);
  padding: 8px 17px;
  box-shadow: none;
}

.login-button:hover:not(:disabled) {
  background: var(--primary-soft);
  border-color: var(--primary);
  box-shadow: none;
}

.login-button.is-account {
  border-color: #dbe2ed;
  background: #f8fafc;
  color: var(--text-strong);
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 128px;
  z-index: 48;
  min-width: 138px;
  border: 1px solid #dbe2ed;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 12px 18px rgba(29, 40, 63, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  visibility: hidden;
}

.login-button:hover + .account-menu,
.login-button:focus + .account-menu,
.top-actions.account-active:hover .account-menu,
.top-actions.account-active:focus-within .account-menu,
.account-menu:hover,
.account-menu:focus-within {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.account-menu[hidden] {
  display: none;
}

.account-menu button {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-strong);
  cursor: pointer;
  padding: 7px 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

.account-menu button:hover,
.account-menu button:focus-visible {
  background: #f1f4f9;
}

.login-icon {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 20px;
}

.login-icon i {
  position: absolute;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.login-icon i:first-child {
  left: 2px;
}

.login-icon i:last-child {
  right: 2px;
}

.login-icon::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 1px;
  width: 5px;
  height: 14px;
  border-radius: 3px;
  background: currentColor;
}

.login-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 14px;
  width: 13px;
  height: 5px;
  border-radius: 3px;
  background: currentColor;
}

.max-upgrade-button,
.panel-max-button {
  border-color: transparent;
  background: linear-gradient(90deg, #ffa843 0%, #ff4b78 100%);
  color: #fff;
  box-shadow: none;
}

.max-upgrade-button {
  padding: 9px 18px;
}

.max-upgrade-button:hover:not(:disabled),
.panel-max-button:hover:not(:disabled) {
  border-color: transparent;
  background: linear-gradient(90deg, #ff9b2d 0%, #f43f70 100%);
  box-shadow: 0 0 0 4px rgba(255, 111, 93, 0.16);
}

.crown-icon {
  position: relative;
  display: inline-block;
  width: 25px;
  height: 20px;
  flex: 0 0 auto;
  color: currentColor;
}

.crown-icon::after {
  content: "";
  position: absolute;
  left: 1px;
  bottom: 2px;
  width: 23px;
  height: 4px;
  border-radius: 3px;
  background: currentColor;
}

.crown-icon i {
  position: absolute;
  bottom: 4px;
  width: 5px;
  height: 12px;
  border-radius: 2px;
  background: currentColor;
}

.crown-icon i::before {
  content: "";
  position: absolute;
  left: 0;
  top: -5px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
}

.crown-icon i:nth-child(1) {
  left: 3px;
  height: 9px;
  transform: rotate(-18deg);
  transform-origin: bottom center;
}

.crown-icon i:nth-child(2) {
  left: 10px;
}

.crown-icon i:nth-child(3) {
  right: 3px;
  height: 9px;
  transform: rotate(18deg);
  transform-origin: bottom center;
}

.top-benefits-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 45;
  display: grid;
  width: min(768px, calc(100vw - 48px));
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
  border: 1px solid #dde4ef;
  border-radius: 12px;
  background: #fefeff;
  padding: 28px 30px 30px;
  box-shadow: 0 12px 14px rgba(29, 40, 63, 0.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  transform: translateY(-6px);
  visibility: hidden;
}

.top-actions:hover .top-benefits-panel,
.top-actions:focus-within .top-benefits-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.top-actions.account-active:hover .top-benefits-panel,
.top-actions.account-active:focus-within .top-benefits-panel {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  visibility: hidden;
}

.benefits-column {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 18px;
}

.max-benefits {
  border-left: 2px solid #e0e6ef;
  padding-left: 30px;
}

.benefits-column h2 {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
}

.benefits-column ul {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.benefits-column li {
  position: relative;
  min-height: 24px;
  color: var(--text);
  padding-left: 34px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.benefits-column li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 23px;
  height: 23px;
  border-radius: 999px;
  background: #edf2f8;
}

.benefits-column li::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 7px;
  width: 9px;
  height: 5px;
  border-left: 3px solid #687288;
  border-bottom: 3px solid #687288;
  transform: rotate(-45deg);
}

.max-capsule {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #F4D27A 0%, #E5B64A 42%, #C8942F 100%);
  color: #FFF8E8;
  padding: 1px 8px;
  font-family: "PingFang SC", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(200, 148, 47, 0.45);
  vertical-align: 1px;
}

.account-max-capsule {
  min-height: 28px;
  padding: 3px 12px;
  font-size: 14px;
  font-style: normal;
}

.export-max-capsule {
  min-height: 18px;
  padding: 1px 7px;
  font-size: 11px;
  font-style: italic;
}

.max-capsule-button {
  min-height: auto;
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  cursor: default;
}

.panel-login-button,
.panel-max-button {
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  justify-content: center;
  color: #fff;
  font-size: 15px;
}

.panel-login-button {
  border-color: transparent;
  background: linear-gradient(90deg, #6e30ef 0%, #4b32eb 100%);
  box-shadow: none;
}

.panel-login-button:hover:not(:disabled) {
  border-color: transparent;
  background: linear-gradient(90deg, #6430ec 0%, #4228d8 100%);
  box-shadow: 0 0 0 4px rgba(100, 48, 236, 0.14);
}

.button,
.icon-button,
.card-toggle,
.sequence-toolbar button,
.add-sequence,
.remove-preview,
.confirm-card {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-strong);
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.primary-button {
  border-color: transparent;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-button);
}

.primary-button:hover:not(:disabled) {
  background: var(--primary-dark);
}

.secondary-button {
  background: #fff;
  color: var(--muted-strong);
}

.secondary-button:hover,
.icon-button:hover,
.card-toggle:hover,
.sequence-toolbar button:hover,
.add-sequence:hover,
.file-button:hover,
.preview-dropzone:hover .preview-dropzone-box {
  border-color: #c8cfe0;
  box-shadow: 0 0 0 4px rgba(109, 62, 235, 0.08);
}

.button.login-button,
.button.max-upgrade-button,
.button.panel-login-button,
.button.panel-max-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.button.login-button {
  border: 2px solid var(--primary);
  background: #fff;
  color: var(--primary);
  padding: 8px 17px;
}

.button.login-button:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: none;
}

.button.max-upgrade-button,
.button.panel-max-button {
  border-color: transparent;
  background: linear-gradient(90deg, #ffa843 0%, #ff4b78 100%);
  color: #fff;
}

.button.max-upgrade-button {
  padding: 9px 18px;
}

.button.max-upgrade-button:hover:not(:disabled),
.button.panel-max-button:hover:not(:disabled) {
  border-color: transparent;
  background: linear-gradient(90deg, #ff9b2d 0%, #f43f70 100%);
  box-shadow: 0 0 0 4px rgba(255, 111, 93, 0.16);
}

.button.panel-login-button {
  border-color: transparent;
  background: linear-gradient(90deg, #6e30ef 0%, #4b32eb 100%);
  color: #fff;
}

.button.panel-login-button:hover:not(:disabled) {
  border-color: transparent;
  background: linear-gradient(90deg, #6430ec 0%, #4228d8 100%);
  box-shadow: 0 0 0 4px rgba(100, 48, 236, 0.14);
}

.button:disabled,
.confirm-card:disabled {
  background: #cfd4e5;
  color: rgba(255, 255, 255, 0.9);
  cursor: not-allowed;
  box-shadow: none;
}

.button.is-locked,
.icon-button.is-locked {
  border-color: #d6dce8;
  background: #cfd4e5;
  color: rgba(255, 255, 255, 0.92);
  cursor: not-allowed;
  box-shadow: none;
}

.button.is-locked:hover,
.icon-button.is-locked:hover {
  border-color: #d6dce8;
  background: #cfd4e5;
  box-shadow: none;
}

.button.max-capsule-button:disabled {
  background: transparent;
  color: inherit;
  cursor: default;
}

.maker-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
  max-width: 1600px;
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  padding: var(--space-6) 28px var(--space-8) 0;
}

.sidebar {
  position: sticky;
  top: 72px;
  display: grid;
  min-height: calc(100vh - 72px);
  align-content: start;
  gap: var(--space-6);
  border-right: 1px solid #e3e8f2;
  background: rgba(255, 255, 255, 0.88);
  padding: 26px 16px 28px;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.72);
}

.step-nav {
  display: grid;
  gap: var(--space-3);
}

.step-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: var(--space-3);
  align-items: start;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-strong);
  padding: 12px 14px;
  text-decoration: none;
}

.step-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 28px;
  top: 52px;
  width: 1px;
  height: 24px;
  background: #cfd4e5;
}

.step-item.active {
  border-color: #ded7ff;
  background: var(--surface-tint);
}

.step-item:hover {
  border-color: #dce2ef;
  background: #fbfcff;
}

.step-dot {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: #cfd4e5;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.step-item.active .step-dot {
  background: var(--primary);
}

.step-item strong {
  display: block;
  color: inherit;
  font-size: 16px;
  line-height: 1.35;
}

.step-item small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.tip-card {
  display: grid;
  gap: var(--space-2);
  border: 1px solid #cbd2e3;
  border-radius: var(--radius);
  background: #fff;
  padding: var(--space-4);
  box-shadow: 0 8px 18px rgba(26, 36, 58, 0.04);
}

.tip-card h2 {
  color: var(--primary-dark);
  font-size: 14px;
}

.tip-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.workspace,
.inspector {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 22px;
}

.inspector {
  grid-column: 2;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  position: static;
  align-items: start;
  gap: var(--space-5);
}

.live-preview-card {
  min-height: 0;
}

.live-preview-card canvas {
  min-height: 0;
}

.card,
.side-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  scroll-margin-top: 96px;
}

.card {
  padding: var(--space-6);
}

.side-card {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
}

.card h2,
.side-card h2 {
  color: var(--text);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
}

.card-heading {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  gap: var(--space-5);
  align-items: center;
  margin-bottom: var(--space-5);
}

.card-heading p {
  max-width: 760px;
  margin-top: var(--space-2);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.card-heading > div {
  min-width: 0;
}

.card-heading > .button {
  flex: 0 0 auto;
}

.collapsible-heading {
  margin-bottom: 0;
}

.collapsible-content {
  margin-top: var(--space-5);
}

.collapsible-content[hidden] {
  display: none;
}

.section-collapse-toggle {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--muted-strong);
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.section-collapse-toggle:hover,
.section-collapse-toggle:focus-visible {
  border-color: #cfc6ff;
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: 0 0 0 4px rgba(109, 62, 235, 0.08);
}

.collapse-icon {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms ease;
}

.section-collapse-toggle[aria-expanded="false"] .collapse-icon {
  transform: translateY(1px) rotate(-45deg);
}

.collapsible-content .basic-grid {
  margin-top: 0;
}

.basic-grid {
  --metadata-visual-height: 240px;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1fr) minmax(230px, 0.9fr);
  gap: var(--space-6);
  align-items: stretch;
  margin-top: var(--space-5);
}

.field-stack {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.field,
.description-field,
.preview-dropzone {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.field span,
.preview-dropzone > span {
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 700;
}

.field.required span::before {
  content: "* ";
  color: var(--danger);
}

.field.optional span::after,
.preview-dropzone.optional > span::after {
  content: "（可选）";
  color: var(--muted);
  font-weight: 500;
}

.field input,
.field select,
.field textarea,
.side-card select,
.fps-field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-strong);
  padding: 9px 12px;
}

.field textarea {
  height: var(--metadata-visual-height);
  min-height: var(--metadata-visual-height);
  resize: vertical;
  line-height: 1.55;
}

.description-field {
  position: relative;
}

#descriptionCounter {
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.preview-dropzone {
  min-height: 0;
  color: var(--muted);
  cursor: pointer;
}

.preview-dropzone > span {
  position: static;
}

.preview-dropzone-box {
  position: relative;
  display: grid;
  width: min(100%, var(--metadata-visual-height));
  height: var(--metadata-visual-height);
  min-width: 0;
  aspect-ratio: 1 / 1;
  justify-self: center;
  place-items: stretch;
  border: 1px dashed #c7cee0;
  border-radius: var(--radius);
  background: #fbfcff;
  padding: 0;
  overflow: hidden;
  text-align: center;
  cursor: pointer;
}

.preview-dropzone.dragover .preview-dropzone-box {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(109, 62, 235, 0.1);
}

.preview-dropzone input,
.file-button input {
  display: none;
}

.preview-dropzone canvas {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  border: 0;
  border-radius: 0;
  image-rendering: auto;
}

.preview-dropzone strong,
.preview-dropzone small {
  position: absolute;
  left: 12px;
  right: 12px;
  z-index: 1;
  display: block;
  max-width: calc(100% - 24px);
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.preview-dropzone strong {
  bottom: 36px;
  font-weight: 800;
}

.preview-dropzone small {
  bottom: 17px;
}

.remove-preview {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  min-width: 30px;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.preview-dropzone.has-preview .remove-preview {
  display: grid;
  place-items: center;
}

.animation-state-list {
  display: grid;
  gap: 14px;
}

.state-card {
  overflow: hidden;
  border: 1px solid #dde2ec;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.state-header {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  gap: var(--space-3);
  align-items: center;
  min-height: 46px;
  padding: 12px 14px;
}

.drag-handle {
  color: #a0a7b8;
  font-size: 16px;
}

.state-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--success);
}

.state-card.optional .state-dot {
  background: var(--blue);
}

.state-card.behavior .state-dot {
  background: var(--orange);
}

.state-card.missing-frames .state-dot {
  background: #b5bdca;
}

.state-card.has-frames .state-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(66, 184, 131, 0.14);
}

.state-card.has-frames .state-pill {
  background: #e9f9f2;
  color: #08774d;
}

.state-header h3 {
  color: var(--text-strong);
  font-size: 16px;
  line-height: 1.35;
}

.state-header p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.state-pill {
  min-width: 70px;
  border-radius: 13px;
  background: #f2f4f8;
  color: var(--muted-strong);
  padding: 5px 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.slot {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  border-radius: 999px;
  background: #edf2f8;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
}

.card-toggle {
  min-height: 30px;
  min-width: 56px;
  color: var(--primary-dark);
  padding: 5px 10px;
  font-size: 13px;
}

.state-body {
  display: grid;
  gap: var(--space-4);
  border-top: 1px solid #dde2ec;
  background: #fff;
  padding: var(--space-4) var(--space-5) var(--space-5);
}

.state-card.collapsed .state-body {
  display: none;
}

.sequence-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.sequence-toolbar strong {
  margin-right: auto;
  color: var(--text-strong);
}

.sequence-toolbar button,
.add-sequence {
  min-height: 28px;
  padding: 5px 10px;
  font-size: 12px;
}

.fps-field,
.reverse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 700;
}

.fps-field input {
  width: 54px;
  min-height: 28px;
  padding: 4px 8px;
}

.sequence-editor {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: var(--space-5);
}

.upload-panel {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 140px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f9fbff;
  padding: 10px;
}

.file-button {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.upload-panel small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.frame-strip {
  display: grid;
  grid-auto-columns: 90px;
  grid-auto-flow: column;
  gap: var(--space-3);
  min-width: 0;
  min-height: 140px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-gutter: stable;
}

.frame-thumb {
  display: block;
  width: 90px;
  height: 118px;
  max-width: 100%;
  border: 1px solid #dde2ec;
  border-radius: var(--radius);
  background: #fff;
  object-fit: contain;
  image-rendering: auto;
  cursor: pointer;
  padding: 10px;
}

.frame-thumb.selected {
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 4px rgba(109, 62, 235, 0.08);
}

.frame-thumb.webm-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #3f335f;
  font-size: 12px;
  font-weight: 700;
  background: linear-gradient(180deg, #f8f7ff 0%, #eef5ff 100%);
}

.frame-strip:empty {
  border: 1px dashed #cfd4e5;
  border-radius: 8px;
  background: #fbfcff;
}

.mood-bindings,
.behavior-bindings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.behavior-bindings {
  display: grid;
  gap: 10px;
}

.mood-bindings[hidden],
.behavior-bindings[hidden] {
  display: none;
}

.mood-bindings label,
.behavior-bindings label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted-strong);
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.binding-group {
  display: grid;
  gap: 7px;
  border: 1px solid #eef1f6;
  border-radius: 6px;
  background: #fbfcff;
  padding: 9px;
}

.binding-group > strong {
  color: var(--text-strong);
  font-size: 12px;
}

.binding-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mood-bindings input,
.behavior-bindings input,
.reverse-toggle input {
  accent-color: var(--primary);
}

.add-sequence {
  width: 100%;
  border-color: #d2d7e7;
  color: var(--primary-dark);
}

.state-footer {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.anim-preview,
#previewCanvas,
#previewThumbCanvas {
  border: 1px solid #e1e5ef;
  border-radius: 6px;
  background:
    linear-gradient(45deg, #f1f2f6 25%, transparent 25%),
    linear-gradient(-45deg, #f1f2f6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f1f2f6 75%),
    linear-gradient(-45deg, transparent 75%, #f1f2f6 75%),
    #fff;
  background-size: 48px 48px;
  background-position: 0 0, 0 24px, 24px -24px, -24px 0;
  image-rendering: auto;
}

.anim-preview {
  width: 96px;
  height: 96px;
}

.card-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.confirm-card {
  min-width: 108px;
  border-color: transparent;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-button);
}

.confirm-card:hover:not(:disabled) {
  background: var(--primary-dark);
}

.binding-toolbar {
  margin: -6px 0 var(--space-5);
}

.unified-upload-layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "upload"
    "frames";
  gap: var(--space-5);
  align-items: stretch;
}

.unified-upload-card {
  display: grid;
  grid-area: upload;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  align-items: stretch;
  min-width: 0;
  border: 1px dashed #bdc8dc;
  border-radius: var(--radius);
  background: #fbfcff;
  padding: var(--space-4);
  overflow: hidden;
}

.unified-upload-card > * {
  min-width: 0;
}

.animation-common-fields {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(112px, 0.32fr);
  gap: var(--space-3);
  min-width: 0;
}

.animation-common-fields > * {
  min-width: 0;
}

.unified-upload-card .field,
.upload-drop-area {
  min-height: 118px;
}

.unified-upload-card .field {
  grid-template-rows: auto auto minmax(0, 1fr);
  align-items: stretch;
  border: 1px solid #d8e0ed;
  border-radius: var(--radius);
  background: #fff;
  padding: var(--space-4);
}

.unified-upload-card .field span {
  align-self: start;
}

.field-label-with-help {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.field-hint {
  align-self: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.unified-upload-card .field input {
  align-self: start;
  min-height: 56px;
  border-color: #dbe3ef;
  font-size: 20px;
}

.unified-upload-card .field:first-child input {
  width: 100%;
}

.fps-mini-field input {
  width: 100%;
  text-align: center;
}

.upload-drop-area {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  border: 1px solid #d8e0ed;
  border-radius: var(--radius);
  background: #fff;
  padding: var(--space-3) var(--space-4);
  text-align: center;
}

.upload-drop-area strong {
  color: var(--text-strong);
  font-size: 17px;
  line-height: 1.25;
}

.upload-drop-area span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.upload-drop-area small {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 12px;
  font-weight: 800;
}

.upload-drop-area .max-capsule {
  display: inline-flex;
  color: #FFF8E8;
}

.upload-drop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin-top: 2px;
}

.upload-drop-actions .file-button {
  min-width: 108px;
  padding: 7px 10px;
}

.animation-upload-tabs {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  gap: 4px;
  border: 1px solid #d8e0ed;
  border-radius: 999px;
  background: #f4f7fb;
  padding: 4px;
}

.animation-upload-tab {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-strong);
  padding: 7px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.animation-upload-tab:hover,
.animation-upload-tab:focus-visible {
  color: var(--primary-dark);
}

.animation-upload-tab.active,
.animation-upload-tab[aria-selected="true"] {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(29, 40, 63, 0.08);
}

.animation-upload-panels,
.animation-upload-panel {
  display: grid;
  min-width: 0;
  gap: var(--space-3);
}

.animation-upload-panel[hidden] {
  display: none;
}

.loop-animation-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.loop-advanced-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  border: 1px solid #d8e0ed;
  border-radius: var(--radius);
  background: #fff;
  padding: var(--space-3);
}

.loop-advanced-options[hidden] {
  display: none;
}

.loop-toggle-row {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 6px;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 800;
}

.loop-toggle-row input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.loop-duration-field.disabled {
  opacity: 0.55;
}

.loop-duration-field {
  min-width: 148px;
  max-width: 180px;
}

.loop-advanced-options .field {
  min-height: 0;
  border: 0;
  background: transparent;
  padding: 0;
}

.loop-advanced-options .field input {
  min-height: 40px;
  font-size: 14px;
}

.loop-segment-upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.loop-segment-upload-grid[hidden] {
  display: none;
}

.loop-segment-upload {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcff;
  padding: 8px;
}

.loop-segment-upload strong {
  color: var(--text-strong);
  font-size: 13px;
}

.loop-segment-upload .file-button {
  justify-content: center;
  min-width: 0;
  padding: 7px 8px;
}

.loop-frame-section {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.loop-frame-section + .loop-frame-section {
  padding-top: 10px;
}

.loop-frame-section-head {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
}

.loop-frame-section-head strong {
  color: var(--text-strong);
  font-size: 13px;
}

.loop-frame-section-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.loop-frame-track {
  display: grid;
  grid-auto-columns: 84px;
  grid-auto-flow: column;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 6px;
  scrollbar-gutter: stable;
}

.loop-frame-track .frame-thumb {
  width: 84px;
  height: 104px;
  padding: 8px;
}

.frame-order-card {
  display: grid;
  grid-area: frames;
  gap: var(--space-3);
  min-width: 0;
}

.frame-order-head,
.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.frame-order-head strong,
.section-title-row h3 {
  color: var(--text-strong);
  font-size: 16px;
}

.frame-order-head span,
.section-title-row span {
  color: var(--muted);
  font-size: 13px;
}

.unified-frame-strip {
  min-height: 156px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.unified-frame-strip.is-loop {
  display: grid;
  grid-auto-columns: unset;
  grid-auto-flow: row;
  gap: 10px;
  max-height: 430px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.frame-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.animation-anchor-editor {
  display: grid;
  gap: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcff;
  padding: 12px;
}

.animation-anchor-editor[hidden] {
  display: none;
}

.animation-anchor-head,
.animation-anchor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.animation-anchor-head strong {
  color: var(--text-strong);
  font-size: 14px;
}

.animation-anchor-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.animation-anchor-marker {
  position: absolute;
  z-index: 1;
  width: 34px;
  height: 34px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--anchor-color, #151a27);
  box-shadow: 0 8px 20px rgba(20, 28, 46, 0.24), 0 0 0 1px rgba(15, 23, 42, 0.16);
  cursor: grab;
  outline: none;
  padding: 0;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.animation-anchor-marker::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
}

.animation-anchor-marker:hover,
.animation-anchor-marker:focus-visible,
.animation-anchor-marker.is-active {
  box-shadow: 0 10px 24px rgba(20, 28, 46, 0.3), 0 0 0 4px rgba(54, 105, 255, 0.18);
}

.animation-anchor-marker.is-dragging {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.08);
}

.animation-anchor-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(96px, 1fr));
  gap: var(--space-2);
}

.animation-anchor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 8px;
}

.animation-anchor-row.is-active {
  border-color: rgba(54, 105, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(54, 105, 255, 0.1);
}

.animation-anchor-label {
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 850;
}

.animation-anchor-value {
  flex: none;
  color: var(--muted);
  font-family: var(--mono, "SFMono-Regular", Consolas, monospace);
  font-size: 12px;
  font-weight: 850;
}

.animation-anchor-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.library-anchor-saved {
  justify-self: flex-start;
  border-radius: 999px;
  background: #eefbf4;
  color: #217252;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 850;
}

.animation-library-panel {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}

.library-grid .empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fbfcff;
  color: var(--muted);
  padding: var(--space-5);
  text-align: center;
}

.animation-workflow-status {
  grid-column: 1 / -1;
  min-height: 40px;
  border: 1px solid #d9e4f5;
  border-radius: 7px;
  background: #f7fbff;
  color: var(--text-strong);
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.45;
}

.library-card {
  position: relative;
  display: grid;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 0;
  color: var(--text);
  text-align: left;
  overflow: hidden;
}

.library-card.active {
  border-color: #cfc6ff;
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px #cfc6ff;
}

.library-card:hover {
  border-color: #c8cfe0;
  box-shadow: 0 0 0 4px rgba(109, 62, 235, 0.06);
}

.library-select {
  display: grid;
  width: 100%;
  min-height: 104px;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 4px var(--space-3);
  align-items: center;
  border: 0;
  background: transparent;
  color: inherit;
  padding: var(--space-3) 42px var(--space-3) var(--space-3);
  text-align: left;
  cursor: pointer;
}

.library-thumb {
  grid-row: span 4;
  position: relative;
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #dde4ef;
  border-radius: 7px;
  background:
    linear-gradient(45deg, #edf1f7 25%, transparent 25%),
    linear-gradient(-45deg, #edf1f7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #edf1f7 75%),
    linear-gradient(-45deg, transparent 75%, #edf1f7 75%),
    #fff;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 850;
}

.library-card.empty .library-thumb {
  border-style: dashed;
  background: #f8fafc;
  color: var(--muted);
}

.library-thumb-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.library-empty-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.library-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  width: 26px;
  height: 26px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  padding: 0;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.library-delete:hover,
.library-delete:focus-visible {
  background: var(--danger);
  color: #fff;
}

.library-card strong,
.library-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-card strong {
  font-size: 15px;
}

.library-meta,
.library-fps,
.library-binding {
  color: var(--muted);
  font-size: 12px;
}

.library-binding {
  color: var(--primary-dark);
  font-weight: 750;
}

.behavior-bind-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.behavior-editor-shell {
  display: grid;
  gap: var(--space-4);
}

.behavior-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
}

/* ---- Behaviour pacing (activity slider + rhythm preview) ---- */
.behavior-tempo-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.behavior-tempo-panel .tempo-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.behavior-tempo-panel .tempo-head strong { color: var(--text-strong); font-size: 15px; }
.behavior-tempo-panel .tempo-head span { color: var(--muted); font-size: 12px; }
.tempo-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tempo-preset-btn {
  flex: 1 1 140px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.tempo-preset-btn strong { font-size: 13px; color: var(--text-strong); }
.tempo-preset-btn span { font-size: 11px; color: var(--muted); }
.tempo-preset-btn:hover { border-color: var(--primary); }
.tempo-preset-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.tempo-readout { margin: 0; font-size: 12px; color: var(--muted-strong); }
.rhythm-sim-bar { display: flex; }
.rhythm-sim-btn {
  padding: 7px 14px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
}
.rhythm-sim-btn:hover { background: var(--primary-soft); }
.rhythm-sim { display: flex; flex-direction: column; gap: 8px; }
.rhythm-track {
  display: flex;
  width: 100%;
  height: 18px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}
.rhythm-seg { display: inline-block; height: 100%; min-width: 1px; }
.rhythm-seg.idle { background: #d7dce8; }
.rhythm-seg.active { background: var(--blue); }
.rhythm-seg.motion { background: var(--orange); }
.rhythm-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}
.rhythm-legend .rhythm-seg {
  width: 14px;
  height: 10px;
  border-radius: 3px;
  margin-right: 2px;
}
.rhythm-stats { margin: 0; font-size: 12px; color: var(--text); }
.rhythm-warn {
  margin: 0;
  font-size: 12px;
  color: var(--warn);
  background: var(--warn-soft);
  border-radius: 6px;
  padding: 6px 10px;
}
.library-anchor-hint {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--warn);
  background: var(--warn-soft);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}

.behavior-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.behavior-mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text-strong);
  cursor: pointer;
  padding: 7px 8px;
  text-align: left;
  white-space: nowrap;
}

.behavior-mode-tab.active {
  border-color: #d6ceff;
  background: var(--primary-soft);
}

.behavior-mode-tab:hover {
  border-color: #cfd7e6;
  background: #fbfcff;
}

.behavior-mode-tab-idle-interaction {
  border-color: #c9c2ff;
  background: #f1efff;
  color: #4c1d95;
}

.behavior-mode-tab-mouse-interaction {
  border-color: #bae6fd;
  background: #e0f2fe;
  color: #075985;
}

.behavior-mode-tab-teleport-interaction {
  border-color: #fecdd3;
  background: #ffe4e6;
  color: #be123c;
}

.behavior-mode-tab-pomodoro-interaction {
  border-color: #fed7aa;
  background: #ffedd5;
  color: #9a3412;
}

.behavior-mode-tab-widget-interaction {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.behavior-mode-tab-scene-interaction {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: #166534;
}

.behavior-mode-tab-idle-interaction:hover,
.behavior-mode-tab-idle-interaction.active {
  border-color: #a78bfa;
  background: #e9d5ff;
}

.behavior-mode-tab-mouse-interaction:hover,
.behavior-mode-tab-mouse-interaction.active {
  border-color: #7dd3fc;
  background: #bae6fd;
}

.behavior-mode-tab-teleport-interaction:hover,
.behavior-mode-tab-teleport-interaction.active {
  border-color: #fda4af;
  background: #fecdd3;
}

.behavior-mode-tab-pomodoro-interaction:hover,
.behavior-mode-tab-pomodoro-interaction.active {
  border-color: #fdba74;
  background: #fed7aa;
}

.behavior-mode-tab-widget-interaction:hover,
.behavior-mode-tab-widget-interaction.active {
  border-color: #93c5fd;
  background: #dbeafe;
}

.behavior-mode-tab-scene-interaction:hover,
.behavior-mode-tab-scene-interaction.active {
  border-color: #86efac;
  background: #bbf7d0;
}

.behavior-mode-tab.active {
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.16), 0 4px 12px rgba(15, 23, 42, 0.08);
}

.behavior-mode-tab-idle-interaction span {
  color: #6d28d9;
}

.behavior-mode-tab-mouse-interaction span {
  color: #0369a1;
}

.behavior-mode-tab-teleport-interaction span {
  color: #e11d48;
}

.behavior-mode-tab-pomodoro-interaction span {
  color: #c2410c;
}

.behavior-mode-tab-widget-interaction span {
  color: #2563eb;
}

.behavior-mode-tab-scene-interaction span {
  color: #15803d;
}

.behavior-mode-tab strong {
  font-size: 12px;
  line-height: 1;
}

.behavior-mode-tab span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
}

.behavior-mode-tab .max-capsule {
  justify-self: start;
}

.official-scene-mode-tab strong {
  color: var(--primary-dark);
}

.behavior-mode-tab-scene-interaction.official-scene-mode-tab strong {
  color: #166534;
}

.scene-interaction-panel {
  display: grid;
  gap: var(--space-3);
}

.scene-interaction-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  border: 1px solid #e4e9f3;
  border-radius: var(--radius);
  background: #fff;
  padding: 8px;
}

.scene-interaction-tab {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 850;
}

.scene-interaction-tab.active {
  border-color: #d6ceff;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.scene-interaction-body,
.scene-application-section {
  display: grid;
  gap: var(--space-3);
}

.scene-application-head {
  padding: var(--space-4);
  border: 1px solid #e4e9f3;
  border-radius: var(--radius);
  background: #fff;
}

.scene-application-head h3 {
  margin: 0 0 4px;
  color: var(--text-strong);
  font-size: 17px;
}

.scene-application-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.scene-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: var(--space-3);
}

.scene-app-card {
  display: grid;
  min-width: 0;
  min-height: 188px;
  gap: 18px;
  border: 1px solid #e4e9f3;
  border-radius: var(--radius);
  background: #fff;
  padding: 20px 24px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.scene-app-card.enabled {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.scene-app-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.scene-app-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.scene-app-icon {
  display: inline-flex;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid #dfe7f3;
  border-radius: var(--radius);
  background: #fff;
  color: #2563eb;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.04);
}

.scene-app-icon-bilibili {
  color: #ec4899;
}

.scene-app-icon-photoshop {
  background: #06172c;
  color: #38bdf8;
}

.scene-app-icon-steam {
  color: #0f335f;
}

.scene-app-icon-chrome {
  color: #16a34a;
}

.scene-app-icon-camera-on {
  color: #0f766e;
}

.scene-app-icon-voice-chat {
  color: #7c3aed;
}

.scene-app-icon-game {
  color: #f97316;
}

.scene-app-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.scene-app-copy strong {
  color: var(--text-strong);
  font-size: 18px;
  line-height: 1.2;
}

.scene-app-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.scene-app-capsules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  align-items: stretch;
}

.scene-app-capsule {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 16px;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 64px;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  padding: 10px 12px;
  text-align: left;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.scene-app-capsule + .scene-app-capsule {
  border-left: 1px solid #e5ebf5;
}

.scene-app-capsule:hover,
.scene-app-capsule:focus-visible {
  border-radius: var(--radius);
  outline: 0;
  background: #f8fbff;
  box-shadow: inset 0 0 0 1px #dbeafe;
}

.scene-app-capsule.configured {
  background: #f0fdf4;
}

.scene-app-capsule-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.scene-app-capsule-label {
  color: var(--text-strong);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 850;
}

.scene-app-capsule strong {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-app-capsule.configured strong::before {
  content: "已配置 · ";
  color: #15803d;
}

.scene-app-event-symbol {
  position: relative;
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.scene-app-event-symbol-start {
  color: #22c55e;
}

.scene-app-event-symbol-start::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid currentColor;
}

.scene-app-event-symbol-duration {
  color: #2563eb;
}

.scene-app-event-symbol-duration::before,
.scene-app-event-symbol-duration::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  width: 2px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.scene-app-event-symbol-duration::after {
  top: 9px;
  width: 6px;
  height: 2px;
}

.scene-app-event-symbol-close {
  color: #ef4444;
}

.scene-app-event-symbol-close::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 8px;
  width: 2px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
}

.scene-app-capsule-arrow {
  color: #8a94a6;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
}

.scene-app-popover {
  position: fixed;
  z-index: 120;
  display: grid;
  gap: 12px;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 18px 36px rgba(17, 24, 39, 0.18);
}

.scene-app-popover-head {
  display: grid;
  gap: 3px;
}

.scene-app-popover-head strong {
  color: var(--text-strong);
  font-size: 14px;
}

.scene-app-popover-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.scene-app-popover-field {
  display: grid;
  gap: 6px;
}

.scene-app-popover-field span {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 850;
}

.scene-app-popover-field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #dbe4f0;
  border-radius: 999px;
  background: #fff;
  color: var(--text-strong);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 750;
}

.scene-app-popover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.scene-app-popover-button {
  min-height: 32px;
  border: 1px solid #dbe4f0;
  border-radius: 999px;
  background: #fff;
  color: var(--muted-strong);
  cursor: pointer;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 850;
}

.scene-app-popover-button.primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.scene-app-popover-button.secondary {
  border-color: #bfdbfe;
  background: #eef6ff;
  color: #1d4ed8;
}

.scene-app-popover-button.danger {
  border-color: #fecaca;
  background: #fee2e2;
  color: #dc2626;
}

.scene-app-popover-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.behavior-detail-panel {
  min-width: 0;
  display: grid;
  gap: var(--space-3);
}

.widget-interaction-panel {
  display: grid;
  gap: var(--space-3);
}

.widget-interaction-card {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid #dbe6f5;
  border-radius: var(--radius);
  background: #fff;
}

.widget-interaction-card-head {
  display: grid;
  gap: 4px;
}

.widget-interaction-card-head h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 17px;
}

.widget-interaction-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.official-scene-library {
  display: grid;
  gap: var(--space-3);
}

.official-scene-library-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid #e4e9f3;
  border-radius: var(--radius);
  background: #fff;
}

.official-scene-library-head h3 {
  margin: 0 0 4px;
  color: var(--text-strong);
  font-size: 17px;
}

.official-scene-library-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.official-scene-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.official-scene-tab {
  min-height: 32px;
  border: 1px solid #e4e9f3;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 0 14px;
  font-weight: 750;
  cursor: pointer;
}

.official-scene-tab.active {
  border-color: #d6ceff;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.official-scene-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.official-scene-card {
  min-width: 0;
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid #e4e9f3;
  border-radius: var(--radius);
  background: #fff;
}

.official-scene-card.enabled {
  border-color: #bfe5cc;
  background: #fbfffc;
}

.official-scene-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.official-scene-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.official-scene-copy strong {
  color: var(--text-strong);
  font-size: 14px;
}

.official-scene-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.official-scene-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
}

.official-scene-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.official-scene-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d8dee8;
  transition: background 140ms ease;
}

.official-scene-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
  transition: transform 140ms ease;
}

.official-scene-switch input:checked + span {
  background: #16a34a;
}

.official-scene-switch input:checked + span::after {
  transform: translateX(18px);
}

.official-scene-controls {
  display: grid;
  gap: 6px;
}

.official-scene-controls label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.official-scene-controls select {
  width: 100%;
  min-height: 34px;
  border: 1px solid #dbe4f0;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-strong);
  padding: 0 10px;
}

.judgement-tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  border: 1px solid #e4e9f3;
  border-radius: var(--radius);
  background: #fff;
  padding: 8px;
}

.judgement-tab {
  display: grid;
  min-width: 104px;
  min-height: 48px;
  align-content: center;
  gap: 2px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-strong);
  cursor: pointer;
  padding: 7px 11px;
  text-align: left;
}

.judgement-tab:hover,
.judgement-tab:focus-visible {
  border-color: #d7deec;
  background: #fbfcff;
}

.judgement-tab.active {
  border-color: #d6ceff;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.judgement-tab strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
}

.judgement-tab span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
}

.active-judgement-panel {
  display: grid;
  max-height: 700px;
  overflow-y: auto;
  padding: 0 2px 0 0;
}

.mode-probability-control {
  grid-column: 2;
  grid-row: 1;
  justify-items: end;
  width: 96px;
}

.probability-control-head {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  width: 100%;
  line-height: 1.2;
}

.probability-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.probability-help,
.fps-help {
  position: relative;
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cfd8e8;
  border-radius: 999px;
  background: #fff;
  color: var(--muted-strong);
  cursor: help;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  outline: none;
}

.probability-help::after,
.fps-help::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 8;
  width: max-content;
  max-width: 260px;
  border-radius: 7px;
  background: #151a27;
  color: #fff;
  padding: 7px 9px;
  box-shadow: 0 10px 22px rgba(20, 28, 45, 0.22);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: normal;
}

.probability-help:hover::after,
.probability-help.is-visible::after,
.probability-help:focus::after,
.probability-help:focus-visible::after,
.fps-help:hover::after,
.fps-help.is-visible::after,
.fps-help:focus::after,
.fps-help:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.mode-probability-control input {
  width: 72px;
  min-height: 36px;
  border-color: #cfd8e8;
  background: #fff;
  text-align: center;
  font-weight: 850;
}

.interaction-mode-card {
  display: grid;
  gap: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcff;
  padding: var(--space-4);
}

.interaction-mode-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: var(--space-4);
  align-items: end;
}

.interaction-mode-head h3 {
  color: var(--text-strong);
  font-size: 17px;
}

.interaction-mode-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.judgement-config-list {
  display: grid;
  gap: var(--space-3);
}

.judgement-config-list.compact {
  max-height: 700px;
  overflow-y: auto;
  padding: 0 2px 0 0;
}

.muted-pill {
  background: #edf2f8;
  color: var(--muted-strong);
}

.behavior-animation-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}

.pet-behavior-rows {
  display: grid;
  gap: var(--space-2);
}

.pet-behavior-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: var(--space-2);
  align-items: start;
  border: 1px solid #edf1f7;
  border-radius: var(--radius);
  background: #fff;
  padding: 8px 10px;
}

.pet-behavior-card {
  min-height: 150px;
  gap: var(--space-3);
  border-color: #e5ebf5;
  background: #fff;
  padding: var(--space-4);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
}

.pet-behavior-card .slot {
  width: 38px;
  height: 38px;
  align-self: start;
  background: var(--probability-color, #eaf0f8);
  color: #fff;
  background: color-mix(in srgb, var(--probability-color, #eaf0f8) 14%, #eaf0f8);
  color: color-mix(in srgb, var(--probability-color, var(--text-strong)) 78%, #0f172a);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--probability-color, transparent) 16%, transparent);
}

.pet-behavior-card .pet-behavior-name {
  min-height: 38px;
  align-content: center;
}

.pet-behavior-card .pet-behavior-controls {
  margin-top: 2px;
}

.pet-behavior-row > * {
  min-width: 0;
}

.pet-behavior-row.add-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  grid-template-columns: minmax(0, 1fr);
  border-style: dashed;
  background: #fcfdff;
  padding: 6px;
}

.pet-behavior-row .animation-picker,
.pet-behavior-row .weight,
.pet-behavior-row .pet-behavior-controls {
  grid-column: 2 / -1;
  width: 100%;
}

.pet-behavior-row.add-row .add-behavior-action {
  grid-column: 1 / -1;
}

.pet-behavior-row.add-row .create-and-bind-action {
  grid-column: 1 / -1;
}

.pet-behavior-row.add-row .add-behavior-action:not(.create-and-bind-icon-action) {
  flex: 1 1 auto;
  min-width: 0;
}

.pet-behavior-name {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.pet-behavior-title-line {
  display: flex;
  min-width: 0;
  gap: 6px;
  align-items: center;
}

.pet-behavior-preview,
.pet-behavior-desktop-test,
.pet-behavior-capsule {
  min-height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--primary-dark);
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.pet-behavior-capsule.config-capsule {
  border-color: #bfdbfe;
  background: #eef6ff;
  color: #1d4ed8;
}

.pet-behavior-capsule.config-capsule.is-muted {
  border-color: #dbe2ed;
  background: #f8fafc;
  color: #64748b;
}

.pet-behavior-capsule.test-capsule {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.pet-behavior-capsule.edit-capsule {
  border-color: transparent;
  background: #fee2e2;
  color: #dc2626;
}

.pet-behavior-desktop-test {
  color: #0f766e;
}

.pet-behavior-desktop-test:disabled {
  cursor: wait;
  opacity: 0.72;
}

.pet-behavior-capsule:hover,
.pet-behavior-capsule:focus-visible {
  border-color: #cfc6ff;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.pet-behavior-name strong,
.pet-behavior-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pet-behavior-name strong {
  color: var(--text-strong);
  font-size: 14px;
}

.pet-behavior-name span {
  color: var(--muted);
  font-size: 12px;
}

.pet-behavior-remove {
  display: inline-flex;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  min-width: 20px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: #fee2e2;
  color: #dc2626;
  font-size: 16px;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
}

.pet-behavior-remove.pet-behavior-capsule {
  padding: 0;
  font-size: 16px;
}

.pet-behavior-remove:hover,
.pet-behavior-remove:focus-visible {
  background: #ef4444;
  color: #fff;
}

.pet-behavior-link-control {
  position: relative;
  flex: 0 0 auto;
}

.behavior-link-menu {
  position: fixed;
  z-index: 80;
  display: grid;
  width: 320px;
  max-width: calc(100vw - 32px);
  max-height: 360px;
  overflow: auto;
  border: 1px solid #d8e0ed;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 16px 28px rgba(29, 40, 63, 0.18);
}

.behavior-link-menu[hidden] {
  display: none;
}

.behavior-link-menu-heading {
  padding: 2px 2px 8px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
}

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

.process-rule-empty {
  border: 1px dashed #d8e0ed;
  border-radius: 7px;
  color: var(--muted);
  padding: 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 750;
}

.process-rule-row {
  display: grid;
  grid-template-columns: 92px 92px minmax(0, 1fr) 24px;
  gap: 6px;
  align-items: center;
}

.process-rule-row select {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  border: 1px solid #d8e0ed;
  border-radius: 7px;
  background: #fff;
  color: var(--text-strong);
  padding: 5px 7px;
  font-size: 12px;
  font-weight: 750;
}

.process-rule-row .process-rule-trigger {
  border-color: #bfdbfe;
  background: #eef6ff;
  color: #1d4ed8;
}

.process-rule-row .process-rule-param {
  border-color: #ddd6fe;
  background: #f5f3ff;
  color: #6d28d9;
}

.process-rule-remove {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: #fee2e2;
  color: #dc2626;
  padding: 0;
  font-size: 15px;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
}

.process-rule-add {
  width: 100%;
  min-height: 34px;
  margin-top: 10px;
  border: 1px dashed #bfdbfe;
  border-radius: 7px;
  background: #f8fbff;
  color: #1d4ed8;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.behavior-link-group {
  display: grid;
  gap: 4px;
  padding: 8px 0;
  border-top: 1px solid #eef2f7;
}

.behavior-link-group strong {
  color: var(--text-strong);
  font-size: 12px;
}

.behavior-link-option {
  display: flex;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  border-radius: 6px;
  color: var(--text);
  padding: 4px 6px;
  font-size: 12px;
  font-weight: 700;
}

.behavior-link-option:hover {
  background: #f8fafc;
}

.behavior-link-option input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.pet-behavior-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 8px;
  align-items: end;
}

.pet-behavior-controls.teleport-controls {
  grid-template-columns: minmax(0, 1fr) 118px;
}

.pet-behavior-controls.app-controls {
  grid-template-columns: minmax(0, 1fr) 104px 96px;
}

.pet-behavior-controls.window-controls {
  grid-template-columns: minmax(260px, 1fr) 96px minmax(342px, 0.75fr);
}

.pet-behavior-controls > .probability-control,
.pet-behavior-controls .animation-picker {
  grid-column: auto;
}

.behavior-probability-summary {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px 12px;
}

.behavior-probability-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.behavior-probability-header strong {
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 850;
}

.probability-total {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 850;
}

.probability-total.ok {
  border: 1px solid #99f6e4;
  background: #ecfdf5;
  color: #0f766e;
}

.probability-total.warn {
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.behavior-probability-bar {
  position: relative;
  width: 100%;
  height: 24px;
  border-radius: 999px;
  background: #e8eef7;
}

.behavior-probability-fill {
  position: absolute;
  inset: 0;
  display: flex;
  overflow: hidden;
  border-radius: inherit;
}

.behavior-probability-segment {
  display: grid;
  height: 100%;
  min-width: 2px;
  place-items: center;
}

.behavior-probability-percent {
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.32);
  white-space: nowrap;
  pointer-events: none;
}

.behavior-probability-segment.is-tiny .behavior-probability-percent {
  opacity: 0;
}

.probability-boundary {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 18px;
  height: 30px;
  border: 3px solid #fff;
  border-radius: 999px;
  margin: 0 0 0 -9px;
  padding: 0;
  translate: 0 -50%;
  background: linear-gradient(90deg, var(--boundary-left, var(--primary)) 0 50%, var(--boundary-right, var(--primary)) 50% 100%);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
  cursor: col-resize;
  touch-action: none;
}

.probability-boundary:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.behavior-probability-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.probability-control {
  grid-template-columns: minmax(0, 1fr) 62px;
  align-items: end;
}

.probability-control .probability-label {
  grid-column: 1 / -1;
}

.probability-slider {
  width: 100%;
  accent-color: var(--probability-color, var(--primary));
}

.probability-slider:disabled {
  opacity: 0.55;
}

.probability-input-wrap {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text-strong);
  padding: 0 6px;
  font-weight: 850;
}

.probability-number {
  width: 34px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: center;
  font: inherit;
}

.probability-number:focus {
  outline: 0;
}

.probability-input-wrap:has(.probability-number:disabled) {
  background: #f3f5f9;
  color: var(--muted);
}

.behavior-control-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.behavior-control-field .slot-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.leave-wake-control {
  align-content: end;
  min-height: 54px;
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 800;
}

.leave-wake-control input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.leave-wake-control:has(input:disabled) {
  color: var(--muted);
}

.window-movement-control {
  display: grid;
  grid-template-columns: 56px minmax(82px, 0.55fr) minmax(96px, 0.8fr) 72px;
  gap: 6px;
  align-items: end;
}

.window-movement-toggle {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 5px;
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 800;
}

.window-movement-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.window-movement-mode,
.window-movement-speed {
  display: grid;
  gap: 4px;
}

.window-movement-mode .animation-picker-button,
.window-movement-speed input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text-strong);
  padding: 6px 26px 6px 8px;
}

.window-movement-speed input {
  padding-right: 8px;
  text-align: center;
}

.window-movement-control .animation-picker-button:disabled,
.window-movement-speed input:disabled {
  border-color: #dfe5ee;
  background: #f3f5f9;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 1;
}

.window-movement-control.is-disabled,
.window-movement-speed.is-disabled {
  color: var(--muted);
}

.animation-picker {
  position: relative;
}

.distance-picker {
  width: 100%;
}

.animation-picker-button {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text-strong);
  padding: 6px 34px 6px 10px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.animation-picker-button::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #2f3545;
  border-bottom: 2px solid #2f3545;
  transform: translateY(-65%) rotate(45deg);
}

.animation-picker.open .animation-picker-button {
  border-color: #bda9ff;
  box-shadow: 0 0 0 4px rgba(109, 62, 235, 0.12);
}

.animation-picker.open .animation-picker-button::after {
  transform: translateY(-20%) rotate(-135deg);
}

.animation-picker-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 5px);
  z-index: 20;
  display: grid;
  max-height: 220px;
  overflow: auto;
  border: 1px solid #d8e0ed;
  border-radius: 8px;
  background: #fff;
  padding: 5px;
  box-shadow: 0 12px 22px rgba(29, 40, 63, 0.14);
}

.animation-picker-menu[hidden] {
  display: none;
}

.animation-picker-option {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 6px 8px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.animation-picker-option:hover,
.animation-picker-option:focus-visible,
.animation-picker-option[aria-selected="true"] {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.pet-behavior-row.add-row .add-behavior-action {
  display: inline-flex;
  width: 100%;
  min-height: 40px;
  border-style: dashed;
  color: var(--text-strong);
  font-weight: 750;
  justify-content: flex-start;
}

.pet-behavior-row.add-row .create-and-bind-action {
  border-style: solid;
  justify-content: center;
}

.pet-behavior-row.add-row .create-and-bind-icon-action {
  position: relative;
  flex: 0 0 32px;
  border: 1px solid #dbe2ed;
  background: #fff;
  color: #111827;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  box-shadow: none;
  font-size: 0;
  line-height: 0;
}

.pet-behavior-row.add-row .create-and-bind-icon-action::before,
.pet-behavior-row.add-row .create-and-bind-icon-action::after {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.pet-behavior-row.add-row .create-and-bind-icon-action::before {
  content: "";
  transform: translate(-50%, -50%);
}

.pet-behavior-row.add-row .create-and-bind-icon-action::after {
  content: "";
  transform: translate(-50%, -50%) rotate(90deg);
}

.pet-behavior-row.add-row .create-and-bind-icon-action:hover:not(:disabled),
.pet-behavior-row.add-row .create-and-bind-icon-action:focus-visible {
  border-color: #cfc6ff;
  background: #fff;
  color: #111827;
  box-shadow: 0 0 0 4px rgba(109, 62, 235, 0.12);
}

.pet-behavior-row.add-row .add-behavior-action:disabled,
.pet-behavior-row.add-row .create-and-bind-action:disabled {
  border-color: #e3e8f2;
  background: #f8fafc;
  color: var(--muted);
}

.pet-behavior-row .weight input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 6px 8px;
  color: var(--text-strong);
  font-weight: 800;
  text-align: center;
}

.pet-behavior-row .behavior-cooldown-field input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 6px 8px;
  color: var(--text-strong);
  font-weight: 800;
  text-align: center;
}

.behavior-animation-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 62px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 6px 8px;
  color: var(--muted-strong);
  font-size: 12px;
}

.behavior-animation-option input[type="checkbox"] {
  accent-color: var(--primary);
}

.behavior-animation-option input[type="number"] {
  min-height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 3px 6px;
}

.behavior-animation-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.max-limit-note {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border: 1px dashed #c7d2fe;
  border-radius: var(--radius);
  background: #fbfaff;
  color: var(--muted);
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 700;
}

.preview-anchor-stage {
  position: relative;
  display: block;
  justify-self: center;
  width: min(100%, 300px);
  aspect-ratio: 1 / 1;
  overflow: visible;
  touch-action: none;
}

.live-preview-card canvas {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 300px;
  aspect-ratio: 1 / 1;
}

.preview-anchor-marker-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.preview-anchor-marker-layer[hidden] {
  display: none;
}

.live-preview-card {
  position: relative;
  align-content: start;
  overflow: visible;
}

#previewAnimationSelect {
  min-width: 0;
  max-width: 100%;
}

.preview-caption {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.live-preview-card.is-limited .preview-controls,
.live-preview-card.is-limited #previewAnimationSelect {
  opacity: 0.62;
}

.preview-controls {
  display: grid;
  grid-template-columns: 46px minmax(128px, 1fr);
  justify-content: stretch;
  align-items: center;
  width: 100%;
}

.icon-button {
  display: grid;
  width: 44px;
  min-height: 44px;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  padding: 0;
  box-shadow: none;
}

#previewFpsSelect {
  width: 100%;
  min-width: 0;
}

.export-meta {
  display: grid;
  gap: var(--space-2);
}

.export-meta div {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: var(--space-2);
  align-items: baseline;
}

.export-meta dt {
  color: var(--muted);
  font-size: 13px;
}

.export-meta dd {
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 700;
}

.export-primary {
  width: 100%;
  min-height: 46px;
  margin-top: 8px;
}

.export-card > p,
.cdkey-publish-card > p,
.check-card > p,
.check-card strong {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.publish-cdkey-button,
.cdkey-publish-card > .button {
  width: 100%;
  min-height: 38px;
}

.publish-cdkey-button {
  margin-top: 8px;
}

.cdkey-title-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cdkey-title-row h2 {
  margin: 0;
}

.cdkey-method-help {
  position: relative;
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cfd8e8;
  border-radius: 999px;
  background: #fff;
  color: var(--muted-strong);
  cursor: help;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.cdkey-method-help::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 10;
  width: min(260px, calc(100vw - 48px));
  border-radius: 7px;
  background: #151a27;
  color: #fff;
  padding: 8px 10px;
  box-shadow: 0 10px 22px rgba(20, 28, 45, 0.22);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: normal;
}

.cdkey-method-help:hover::after,
.cdkey-method-help:focus::after,
.cdkey-method-help:focus-visible::after,
.cdkey-method-help.is-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.cdkey-quota-pack {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffaf0;
}

.cdkey-quota-pack div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.cdkey-quota-pack strong {
  color: var(--text-strong);
  font-size: 18px;
}

.cdkey-packages-page {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.cdkey-packages-page[hidden] {
  display: none;
}

.cdkey-packages-page header,
.cdkey-package-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.cdkey-packages-page header h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 14px;
}

.cdkey-packages-page header span {
  color: var(--muted);
  font-size: 12px;
}

.cdkey-package-card {
  grid-template-columns: minmax(0, 1fr) auto 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcff;
}

.cdkey-package-card strong,
.cdkey-package-card small {
  display: block;
}

.cdkey-package-card strong {
  color: var(--text-strong);
  font-size: 13px;
}

.cdkey-package-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.cdkey-package-card .cdkey-discount-note {
  color: #a0610a;
  font-weight: 700;
}

.cdkey-package-card.pending {
  opacity: 0.72;
}

.cdkey-package-price {
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 800;
}

.cdkey-package-card .button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.cdkey-batch-fields {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.cdkey-batch-fields label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.cdkey-batch-fields input,
#cdkeyCodesOutput {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-strong);
  font: inherit;
}

.cdkey-batch-fields input {
  height: 34px;
  padding: 0 10px;
}

.cdkey-refund-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

#cdkeyCodesOutput {
  min-height: 112px;
  margin: 10px 0 8px;
  padding: 10px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.check-card h3 {
  color: var(--text-strong);
  font-size: 14px;
}

.check-card ul {
  min-height: 56px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcff;
  padding: 10px 12px 10px 26px;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.5;
}

.check-card h3:first-of-type + ul {
  border-color: #ffd0d0;
  background: var(--danger-soft);
}

.check-card h3:nth-of-type(2) + ul {
  border-color: #ffe1b7;
  background: var(--warn-soft);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible,
.file-button:focus-within,
.preview-dropzone:focus-visible .preview-dropzone-box,
.preview-dropzone-box:focus-within {
  outline: 3px solid rgba(109, 62, 235, 0.22);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .scene-app-grid {
    grid-template-columns: 1fr;
  }

  .scene-app-card {
    min-height: 0;
    gap: var(--space-3);
    padding: 18px 20px;
  }

  .scene-app-icon {
    display: none;
  }

  .scene-app-capsules {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .scene-app-capsule {
    min-height: 48px;
    grid-template-columns: minmax(0, 1fr) 16px;
    border: 1px solid #e5ebf5;
    border-radius: 999px;
    background: #fbfcff;
    padding: 10px 14px;
  }

  .scene-app-capsule + .scene-app-capsule {
    border-left: 1px solid #e5ebf5;
  }

  .scene-app-capsule.configured {
    border-color: #bbf7d0;
    background: #f0fdf4;
  }

  .scene-app-event-symbol {
    display: none;
  }

  .scene-app-capsule-copy {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media (min-width: 1440px) {
  .maker-layout {
    grid-template-columns: 248px minmax(0, 1fr) 332px;
  }

  .inspector {
    grid-column: auto;
    grid-template-columns: 1fr;
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 112px);
    overflow-y: auto;
    padding-right: 4px;
  }

  .check-card {
    grid-column: auto;
  }

  .live-preview-card canvas {
    width: min(100%, 280px);
    max-height: 280px;
  }

  .export-meta div {
    grid-template-columns: 104px minmax(0, 1fr);
  }
}

@media (max-width: 1500px) {
  .basic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .preview-dropzone {
    grid-column: 1 / -1;
  }

  .unified-upload-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "upload"
      "frames";
  }

  .animation-common-fields {
    grid-template-columns: minmax(220px, 1fr) minmax(112px, 0.36fr);
  }

  .behavior-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .pet-behavior-row {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
  }

  .pet-behavior-row .animation-picker,
  .pet-behavior-row .weight,
  .pet-behavior-row .pet-behavior-controls {
    grid-column: 2 / -1;
    width: 100%;
  }

  .pet-behavior-row.add-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .pet-behavior-row.add-row .add-behavior-action {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1180px) {
  .creator-mode-grid,
  .creator-flow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .creator-api-grid,
  .reference-builder-grid {
    grid-template-columns: 1fr;
  }

  .top-help-link span:last-child {
    display: none;
  }

  .maker-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    padding-right: 18px;
  }

  .inspector {
    grid-column: 2;
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .check-card {
    grid-column: 1 / -1;
  }

  .basic-grid,
  .behavior-bind-panel,
  .animation-common-fields,
  .interaction-mode-head,
  .behavior-workbench {
    grid-template-columns: 1fr 1fr;
  }

  .behavior-mode-tabs {
    grid-column: 1 / -1;
  }

  .behavior-workbench {
    grid-template-columns: 1fr;
  }

  .pet-behavior-controls.window-controls {
    grid-template-columns: minmax(0, 1fr) 96px;
  }

  .pet-behavior-controls.window-controls .window-movement-control {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .creator-mode-entry,
  .creator-page {
    padding: 24px 16px;
  }

  .creator-mode-grid,
  .creator-flow-grid {
    grid-template-columns: 1fr;
  }

  .top-nav {
    height: auto;
    min-height: 68px;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
  }

  .top-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .top-help-link {
    min-width: 44px;
    justify-content: center;
  }

  .top-benefits-panel {
    right: auto;
    left: 0;
    width: 100%;
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 22px;
  }

  .max-benefits {
    border-top: 1px solid #e0e6ef;
    border-left: 0;
    padding-top: 22px;
    padding-left: 0;
  }

  .maker-layout {
    display: block;
    padding: 16px;
  }

  .sidebar,
  .inspector {
    position: static;
  }

  .sidebar {
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 16px;
  }

  .step-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .step-item {
    grid-template-columns: 28px;
  }

  .step-item:not(:last-child)::after,
  .step-item small,
  .tip-card {
    display: none;
  }

  .workspace,
  .inspector {
    margin-top: 16px;
  }

  .basic-grid,
  .sequence-editor,
  .state-footer,
  .behavior-bind-panel,
  .animation-common-fields,
  .interaction-mode-head,
  .behavior-workbench,
  .behavior-mode-tabs,
  .pet-behavior-row,
  .inspector {
    grid-template-columns: 1fr;
  }

  .mode-probability-control {
    justify-items: start;
  }

  .pet-behavior-row .slot,
  .pet-behavior-name,
  .pet-behavior-row .animation-picker,
  .pet-behavior-row .weight,
  .pet-behavior-row .pet-behavior-controls {
    grid-column: 1 / -1;
  }

  .pet-behavior-row .slot {
    justify-self: start;
  }

  .pet-behavior-controls {
    grid-template-columns: 1fr;
  }

  .window-movement-control {
    grid-template-columns: 1fr;
  }

  .card,
  .side-card {
    padding: 18px;
  }

  .card-heading {
    display: grid;
  }
}

@media (max-width: 540px) {
  .creator-entry-head h1,
  .creator-page-hero h1 {
    font-size: 34px;
  }

  .top-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .preview-controls {
    width: 100%;
    align-items: stretch;
  }

  .top-actions .button,
  .top-help-link,
  .preview-controls > * {
    width: 100%;
    flex: 1;
  }

  .max-upgrade-button {
    grid-column: 1 / -1;
  }

  .top-benefits-panel .button {
    flex: none;
  }

  .step-nav {
    grid-template-columns: 1fr;
  }

  .step-item {
    grid-template-columns: 28px 1fr;
  }

  .state-header {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .state-pill,
  .card-toggle {
    grid-column: span 1;
  }

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

  .frame-strip {
    grid-auto-columns: 80px;
  }

  .frame-thumb {
    width: 80px;
    height: 104px;
  }

  .loop-frame-section {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .loop-frame-section-head {
    grid-template-columns: auto auto;
    align-items: baseline;
    justify-content: space-between;
  }

  .loop-frame-track {
    grid-auto-columns: 76px;
  }

  .loop-frame-track .frame-thumb {
    width: 76px;
    height: 96px;
  }

  .unified-frame-strip.is-loop {
    max-height: 390px;
  }
}
