:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #fff;
  --text: #0d0d0d;
  --muted: #858b98;
  --line: #e8ebf0;
  --soft: #f0f2f6;
  --cyan: #32bde3;
  --blue: #4e7cff;
  --shadow: 0 10px 34px rgba(26, 33, 52, .06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
textarea,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus {
  outline: none;
}

button:focus-visible {
  box-shadow: 0 0 0 2px rgba(50, 189, 227, .24);
}

svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  width: 300px;
  padding: 0 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: #fff;
  border-right: 1px solid var(--line);
}

.brand {
  width: 100%;
  height: 72px;
  margin-bottom: 0;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  overflow: visible;
  color: #141820;
  font-size: 16px;
  font-weight: 750;
  text-align: left;
}

.brand::after {
  content: "APILLM";
}

.brand img {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
}

.main-nav,
.side-bottom {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.side-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.main-nav {
  width: 100%;
  padding: 12px 0 8px;
  border-bottom: 1px solid var(--line);
}

.side-bottom {
  margin-top: auto;
  gap: 10px;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  color: #1c2028;
  background: transparent;
  border-radius: 12px;
  font-size: 14px;
  text-align: left;
}

.nav-item svg {
  width: 19px;
  height: 19px;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(0, 0, 0, .035);
}

.create-panel {
  width: 100%;
  padding: 0 4px 10px;
  display: grid;
  gap: 8px;
}

.create-title {
  padding: 0 4px;
  color: #151a22;
  font-size: 16px;
  font-weight: 760;
  line-height: 1.35;
}

.nav-item small {
  padding: 0 4px;
  color: #2a9ec3;
  background: #dff7ff;
  border-radius: 4px;
  font-size: 10px;
}

.octo-mark {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  background: #0a0b0f;
  box-shadow: inset 5px 4px 0 #f6c76d;
}

.login {
  width: 100%;
  min-height: 54px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  background: #f3f4f6;
  color: #222833;
  box-shadow: inset 0 0 0 1px #e4e8ee;
  text-align: left;
}

.account-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #22a884;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.account-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.account-copy strong,
.account-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  color: #202631;
  font-size: 13px;
  font-weight: 720;
}

.account-copy small {
  color: #7b8492;
  font-size: 12px;
  font-weight: 520;
}

.login.signed-in {
  color: #222833;
  background: #f3f4f6;
  box-shadow: inset 0 0 0 1px #e4e8ee;
}

.app {
  min-height: 100vh;
  padding-left: 300px;
}

.panorama-view {
  width: calc(100vw - 300px);
  height: 100vh;
  background: #f7f8f5;
  overflow: auto;
}

.panorama-shell {
  min-height: 100vh;
  padding: 48px;
}

.panorama-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin: 0 0 24px;
}

.panorama-header h2 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.2;
}

.panorama-header p {
  margin: 0;
  color: #667064;
  font-size: 14px;
}

.panorama-header span {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid #dce3d5;
  border-radius: 8px;
  background: #fff;
  color: #384132;
  font-size: 13px;
  font-weight: 700;
}

.panorama-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 20px;
}

.panorama-panel,
.panorama-result {
  border: 1px solid #e1e5dc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 50px rgba(29, 37, 28, 0.08);
}

.panorama-panel {
  padding: 18px;
}

.panorama-upload {
  display: grid;
  place-items: center;
  min-height: 156px;
  border: 1px dashed #b8c5ae;
  border-radius: 8px;
  background: #f8faf5;
  color: #44523c;
  cursor: pointer;
  text-align: center;
}

.panorama-upload input {
  display: none;
}

.panorama-upload span {
  font-size: 15px;
  font-weight: 760;
}

.panorama-upload small {
  margin-top: 6px;
  color: #798574;
  font-size: 12px;
}

.panorama-reference {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #e1e5dc;
  background: #eef2ea;
}

.panorama-reference img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.panorama-reference button {
  position: absolute;
  right: 10px;
  top: 10px;
  border: 0;
  border-radius: 8px;
  padding: 7px 10px;
  background: rgba(18, 22, 17, 0.76);
  color: #fff;
  font-size: 12px;
}

.panorama-field {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.panorama-field span {
  color: #384132;
  font-size: 13px;
  font-weight: 720;
}

.panorama-field textarea {
  width: 100%;
  resize: vertical;
  min-height: 118px;
  border: 1px solid #dce3d5;
  border-radius: 8px;
  padding: 12px;
  color: #222833;
  font: inherit;
  line-height: 1.55;
  outline: none;
}

.panorama-generate {
  width: 100%;
  margin-top: 16px;
  border: 0;
  border-radius: 8px;
  padding: 13px 16px;
  background: #202a1d;
  color: #fff;
  font-weight: 760;
}

.panorama-generate:disabled,
.panorama-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.panorama-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: #667064;
  font-size: 13px;
  line-height: 1.5;
}

.panorama-status.error {
  color: #b42318;
}

.panorama-status.success {
  color: #1d7a3a;
}

.panorama-result {
  min-height: 520px;
  padding: 18px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 14px;
}

.panorama-result-preview {
  min-height: 420px;
  border-radius: 8px;
  background: #eef2ea;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #778372;
  font-size: 14px;
}

.panorama-result-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #11160f;
}

.panorama-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.panorama-actions button {
  border: 1px solid #dce3d5;
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff;
  color: #2c3528;
  font-weight: 720;
}

.panorama-actions button:first-child {
  background: #202a1d;
  border-color: #202a1d;
  color: #fff;
}

.home-view {
  width: min(1130px, calc(100vw - 340px));
  margin: 0 auto;
  padding: 88px 0 64px;
}

.hero {
  text-align: center;
}

h1 {
  margin: 0 0 36px;
  font-size: 25px;
  font-weight: 720;
  line-height: 1.2;
}

.mode-title {
  padding: 0;
  color: var(--cyan);
  background: transparent;
  font-size: inherit;
  font-weight: inherit;
}

.mode-title span {
  font-size: 18px;
}

.prompt-card {
  position: relative;
  min-height: 174px;
  padding: 24px 24px 28px 136px;
  text-align: left;
  cursor: text;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 25px;
  box-shadow: 0 18px 46px rgba(30, 37, 54, .045);
  overflow: visible;
}

.attach {
  position: absolute;
  left: 24px;
  top: 23px;
  width: 54px;
  height: 68px;
  border-radius: 3px;
  color: #8c94a3;
  background: #f1f2f4;
  font-size: 28px;
  transform: rotate(-8deg);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .03);
}

.video-mode .attach {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  font-size: 24px;
}

.video-mode .attach.hidden {
  display: none;
}

.video-mode .attach::after {
  content: "参考内容";
  display: block;
  color: #a0a6b0;
  font-size: 12px;
  line-height: 1;
  transform: rotate(0);
}

.attach.has-reference {
  color: #fff;
  background: #1f6feb;
}

.tail-attach {
  left: 86px;
}

.prompt-card.tail-reference-mode {
  padding-left: 162px;
}

.prompt-card.tail-reference-mode .attach::after {
  content: "首帧";
}

.prompt-card.tail-reference-mode .tail-attach::after {
  content: "尾帧";
}

.prompt-card.tail-reference-mode .reference-preview {
  left: 148px;
}

.prompt-card.tail-reference-mode .tail-preview {
  left: 222px;
}

.prompt-card.multi-reference-mode.has-reference-image {
  padding-left: 24px;
  padding-top: 112px;
}

.reference-preview {
  position: absolute;
  left: 86px;
  top: 20px;
  width: 68px;
  height: 68px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(30, 37, 54, .12);
}

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

.reference-preview button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  color: #fff;
  background: rgba(17, 24, 39, .74);
  font-size: 16px;
  line-height: 1;
}

.multi-reference-preview {
  position: absolute;
  left: 96px;
  right: 24px;
  top: 20px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
}

.multi-reference-item {
  position: relative;
  flex: 0 0 78px;
  width: 78px;
  height: 78px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(30, 37, 54, .12);
}

.multi-reference-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reference-file-chip {
  width: 100%;
  height: 100%;
  padding: 8px;
  display: grid;
  align-content: center;
  gap: 5px;
  color: #5f6978;
  background: #f2f4f7;
  border-radius: 6px;
}

.reference-file-chip span {
  color: #172033;
  font-size: 12px;
  font-weight: 760;
}

.reference-file-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 620;
}

.multi-reference-item button {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: #fff;
  background: rgba(17, 24, 39, .74);
  font-size: 14px;
  line-height: 1;
}

.prompt-card.has-reference-image {
  padding-left: 176px;
}

.prompt-card.tail-reference-mode.has-reference-image {
  padding-left: 314px;
}

.prompt-card.multi-reference-mode.has-reference-image {
  padding-left: 24px;
}

.prompt-card.multi-reference-full .multi-reference-preview {
  left: 24px;
}

.prompt-card.multi-reference-mode.has-reference-image #promptInput {
  min-height: 64px;
}

#promptInput {
  width: 100%;
  min-height: 86px;
  display: block;
  padding: 0;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #333842;
  font-size: 15px;
  line-height: 1.6;
}

#promptInput::placeholder {
  color: #9aa2ae;
}

.prompt-actions {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.action-left,
.action-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-left {
  min-width: 0;
  flex: 1;
}

.action-right {
  flex: 0 0 auto;
  margin-left: auto;
}

.chip {
  height: 36px;
  padding: 0 15px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #27303d;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 560;
  white-space: nowrap;
}

.chip:disabled {
  cursor: wait;
  opacity: .62;
}

.model-chip {
  color: #151a22;
}

.combo-chip {
  min-width: 222px;
  justify-content: center;
  color: #151a22;
}

.reference-chip {
  min-width: 142px;
  justify-content: center;
  color: #151a22;
}

.video-mode .combo-chip {
  min-width: 150px;
}

.duration-chip {
  min-width: 72px;
  justify-content: center;
}

.duration-chip svg {
  width: 17px;
  height: 17px;
}

.credit-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #667080;
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
}

.credit-count b {
  color: #5f6978;
  font-size: 13px;
}

.chip svg {
  width: 16px;
  height: 16px;
}

.chip span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.chip.primary {
  color: #229ec8;
}

.chip.open,
.chip[aria-expanded="true"]:not(.primary) {
  color: #202631;
  background: #e6e6e6;
  border-color: #d9dce1;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .06);
}

.spark {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: repeating-linear-gradient(120deg, #28c7f0 0 3px, transparent 3px 6px);
}

.send {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #2e3440;
  border-radius: 50%;
}

.send:disabled {
  color: #6f7988;
  background: #dee2e8;
}

.send:disabled svg {
  color: #6f7988;
}

.mode-menu,
.model-menu {
  position: absolute;
  left: 24px;
  top: calc(100% - 8px);
  z-index: 20;
  width: 188px;
  padding: 8px;
  background: rgba(255, 255, 255, .98);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 46px rgba(30, 37, 54, .13);
}

.model-menu {
  left: 158px;
  width: 228px;
}

.reference-menu,
.duration-menu {
  position: absolute;
  z-index: 18;
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(232, 235, 240, .95);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(28, 35, 50, .14);
}

.reference-menu {
  left: 330px;
  top: calc(100% - 8px);
  width: 210px;
  padding: 10px;
}

.reference-menu-section {
  display: grid;
  gap: 6px;
}

.reference-menu-section + .reference-menu-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #edf0f4;
}

.reference-menu-section p {
  margin: 0 6px 4px;
  color: #8a94a3;
  font-size: 13px;
  font-weight: 650;
}

.reference-menu [data-reference] {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  display: grid;
  grid-template-columns: 28px 1fr 22px;
  align-items: center;
  text-align: left;
  color: #151a22;
  background: transparent;
  border-radius: 10px;
  font-size: 16px;
}

.reference-menu [data-reference].selected,
.reference-menu [data-reference]:hover {
  background: #f1f1f2;
}

.reference-menu strong {
  font-weight: 650;
}

.reference-menu b {
  visibility: hidden;
  justify-self: end;
  font-size: 20px;
  font-weight: 600;
}

.reference-menu .selected b {
  visibility: visible;
}

.duration-menu p {
  margin: 0 0 14px;
  color: #929ba7;
  font-size: 16px;
}

.duration-menu {
  left: 500px;
  top: calc(100% - 2px);
  width: 206px;
  max-height: 420px;
  padding: 20px 8px 8px;
  overflow-y: auto;
}

.duration-list {
  display: grid;
  gap: 6px;
}

.duration-list button {
  height: 48px;
  padding: 0 14px;
  display: grid;
  grid-template-columns: 28px 1fr 24px;
  align-items: center;
  color: #202631;
  background: transparent;
  border-radius: 10px;
  text-align: left;
  font-size: 17px;
}

.duration-list button:hover,
.duration-list button.selected {
  background: #f1f1f2;
}

.duration-list strong {
  font-weight: 520;
}

.duration-list b {
  visibility: hidden;
  justify-self: end;
  font-size: 20px;
}

.duration-list .selected b {
  visibility: visible;
}

.prompt-status {
  position: absolute;
  left: 136px;
  right: 78px;
  bottom: -28px;
  min-height: 18px;
  margin: 0;
  color: #667080;
  font-size: 13px;
  line-height: 1.4;
}

.prompt-status.error {
  color: #d04b55;
}

.prompt-status.success {
  color: #16865d;
}

.mode-menu button,
.model-menu button {
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  color: #1d222c;
  background: transparent;
  border-radius: 10px;
}

.mode-menu button:hover,
.mode-menu button.selected,
.model-menu button:hover,
.model-menu button.selected {
  background: #f2f7fb;
}

.model-menu button:disabled {
  cursor: not-allowed;
  opacity: .46;
}

.model-menu button:disabled:hover {
  background: transparent;
}

.mode-menu strong,
.mode-menu span,
.model-menu strong,
.model-menu span {
  display: block;
}

.mode-menu strong,
.model-menu strong {
  font-size: 14px;
  line-height: 1.35;
}

.mode-menu span,
.model-menu span {
  margin-top: 2px;
  color: #8a92a0;
  font-size: 12px;
}

.preference-panel {
  position: absolute;
  left: 130px;
  top: calc(100% - 16px);
  z-index: 15;
  width: min(540px, calc(100% - 150px));
  padding: 18px 20px 20px;
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(232, 235, 240, .95);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(28, 35, 50, .14);
}

.preference-panel.image-panel {
  left: 140px;
  width: min(620px, calc(100vw - 180px));
  max-width: calc(100vw - 140px);
  padding: 16px 18px 18px;
  border-radius: 14px;
}

.preference-panel.image-panel .video-only {
  display: none;
}

.preference-panel.video-panel {
  left: 486px;
  width: 372px;
  max-width: min(372px, calc(100vw - 520px));
  padding: 14px 16px 16px;
  border-radius: 14px;
}

.preference-panel.video-panel .image-only {
  display: none;
}

.mode-menu.studio-anchor,
.model-menu.studio-anchor,
.reference-menu.studio-anchor,
.duration-menu.studio-anchor,
.preference-panel.studio-anchor,
.preference-panel.image-panel.studio-anchor {
  position: fixed;
  top: auto;
  bottom: 132px;
  left: calc(320px + (100vw - 320px) / 2);
  right: auto;
  transform: translateX(-50%);
}

.mode-menu.studio-anchor {
  width: 188px;
}

.model-menu.studio-anchor {
  width: 260px;
}

.preference-panel.studio-anchor,
.preference-panel.image-panel.studio-anchor {
  width: min(420px, calc(100vw - 380px));
  max-width: 420px;
}

.pref-section {
  margin-top: 15px;
}

.image-panel .pref-section {
  margin-top: 0;
}

.image-panel .pref-section + .pref-section {
  margin-top: 14px;
}

.pref-section p {
  margin: 0 0 8px;
  color: #929ba7;
  font-size: 13px;
}

.image-panel .pref-section p {
  margin-bottom: 8px;
  font-size: 13px;
}

.ratio-row {
  min-height: 74px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--ratio-count, 8), minmax(58px, 1fr));
  background: #f8f8f9;
  border-radius: 16px;
  overflow: hidden;
}

.video-panel .ratio-row {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.image-panel .ratio-row {
  min-height: 0;
  grid-template-columns: repeat(3, minmax(128px, 1fr));
  border-radius: 11px;
}

.ratio-option {
  min-width: 0;
  height: 74px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: #858b94;
  background: transparent;
  font-size: 14px;
}

.image-panel .ratio-option {
  height: auto;
  gap: 4px;
  color: #242a33;
  font-size: 11px;
}

.ratio-option.selected {
  color: #1f2530;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 3px 14px rgba(24, 30, 45, .06);
}

.image-panel .ratio-option.selected {
  border-radius: 10px;
}

.image-panel .ratio-row {
  height: auto;
  max-height: none;
  grid-template-columns: repeat(3, minmax(128px, 1fr));
  gap: 9px;
  padding: 2px;
  overflow: visible;
  background: transparent;
  border-radius: 0;
}

.image-panel .image-size-option {
  min-height: 74px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f8fa;
}

.image-size-tabs {
  grid-column: 1 / -1;
  height: 38px;
  padding: 2px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  border-radius: 10px;
  background: #f1f2f4;
}

.image-size-tabs button {
  color: #6f7785;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 720;
}

.image-size-tabs button.selected {
  color: #182233;
  background: #fff;
  box-shadow: 0 2px 12px rgba(24, 30, 45, .06);
}

.image-panel .image-size-option span {
  color: #172033;
  font-size: 15px;
  font-weight: 750;
}

.image-panel .image-size-option small {
  color: #747d8c;
  font-size: 12px;
  font-weight: 560;
}

.ratio-icon {
  width: 16px;
  height: 11px;
  border: 2px solid #8b9097;
  border-radius: 3px;
}

.ratio-option[data-ratio="智能"] .ratio-icon {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.ratio-option[data-ratio="智能"] .ratio-icon::after {
  content: "";
  display: block;
  width: 5px;
  height: 5px;
  margin: 2px auto 0;
  border: 2px solid currentColor;
  border-top: 0;
  border-left: 0;
}

.ratio-option[data-ratio="21:9"] .ratio-icon,
.ratio-option[data-ratio="16:9"] .ratio-icon,
.ratio-option[data-ratio="3:2"] .ratio-icon {
  height: 6px;
}

.ratio-option[data-ratio="4:3"] .ratio-icon {
  width: 16px;
  height: 10px;
}

.ratio-option[data-ratio="1:1"] .ratio-icon {
  width: 13px;
  height: 13px;
}

.ratio-option[data-ratio="3:4"] .ratio-icon,
.ratio-option[data-ratio="2:3"] .ratio-icon,
.ratio-option[data-ratio="9:16"] .ratio-icon {
  width: 10px;
  height: 16px;
}

.resolution-row {
  height: 36px;
  padding: 2px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f4f4f5;
  border-radius: 10px;
}

.video-panel .resolution-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.resolution-row button {
  color: #1f2530;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 560;
}

.resolution-row .selected {
  background: #fff;
  box-shadow: 0 2px 12px rgba(24, 30, 45, .05);
}

.size-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
}

.size-field {
  height: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #9aa3af;
  background: #f4f4f5;
  border-radius: 8px;
  font-size: 13px;
  user-select: none;
}

.size-field span {
  color: #aeb6c1;
}

.size-row strong {
  color: #9aa3af;
  text-align: center;
  font-size: 15px;
  font-weight: 520;
}

.size-row em {
  color: #566170;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.help {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 42px;
  height: 42px;
  color: #667083;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(25, 30, 45, .08);
  font-weight: 800;
}

.auth-modal,
.billing-modal,
.ledger-modal,
.api-modal,
.api-guide-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 21, 28, .34);
  backdrop-filter: blur(10px);
}

.auth-modal.hidden,
.billing-modal.hidden,
.ledger-modal.hidden,
.api-modal.hidden,
.api-guide-modal.hidden {
  display: none;
}

.auth-panel,
.billing-panel,
.ledger-panel,
.api-panel,
.api-guide-panel {
  position: relative;
  width: min(420px, 100%);
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 28px 90px rgba(17, 22, 34, .2);
}

.billing-panel {
  width: min(460px, 100%);
}

.ledger-panel {
  width: min(760px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.api-panel {
  width: min(980px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  display: block;
  overflow: auto;
  color: #1f2530;
  background: #fff;
}

.api-panel > * + * {
  margin-top: 16px;
}

.api-panel .billing-head h2 {
  color: #111827;
  font-weight: 820;
}

.api-panel .billing-head p {
  color: #586476;
  font-weight: 650;
}

.api-panel .api-create-form label {
  color: #384456;
}

.api-panel .api-section-head h3,
.api-panel .api-example span {
  color: #111827;
  font-weight: 820;
}

.api-guide-panel {
  width: min(1040px, 100%);
  max-height: min(840px, calc(100vh - 48px));
  overflow: auto;
  color: #1f2530;
  background: #fff;
}

.api-guide-panel .billing-head h2 {
  color: #111827;
  font-weight: 820;
}

.api-guide-panel .billing-head p {
  color: #586476;
  font-weight: 650;
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  color: #667080;
  background: #f4f6f8;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
}

.auth-head {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-right: 34px;
}

.auth-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: block;
  object-fit: contain;
}

.auth-head h2,
.auth-head p {
  margin: 0;
}

.auth-head h2 {
  font-size: 22px;
  line-height: 1.25;
}

.auth-head p {
  margin-top: 4px;
  color: #7b8492;
  font-size: 13px;
  line-height: 1.5;
}

.auth-tabs {
  margin-top: 24px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f3f5f8;
  border-radius: 12px;
}

.auth-tabs button {
  height: 38px;
  color: #737d8b;
  background: transparent;
  border-radius: 9px;
  font-weight: 650;
}

.auth-tabs .selected {
  color: #151a22;
  background: #fff;
  box-shadow: 0 2px 12px rgba(24, 30, 45, .06);
}

.auth-form {
  margin-top: 20px;
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: #566170;
  font-size: 13px;
  font-weight: 650;
}

.auth-form .auth-register-only.hidden {
  display: none;
}

.auth-form input {
  height: 44px;
  padding: 0 13px;
  color: #171c25;
  background: #f8f9fb;
  border: 1px solid #e4e8ee;
  border-radius: 10px;
  outline: 0;
  font-size: 15px;
}

.auth-form input:focus {
  border-color: rgba(50, 189, 227, .72);
  box-shadow: 0 0 0 3px rgba(50, 189, 227, .13);
}

.auth-form .auth-agreement {
  grid-template-columns: 18px 1fr;
  align-items: flex-start;
  gap: 9px;
  color: #6b7483;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
}

.auth-form .auth-agreement input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: #151a22;
}

.auth-form .auth-agreement a {
  color: #0f8fbd;
  font-weight: 650;
  text-decoration: none;
}

.auth-form .auth-agreement a:hover {
  text-decoration: underline;
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: #667080;
  font-size: 13px;
  line-height: 1.45;
}

.auth-message.error {
  color: #c43c45;
}

.auth-message.success {
  color: #16865d;
}

.auth-submit {
  height: 44px;
  color: #fff;
  background: #151a22;
  border-radius: 10px;
  font-weight: 720;
}

.auth-popover {
  position: fixed;
  left: 14px;
  bottom: 82px;
  z-index: 40;
  width: 272px;
  padding: 14px;
  display: grid;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 46px rgba(30, 37, 54, .14);
}

.auth-popover.hidden {
  display: none;
}

.auth-popover strong {
  color: #171c25;
  font-size: 15px;
}

.auth-popover span {
  overflow: hidden;
  color: #7b8492;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-popover p {
  margin: 0;
  color: #5f6978;
  font-size: 13px;
}

.auth-popover p b {
  color: #151a22;
  font-size: 16px;
}

.auth-legal-links {
  margin: 2px 0 4px;
  display: grid;
  gap: 4px;
}

.auth-legal-links a {
  padding: 7px 9px;
  color: #566170;
  background: #f8f9fb;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.auth-legal-links a:hover,
.auth-legal-links a:focus-visible {
  color: #171c25;
  background: #eef1f5;
  outline: 0;
}

.auth-admin-link {
  height: 34px;
  margin-top: 4px;
  display: grid;
  place-items: center;
  color: #262d38;
  background: #eef7fb;
  border-radius: 8px;
  font-weight: 650;
  text-decoration: none;
}

.auth-admin-link.hidden {
  display: none;
}

.auth-admin-link:hover,
.auth-admin-link:focus-visible {
  background: #dff1f8;
  outline: 0;
}

.auth-popover button {
  height: 34px;
  margin-top: 4px;
  color: #262d38;
  background: #f2f4f7;
  border-radius: 8px;
  font-weight: 650;
}

#rechargeButton {
  color: #262d38;
  background: #f2f4f7;
}

.billing-head h2,
.billing-head p {
  margin: 0;
}

.billing-head h2 {
  font-size: 22px;
}

.billing-head p {
  margin-top: 6px;
  color: #7b8492;
  font-size: 14px;
}

.billing-head strong {
  color: #151a22;
}

.plans {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.plans button {
  min-height: 96px;
  padding: 14px 10px;
  display: grid;
  place-items: center;
  gap: 6px;
  color: #18202d;
  background: #f7f8fa;
  border: 1px solid #e5e9ef;
  border-radius: 12px;
}

.plans button.selected {
  background: #edfaff;
  border-color: rgba(50, 189, 227, .55);
  box-shadow: inset 0 0 0 1px rgba(50, 189, 227, .2);
}

.plans strong {
  font-size: 17px;
}

.plans span {
  color: #697382;
  font-size: 14px;
  font-weight: 700;
}

.billing-note {
  margin: 18px 0;
  padding: 13px;
  background: #f8f9fb;
  border: 1px solid #e8ebf0;
  border-radius: 12px;
}

.billing-note span {
  display: block;
  color: #27303d;
  font-size: 13px;
  font-weight: 750;
}

.billing-note p {
  margin: 5px 0 0;
  color: #747e8d;
  font-size: 13px;
  line-height: 1.5;
}

.ledger-list {
  margin-top: 20px;
  min-height: 180px;
  overflow: auto;
  border: 1px solid #e8ebf0;
  border-radius: 12px;
}

.ledger-row {
  min-height: 54px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 92px 86px minmax(0, 1fr) 70px 70px;
  gap: 12px;
  align-items: center;
  color: #3e4856;
  border-top: 1px solid #eef1f5;
  font-size: 13px;
}

.ledger-row:first-child {
  border-top: 0;
}

.ledger-head-row {
  min-height: 40px;
  color: #7b8492;
  background: #f8f9fb;
  font-size: 12px;
  font-weight: 750;
}

.ledger-row strong {
  color: #1f2530;
  font-size: 13px;
}

.ledger-row span {
  min-width: 0;
}

.ledger-row span:nth-child(3) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-row em {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #8b95a3;
  font-style: normal;
  text-overflow: ellipsis;
}

.ledger-row b {
  justify-self: end;
  font-size: 14px;
}

.ledger-row b.positive {
  color: #16865d;
}

.ledger-row b.negative {
  color: #c43c45;
}

.ledger-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: #8b95a3;
  font-size: 14px;
}

.ledger-hint {
  min-height: 18px;
  margin: 10px 0 0;
  color: #7b8492;
  font-size: 13px;
}

.api-create-form {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(180px, 1fr) 100px 100px 100px 112px;
  gap: 10px;
  align-items: end;
}

.api-create-form label {
  display: grid;
  gap: 7px;
  color: #566170;
  font-size: 13px;
  font-weight: 650;
}

.api-create-form input,
.api-create-form select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: #171c25;
  background: #f8f9fb;
  border: 1px solid #e4e8ee;
  border-radius: 10px;
  outline: 0;
}

.api-secret {
  padding: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 76px;
  gap: 10px;
  align-items: center;
  background: #fff8e5;
  border: 1px solid #f1d58a;
  border-radius: 12px;
}

.api-secret.hidden {
  display: none;
}

.api-secret span,
.api-example span {
  color: #8a5b00;
  font-size: 13px;
  font-weight: 750;
}

.api-secret code,
.api-example code,
.api-key-card code {
  min-width: 0;
  padding: 7px 9px;
  overflow: hidden;
  color: #202631;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-secret button,
.api-section-head button,
.api-key-card button {
  height: 34px;
  padding: 0 12px;
  color: #262d38;
  background: #f2f4f7;
  border-radius: 8px;
  font-weight: 650;
}

.api-example {
  padding: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  background: #f8f9fb;
  border: 1px solid #e8ebf0;
  border-radius: 12px;
}

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

.api-usage-summary div,
.api-admin-grid div {
  padding: 12px;
  display: grid;
  gap: 4px;
  background: #f8f9fb;
  border: 1px solid #e8ebf0;
  border-radius: 12px;
}

.api-usage-summary span {
  color: #7b8492;
  font-size: 12px;
  font-weight: 750;
}

.api-usage-summary strong,
.api-admin-grid strong {
  color: #151a22;
  font-size: 18px;
}

.api-usage-summary em,
.api-admin-grid em {
  color: #7b8492;
  font-size: 12px;
  font-style: normal;
}

.api-admin-summary {
  display: grid;
  gap: 10px;
  border: 1px solid #e8ebf0;
  border-radius: 12px;
  overflow: visible;
  background: #fff;
}

.api-admin-summary.hidden {
  display: none;
}

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

.api-admin-users {
  padding: 0 12px 12px;
  display: grid;
  gap: 8px;
}

.api-admin-users div {
  min-height: 54px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 130px;
  gap: 10px;
  align-items: center;
  background: #fff;
  border: 1px solid #edf0f4;
  border-radius: 10px;
  color: #4f5c6e;
  font-size: 12px;
}

.api-admin-users span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.api-admin-users span b,
.api-admin-users span small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-admin-users span b {
  color: #111827;
  font-size: 13px;
}

.api-admin-users span small {
  color: #7b8492;
  font-size: 11px;
}

.api-admin-users strong,
.api-admin-users em {
  justify-self: end;
  font-style: normal;
}

.api-pricing-panel {
  padding: 0 12px 12px;
  display: grid;
  gap: 10px;
}

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

.api-pricing-row {
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(130px, 160px));
  gap: 10px;
  align-items: end;
  background: #f8f9fb;
  border: 1px solid #e8ebf0;
  border-radius: 10px;
}

.api-pricing-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.api-pricing-row strong,
.api-pricing-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-pricing-row strong {
  color: #151a22;
  font-size: 13px;
}

.api-pricing-row small {
  color: #7b8492;
  font-size: 11px;
}

.api-pricing-row label {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: #647084;
  font-size: 12px;
  font-weight: 750;
}

.api-pricing-row input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  color: #171c25;
  background: #fff;
  border: 1px solid #e2e6ec;
  border-radius: 8px;
  outline: 0;
}

.api-example span {
  color: #27303d;
}

.api-grid {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(360px, 1.1fr);
  gap: 14px;
}

.api-grid section {
  min-width: 0;
  min-height: 300px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid #e8ebf0;
  border-radius: 12px;
  overflow: hidden;
}

.api-section-head {
  min-height: 46px;
  padding: 8px 10px 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8f9fb;
  border-bottom: 1px solid #e8ebf0;
}

.api-section-head h3 {
  margin: 0;
  font-size: 14px;
}

.api-key-list,
.api-call-list {
  min-height: 180px;
  overflow: auto;
}

.api-key-card {
  min-height: 70px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, .7fr) 76px 64px;
  gap: 10px;
  align-items: center;
  border-top: 1px solid #eef1f5;
}

.api-key-card:first-child {
  border-top: 0;
}

.api-key-card.revoked {
  color: #9aa3af;
  background: #fafbfc;
}

.api-key-card div {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.api-key-card strong {
  overflow: hidden;
  color: #1f2530;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-key-card span,
.api-key-card em {
  overflow: hidden;
  color: #7b8492;
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-key-card button:disabled {
  cursor: default;
  opacity: .55;
}

.api-call-row {
  min-height: 48px;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 50px 72px 54px;
  gap: 9px;
  align-items: center;
  border-top: 1px solid #eef1f5;
  color: #3e4856;
  font-size: 12px;
}

.api-call-row:first-child {
  border-top: 0;
}

.api-call-head {
  min-height: 38px;
  color: #7b8492;
  background: #f8f9fb;
  font-weight: 750;
}

.api-call-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-call-row em {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #9aa3af;
  font-style: normal;
  text-overflow: ellipsis;
}

.api-call-row strong.success {
  color: #16865d;
}

.api-call-row strong.failed {
  color: #c43c45;
}

.api-call-row b {
  justify-self: end;
}

.guide-overview {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.guide-overview div {
  padding: 14px;
  display: grid;
  gap: 8px;
  background: #f8f9fb;
  border: 1px solid #e8ebf0;
  border-radius: 12px;
}

.guide-overview span {
  color: #111827;
  font-size: 13px;
  font-weight: 800;
}

.guide-overview code,
.guide-card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.guide-overview code {
  padding: 8px 10px;
  color: #202631;
  background: #fff;
  border: 1px solid #e8ebf0;
  border-radius: 8px;
  font-size: 12px;
}

.guide-overview p {
  margin: 0;
  color: #747e8d;
  font-size: 13px;
  line-height: 1.5;
}

.guide-list {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.guide-card {
  min-width: 0;
  padding: 16px;
  display: grid;
  gap: 10px;
  background: #fff;
  border: 1px solid #e8ebf0;
  border-radius: 12px;
}

.guide-card h3 {
  margin: 0;
  color: #111827;
  font-size: 16px;
  font-weight: 820;
}

.guide-card p {
  margin: 0;
  color: #4f5c6e;
  font-size: 13px;
  line-height: 1.5;
}

.guide-card pre {
  max-width: 100%;
  margin: 0;
  padding: 12px;
  overflow: auto;
  color: #1f2530;
  background: #f8f9fb;
  border: 1px solid #e8ebf0;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
}

.hidden {
  display: none;
}

.studio-view {
  min-height: 100vh;
  padding: 16px 18px 18px;
  background: #f5f6f8;
}

.studio-top {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.back {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #1e2430;
  background: #f0f2f6;
  border-radius: 10px;
}

.studio-top strong,
.studio-top span {
  display: block;
}

.studio-top strong {
  font-size: 15px;
}

.studio-top span {
  margin-top: 2px;
  color: #868e9b;
  font-size: 12px;
}

.publish {
  margin-left: auto;
  height: 34px;
  padding: 0 16px;
  color: #fff;
  background: #161a22;
  border-radius: 10px;
}

.studio-layout {
  height: calc(100vh - 92px);
  margin-top: 14px;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 14px;
}

.conversation,
.result-board {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.conversation {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bubble {
  padding: 14px;
  border-radius: 14px;
}

.bubble span {
  display: block;
  margin-bottom: 7px;
  color: #7b8391;
  font-size: 12px;
}

.bubble p {
  margin: 0;
  color: #222733;
  font-size: 14px;
  line-height: 1.6;
}

.bubble.user {
  background: #f1f7ff;
}

.bubble.ai {
  background: #f6f7f9;
}

.agent-plan {
  padding: 12px 14px;
  display: grid;
  gap: 12px;
  background: #fbfcfd;
  border: 1px solid #edf0f4;
  border-radius: 14px;
}

.step {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #8b94a3;
  font-size: 13px;
}

.step span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cbd1da;
}

.step.done {
  color: #232936;
}

.step.done span {
  background: #2cc08a;
}

.step.active {
  color: #229ec8;
}

.step.active span {
  background: var(--cyan);
  box-shadow: 0 0 0 5px rgba(50, 189, 227, .12);
}

.mini-prompt {
  margin-top: auto;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 14px;
  background: #f6f7f9;
  border-radius: 12px;
}

.mini-prompt input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #333842;
  font-size: 13px;
}

.mini-prompt button {
  width: 32px;
  height: 32px;
  color: #fff;
  background: #222833;
  border-radius: 9px;
}

.result-board {
  min-width: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

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

.segmented {
  padding: 4px;
  display: flex;
  background: #f0f2f6;
  border-radius: 10px;
}

.segmented button,
.toolbar-actions button {
  height: 32px;
  padding: 0 14px;
  color: #656e7d;
  background: transparent;
  border-radius: 8px;
}

.segmented .on {
  color: #171b24;
  background: #fff;
  box-shadow: 0 2px 10px rgba(24, 30, 45, .08);
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.toolbar-actions button {
  background: #f7f8fa;
  border: 1px solid #edf0f4;
}

.generation-grid {
  min-height: 0;
  margin-top: 16px;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, .75fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 12px;
}

.generation-card {
  overflow: hidden;
  border-radius: 16px;
  background: #f1f3f7;
  border: 1px solid #e8ebf0;
}

.main-card {
  grid-row: 1 / -1;
  position: relative;
  min-height: 420px;
  background:
    linear-gradient(180deg, transparent 0, rgba(0, 0, 0, .58) 100%),
    radial-gradient(circle at 48% 33%, #f7fbff, transparent 18%),
    linear-gradient(135deg, #1f293d, #495f7b 45%, #c6d9e9);
}

.loading-art {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
}

.loading-art span {
  width: 68px;
  height: 68px;
  border: 4px solid rgba(255, 255, 255, .22);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1.1s linear infinite;
}

.loading-art strong {
  position: absolute;
  margin-top: 120px;
  font-size: 16px;
}

.main-card footer {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
}

.main-card footer button {
  height: 34px;
  padding: 0 14px;
  color: #11151d;
  background: rgba(255, 255, 255, .9);
  border-radius: 10px;
}

.preview {
  background-size: cover;
  background-position: center;
}

.preview.one {
  background-image: url("https://p26-dreamina-sign.byteimg.com/tos-cn-i-tb4s082cfz/8c0a2909f59f4145aecefc6c23e4150a~tplv-tb4s082cfz-aigc_smart_crop:720:480.webp?lk3s=4fa96020&x-expires=1780704000&x-signature=wGUVjf4vMkf6AMJ3cMGtj1f65G4%3D");
}

.preview.two {
  background-image: url("https://p11-dreamina-sign.byteimg.com/tos-cn-i-tb4s082cfz/3530ebf0f8bb4a01b71894dfe4fe3811~tplv-tb4s082cfz-aigc_smart_crop:720:720.webp?lk3s=4fa96020&x-expires=1780704000&x-signature=VsY3lQadyiWXQHv8LC87tmT6gHY%3D");
}

.preview.three {
  background-image: url("https://p11-dreamina-sign.byteimg.com/tos-cn-i-tb4s082cfz/2a0faf0504204b68881d6cfc53403626~tplv-tb4s082cfz-aigc_smart_crop:480:640.webp?lk3s=4fa96020&x-expires=1780704000&x-signature=CBcTtOuH%2FlLoxA8zCJF%2B%2BmaKrzE%3D");
}

.studio-view {
  height: 100vh;
  min-height: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  background: #f6f7f9;
}

.studio-view.history-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.studio-view.hidden {
  display: none;
}

.history-panel {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  padding: 28px 20px;
  background: #fff;
  border-right: 1px solid #e9edf2;
}

.sidebar .history-panel {
  height: auto;
  min-height: 0;
  padding: 10px 8px 10px;
  overflow: visible;
  background: transparent;
  border-right: 0;
}

.sidebar .history-head {
  margin-bottom: 12px;
}

.sidebar .history-head strong {
  font-size: 13px;
  font-weight: 500;
}

.sidebar .history-panel p {
  margin-top: 0;
}

.history-collapsed .history-panel {
  display: none;
}

.history-expand-button {
  position: fixed;
  left: 82px;
  top: 28px;
  z-index: 8;
  width: 34px;
  height: 34px;
  color: #222833;
  background: #fff;
  border: 1px solid #e9edf2;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(26, 33, 52, .08);
  font-size: 18px;
}

.history-expand-button.hidden {
  display: none;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.history-head strong {
  font-size: 17px;
}

.history-head button {
  width: 28px;
  height: 28px;
  color: #222833;
  background: transparent;
  border-radius: 8px;
  font-size: 18px;
}

.history-action {
  width: 100%;
  height: 42px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #1f2530;
  background: transparent;
  border-radius: 8px;
  text-align: left;
  font-size: 13px;
  font-weight: 400;
}

.history-action svg {
  width: 24px;
  height: 24px;
  padding: 4px;
  border: 1px solid #edf0f4;
  border-radius: 7px;
}

.history-panel p {
  margin: 12px 0 10px;
  color: #8a8a8a;
  font-size: 12px;
  font-weight: 400;
}

.history-list {
  display: grid;
  gap: 6px;
}

.history-date-title {
  margin: 18px 8px 8px;
  color: #8a8a8a;
  font-size: 12px;
  font-weight: 400;
}

.history-chat-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px 30px;
  align-items: center;
  border-radius: 8px;
}

.history-chat-row:hover,
.history-chat-row.active {
  background: #f0f0f1;
}

.history-chat {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #262c36;
  background: transparent;
  border-radius: 8px;
  text-align: left;
}

.history-chat:hover,
.history-chat.active {
  background: #f0f0f1;
}

.history-chat-row .history-chat:hover,
.history-chat-row .history-chat.active {
  background: transparent;
}

.history-pin,
.history-delete {
  width: 26px;
  height: 26px;
  margin-right: 4px;
  display: grid;
  place-items: center;
  color: #8f98a6;
  background: transparent;
  border-radius: 7px;
  font-size: 18px;
  line-height: 1;
  opacity: 0;
}

.history-pin {
  font-size: 15px;
}

.history-pin.active {
  color: #1a8fb5;
  background: #e7f8ff;
  opacity: 1;
}

.history-chat-row:hover .history-delete,
.history-chat-row:hover .history-pin,
.history-chat-row.active .history-delete,
.history-chat-row.active .history-pin,
.history-pin:focus-visible,
.history-delete:focus-visible {
  opacity: 1;
}

.history-pin:hover {
  color: #1a8fb5;
  background: #e7f8ff;
}

.history-delete:hover {
  color: #bf3645;
  background: #fdecef;
}

.history-pin:disabled,
.history-delete:disabled {
  opacity: .45;
  cursor: wait;
}

.history-chat.empty {
  color: #8d96a4;
}

.history-chat strong {
  min-width: 0;
  font-size: 13px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thumb-mini {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(0, 0, 0, .08)),
    linear-gradient(140deg, #f0a15f, #764b67 48%, #f5c06b);
}

.creation-feed {
  position: relative;
  min-width: 0;
  height: 100vh;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 44px 170px;
}

.feed-filter {
  position: sticky;
  top: 22px;
  float: right;
  right: 34px;
  z-index: 3;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
  background: #fff;
  border: 1px solid #e8ebf0;
  border-radius: 10px;
}

.feed-filter button {
  height: 30px;
  padding: 0 12px;
  color: #1f2530;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 620;
}

.feed-menu-wrap {
  position: relative;
}

.feed-menu {
  position: absolute;
  right: 0;
  top: 38px;
  z-index: 6;
  min-width: 116px;
  padding: 6px;
  display: grid;
  gap: 2px;
  background: #fff;
  border: 1px solid #e4e8ee;
  border-radius: 10px;
  box-shadow: 0 16px 42px rgba(26, 33, 52, .12);
}

.feed-menu.hidden {
  display: none;
}

.feed-menu button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.feed-menu button.selected {
  color: #11151c;
  background: #eef1f5;
}

.feed-filter input,
.asset-tools input {
  width: 0;
  height: 30px;
  padding: 0;
  color: #1f2530;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 14px;
  transition: width .18s ease, padding .18s ease;
}

.feed-filter:focus-within input,
.feed-filter input:not(:placeholder-shown) {
  width: 154px;
  padding: 0 8px;
}

.feed-filter > button + button,
.feed-filter > button + .feed-menu-wrap {
  border-left: 1px solid #edf0f4;
}

.feed-filter svg {
  width: 18px;
  height: 18px;
}

.feed-inner {
  width: min(1120px, calc(100vw - 410px));
  margin: 0 auto;
}

.feed-inner h2 {
  margin: 6px 0 38px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
}

.feed-empty {
  width: min(480px, 100%);
  padding: 28px;
  display: grid;
  gap: 8px;
  color: #7e8795;
  background: #fff;
  border: 1px dashed #dfe4eb;
  border-radius: 8px;
}

.feed-empty.hidden {
  display: none;
}

.feed-empty strong {
  color: #252b35;
  font-size: 14px;
  font-weight: 500;
}

.studio-loading {
  min-height: min(420px, calc(100vh - 220px));
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: #6f7988;
}

.studio-loading span {
  width: 44px;
  height: 44px;
  display: block;
  background:
    radial-gradient(circle at center, #fff 0 52%, transparent 54%),
    conic-gradient(from 40deg, transparent 0 22%, #202631 22% 45%, transparent 45% 100%);
  border-radius: 50%;
  box-shadow: 0 12px 32px rgba(26, 33, 52, .08);
  animation: studio-loading-spin .8s linear infinite;
}

.studio-loading strong {
  font-size: 14px;
  font-weight: 400;
}

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

.result-group {
  margin-bottom: 58px;
  content-visibility: auto;
  contain-intrinsic-size: 330px;
}

.result-group.filtered-out {
  display: none;
}

.result-group p {
  margin: 0 0 16px;
  color: #0d0d0d;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.result-group em {
  margin-left: 8px;
  color: #98a1ad;
  font-style: normal;
  font-weight: 400;
}

.task-status {
  margin-left: 8px;
  padding: 3px 7px;
  color: #6e7785;
  background: #edf0f4;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 680;
}

.task-status.succeeded {
  color: #16865d;
  background: #e6f6ef;
}

.task-status.failed {
  color: #c43c45;
  background: #fdecef;
}

.result-error {
  margin: -4px 0 16px;
  padding: 10px 12px;
  color: #9f2f3b;
  background: #fff0f2;
  border: 1px solid #ffd6dc;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.image-row {
  height: 236px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: #e5e7ea;
  overflow: hidden;
}

.image-row.single {
  height: auto;
  width: min(420px, 100%);
  grid-template-columns: 1fr;
  background: transparent;
}

.result-media-frame {
  position: relative;
  min-height: 236px;
  overflow: hidden;
  background: #e5e7ea;
}

.image-row.single .result-media-frame {
  height: auto;
  min-height: 0;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
}

.image-row.single .result-media-frame:has(video) {
  aspect-ratio: var(--media-aspect-ratio, 16 / 9);
}

.result-media-tools {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .16s ease;
}

.result-media-frame:hover .result-media-tools,
.result-media-frame:focus-within .result-media-tools {
  opacity: 1;
}

.result-media-tools button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(20, 24, 31, .86);
  border-radius: 2px;
  font-size: 18px;
  font-weight: 760;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

.result-media-tools button.active {
  color: #ffd166;
}

.media-empty {
  min-height: 236px;
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  gap: 10px;
  color: #6e7785;
  background: #f2f4f7;
  border: 1px dashed #d9dee7;
  font-size: 14px;
  font-weight: 650;
}

.media-empty.loading {
  position: relative;
  overflow: hidden;
  background: #eef2f7;
}

.media-empty.loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .72) 45%, transparent 70%);
  animation: media-loading-sweep 1.4s ease-in-out infinite;
}

.media-empty.loading span {
  position: relative;
  width: 34px;
  height: 34px;
  border: 3px solid #d7dde7;
  border-top-color: #1f2530;
  border-radius: 50%;
  animation: media-loading-spin .9s linear infinite;
}

.media-empty.loading strong {
  position: relative;
  font-size: 14px;
}

.media-empty.failed {
  color: #a43742;
  background: #fff5f6;
  border-color: #ffd6dc;
}

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

@keyframes media-loading-sweep {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

.result-media {
  width: 100%;
  height: 100%;
  min-height: 236px;
  display: block;
  object-fit: cover;
  background: #e5e7ea;
}

.image-row.single .result-media {
  min-height: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
}

.image-row.single .result-media:is(video) {
  aspect-ratio: var(--media-aspect-ratio, 16 / 9);
  object-fit: contain;
}

.bridge-card {
  position: relative;
  overflow: hidden;
  background: #e4e6e9;
}

.bridge-card::before {
  content: "AI生成";
  position: absolute;
  top: 52px;
  left: 8px;
  z-index: 2;
  padding: 2px 5px;
  color: rgba(255, 255, 255, .65);
  background: rgba(35, 45, 75, .25);
  border-radius: 4px;
  font-size: 10px;
}

.bridge-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 40px;
  height: 152px;
  background:
    linear-gradient(8deg, transparent 48%, rgba(37, 38, 42, .78) 49% 52%, transparent 53%),
    linear-gradient(90deg, transparent 15%, rgba(30, 30, 34, .85) 15% 17%, transparent 17% 52%, rgba(30, 30, 34, .85) 52% 54%, transparent 54%),
    linear-gradient(0deg, transparent 54%, rgba(30, 30, 34, .8) 55% 61%, transparent 62%),
    linear-gradient(180deg, #8f7896 0%, #f3a054 42%, #6f5045 72%, #333a46 100%);
}

.bridge-two {
}

.bridge-two::after {
  filter: saturate(.9) hue-rotate(8deg);
}

.bridge-three {
}

.bridge-three::after {
  filter: saturate(1.15) hue-rotate(-12deg);
}

.bridge-four {
}

.bridge-four::after {
  filter: brightness(1.06) saturate(.95);
}

.result-actions {
  margin-top: 16px;
  display: flex;
  gap: 6px;
}

.result-actions button {
  height: 40px;
  padding: 0 14px;
  color: #252b35;
  background: #e9eaec;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 560;
}

.studio-prompt {
  position: fixed;
  left: calc(320px + (100vw - 320px) / 2);
  bottom: 20px;
  z-index: 5;
  width: min(720px, calc(100vw - 560px));
  min-width: 560px;
  min-height: 78px;
  padding: 18px 18px 16px 78px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #fff;
  border: 1px solid #e8ebf0;
  border-radius: 24px;
  box-shadow: 0 16px 50px rgba(26, 33, 52, .08);
  transform: translateX(-50%);
}

.studio-prompt .attach.small {
  position: absolute;
  left: 20px;
  top: 18px;
  width: 38px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #9aa2ae;
  background: #f0f1f3;
  border-radius: 3px;
  font-size: 20px;
  transform: rotate(-8deg);
}

.studio-prompt input {
  position: absolute;
  left: 78px;
  right: 72px;
  top: 27px;
  border: 0;
  outline: 0;
  color: #1f2530;
  background: transparent;
  font-size: 15px;
}

.studio-prompt-tools {
  display: none;
  gap: 6px;
  min-width: 0;
}

.studio-prompt:focus-within .studio-prompt-tools,
.studio-prompt.expanded .studio-prompt-tools {
  display: flex;
}

.studio-prompt:focus-within,
.studio-prompt.expanded {
  min-height: 110px;
}

.studio-prompt.has-status {
  min-height: 132px;
}

.studio-prompt.has-reference-image {
  padding-left: 132px;
}

.studio-prompt:focus-within input,
.studio-prompt.expanded input {
  top: 20px;
}

.studio-prompt.has-reference-image input {
  left: 132px;
}

.mini-reference-preview {
  position: absolute;
  left: 68px;
  top: 14px;
  width: 48px;
  height: 48px;
  overflow: hidden;
  background: #eef1f5;
  border: 1px solid #dfe5ee;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(26, 33, 52, .1);
}

.mini-reference-preview.hidden {
  display: none;
}

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

.mini-reference-preview button {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(17, 21, 28, .72);
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
}

.mini-status {
  position: absolute;
  left: 78px;
  right: 72px;
  top: 50px;
  margin: 0;
  color: #667080;
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
}

.mini-status:empty {
  display: none;
}

.mini-status.error {
  color: #d04b55;
}

.mini-status.success {
  color: #16865d;
}

.studio-prompt.has-reference-image .mini-status {
  left: 132px;
}

.studio-prompt .chip {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.studio-prompt .credit-count {
  margin-left: auto;
  font-size: 13px;
}

.studio-prompt .send {
  flex: 0 0 auto;
}

.send.active {
  background: #11151c;
}

.assets-view {
  min-height: 100vh;
  padding: 30px 44px 80px;
  background: #f7f8fa;
}

.assets-view.hidden {
  display: none;
}

.assets-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.asset-tabs,
.asset-subtabs,
.asset-tools {
  display: flex;
  align-items: center;
}

.asset-tabs {
  gap: 24px;
}

.asset-tabs button,
.asset-subtabs button {
  height: 42px;
  padding: 0 16px;
  color: #667080;
  background: transparent;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 720;
}

.asset-tabs .selected {
  color: #1b2029;
  background: #eceef1;
}

.asset-tools {
  height: 38px;
  gap: 2px;
  padding: 0 8px;
  background: #fff;
  border: 1px solid #e8ebf0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(26, 33, 52, .04);
}

.asset-tools button {
  height: 30px;
  padding: 0 12px;
  color: #1f2530;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 680;
}

.asset-tools button:disabled {
  color: #a1a9b6;
  cursor: default;
}

.asset-tools:focus-within input,
.asset-tools input:not(:placeholder-shown) {
  width: 150px;
  padding: 0 8px;
}

.asset-tools button + button {
  border-left: 1px solid #edf0f4;
}

.asset-tools svg {
  width: 18px;
  height: 18px;
}

.asset-subtabs {
  margin-top: 18px;
  gap: 24px;
}

.asset-subtabs .selected {
  color: #1f2530;
}

.asset-retention-tip {
  margin: 18px 0 0;
  padding: 10px 14px;
  color: #6b7482;
  background: #fff7e8;
  border: 1px solid #f4dfb8;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.asset-library {
  position: relative;
  min-height: 420px;
  margin-top: 22px;
}

.asset-groups {
  display: grid;
  gap: 30px;
}

.asset-date-group {
  display: grid;
  gap: 12px;
}

.asset-date-group h3 {
  margin: 0;
  color: #697382;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 760;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 3px;
  align-items: start;
}

.asset-card {
  position: relative;
  min-height: 132px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #eef0f3;
  border: 1px solid #e1e4e9;
  border-radius: 2px;
  content-visibility: auto;
  contain-intrinsic-size: 160px 160px;
}

.asset-card.video {
  min-height: 84px;
  aspect-ratio: var(--media-aspect-ratio, 16 / 9);
  contain-intrinsic-size: 180px 102px;
}

.asset-card.selected {
  outline: 3px solid rgba(50, 189, 227, .72);
  outline-offset: -3px;
}

.asset-select {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 4;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .86);
  border-radius: 7px;
}

.asset-select.hidden {
  display: none;
}

.asset-favorite {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  width: 28px;
  height: 28px;
  color: rgba(255, 255, 255, .72);
  background: rgba(18, 23, 32, .34);
  border-radius: 8px;
  opacity: 0;
  transition: opacity .16s ease;
}

.asset-card:hover .asset-favorite,
.asset-favorite.active {
  opacity: 1;
}

.asset-favorite.active {
  color: #f7b733;
  background: rgba(17, 21, 28, .62);
}

.asset-card.video::before {
  content: "视频";
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 3px 6px;
  color: #fff;
  background: rgba(20, 25, 35, .45);
  border-radius: 5px;
  font-size: 12px;
  pointer-events: none;
}

.asset-card .bridge-card {
  width: 100%;
  height: 100%;
}

.asset-card .bridge-card::before {
  content: none;
  top: 12px;
}

.asset-card .bridge-card::after {
  top: 0;
  height: 100%;
}

.asset-card img,
.asset-card video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.asset-card video {
  position: relative;
  z-index: 1;
}

.asset-card-actions {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 4;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .16s ease;
}

.asset-card:hover .asset-card-actions {
  opacity: 1;
}

.asset-card-actions button {
  height: 26px;
  padding: 0 8px;
  color: #fff;
  background: rgba(17, 21, 28, .62);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 650;
}

.storyboard-detail-modal,
.asset-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  padding: 40px 18px;
  display: grid;
  place-items: center;
  background: rgba(17, 21, 28, .34);
}

.storyboard-detail-modal.hidden,
.asset-detail-modal.hidden {
  display: none;
}

.storyboard-detail-panel,
.asset-detail-panel {
  width: min(960px, 100%);
  max-height: calc(100vh - 80px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e3e6ec;
  border-radius: 22px;
  box-shadow: 0 26px 80px rgba(17, 24, 39, .2);
}

.storyboard-detail-panel header,
.storyboard-detail-panel footer,
.asset-detail-panel header,
.asset-detail-panel footer {
  min-height: 64px;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #eceff4;
}

.storyboard-detail-panel footer,
.asset-detail-panel footer {
  justify-content: flex-end;
  border-top: 1px solid #eceff4;
  border-bottom: 0;
}

.storyboard-detail-panel header strong,
.asset-detail-panel header strong {
  color: #11151c;
  font-size: 16px;
  font-weight: 760;
}

.asset-detail-panel header > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.asset-detail-panel header span {
  color: #7b8491;
  font-size: 13px;
}

#storyboardDetailClose,
#assetDetailClose {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #202532;
  background: #fff;
  border: 1px solid #dfe3ea;
  border-radius: 999px;
  font-size: 18px;
}

.asset-detail-panel {
  width: min(1120px, 100%);
}

.storyboard-detail-panel {
  width: min(1280px, calc(100vw - 36px));
}

.asset-detail-scroll {
  min-height: 0;
  padding: 18px;
  display: grid;
  grid-template-rows: minmax(240px, 1fr) minmax(130px, .55fr);
  gap: 16px;
  overflow: hidden;
  background: #f6f7f9;
}

.asset-detail-preview {
  min-height: 0;
  display: grid;
  place-items: center;
}

.asset-detail-preview:has(video) {
  aspect-ratio: var(--media-aspect-ratio, 16 / 9);
  justify-self: center;
  align-self: center;
  width: 100%;
  max-height: 100%;
}

.asset-detail-preview img,
.asset-detail-preview video {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
}

.asset-detail-prompt {
  min-height: 0;
  padding: 16px 18px;
  overflow-y: auto;
  color: #2d3441;
  background: #fff;
  border: 1px solid #e1e5ec;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 560;
  line-height: 1.75;
  white-space: pre-wrap;
}

.asset-detail-panel footer button {
  min-height: 38px;
  padding: 0 18px;
  color: #1f2530;
  background: #fff;
  border: 1px solid #dfe3ea;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 720;
}

.asset-detail-panel footer .danger-action {
  color: #c9313f;
  border-color: #f0c5cb;
  background: #fff7f8;
}

.storyboard-detail-body {
  min-height: 0;
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  overflow-y: auto;
  background: #f6f7f9;
}

.storyboard-detail-preview,
.storyboard-detail-info {
  background: #f8f9fb;
  border: 1px solid #dfe3ea;
  border-radius: 16px;
}

.storyboard-detail-preview {
  min-height: 0;
  height: clamp(280px, 44vh, 620px);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #8b93a1;
  background: #fff;
}

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

.storyboard-detail-preview > div {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.storyboard-detail-info {
  min-height: 148px;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(220px, .36fr) minmax(0, 1fr);
  align-content: start;
  gap: 8px 18px;
  background: #fff;
}

.storyboard-detail-info h2 {
  margin: 0;
  color: #151a22;
  font-size: 20px;
  line-height: 1.35;
}

.storyboard-detail-info p {
  grid-column: 1;
  margin: 0;
  color: #7b8491;
  font-size: 13px;
  line-height: 1.6;
}

.storyboard-detail-prompt {
  grid-column: 2;
  grid-row: 1 / span 2;
  max-height: 160px;
  padding: 14px;
  overflow-y: auto;
  color: #4e5868;
  background: #fff;
  border: 1px solid #e1e4ea;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.storyboard-detail-panel footer button {
  min-height: 38px;
  padding: 0 18px;
  color: #1f2530;
  background: #fff;
  border: 1px solid #dfe3ea;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 720;
}

.storyboard-detail-panel footer .primary-action {
  color: #fff;
  background: #1f2530;
  border-color: #1f2530;
}

.asset-empty {
  position: absolute;
  left: 50%;
  top: 45%;
  width: min(360px, 100%);
  padding: 0;
  display: grid;
  gap: 10px;
  place-items: center;
  text-align: center;
  color: #697382;
  background: transparent;
  border: 0;
  transform: translate(-50%, -50%);
}

.asset-empty.hidden {
  display: none;
}

.asset-empty strong {
  color: #1f2530;
  font-size: 17px;
}

.asset-sentinel {
  height: 1px;
}

.storyboard-view,
.settings-view {
  min-height: 100vh;
  padding: 48px 32px 72px;
}

.story-page,
.settings-page {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.story-hero {
  text-align: center;
}

.story-flow {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: -18px 0 26px;
  flex-wrap: wrap;
}

.story-flow-step {
  height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #737b88;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
}

.story-flow-step b {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: #7b8491;
  background: #edf0f4;
  border-radius: 50%;
  font-size: 11px;
}

.story-flow-step.active {
  color: #111318;
  border-color: #252a33;
}

.story-flow-step.active b {
  color: #fff;
  background: #252a33;
}

.story-flow-step.done {
  color: #303744;
}

.story-composer,
.story-workbench,
.story-image-panel,
.settings-list {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 12px 40px rgba(26, 33, 52, .04);
}

.story-composer {
  padding: 18px;
}

.story-composer textarea {
  width: 100%;
  min-height: 116px;
  padding: 4px 2px;
  resize: vertical;
  color: #252b35;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 15px;
  line-height: 1.7;
}

.story-composer-bar {
  margin-top: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.story-composer-bar select {
  height: 40px;
  min-width: 94px;
  padding: 0 12px;
  color: #202631;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
}

.story-composer-bar p,
.story-image-head p,
.settings-page header p {
  margin: 8px 0 0;
  color: #7b8491;
  font-size: 13px;
  line-height: 1.5;
}

.story-workbench {
  margin-top: 22px;
  overflow: hidden;
}

.story-workbench-head,
.story-image-head {
  min-height: 56px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #fafbfc;
  border-bottom: 1px solid var(--line);
}

.story-workbench-head span,
.story-image-head span {
  color: #667080;
  font-size: 13px;
}

.story-workbench-head span.error,
.story-image-head span.error {
  color: #d04b55;
}

.story-workbench-head span.success,
.story-image-head span.success {
  color: #16865d;
}

.story-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.story-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.story-column + .story-column {
  border-left: 1px solid var(--line);
}

.story-column-head {
  min-height: 64px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.story-column-head button,
.story-image-actions button,
.settings-list button {
  min-height: 38px;
  padding: 0 14px;
  color: #202631;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.story-column-head .primary-action {
  color: #fff;
  background: #202631;
  border-color: #202631;
}

.story-reference-bar {
  min-height: 62px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.story-reference-bar > button {
  min-height: 38px;
  padding: 0 14px;
  color: #202631;
  background: #f7f8fa;
  border: 1px dashed #cfd5de;
  border-radius: 10px;
  font-weight: 650;
}

.story-reference-bar > button.has-reference {
  color: #16865d;
  border-style: solid;
  border-color: #b9decf;
  background: #f2fbf6;
}

.story-reference-preview {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.story-reference-preview.hidden {
  display: none;
}

.story-reference-preview img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 1px solid #dfe3ea;
  border-radius: 8px;
}

.story-reference-preview span {
  max-width: 180px;
  overflow: hidden;
  color: #667080;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-reference-preview button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #7b8491;
  background: #fff;
  border: 1px solid #dfe3ea;
  border-radius: 999px;
}

.story-column textarea {
  width: 100%;
  min-height: 480px;
  padding: 22px;
  resize: vertical;
  color: #252b35;
  background: #fff;
  border: 0;
  outline: 0;
  font-size: 15px;
  line-height: 1.9;
}

#storyboardAiPrompt {
  color: #596273;
  background: #fafbfc;
}

.story-image-panel {
  margin-top: 22px;
  overflow: hidden;
}

.story-image-preview {
  min-height: 360px;
  margin: 22px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #8a94a3;
  background: linear-gradient(135deg, #f0f2f6, #fbfcfd);
  border: 1px dashed #d9dee7;
  border-radius: 18px;
  text-align: center;
}

.story-image-preview img {
  width: 100%;
  max-height: 680px;
  object-fit: contain;
  display: block;
  background: #fff;
}

.story-image-preview .media-empty.loading span,
.storyboard-spinner {
  width: 28px;
  height: 28px;
  display: inline-block;
  border: 3px solid #dbe0e8;
  border-top-color: #252a33;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.story-image-actions {
  padding: 0 22px 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.settings-page header {
  margin-bottom: 22px;
}

.settings-page h1 {
  margin-bottom: 8px;
}

.settings-list {
  padding: 8px;
}

.settings-list button {
  width: 100%;
  min-height: 72px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  text-align: left;
  border: 0;
  border-radius: 14px;
}

.settings-list button:hover {
  background: #f6f7f9;
}

.settings-list span {
  color: #7b8491;
}

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

@media (max-width: 900px) {
  .sidebar {
    width: 62px;
    padding-inline: 8px;
  }

  .app {
    padding-left: 62px;
  }

  .panorama-view {
    width: calc(100vw - 62px);
  }

  .panorama-shell {
    padding: 28px 18px;
  }

  .panorama-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .panorama-workspace {
    grid-template-columns: 1fr;
  }

  .home-view {
    width: calc(100vw - 86px);
    padding-top: 58px;
  }

  h1 {
    margin-bottom: 26px;
    font-size: 22px;
  }

  .prompt-card {
    min-height: 186px;
    padding: 24px 18px 28px 116px;
  }

  .prompt-actions {
    left: 24px;
    right: 18px;
  }

  .action-left {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .action-left::-webkit-scrollbar {
    display: none;
  }

  .combo-chip {
    min-width: 190px;
  }

  .studio-layout {
    height: auto;
    grid-template-columns: 1fr;
  }

  .conversation {
    min-height: 360px;
  }

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

  .main-card {
    grid-row: auto;
  }

  .api-create-form,
  .api-grid,
  .api-usage-summary,
  .api-admin-grid,
  .api-pricing-row,
  .guide-overview,
  .guide-list {
    grid-template-columns: 1fr;
  }

  .api-panel,
  .api-guide-panel {
    width: min(720px, 100%);
  }
}

@media (max-width: 640px) {
  .optional,
  .cli {
    display: none;
  }

  .sidebar {
    inset: auto 0 0 0;
    z-index: 30;
    width: 100%;
    height: 66px;
    padding: 6px max(10px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-right));
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 8px;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .brand {
    display: none;
  }

  .side-scroll {
    min-width: 0;
    overflow: visible;
  }

  .main-nav {
    min-width: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    border-bottom: 0;
  }

  .create-panel {
    min-width: 0;
    padding: 0;
    display: block;
  }

  .create-title {
    display: none;
  }

  .create-panel .history-action {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    height: 52px;
    padding: 4px 2px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
    color: #1c2028;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
  }

  .create-panel .history-action svg {
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
  }

  .create-panel .history-action span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-item {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 4px 2px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
  }

  .nav-item svg {
    width: 18px;
    height: 18px;
  }

  .nav-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar .history-panel {
    display: none;
  }

  .side-bottom {
    margin-top: 0;
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }

  .app {
    padding-left: 0;
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .home-view {
    width: 100%;
    padding: 34px 12px 38px;
  }

  h1 {
    margin-bottom: 20px;
    font-size: 20px;
  }

  .prompt-card {
    min-height: 238px;
    padding: 96px 14px 86px;
    border-radius: 18px;
    overflow: visible;
  }

  .prompt-card.has-reference-image {
    padding-left: 14px;
  }

  .prompt-card.tail-reference-mode {
    padding-left: 14px;
  }

  .prompt-card.tail-reference-mode.has-reference-image {
    padding-left: 14px;
  }

  .prompt-card.multi-reference-mode.has-reference-image {
    padding-left: 14px;
    padding-top: 92px;
  }

  .attach {
    left: 16px;
    top: 16px;
    width: 46px;
    height: 58px;
  }

  .tail-attach {
    left: 70px;
  }

  .reference-preview {
    left: 70px;
    top: 14px;
    width: 58px;
    height: 58px;
  }

  .prompt-card.tail-reference-mode .reference-preview {
    left: 124px;
  }

  .prompt-card.tail-reference-mode .tail-preview {
    left: 188px;
  }

  .multi-reference-preview {
    left: 76px;
    right: 14px;
    top: 14px;
    max-width: none;
  }

  .prompt-card.multi-reference-full .multi-reference-preview {
    left: 14px;
  }

  .multi-reference-item {
    flex-basis: 58px;
    width: 58px;
    height: 58px;
  }

  #promptInput {
    min-height: 82px;
    font-size: 14px;
  }

  .prompt-actions {
    left: 14px;
    right: 14px;
    bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .action-left,
  .action-right {
    width: 100%;
  }

  .action-left {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .action-right {
    justify-content: space-between;
    margin-left: 0;
  }

  .chip {
    height: 34px;
    padding: 0 10px;
    min-width: 0;
    justify-content: center;
    font-size: 12px;
  }

  .chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mode-chip,
  .model-chip,
  .combo-chip,
  .duration-chip {
    width: 100%;
    min-width: 0;
  }

  .mode-menu,
  .model-menu,
  .reference-menu,
  .duration-menu,
  .preference-panel,
  .preference-panel.image-panel {
    left: 12px;
    right: 12px;
    top: calc(100% + 8px);
    width: auto;
    max-width: none;
    max-height: min(68vh, 560px);
    overflow: auto;
  }

  .mode-menu.studio-anchor,
  .model-menu.studio-anchor,
  .reference-menu.studio-anchor,
  .duration-menu.studio-anchor,
  .preference-panel.studio-anchor,
  .preference-panel.image-panel.studio-anchor {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: calc(156px + env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
    transform: none;
  }

  .preference-panel,
  .preference-panel.image-panel {
    padding: 16px;
    border-radius: 16px;
  }

  .ratio-row,
  .image-panel .ratio-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .ratio-option,
  .image-panel .ratio-option {
    height: 58px;
  }

  .size-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .size-row strong,
  .size-row em {
    display: none;
  }

  .prompt-status {
    left: 14px;
    right: 14px;
    bottom: -34px;
  }

  .send {
    margin-left: 0;
  }

  .login {
    width: 46px;
    min-height: 52px;
    padding: 4px;
    grid-template-columns: 1fr;
    justify-items: center;
    border-radius: 10px;
  }

  .login .account-avatar {
    width: 30px;
    height: 30px;
  }

  .login .account-copy {
    display: none;
  }

  .auth-popover {
    left: auto;
    right: 10px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    width: min(260px, calc(100vw - 20px));
  }

  .auth-modal,
  .billing-modal,
  .ledger-modal,
  .api-modal,
  .api-guide-modal {
    padding: 10px;
    align-items: stretch;
  }

  .auth-panel,
  .billing-panel,
  .ledger-panel,
  .api-panel,
  .api-guide-panel {
    width: 100%;
    max-height: calc(100vh - 20px);
    padding: 22px 16px;
    border-radius: 14px;
    overflow: auto;
  }

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

  .studio-view {
    grid-template-columns: 1fr;
  }

  .history-panel {
    display: none;
  }

  .creation-feed {
    padding: 16px 12px calc(154px + env(safe-area-inset-bottom));
  }

  .feed-filter {
    position: static;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    margin-bottom: 18px;
  }

  .feed-inner {
    width: 100%;
  }

  .image-row {
    height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    aspect-ratio: 1 / 1;
  }

  .studio-prompt {
    left: 12px;
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    width: auto;
    min-width: 0;
    min-height: 86px;
    padding: 16px 14px 14px 66px;
    border-radius: 18px;
    transform: none;
  }

  .studio-prompt input {
    left: 66px;
    right: 58px;
    top: 24px;
    font-size: 14px;
  }

  .studio-prompt .attach.small {
    left: 16px;
    top: 16px;
    width: 36px;
    height: 50px;
  }

  .studio-prompt:focus-within,
  .studio-prompt.expanded {
    min-height: 156px;
  }

  .studio-prompt-tools {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 48px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .studio-prompt-tools::-webkit-scrollbar {
    display: none;
  }

  .mini-status {
    left: 66px;
    right: 58px;
    top: 48px;
  }

  .studio-prompt.has-reference-image {
    padding-left: 118px;
  }

  .studio-prompt.has-reference-image input,
  .studio-prompt.has-reference-image .mini-status {
    left: 118px;
  }

  .mini-reference-preview {
    left: 62px;
    width: 44px;
    height: 44px;
  }

  .plans {
    grid-template-columns: 1fr;
  }

  .api-panel,
  .api-guide-panel {
    padding: 22px 16px;
  }

  .api-create-form {
    grid-template-columns: 1fr 1fr;
  }

  .api-create-form label:first-child,
  .api-create-form label:nth-child(2),
  .api-create-form .auth-submit {
    grid-column: 1 / -1;
  }

  .api-usage-summary,
  .api-admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .api-secret,
  .api-example,
  .api-key-card,
  .api-call-row,
  .api-pricing-row,
  .api-admin-users div {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .api-key-list,
  .api-call-list {
    max-height: 360px;
  }

  .api-grid section {
    min-height: 260px;
  }

  .guide-card pre {
    font-size: 11px;
  }

  .assets-view {
    padding: 20px 12px 24px;
  }

  .assets-top {
    display: grid;
    gap: 12px;
  }

  .asset-tabs,
  .asset-subtabs {
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .asset-tabs::-webkit-scrollbar,
  .asset-subtabs::-webkit-scrollbar {
    display: none;
  }

  .asset-tools {
    width: 100%;
    height: auto;
    min-height: 40px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    padding: 6px;
  }

  .asset-tools input {
    width: 100%;
    padding: 0 8px;
  }

  .asset-tools:focus-within input,
  .asset-tools input:not(:placeholder-shown) {
    width: 100%;
  }

  .asset-tools button {
    padding: 0 9px;
  }

  .asset-retention-tip {
    margin-top: 12px;
    padding: 9px 10px;
    font-size: 12px;
  }

  .asset-library {
    min-height: 320px;
    margin-top: 18px;
  }

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

  .asset-favorite,
  .asset-card-actions,
  .result-media-tools {
    opacity: 1;
  }

  .storyboard-detail-modal,
  .asset-detail-modal {
    padding: 14px;
  }

  .storyboard-detail-panel,
  .asset-detail-panel {
    max-height: calc(100vh - 28px);
    border-radius: 18px;
  }

  .asset-detail-scroll {
    padding: 12px;
    grid-template-rows: minmax(180px, 1fr) minmax(120px, .7fr);
  }

  .asset-detail-prompt {
    padding: 14px;
    font-size: 13px;
  }

  .storyboard-detail-body {
    padding: 14px;
    grid-template-columns: 1fr;
  }

  .storyboard-detail-preview {
    height: clamp(220px, 42vh, 360px);
  }

  .storyboard-detail-info {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px;
  }

  .storyboard-detail-prompt {
    grid-column: auto;
    grid-row: auto;
    max-height: 180px;
  }

  .storyboard-detail-panel footer,
  .asset-detail-panel footer {
    align-items: stretch;
    flex-direction: column;
  }

  .storyboard-detail-panel footer button,
  .asset-detail-panel footer button {
    width: 100%;
  }

  .storyboard-view,
  .settings-view {
    padding: 28px 12px 24px;
  }

  .story-flow {
    justify-content: flex-start;
    flex-wrap: nowrap;
    margin: -8px -12px 18px;
    padding: 0 12px 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .story-flow::-webkit-scrollbar {
    display: none;
  }

  .story-flow-step {
    flex: 0 0 auto;
  }

  .story-composer,
  .story-workbench,
  .story-image-panel,
  .settings-list {
    border-radius: 16px;
  }

  .story-composer-bar,
  .story-workbench-head,
  .story-image-head,
  .story-column-head {
    align-items: stretch;
    flex-direction: column;
  }

  .story-columns {
    grid-template-columns: 1fr;
  }

  .story-column + .story-column {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .story-column textarea {
    min-height: 280px;
    padding: 16px;
    font-size: 14px;
  }

  .story-reference-bar {
    padding: 12px 14px;
    align-items: stretch;
    flex-direction: column;
  }

  .story-reference-bar > button {
    width: 100%;
  }

  .story-reference-preview span {
    max-width: none;
  }

  .story-column-head button,
  .story-image-actions button {
    width: 100%;
  }

  .story-image-preview {
    min-height: 220px;
    margin: 14px;
    border-radius: 14px;
  }

  .story-image-actions {
    padding: 0 14px 14px;
    flex-direction: column;
  }

  .settings-list button {
    min-height: 74px;
    grid-template-columns: 1fr;
    gap: 5px;
  }

}

@media (max-width: 430px) {
  .api-create-form,
  .api-usage-summary,
  .api-admin-grid {
    grid-template-columns: 1fr;
  }

  .api-section-head {
    align-items: flex-start;
    gap: 8px;
    flex-direction: column;
  }

  .api-call-row {
    gap: 5px;
  }

  .api-call-row b,
  .api-admin-users strong,
  .api-admin-users em {
    justify-self: start;
  }

  .image-row {
    grid-template-columns: 1fr;
    aspect-ratio: auto;
  }

  .result-media,
  .image-row.single .result-media {
    max-height: 420px;
  }
}

body:has(.studio-view:not(.hidden)) {
  background: #f6f7f9;
  overflow: hidden;
}

body:has(.studio-view:not(.hidden)) .sidebar {
  background: #fff;
  border-right: 1px solid #e9edf2;
}

body:has(.studio-view:not(.hidden)) .nav-item {
  color: #1c2028;
}

body:has(.studio-view:not(.hidden)) .studio-view {
  color: #11151c;
  background: #f6f7f9;
}

body:has(.studio-view:not(.hidden)) .history-panel,
body:has(.studio-view:not(.hidden)) .studio-prompt,
body:has(.studio-view:not(.hidden)) .feed-filter {
  background: #fff;
  color: #11151c;
}

body:has(.studio-view:not(.hidden)) .chip {
  background: #fff;
  color: #1f2530;
}

body:has(.studio-view:not(.hidden)) .studio-prompt .chip {
  background: #f7f8fa;
}

body:has(.studio-view:not(.hidden)) .studio-prompt .chip.primary {
  color: #229ec8;
}
