.create-page {
  --page-gutter: clamp(24px, 5vw, 96px);
  --workspace-max: 1680px;
  --workspace-width: min(var(--workspace-max), calc(100% - var(--page-gutter) * 2));
  min-height: 100vh;
  display: block;
  padding: max(120px, calc((100vh - 250px) / 2)) 0 72px;
}

body[data-active-feature="segmentation"],
body[data-active-feature="library"],
body[data-active-feature="image"],
body[data-active-feature="skill"],
body[data-active-feature="video"] {
  overflow: hidden;
}

body[data-active-feature="segmentation"] .floating-logo,
body[data-active-feature="library"] .floating-logo,
body[data-active-feature="image"] .floating-logo,
body[data-active-feature="skill"] .floating-logo,
body[data-active-feature="video"] .floating-logo {
  transform: scale(0.72);
  transform-origin: left top;
}

body[data-active-feature="segmentation"] .create-page,
body[data-active-feature="library"] .create-page,
body[data-active-feature="image"] .create-page,
body[data-active-feature="skill"] .create-page,
body[data-active-feature="video"] .create-page {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  padding-top: 96px;
  padding-bottom: 24px;
}

body[data-active-feature="library"] .create-page {
  padding-top: 88px;
  padding-bottom: 88px;
}

.feature-sidebar {
  position: fixed;
  left: 28px;
  top: 50%;
  z-index: 28;
  display: grid;
  gap: 10px;
  width: 68px;
  padding: 14px 8px;
  border: 1px solid rgba(216, 225, 235, 0.76);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 38px rgba(34, 52, 73, 0.1);
  backdrop-filter: blur(20px);
  transform: translateY(-50%);
}

.feature-nav-item {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  padding: 0;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.feature-nav-item:hover,
.feature-nav-item.is-active {
  background: rgba(71, 169, 230, 0.12);
  color: #1f3547;
}

.feature-nav-item:hover {
  transform: translateY(-1px) scale(1.02);
}

.feature-nav-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
}

.feature-nav-icon img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  opacity: 0.72;
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
}

.feature-nav-item.is-active .feature-nav-icon {
  border-color: rgba(71, 169, 230, 0.28);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(34, 52, 73, 0.1);
}

.feature-nav-item:hover .feature-nav-icon img,
.feature-nav-item.is-active .feature-nav-icon img {
  opacity: 1;
  transform: scale(1.04);
  filter: sepia(1) saturate(3) hue-rotate(150deg);
}

.feature-panel {
  display: block;
  width: 100%;
}

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

.composer-shell {
  width: min(1500px, calc(100% - var(--page-gutter) * 2));
  margin: 0 auto;
  /* transform: translateX(2.5vw); */
}

.composer-shell {
  display: grid;
  gap: 34px;
}

.module-board {
  width: min(1180px, calc(100% - var(--page-gutter) * 2));
  min-height: 560px;
  margin: 0 auto;
  border: 1px solid rgba(218, 226, 235, 0.9);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 44px rgba(34, 52, 73, 0.1);
  backdrop-filter: blur(12px);
  padding: 28px;
}

.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.module-kicker {
  margin: 0 0 6px;
  color: #47a9e6;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.module-head h2 {
  margin: 0;
  color: #1d2a39;
  font-size: 26px;
  line-height: 1.25;
}

.module-status {
  flex: 0 0 auto;
  border: 1px solid rgba(218, 226, 235, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #7c8ca2;
  padding: 7px 12px;
  font-size: 12px;
}

.module-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(280px, 1fr) minmax(220px, 0.85fr);
  gap: 14px;
  align-items: stretch;
}

.module-grid-two {
  grid-template-columns: minmax(320px, 0.9fr) minmax(320px, 1.1fr);
}

.module-card {
  min-height: 320px;
  border: 1px solid rgba(218, 226, 235, 0.86);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.78);
  padding: 18px;
}

.module-card h3 {
  margin: 0 0 12px;
  color: #243244;
  font-size: 15px;
}

.module-card-media,
.module-card-preview {
  display: grid;
}

.module-upload {
  display: grid;
  place-items: center;
  min-height: 100%;
  border: 1px dashed rgba(124, 140, 162, 0.5);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  color: #7c8ca2;
  font-size: 14px;
  font-weight: 600;
}

.module-upload input {
  display: none;
}

.module-label {
  display: block;
  margin-bottom: 8px;
  color: #526174;
  font-size: 13px;
  font-weight: 700;
}

.module-textarea {
  width: 100%;
  min-height: 210px;
  resize: vertical;
  border: 1px solid rgba(218, 226, 235, 0.9);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.86);
  color: #253142;
  padding: 14px;
  font-size: 14px;
  line-height: 1.5;
}

.module-textarea:focus {
  border-color: rgba(71, 169, 230, 0.58);
}

.module-action {
  width: 100%;
  min-height: 42px;
  margin-top: 14px;
  border: 0;
  border-radius: 10px;
  background: #47a9e6;
  color: #fff;
  font-weight: 700;
}

.module-action:disabled {
  background: #d8dde4;
  cursor: not-allowed;
}

.module-empty {
  display: grid;
  place-items: center;
  min-height: 240px;
  border: 1px dashed rgba(124, 140, 162, 0.42);
  border-radius: 12px;
  color: #8a98a9;
  font-size: 13px;
}

.segmentation-workbench {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(620px, 1.64fr) minmax(210px, 0.58fr);
  grid-template-areas: "controls stage annotations";
  gap: 18px;
  width: var(--workspace-width);
  height: calc(100vh - 120px);
  min-height: 620px;
  align-items: stretch;
  margin: 0 auto;
}

.segmentation-annotation-panel,
.segmentation-stage-panel,
.segmentation-control-panel {
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.segmentation-annotation-panel {
  grid-area: annotations;
}

.segmentation-stage-panel {
  grid-area: stage;
}

.segmentation-control-panel {
  grid-area: controls;
}

.segmentation-annotation-panel,
.segmentation-stage-panel,
.segmentation-control-card {
  border: 1px solid rgba(205, 216, 228, 0.86);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 18px 44px rgba(34, 52, 73, 0.1);
  backdrop-filter: blur(14px);
}

.generation-workbench {
  display: grid;
  grid-template-columns: minmax(210px, 0.58fr) minmax(620px, 1.6fr) minmax(320px, 0.86fr);
  align-items: stretch;
  gap: 18px;
  width: var(--workspace-width);
  height: calc(100vh - 120px);
  min-height: 620px;
  margin: 0 auto;
}

.skill-workbench {
  display: grid;
  grid-template-columns: clamp(300px, 22%, 380px) minmax(520px, 1fr) clamp(220px, 16%, 280px);
  gap: 16px;
  width: var(--workspace-width);
  height: calc(100vh - 112px);
  min-height: 610px;
  margin: 0 auto;
}

.skill-source-panel,
.skill-stage-panel,
.skill-control-panel {
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.skill-source-panel,
.skill-stage-panel,
.skill-control-card {
  border: 1px solid rgba(205, 216, 228, 0.86);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 34px rgba(34, 52, 73, 0.09);
  backdrop-filter: blur(14px);
}

.skill-source-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
  border-radius: 20px;
  padding: 18px;
}

.skill-source-panel .generation-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.skill-source-panel .generation-panel-head h2 {
  font-size: 20px;
}

.skill-source-panel .generation-panel-head .module-status {
  max-width: 136px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-stage-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 20px;
}

.skill-control-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 12px;
  overflow: hidden;
}

.skill-control-card {
  display: grid;
  gap: 11px;
  border-radius: 14px;
  padding: 14px;
}

.skill-control-card[hidden] {
  display: none !important;
}

.skill-result-card {
  min-height: 0;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
}

.skill-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border: 1px solid rgba(218, 226, 235, 0.88);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.82);
  padding: 4px;
}

.skill-mode-btn {
  min-height: 36px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
}

.skill-mode-btn.is-active {
  background: #fff;
  color: #166493;
  box-shadow: 0 8px 18px rgba(34, 52, 73, 0.08);
}

.skill-mini-section {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: visible;
}

.skill-reference-panel[hidden],
.skill-editor-panel[hidden] {
  display: none !important;
}

.skill-editor-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  border-top: 1px solid rgba(218, 226, 235, 0.78);
  padding-top: 12px;
}

.skill-editor-panel .segmentation-card-head h2,
.skill-version-panel .segmentation-card-head h2 {
  font-size: 17px;
}

.skill-run-panel {
  display: grid;
  position: sticky;
  bottom: -18px;
  border-top: 1px solid rgba(218, 226, 235, 0.78);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.96) 36%);
  padding-top: 14px;
  padding-bottom: 2px;
}

.skill-reference-panel {
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  border: 1px solid rgba(218, 226, 235, 0.86);
  border-radius: 12px;
  background: rgba(248, 251, 253, 0.72);
  padding: 10px;
}

.skill-reference-panel .skill-inline-head,
.skill-reference-panel .skill-reference-list {
  grid-column: 1 / -1;
}

.skill-history-flow {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(218, 226, 235, 0.86);
  border-radius: 12px;
  background: rgba(248, 251, 253, 0.72);
  padding: 10px;
}

.skill-history-flow .module-label {
  margin: 0;
}

.skill-history-flow-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: history-flow;
}

.skill-history-flow-list li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  color: #526174;
  font-size: 12px;
  font-weight: 800;
}

.skill-history-flow-list li::before {
  counter-increment: history-flow;
  content: counter(history-flow);
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: rgba(71, 169, 230, 0.12);
  color: #166493;
  font-size: 11px;
  font-weight: 900;
}

.skill-source-panel .generation-upload-btn {
  min-height: 72px;
  border-radius: 12px;
}

.skill-editor-panel .module-label {
  margin-bottom: 0;
  font-size: 12px;
}

.skill-inline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.skill-link-btn {
  min-height: 26px;
  border: 0;
  background: transparent;
  color: #166493;
  font-size: 12px;
  font-weight: 900;
  padding: 0;
}

.skill-link-btn:disabled {
  color: #9aa6b4;
  cursor: not-allowed;
}

.skill-secondary-btn {
  width: 100%;
  min-height: 36px;
  border: 1px dashed rgba(71, 169, 230, 0.42);
  border-radius: 8px;
  background: rgba(246, 250, 253, 0.9);
  color: #263445;
  font-size: 13px;
  font-weight: 800;
}

.skill-reference-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.skill-empty-line {
  display: grid;
  min-height: 46px;
  place-items: center;
  margin: 0;
  border: 1px dashed rgba(124, 140, 162, 0.28);
  border-radius: 10px;
  color: #8a98a9;
  font-size: 12px;
  font-weight: 800;
}

.skill-ref-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 68px;
  border: 1px solid rgba(218, 226, 235, 0.82);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
  color: #263445;
  padding: 7px;
  text-align: left;
}

.skill-ref-card img {
  width: 58px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
}

.skill-ref-card span {
  overflow: hidden;
  color: #526174;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-canvas-shell {
  position: relative;
  display: grid;
  min-height: 0;
  overflow: hidden;
  background-color: #edf3f8;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.72) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.72) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.72) 75%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.72) 25%, transparent 25%);
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

.skill-canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
  cursor: crosshair;
}

.skill-canvas-tools {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(205, 216, 228, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(34, 52, 73, 0.1);
  padding: 7px 9px 7px 13px;
  color: #526174;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(14px);
}

.skill-tool-btn {
  min-height: 30px;
  border: 1px solid rgba(218, 226, 235, 0.92);
  border-radius: 999px;
  background: #fff;
  color: #166493;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
}

.skill-tool-btn:disabled {
  color: #9aa6b4;
  cursor: not-allowed;
}

.skill-textarea {
  min-height: 86px;
}

.skill-short-textarea {
  min-height: 54px;
}

.skill-editor-panel .module-textarea {
  border-radius: 10px;
  padding: 11px;
  font-size: 13px;
}

.skill-editor-panel .segmentation-input {
  min-height: 38px;
  border-radius: 10px;
  font-size: 13px;
}

.skill-run-panel .module-action {
  margin-top: 0;
  min-height: 46px;
  border-radius: 12px;
}

.skill-result-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.skill-icon-action {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(218, 226, 235, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
}

.skill-icon-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.skill-icon-action img {
  width: 16px;
  height: 16px;
}

.skill-result-preview {
  display: grid;
  gap: 10px;
}

.skill-result-preview .module-empty,
.skill-history-list .module-empty {
  min-height: 102px;
  padding: 12px;
  text-align: center;
}

.skill-result-preview figure {
  display: grid;
  gap: 7px;
  margin: 0;
}

.skill-result-image-button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: zoom-in;
}

.skill-result-preview img {
  display: block;
  width: 100%;
  max-height: 168px;
  border: 1px solid rgba(218, 226, 235, 0.86);
  border-radius: 8px;
  background: #f8fafc;
  object-fit: contain;
}

.skill-result-preview figcaption {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.skill-result-image-button:hover img {
  border-color: rgba(71, 169, 230, 0.52);
  box-shadow: 0 14px 28px rgba(34, 52, 73, 0.12);
}

.skill-progress-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(218, 226, 235, 0.9);
}

.skill-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #47a9e6;
  transition: width 0.28s ease;
}

.skill-progress-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skill-progress-step {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: #8a98a9;
  font-size: 12px;
  font-weight: 800;
}

.skill-progress-step span {
  width: 9px;
  height: 9px;
  border: 2px solid rgba(124, 140, 162, 0.36);
  border-radius: 999px;
  background: #fff;
}

.skill-progress-step b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-progress-step.is-active {
  color: #166493;
}

.skill-progress-step.is-active span {
  border-color: #47a9e6;
  background: #47a9e6;
  box-shadow: 0 0 0 5px rgba(71, 169, 230, 0.14);
}

.skill-progress-step.is-done {
  color: #526174;
}

.skill-progress-step.is-done span {
  border-color: #47a9e6;
  background: #47a9e6;
}

.skill-progress-step.is-error {
  color: #b91c1c;
}

.skill-progress-step.is-error span {
  border-color: #dc2626;
  background: #dc2626;
}

.skill-history-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.skill-history-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  min-height: 72px;
  border: 1px solid rgba(218, 226, 235, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: #263445;
  padding: 7px;
  text-align: left;
}

.skill-history-item.is-active {
  border-color: rgba(71, 169, 230, 0.62);
  box-shadow: 0 0 0 3px rgba(71, 169, 230, 0.12);
}

.skill-history-item img {
  grid-row: 1 / span 3;
  width: 56px;
  height: 52px;
  border-radius: 6px;
  background: #f8fafc;
  object-fit: cover;
}

.skill-history-thumb {
  grid-row: 1 / span 3;
  display: grid;
  width: 56px;
  height: 52px;
  overflow: hidden;
  border-radius: 6px;
  cursor: zoom-in;
}

.skill-history-thumb img {
  width: 100%;
  height: 100%;
}

.skill-history-item span,
.skill-history-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-history-item span {
  color: #263445;
  font-size: 12px;
  font-weight: 900;
}

.skill-history-item small {
  margin-top: 5px;
  color: #7c8ca2;
  font-size: 11px;
  font-weight: 800;
}

.skill-result-viewer {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  place-items: center;
  padding: 32px;
}

.skill-result-viewer[hidden] {
  display: none;
}

.skill-result-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 31, 46, 0.46);
  backdrop-filter: blur(12px);
}

.skill-result-viewer-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1640px, 94vw);
  height: min(940px, 92vh);
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(218, 226, 235, 0.92);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 28px 72px rgba(19, 31, 46, 0.28);
}

.skill-result-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(218, 226, 235, 0.76);
  padding: 18px 22px;
}

.skill-result-viewer-head h2 {
  margin: 0;
  color: #1d2a39;
  font-size: 24px;
  line-height: 1.2;
}

.skill-result-viewer-head span {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.skill-result-viewer-body {
  display: grid;
  min-height: 0;
  padding: 18px;
}

.skill-result-viewer-media {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(218, 226, 235, 0.84);
  border-radius: 14px;
  background:
    linear-gradient(45deg, rgba(148, 163, 184, 0.12) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, 0.12) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, 0.12) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, 0.12) 75%),
    #f8fafc;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.skill-result-viewer-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.skill-result-viewer-media span {
  color: #7c8ca2;
  font-size: 13px;
  font-weight: 700;
}

#skillStatus.is-error {
  border-color: rgba(220, 38, 38, 0.28);
  color: #b91c1c;
}

#feature-video .generation-workbench {
  height: calc(100vh - 144px);
  min-height: min(620px, calc(100vh - 144px));
}

#feature-image .generation-workbench {
  grid-template-columns: minmax(260px, 0.42fr) minmax(0, 1fr);
}

.image-generation-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(320px, 28%, 430px);
  gap: 18px;
  min-width: 0;
  min-height: 0;
}

#feature-image .image-generation-main .generation-stage-panel {
  order: 1;
}

#feature-image .image-generation-main .generation-control-panel {
  order: 2;
}

@media (max-width: 1320px) and (min-width: 961px) {
  .create-page {
    --page-gutter: clamp(20px, 3vw, 40px);
  }

  .feature-sidebar {
    left: 18px;
    width: 58px;
    padding: 10px 6px;
  }

  .feature-nav-item {
    width: 44px;
    height: 44px;
  }

  .skill-workbench {
    grid-template-columns: minmax(280px, 0.82fr) minmax(460px, 1.35fr) minmax(210px, 0.58fr);
  }

  .segmentation-workbench {
    grid-template-columns: minmax(260px, 0.74fr) minmax(520px, 1.46fr) minmax(190px, 0.54fr);
  }

  .generation-workbench {
    grid-template-columns: minmax(190px, 0.48fr) minmax(520px, 1.34fr) minmax(280px, 0.72fr);
  }

  #feature-image .generation-workbench {
    grid-template-columns: minmax(220px, 0.38fr) minmax(0, 1fr);
  }
}

@media (max-width: 1120px) and (min-width: 961px) {
  .create-page {
    --page-gutter: 18px;
  }

  .skill-workbench,
  .segmentation-workbench,
  .generation-workbench {
    gap: 12px;
  }

  .skill-workbench {
    grid-template-columns: minmax(250px, 0.78fr) minmax(400px, 1.26fr) minmax(190px, 0.52fr);
  }

  .segmentation-workbench {
    grid-template-columns: minmax(240px, 0.7fr) minmax(440px, 1.3fr) minmax(180px, 0.5fr);
  }

  .generation-workbench {
    grid-template-columns: minmax(180px, 0.44fr) minmax(440px, 1.24fr) minmax(250px, 0.66fr);
  }

  .image-generation-main {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.38fr);
  }
}

.generation-side-panel,
.generation-stage-panel,
.generation-control-panel {
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.generation-side-panel,
.generation-stage-panel,
.generation-control-card {
  border: 1px solid rgba(205, 216, 228, 0.86);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 18px 44px rgba(34, 52, 73, 0.1);
  backdrop-filter: blur(14px);
}

.generation-side-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
  border-radius: 26px;
  padding: 22px;
}

#feature-video .generation-side-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.generation-panel-head {
  display: grid;
  gap: 8px;
}

.generation-panel-head h2 {
  margin: 0;
  color: #1d2a39;
  font-size: 22px;
  line-height: 1.25;
}

.generation-source-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
}

.video-source-sections {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.video-source-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 9px;
  min-height: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  padding: 0;
}

.video-source-section[hidden] {
  display: none;
}

.generation-side-panel[data-source-mode="library"] .video-book-section,
.generation-side-panel[data-source-mode="comic"] #videoLibrarySourceSection {
  display: none;
}

.video-book-section {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.video-source-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.video-source-field .module-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
}

.video-source-field .module-label b {
  display: inline-grid;
  min-width: 24px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: rgba(71, 169, 230, 0.12);
  color: #166493;
  font-size: 11px;
  line-height: 1;
}

.video-source-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #263445;
  font-size: 13px;
  font-weight: 900;
}

.video-source-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.video-source-section-head b {
  display: inline-grid;
  min-width: 24px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: rgba(71, 169, 230, 0.12);
  color: #166493;
  font-size: 11px;
}

.video-source-select {
  width: 100%;
  min-height: 34px;
  min-width: 0;
  border: 1px solid rgba(218, 226, 235, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #263445;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.video-source-mode-select {
  min-height: 38px;
  border-radius: 12px;
  background: rgba(248, 251, 253, 0.95);
}

.video-book-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
}

.video-book-add-row .segmentation-input {
  min-height: 34px;
  border-radius: 8px;
  font-size: 12px;
}

.video-mini-btn {
  min-height: 24px;
  border: 1px solid rgba(71, 169, 230, 0.34);
  border-radius: 999px;
  background: rgba(236, 248, 255, 0.88);
  color: #166493;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 900;
}

.video-library-source-list,
.video-book-list,
.video-book-page-list {
  gap: 8px;
}

.video-source-note {
  overflow: hidden;
  color: #7c8ca2;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-book-item {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.video-book-toggle {
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.video-book-toggle::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid #7c8ca2;
  border-bottom: 2px solid #7c8ca2;
  transform: rotate(45deg) translateY(-2px);
}

.video-book-item.is-open .video-book-toggle::after {
  transform: rotate(225deg) translateY(-2px);
}

.video-book-page-list {
  display: grid;
  max-height: 260px;
  overflow: auto;
  padding-left: 10px;
}

.video-book-page-item {
  background: rgba(255, 255, 255, 0.86);
}

.video-selected-gallery {
  min-height: 74px;
}

.video-selected-gallery p {
  display: grid;
  min-height: 64px;
  place-items: center;
  margin: 0;
  border: 1px dashed rgba(124, 140, 162, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
  color: #8b98a8;
  font-size: 12px;
  font-weight: 800;
}

.video-selected-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 9px;
  min-height: 74px;
  border: 1px solid rgba(71, 169, 230, 0.36);
  border-radius: 12px;
  background: rgba(236, 248, 255, 0.86);
  padding: 8px;
}

.video-selected-thumb {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(218, 226, 235, 0.86);
  border-radius: 9px;
  background:
    linear-gradient(45deg, rgba(148, 163, 184, 0.14) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, 0.14) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, 0.14) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, 0.14) 75%),
    #f8fafc;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-size: 12px 12px;
}

.video-selected-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-selected-card button {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(218, 226, 235, 0.92);
  border-radius: 999px;
  background: #fff;
  color: #7c8ca2;
  font-size: 18px;
  line-height: 1;
}

.generation-upload-btn {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 74px;
  border: 1px dashed rgba(71, 169, 230, 0.42);
  border-radius: 8px;
  background: rgba(246, 250, 253, 0.92);
  color: #263445;
  padding: 10px 12px;
  text-align: left;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.generation-upload-btn:hover {
  border-color: rgba(71, 169, 230, 0.68);
  background: #fff;
  transform: translateY(-1px);
}

.generation-upload-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(218, 226, 235, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #47a9e6;
  font-size: 26px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(34, 52, 73, 0.08);
}

.generation-upload-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.generation-upload-copy b {
  overflow: hidden;
  color: #263445;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generation-upload-copy small {
  overflow: hidden;
  color: #7c8ca2;
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generation-source-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid rgba(218, 226, 235, 0.88);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.78);
  color: #263445;
  padding: 12px;
  text-align: left;
}

.generation-source-item.is-active {
  border-color: rgba(71, 169, 230, 0.56);
  background: rgba(236, 248, 255, 0.88);
}

.generation-source-item.is-risk {
  border-color: rgba(230, 169, 71, 0.45);
  background: rgba(255, 250, 236, 0.82);
}

.generation-source-thumb {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(218, 226, 235, 0.8);
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(148, 163, 184, 0.14) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, 0.14) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, 0.14) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, 0.14) 75%),
    #f8fafc;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-size: 12px 12px;
}

.generation-source-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.generation-hover-preview {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  display: grid;
  width: min(360px, 32vw);
  height: min(460px, 62vh);
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(205, 216, 228, 0.94);
  border-radius: 12px;
  background:
    linear-gradient(45deg, rgba(148, 163, 184, 0.12) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, 0.12) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, 0.12) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, 0.12) 75%),
    rgba(255, 255, 255, 0.98);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  box-shadow: 0 22px 48px rgba(34, 52, 73, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-8px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  visibility: hidden;
}

.generation-hover-preview.is-visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  visibility: visible;
}

.generation-hover-preview[hidden] {
  display: none;
}

.generation-hover-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.generation-source-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.generation-record-item {
  align-items: stretch;
}

.generation-record-body {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.generation-source-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.generation-add-library-btn {
  min-height: 28px;
  border: 1px solid rgba(71, 169, 230, 0.35);
  border-radius: 999px;
  background: rgba(236, 248, 255, 0.86);
  color: #166493;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.generation-add-library-btn:hover {
  border-color: rgba(71, 169, 230, 0.62);
  background: #fff;
}

.generation-add-library-btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.generation-stage-panel {
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  border-radius: 28px;
}

#feature-image .generation-stage-panel {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

#feature-video .generation-stage-panel {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.generation-preview-wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  padding: 20px;
  background-color: #edf3f8;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.72) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.72) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.72) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.72) 75%);
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

.image-canvas-actions {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(205, 216, 228, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 30px rgba(34, 52, 73, 0.14);
  padding: 8px;
  backdrop-filter: blur(14px);
}

.image-download-btn img {
  width: 18px;
  height: 18px;
}

.generation-preview-grid {
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.generation-preview-cell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.generation-preview-cell[hidden] {
  display: none;
}

.generation-preview-cell-result {
  height: 100%;
  grid-template-rows: minmax(0, 1fr);
}

.generation-preview-label {
  color: #526174;
  font-size: 12px;
  font-weight: 800;
}

.generation-preview-media {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(218, 226, 235, 0.72);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
}

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

.generation-control-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  overflow: hidden;
}

#feature-image .generation-control-panel {
  align-content: stretch;
  grid-template-rows: minmax(0, 1fr);
}

.image-generation-control-strip {
  height: 100%;
  overflow: hidden;
}

#feature-video .generation-control-panel {
  grid-template-rows: minmax(0, 1fr);
}

.generation-control-card {
  display: grid;
  gap: 14px;
  border-radius: 22px;
  padding: 20px;
}

.image-generate-card {
  gap: 12px;
  align-content: start;
  height: 100%;
  min-height: 0;
  border-radius: 22px;
  padding: 18px;
}

.image-generate-strip-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.image-generate-strip-head h2 {
  margin: 0;
  color: #1d2a39;
  font-size: 20px;
  line-height: 1.2;
}

.image-generate-strip-head span {
  color: #7c8ca2;
  font-size: 12px;
  font-weight: 800;
}

.image-generate-strip-head .module-action {
  width: 100%;
  min-height: 40px;
  padding: 0 18px;
}

.image-generate-strip-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 12px;
  min-width: 0;
}

.image-control-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.image-control-field .segmentation-input,
.image-control-field select,
.image-control-field textarea {
  width: 100%;
  min-width: 0;
}

.image-control-field select.segmentation-input {
  appearance: auto;
}

.image-control-field-prompt {
  align-self: stretch;
}

.image-control-field-prompt .generation-extra-textarea {
  min-height: 116px;
  max-height: 160px;
  padding: 12px;
  line-height: 1.5;
}

.image-control-field-view {
  align-items: start;
  grid-template-columns: 1fr;
  gap: 8px;
}

.image-control-field-view .module-label {
  margin: 0;
}

.generation-view-panel {
  display: grid;
  gap: 8px;
}

.generation-view-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.generation-view-tag {
  min-height: 32px;
  border: 1px solid rgba(218, 226, 235, 0.92);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #526174;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
}

.generation-view-tag:hover,
.generation-view-tag.is-active {
  border-color: rgba(71, 169, 230, 0.52);
  background: rgba(236, 248, 255, 0.94);
  color: #166493;
}

.generation-queue-card {
  min-height: 0;
}

.generation-textarea {
  min-height: 180px;
  max-height: 360px;
}

.generation-extra-textarea {
  min-height: 128px;
}

.video-preview-wrap {
  position: relative;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

.image-generation-version-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-height: 76px;
  border-bottom: 1px solid rgba(205, 216, 228, 0.72);
  background: rgba(255, 255, 255, 0.72);
  padding: 8px 14px;
}

.image-generation-version-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.image-generation-version-main #imageGenerationQueueStatus {
  flex: 0 0 auto;
  color: #7c8ca2;
  font-size: 12px;
  font-weight: 800;
}

.image-generation-version-list {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
}

.image-generation-step-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.image-generation-step-tab {
  min-width: 0;
  height: 32px;
  overflow: hidden;
  border: 1px solid rgba(218, 226, 235, 0.9);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.82);
  color: #526174;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.image-generation-step-tab.is-ready {
  color: #166493;
}

.image-generation-step-tab.is-active {
  border-color: rgba(71, 169, 230, 0.58);
  background: rgba(71, 169, 230, 0.92);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(71, 169, 230, 0.22);
}

.image-version-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid rgba(218, 226, 235, 0.9);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.86);
  color: #263445;
  padding: 0 6px 0 10px;
}

.image-version-chip.is-active {
  border-color: rgba(71, 169, 230, 0.52);
  background: rgba(236, 248, 255, 0.94);
}

.image-version-body {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}

.image-version-body span {
  max-width: 150px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-version-body b {
  color: #7c8ca2;
  font-size: 11px;
}

.image-version-add-btn {
  min-height: 22px;
  border: 1px solid rgba(71, 169, 230, 0.32);
  border-radius: 999px;
  background: rgba(236, 248, 255, 0.84);
  color: #166493;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 800;
}

.image-version-add-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.video-version-strip {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 6px;
  min-height: 48px;
  border-bottom: 1px solid rgba(205, 216, 228, 0.72);
  background: rgba(255, 255, 255, 0.72);
  padding: 8px 14px 7px;
}

.video-version-strip > div {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.video-version-main {
  min-height: 30px;
}

.video-version-strip #videoGenerationQueueStatus {
  color: #7c8ca2;
  font-size: 12px;
  font-weight: 800;
}

.video-version-list {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
}

.video-version-empty {
  color: #8b98a8;
  font-size: 12px;
}

.video-version-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid rgba(218, 226, 235, 0.9);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.86);
  color: #263445;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.video-version-chip b {
  color: #7c8ca2;
  font-size: 11px;
}

.video-version-chip small {
  max-width: 120px;
  overflow: hidden;
  color: #8b98a8;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-version-chip.is-active {
  border-color: rgba(71, 169, 230, 0.52);
  background: rgba(236, 248, 255, 0.94);
  color: #166493;
}

.video-canvas-actions {
  position: absolute;
  right: 28px;
  bottom: 28px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(205, 216, 228, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 30px rgba(34, 52, 73, 0.14);
  padding: 8px;
  backdrop-filter: blur(14px);
}

.video-canvas-action {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(218, 226, 235, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  padding: 0;
  transition: border-color 160ms ease, background-color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.video-canvas-action:hover:not(:disabled) {
  border-color: rgba(71, 169, 230, 0.58);
  background: #fff;
  transform: translateY(-1px);
}

.video-canvas-action:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.video-canvas-action img {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.video-reference-preview {
  position: absolute;
  left: 28px;
  top: 28px;
  z-index: 4;
  display: grid;
  gap: 8px;
  width: min(260px, 34%);
  overflow: hidden;
  border: 1px solid rgba(205, 216, 228, 0.78);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 34px rgba(34, 52, 73, 0.16);
  padding: 10px;
  backdrop-filter: blur(14px);
}

.video-reference-preview[hidden] {
  display: none;
}

.video-reference-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #526174;
  font-size: 12px;
  font-weight: 900;
}

.video-reference-preview-head b {
  color: #168a9e;
  font-size: 11px;
}

.video-reference-preview-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.video-reference-preview-thumb {
  display: grid;
  place-items: center;
  width: 82px;
  height: 62px;
  overflow: hidden;
  border: 1px solid rgba(218, 226, 235, 0.86);
  border-radius: 8px;
  background: #e8eef5;
}

.video-reference-preview-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-reference-preview-text {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.video-reference-preview-text strong,
.video-reference-preview-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-reference-preview-text strong {
  color: #1f2d3d;
  font-size: 13px;
}

.video-reference-preview-text small {
  color: #64748b;
  font-size: 11px;
}

.video-result-media {
  display: grid;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(218, 226, 235, 0.72);
  border-radius: 16px;
  background: rgba(8, 13, 20, 0.92);
}

.video-result-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-result-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-generate-card {
  gap: 12px;
}

.video-motion-upload {
  min-height: 64px;
}

.video-source-upload {
  min-height: 64px;
}

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

.video-pose-panel {
  display: grid;
  gap: 6px;
}

.video-artwork-type-panel {
  display: grid;
  gap: 6px;
}

.video-artwork-type-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.video-artwork-type-btn {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(218, 226, 235, 0.9);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.82);
  color: #526174;
  padding: 7px 6px;
  text-align: left;
}

.video-artwork-type-btn span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-artwork-type-btn small {
  overflow: hidden;
  color: #8b98a8;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-artwork-type-btn.is-active,
.video-artwork-type-btn:hover {
  border-color: rgba(71, 169, 230, 0.55);
  background: rgba(236, 248, 255, 0.94);
  color: #166493;
}

.video-pose-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}

.video-pose-btn {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(218, 226, 235, 0.9);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.82);
  color: #526174;
  padding: 4px 3px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.video-pose-btn.is-active,
.video-pose-btn:hover {
  border-color: rgba(71, 169, 230, 0.55);
  background: rgba(236, 248, 255, 0.94);
  color: #166493;
}

.video-pose-stick {
  display: grid;
  height: 32px;
  place-items: center;
}

.video-pose-stick svg {
  width: 32px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.2;
}

.video-pose-stick circle {
  fill: currentColor;
  stroke: none;
}

.video-motion-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(218, 226, 235, 0.86);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.76);
  padding: 8px;
}

.video-motion-thumb {
  display: grid;
  width: 46px;
  height: 36px;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  background: #e9eef5;
}

.video-motion-thumb img,
.video-motion-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-motion-item button {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(218, 226, 235, 0.92);
  border-radius: 999px;
  background: #fff;
  color: #7c8ca2;
  font-size: 18px;
  line-height: 1;
}

.video-textarea {
  min-height: 300px;
}

.video-record-thumb {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #1e293b;
  color: #fff;
  font-size: 18px;
}

.segmentation-annotation-panel {
  display: grid;
  grid-template-rows: auto auto minmax(260px, 1fr) auto;
  gap: 14px;
  overflow: hidden;
  border-radius: 26px;
  padding: 22px;
}

.segmentation-panel-head,
.segmentation-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.segmentation-panel-head h2,
.segmentation-card-head h2,
.segmentation-card-head h3 {
  margin: 0;
  color: #1d2a39;
  line-height: 1.25;
}

.segmentation-panel-head h2,
.segmentation-card-head h2 {
  font-size: 22px;
}

.segmentation-card-head h3 {
  font-size: 15px;
}

.segmentation-panel-head span,
.segmentation-card-head span {
  color: #7c8ca2;
  font-size: 12px;
  white-space: nowrap;
}

.segmentation-target-list,
.segmentation-annotation-list {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
}

.segmentation-target-list {
  display: flex;
  align-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
  overflow: auto;
}

.segmentation-annotation-list.is-empty {
  align-content: end;
  overflow: hidden;
}

.segmentation-empty-text {
  margin: 0;
  color: #7c8ca2;
  font-size: 13px;
  line-height: 1.6;
}

.segmentation-annotation-item {
  width: 100%;
  border: 1px solid rgba(218, 226, 235, 0.88);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.78);
  color: #263445;
  padding: 12px;
  text-align: left;
}

.segmentation-annotation-item.is-active {
  border-color: rgba(71, 169, 230, 0.56);
  background: rgba(236, 248, 255, 0.88);
}

.segmentation-item-title {
  display: block;
  overflow: hidden;
  color: #1f2d3d;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segmentation-item-meta {
  display: block;
  margin-top: 5px;
  color: #7c8ca2;
  font-size: 12px;
  line-height: 1.45;
}

.segmentation-stage-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  border-radius: 28px;
}

.segmentation-mode-group,
.segmentation-view-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.segmentation-tool-btn,
.segmentation-icon-btn,
.segmentation-link-btn,
.segmentation-secondary-btn,
.segmentation-primary-outline,
.segmentation-manual-row button {
  min-height: 34px;
  border: 1px solid rgba(218, 226, 235, 0.92);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #36475a;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.segmentation-tool-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.segmentation-tool-btn img {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.78;
  transition: opacity 160ms ease, transform 160ms ease, filter 160ms ease;
}

.segmentation-tool-btn:hover img,
.segmentation-tool-btn.is-active img {
  opacity: 1;
  transform: scale(1.04);
  filter: sepia(1) saturate(3) hue-rotate(150deg);
}

.segmentation-tool-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 12;
  width: max-content;
  max-width: 190px;
  border: 1px solid rgba(31, 45, 61, 0.1);
  border-radius: 8px;
  background: rgba(31, 45, 61, 0.94);
  box-shadow: 0 10px 24px rgba(34, 52, 73, 0.18);
  color: #fff;
  opacity: 0;
  padding: 7px 9px;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 150ms ease, transform 150ms ease;
  white-space: normal;
}

.segmentation-tool-btn[data-tooltip]:hover::after,
.segmentation-tool-btn[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.segmentation-tool-btn:hover,
.segmentation-icon-btn:hover,
.segmentation-link-btn:hover,
.segmentation-secondary-btn:hover,
.segmentation-primary-outline:hover,
.segmentation-manual-row button:hover {
  border-color: rgba(71, 169, 230, 0.45);
  background: #fff;
  transform: translateY(-1px);
}

.segmentation-tool-btn.is-active,
.segmentation-icon-btn.is-active {
  border-color: rgba(71, 169, 230, 0.52);
  background: rgba(236, 248, 255, 0.94);
  color: #166493;
}

.segmentation-primary-btn {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: #47a9e6;
  color: #fff;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
}

.segmentation-primary-btn:disabled,
.segmentation-secondary-btn:disabled,
.segmentation-primary-outline:disabled,
.segmentation-link-btn:disabled,
.segmentation-manual-row button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.segmentation-canvas-wrap {
  position: relative;
  height: 100%;
  min-height: 0;
  background-color: #edf3f8;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.72) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.72) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.72) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.72) 75%);
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

.segmentation-floating-toolbar {
  position: absolute;
  right: 18px;
  top: 18px;
  bottom: auto;
  z-index: 4;
  display: flex;
  max-width: min(320px, calc(100% - 36px));
  border: 1px solid rgba(218, 226, 235, 0.86);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 14px 34px rgba(34, 52, 73, 0.14);
  backdrop-filter: blur(18px);
  padding: 8px;
}

.segmentation-view-toolbar {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.segmentation-view-toolbar > span,
.segmentation-view-toolbar .segmentation-view-actions {
  pointer-events: auto;
}

.segmentation-view-toolbar > span {
  max-width: min(420px, 42vw);
  overflow: hidden;
  border: 1px solid rgba(218, 226, 235, 0.86);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 28px rgba(34, 52, 73, 0.12);
  color: #526174;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segmentation-view-toolbar .segmentation-view-actions {
  border: 1px solid rgba(218, 226, 235, 0.86);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 34px rgba(34, 52, 73, 0.14);
  backdrop-filter: blur(18px);
  padding: 8px;
}

.segmentation-floating-toolbar .segmentation-mode-group {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.segmentation-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  cursor: crosshair;
}

.segmentation-canvas-empty {
  position: absolute;
  inset: 20px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border-radius: 22px;
  background: rgba(246, 249, 252, 0.82);
  color: #78879b;
  pointer-events: none;
  text-align: center;
}

.segmentation-canvas-empty strong {
  color: #263445;
  font-size: 20px;
}

.segmentation-canvas-empty span {
  font-size: 13px;
}

.segmentation-canvas-empty.is-hidden {
  display: none;
}

.segmentation-control-panel {
  display: grid;
  grid-template-rows: minmax(184px, 0.58fr) minmax(228px, 0.74fr) minmax(280px, 1.02fr);
  gap: 12px;
  overflow: hidden;
}

.segmentation-control-card {
  display: grid;
  gap: 8px;
  border-radius: 22px;
  padding: 14px;
}

.segmentation-prompt-card {
  min-height: 184px;
  grid-template-rows: auto minmax(112px, 1fr) auto;
}

.segmentation-seed-card {
  min-height: 0;
  grid-template-rows: auto minmax(170px, 1fr) auto;
}

.segmentation-control-card input[type="file"] {
  display: none;
}

.segmentation-primary-outline {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  font-size: 15px;
}

.segmentation-upload-box {
  display: grid;
  grid-template-rows: auto minmax(78px, 1fr);
  gap: 7px;
  width: 100%;
  min-height: 118px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(218, 226, 235, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: #36475a;
  padding: 7px;
  cursor: pointer;
  text-align: left;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.segmentation-upload-box:hover {
  border-color: rgba(71, 169, 230, 0.38);
  background: #fff;
  box-shadow: 0 10px 24px rgba(34, 52, 73, 0.08);
  transform: translateY(-1px);
}

.segmentation-upload-box:focus-visible {
  outline: 2px solid rgba(71, 169, 230, 0.55);
  outline-offset: 2px;
}

.segmentation-upload-box:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.segmentation-upload-preview {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 7.2;
  min-height: 78px;
  max-height: 96px;
  overflow: hidden;
  border: 1px dashed rgba(148, 163, 184, 0.34);
  border-radius: 11px;
  background:
    linear-gradient(45deg, rgba(148, 163, 184, 0.12) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, 0.12) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, 0.12) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, 0.12) 75%),
    #f8fafc;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

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

.segmentation-upload-placeholder {
  display: grid;
  justify-items: center;
  gap: 5px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.segmentation-upload-plus {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(71, 169, 230, 0.13);
  color: #2d8bc4;
  font-size: 20px;
  line-height: 1;
}

.segmentation-upload-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  order: -1;
  padding: 0 2px;
}

.segmentation-upload-copy strong {
  color: #1d2a39;
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}

.segmentation-upload-copy small {
  overflow: hidden;
  color: #7c8ca2;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segmentation-meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
  overflow: hidden;
  color: #7c8ca2;
  font-size: 11px;
  line-height: 1.3;
}

.segmentation-meta-list span {
  min-width: 0;
  white-space: nowrap;
}

.segmentation-side-textarea,
.segmentation-feedback {
  width: 100%;
  min-height: 220px;
  resize: none;
  border: 1px solid rgba(218, 226, 235, 0.95);
  border-radius: 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.88);
  color: #263445;
  padding: 14px;
  font-size: 14px;
  line-height: 1.6;
}

.segmentation-side-textarea {
  min-height: 104px;
  max-height: none;
}

.segmentation-seed-card .segmentation-side-textarea {
  min-height: 170px;
  line-height: 1.5;
}

.segmentation-side-textarea:focus,
.segmentation-feedback:focus,
.segmentation-input:focus,
.segmentation-manual-row input:focus {
  border-color: rgba(71, 169, 230, 0.58);
}

.segmentation-secondary-btn {
  width: fit-content;
  border-radius: 12px;
  padding: 0 18px;
}

.segmentation-target-card {
  min-height: 0;
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.segmentation-manual-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.segmentation-input,
.segmentation-manual-row input {
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgba(218, 226, 235, 0.95);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.9);
  color: #263445;
  padding: 0 14px;
}

.segmentation-readout {
  margin: 0;
  color: #7c8ca2;
  font-size: 13px;
}

.segmentation-target-chip {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  max-width: 100%;
  min-height: 30px;
  overflow: hidden;
  border: 1px solid rgba(218, 226, 235, 0.92);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.86);
  color: #526174;
}

.segmentation-target-chip.is-selected {
  border-color: rgba(71, 169, 230, 0.35);
  background: rgba(236, 248, 255, 0.82);
}

.segmentation-target-chip.is-active {
  border-color: rgba(71, 169, 230, 0.62);
  box-shadow: 0 8px 18px rgba(71, 169, 230, 0.12);
}

.segmentation-target-check {
  display: grid;
  place-items: center;
  width: 26px;
  height: 100%;
  cursor: pointer;
}

.segmentation-target-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.segmentation-target-check span {
  display: block;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(100, 116, 139, 0.45);
  border-radius: 999px;
  background: #fff;
}

.segmentation-target-check input:checked + span {
  border-color: #47a9e6;
  background: #47a9e6;
  box-shadow: inset 0 0 0 3px #fff;
}

.segmentation-target-body {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0 9px 0 0;
  text-align: left;
}

.segmentation-target-name {
  overflow: hidden;
  color: #263445;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segmentation-target-score {
  color: #8a98a9;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.segmentation-small-btn {
  min-height: 30px;
  border: 1px solid rgba(218, 226, 235, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: #526174;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.segmentation-small-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.segmentation-annotation-list {
  max-height: none;
  min-height: 0;
}

.segmentation-annotation-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  border: 1px solid rgba(218, 226, 235, 0.82);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  padding: 10px;
}

.segmentation-annotation-body {
  min-width: 0;
  color: inherit;
  text-align: left;
}

.segmentation-annotation-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.segmentation-annotation-actions .segmentation-small-btn {
  min-width: 0;
  padding: 0 6px;
  white-space: nowrap;
}

.segmentation-annotation-item.is-active {
  border-color: rgba(71, 169, 230, 0.48);
  background: rgba(236, 248, 255, 0.72);
}

.segmentation-status-error {
  color: #be3d3d;
}

.segmentation-status-ok {
  color: #168a69;
}

@media (min-width: 961px) {
  .composer-shell {
    width: min(1500px, calc(100% - var(--page-gutter) * 2));
  }

  .feature-panel[data-feature-panel="segmentation"].is-active {
    margin-left: 0;
  }
}

.prompt-card {
  position: relative;
  min-height: 250px;
  border: 1px solid rgba(218, 226, 235, 0.9);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 18px 44px rgba(34, 52, 73, 0.1);
  backdrop-filter: blur(12px);
  padding: 32px 34px 28px;
}

.prompt-card input[type="file"] {
  display: none;
}

.prompt-main {
  position: relative;
  display: block;
  min-height: 150px;
  padding-right: 92px;
}

.upload-stack {
  position: absolute;
  left: 4px;
  top: 8px;
  z-index: 5;
  width: 318px;
  height: 138px;
  margin: 0;
  overflow: visible;
}

.upload-stack__empty,
.upload-stack__add {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(218, 226, 235, 0.85);
  border-radius: 8px;
  background: rgba(246, 248, 251, 0.92);
  color: #9aa6b4;
  transition: transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1), background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.upload-stack__empty {
  inset: auto;
  top: 4px;
  left: 0;
  width: 88px;
  height: 118px;
  gap: 8px;
  padding: 12px;
  transform: rotate(-8deg);
  cursor: pointer;
}

.upload-stack__empty:hover {
  background: #fff;
  border-color: rgba(71, 169, 230, 0.45);
  transform: rotate(-6deg) translateY(-1px);
}

.upload-stack__empty-plus {
  font-size: 34px;
  line-height: 1;
}

.upload-stack__empty-text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.upload-stack__item {
  position: absolute;
  top: 4px;
  left: 0;
  width: 88px;
  height: 118px;
  transform: translate(var(--stack-base-x), var(--stack-base-y)) rotate(var(--stack-base-rotate));
  transition: transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 360ms ease, filter 360ms ease;
  transform-origin: center center;
  cursor: default;
}

.upload-stack:hover .upload-stack__item,
.upload-stack:focus-within .upload-stack__item {
  transform: translate(var(--stack-hover-x), var(--stack-hover-y)) rotate(var(--stack-hover-rotate));
}

.upload-stack__item:hover {
  z-index: 999;
  filter: drop-shadow(0 10px 24px rgba(34, 52, 73, 0.12));
}

.upload-stack__media {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(218, 226, 235, 0.88);
  border-radius: 8px;
  background: #fff;
}

.upload-stack__remove {
  position: absolute;
  top: -9px;
  right: -9px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(218, 226, 235, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #6b7788;
  font-size: 16px;
  line-height: 1;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 160ms ease, transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.upload-stack:hover .upload-stack__remove,
.upload-stack:focus-within .upload-stack__remove,
.upload-stack__item:hover .upload-stack__remove {
  opacity: 1;
  transform: scale(1);
}

.upload-stack__remove:hover {
  border-color: rgba(71, 169, 230, 0.45);
  background: #fff;
}

.upload-stack__add {
  left: 0;
  top: 4px;
  right: auto;
  bottom: auto;
  width: 52px;
  height: 52px;
  z-index: 2000;
  border-style: solid;
  border-color: rgba(218, 226, 235, 0.9);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(34, 52, 73, 0.12);
  background: rgba(255, 255, 255, 0.96);
  color: #8d9aab;
  font-size: 28px;
  transform: translate(var(--stack-add-base-x), var(--stack-add-base-y)) rotate(var(--stack-add-base-rotate));
  pointer-events: auto;
  cursor: pointer;
}

.upload-stack:hover .upload-stack__add,
.upload-stack:focus-within .upload-stack__add {
  transform: translate(var(--stack-add-hover-x), var(--stack-add-hover-y)) rotate(var(--stack-add-hover-rotate));
}

.upload-stack__add:hover {
  border-color: rgba(71, 169, 230, 0.45);
  background: #fff;
  transform: translate(var(--stack-add-hover-x), calc(var(--stack-add-hover-y) - 1px)) rotate(var(--stack-add-hover-rotate));
}

.prompt-editor {
  width: 100%;
  min-height: 130px;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: #253142;
  font-size: 26px;
  line-height: 1.55;
  font-weight: 500;
  padding: 0 0 12px 128px;
}

.prompt-editor::placeholder {
  color: #9aa6b4;
}

.prompt-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid rgba(218, 226, 235, 0.76);
  min-height: 82px;
  padding-top: 18px;
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
  color: #7c8ca2;
}

.tool-pill {
  min-height: 44px;
  border: 1px solid rgba(218, 226, 235, 0.94);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  padding: 0 18px;
  color: #263445;
  font-size: 15px;
  font-weight: 600;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.tool-pill:hover {
  border-color: rgba(71, 169, 230, 0.42);
  background: #fff;
  transform: translateY(-1px);
}

.asset-count,
.state-pill {
  color: #7c8ca2;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(218, 226, 235, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0 9px;
}

#segmentationStatus {
  display: inline-flex;
  align-items: center;
  max-width: 168px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generate-fab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: #d8dde4;
  color: #fff;
  font-size: 27px;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, opacity 160ms ease;
}

.generate-fab b {
  display: none;
  font-size: 14px;
  line-height: 1;
}

.generate-fab:not(:disabled):hover {
  background: #47a9e6;
  transform: translateY(-1px);
}

.generate-fab:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.segmentation-run:disabled {
  cursor: not-allowed;
}

.generate-fab.is-loading {
  width: 92px;
  background: #47a9e6;
  font-size: 14px;
}

.generate-fab.is-loading b {
  display: inline;
}

.generate-fab.is-loading span {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

.ghost-error {
  display: block;
  margin: 10px 0 0 122px;
}

.library-board {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  width: min(1420px, calc(100% - var(--page-gutter) * 2));
  height: calc(100vh - 176px);
  min-height: min(620px, calc(100vh - 176px));
  margin: 0 auto;
  border: 1px solid rgba(218, 226, 235, 0.9);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 44px rgba(34, 52, 73, 0.1);
  backdrop-filter: blur(12px);
  padding: 24px;
}

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

.library-head h2 {
  margin: 0;
  color: #1d2a39;
  font-size: 26px;
  line-height: 1.25;
}

.library-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.library-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid rgba(218, 226, 235, 0.92);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #526174;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
}

.library-filter-btn b {
  display: inline-grid;
  min-width: 22px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
  font-size: 11px;
  line-height: 1;
}

.library-filter-btn:hover,
.library-filter-btn.is-active {
  border-color: rgba(71, 169, 230, 0.52);
  background: rgba(236, 248, 255, 0.94);
  color: #166493;
}

.library-filter-btn:hover b,
.library-filter-btn.is-active b {
  background: rgba(71, 169, 230, 0.16);
  color: #166493;
}

.library-grid {
  display: grid;
  align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  column-gap: 22px;
  row-gap: 36px;
  min-height: 0;
  overflow: auto;
  padding: 12px 8px 32px 0;
}

.library-grid:has(.library-card-inspiration) {
  column-gap: 24px;
  row-gap: 38px;
}

.library-card {
  display: grid;
  grid-template-rows: minmax(0, 238px) 92px;
  box-sizing: border-box;
  min-height: 330px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(218, 226, 235, 0.88);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: inherit;
  padding: 0;
  text-align: left;
  aspect-ratio: auto;
  contain: layout paint;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button.library-card {
  cursor: pointer;
}

.library-card:hover {
  border-color: rgba(71, 169, 230, 0.38);
  box-shadow: 0 12px 28px rgba(34, 52, 73, 0.1);
  transform: translateY(-1px);
}

.library-thumb {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(148, 163, 184, 0.14) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, 0.14) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, 0.14) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, 0.14) 75%),
    #f8fafc;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

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

.library-card-cutout .library-thumb img,
.library-card-annotation .library-thumb img,
.library-card.is-transparent .library-thumb img {
  width: calc(100% - 18px);
  height: calc(100% - 18px);
  object-fit: contain;
}

.library-card-video .library-type {
  color: #7c3aed;
}

.library-card-inspiration .library-type {
  color: #a15c17;
}

.library-card-inspiration {
  border-color: rgba(218, 226, 235, 0.7);
}

.library-card-video .library-thumb::after {
  content: "视频";
  position: absolute;
  right: 8px;
  top: 8px;
  border-radius: 999px;
  background: rgba(31, 45, 61, 0.78);
  color: #fff;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
}

.library-card-inspiration .library-thumb::after {
  content: "灵感";
  position: absolute;
  right: 8px;
  top: 8px;
  border-radius: 999px;
  background: rgba(161, 92, 23, 0.82);
  color: #fff;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
}

.library-thumb-empty {
  color: #8a98a9;
  font-size: 12px;
  font-weight: 800;
}

.library-thumb-fallback {
  color: #8a98a9;
  font-size: 12px;
  font-weight: 800;
}

.library-card-body {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  border-top: 1px solid rgba(218, 226, 235, 0.72);
  padding: 10px;
  background: rgba(255, 255, 255, 0.94);
}

.library-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #8a98a9;
  font-size: 12px;
}

.library-type {
  color: #168a9e;
  font-weight: 800;
}

.library-card h3 {
  margin: 0;
  overflow: hidden;
  color: #1f2d3d;
  font-size: 14px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.library-empty {
  display: grid;
  place-items: center;
  min-height: 88px;
  color: #7c8ca2;
  font-size: 13px;
  text-align: center;
}

.library-empty[hidden] {
  display: none;
}

.library-book-viewer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 48px;
}

.library-book-viewer[hidden] {
  display: none;
}

.library-book-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 31, 46, 0.36);
  backdrop-filter: blur(12px);
}

.library-book-viewer-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1420px, 88vw);
  height: min(820px, 86vh);
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(218, 226, 235, 0.92);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 72px rgba(19, 31, 46, 0.24);
}

.library-book-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(218, 226, 235, 0.76);
  padding: 18px 22px;
}

.library-book-viewer-head h2 {
  margin: 0;
  color: #1d2a39;
  font-size: 24px;
  line-height: 1.25;
}

.library-book-viewer-head span {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.library-book-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(218, 226, 235, 0.9);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.92);
  color: #526174;
  font-size: 24px;
  line-height: 1;
}

.library-book-close:hover {
  border-color: rgba(71, 169, 230, 0.5);
  color: #166493;
}

.library-book-viewer-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 18px;
  min-height: 0;
  padding: 18px;
}

.library-book-page-preview {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  margin: 0;
}

.library-book-page-media {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(218, 226, 235, 0.84);
  border-radius: 12px;
  background:
    linear-gradient(45deg, rgba(148, 163, 184, 0.12) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, 0.12) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, 0.12) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, 0.12) 75%),
    #f8fafc;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.library-book-page-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.library-book-page-media span,
.library-book-empty {
  color: #7c8ca2;
  font-size: 13px;
  font-weight: 700;
}

.library-book-page-preview figcaption {
  min-height: 22px;
  overflow: hidden;
  color: #526174;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-book-pages-shell {
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(218, 226, 235, 0.84);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.8);
}

.library-book-pages {
  display: grid;
  align-content: start;
  gap: 8px;
  height: 100%;
  overflow: auto;
  padding: 10px;
}

.library-book-page-btn {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 86px;
  border: 1px solid rgba(218, 226, 235, 0.82);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  color: #1f2d3d;
  padding: 7px;
  text-align: left;
}

.library-book-page-btn:hover,
.library-book-page-btn.is-active {
  border-color: rgba(71, 169, 230, 0.55);
  background: rgba(236, 248, 255, 0.92);
}

.library-book-page-thumb {
  display: grid;
  place-items: center;
  width: 76px;
  height: 70px;
  overflow: hidden;
  border-radius: 8px;
  background: #e8eef5;
}

.library-book-page-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.library-book-page-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.library-book-page-text b,
.library-book-page-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-book-page-text b {
  color: #1f2d3d;
  font-size: 13px;
}

.library-book-page-text span {
  color: #64748b;
  font-size: 12px;
}

.artwork-gallery {
  width: 100%;
}

.artwork-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 72px;
  grid-auto-flow: dense;
  gap: 10px;
}

.artwork-card {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  padding: 0;
  outline: 0 solid transparent;
  transition: filter 160ms ease, outline-color 160ms ease, transform 160ms ease;
}

.artwork-card:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.artwork-card.is-selected {
  outline: 2px solid rgba(71, 169, 230, 0.78);
  outline-offset: -2px;
}

.artwork-card.is-selected::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 8px;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #47a9e6;
  box-shadow: 0 4px 10px rgba(34, 52, 73, 0.18);
}

.artwork-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.artwork-card.item-wide {
  grid-column: span 3;
  grid-row: span 2;
}

.artwork-card.item-tall {
  grid-column: span 3;
  grid-row: span 4;
}

.artwork-card.item-tall-narrow {
  grid-column: span 2;
  grid-row: span 4;
}

.artwork-card.item-feature {
  grid-column: span 4;
  grid-row: span 4;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 960px) {
  .create-page {
    --page-gutter: 18px;
    align-items: start;
    padding: 116px var(--page-gutter) 36px;
  }

  .feature-sidebar {
    left: 18px;
    right: 18px;
    top: 72px;
    width: auto;
    padding: 8px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    transform: none;
  }

  .feature-nav-item {
    width: 100%;
    height: 48px;
  }

  .composer-shell {
    width: 100%;
    transform: none;
  }

  .module-board {
    width: 100%;
    min-height: auto;
    border-radius: 24px;
    padding: 20px;
  }

  .library-board {
    width: 100%;
    height: auto;
    min-height: 520px;
    border-radius: 24px;
    padding: 20px;
  }

  .library-head {
    align-items: stretch;
    flex-direction: column;
  }

  .library-book-viewer {
    padding: 18px;
  }

  .library-book-viewer-panel {
    width: min(100%, 960px);
    height: min(880px, 92vh);
  }

  .library-book-viewer-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(320px, 1fr) minmax(220px, 0.72fr);
  }

  .skill-result-viewer {
    padding: 18px;
  }

  .skill-result-viewer-panel {
    width: min(100%, 1120px);
    height: min(860px, 92vh);
  }

  .module-grid,
  .module-grid-two {
    grid-template-columns: 1fr;
  }

  .module-card {
    min-height: auto;
  }

  .segmentation-native-shell {
    width: 100%;
    height: calc(100vh - 152px);
    min-height: 520px;
  }

  .segmentation-workbench {
    grid-template-columns: 1fr;
    grid-template-areas:
      "controls"
      "stage"
      "annotations";
    width: 100%;
    height: auto;
    min-height: auto;
  }

  .generation-workbench {
    grid-template-columns: 1fr;
    width: 100%;
    height: auto;
    min-height: auto;
  }

  .skill-workbench {
    grid-template-columns: 1fr;
    width: 100%;
    height: auto;
    min-height: auto;
  }

  .segmentation-annotation-panel,
  .segmentation-stage-panel,
  .segmentation-control-panel,
  .generation-side-panel,
  .generation-stage-panel,
  .generation-control-panel,
  .skill-source-panel,
  .skill-stage-panel,
  .skill-control-panel {
    height: auto;
  }

  .segmentation-annotation-panel,
  .segmentation-stage-panel,
  .segmentation-control-card,
  .generation-side-panel,
  .generation-stage-panel,
  .generation-control-card,
  .skill-source-panel,
  .skill-stage-panel,
  .skill-control-card {
    border-radius: 22px;
  }

  .segmentation-target-list,
  .segmentation-annotation-list,
  .segmentation-control-panel,
  .generation-source-list,
  .generation-control-panel,
  .skill-source-panel,
  .skill-control-panel,
  .skill-reference-list {
    max-height: none;
    overflow: visible;
  }

  .segmentation-mode-group,
  .segmentation-view-actions {
    flex-wrap: wrap;
  }

  .segmentation-canvas-wrap,
  .segmentation-canvas,
  .generation-preview-wrap,
  .skill-canvas-shell,
  .skill-canvas {
    min-height: 420px;
  }

  .generation-preview-grid {
    grid-template-columns: 1fr;
  }

  .generation-preview-wrap {
    grid-template-columns: 1fr;
  }

  .video-version-strip {
    grid-template-columns: 1fr;
  }

  .video-pose-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .prompt-card {
    min-height: auto;
    border-radius: 24px;
    padding: 22px;
  }

  .prompt-main {
    min-height: 260px;
    padding-right: 0;
  }

  .upload-stack {
    position: relative;
    left: auto;
    top: auto;
    width: min(100%, 318px);
    height: 132px;
    margin-left: 0;
  }

  .prompt-editor {
    min-height: 140px;
    font-size: 20px;
    padding-left: 0;
  }

  .ghost-error {
    margin-left: 0;
    margin-right: 0;
  }

  .prompt-actions {
    align-items: stretch;
  }

  .artwork-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: 64px;
  }

  .generate-fab {
    width: 52px;
    height: 52px;
    font-size: 26px;
  }
}

@media (max-width: 620px) {
  .library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
    row-gap: 24px;
  }

  .library-card {
    grid-template-rows: minmax(0, 188px) 86px;
    min-height: 274px;
  }

  .artwork-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 58px;
  }

  .segmentation-manual-row {
    grid-template-columns: 1fr;
  }

  .segmentation-icon-btn {
    flex: 1 1 calc(50% - 8px);
  }

  .segmentation-floating-toolbar {
    right: 12px;
    top: 12px;
  }

  .segmentation-view-toolbar {
    left: 12px;
    right: 12px;
    bottom: 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  .segmentation-view-toolbar > span {
    max-width: min(100%, 320px);
  }

  .segmentation-tool-btn {
    flex: 0 0 40px;
  }

  .segmentation-canvas-wrap,
  .segmentation-canvas {
    min-height: 340px;
  }

  .generation-preview-wrap {
    min-height: 340px;
  }

  .skill-canvas-tools {
    left: 12px;
    right: 12px;
    bottom: 12px;
    align-items: flex-start;
    flex-direction: column;
    border-radius: 14px;
  }

  .artwork-card.item-tall,
  .artwork-card.item-tall-narrow,
  .artwork-card.item-feature,
  .artwork-card.item-wide {
    grid-column: span 2;
    grid-row: span 2;
  }
}
