:root {
  color-scheme: dark;
  --bg: #080a0f;
  --surface: rgba(20, 24, 31, 0.78);
  --surface-2: rgba(29, 34, 43, 0.88);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f7f8fb;
  --muted: rgba(247, 248, 251, 0.58);
  --muted-2: rgba(247, 248, 251, 0.38);
  --accent: #f2bd63;
  --radius: 18px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

button,
textarea,
input {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(245, 250, 255, 0.02) 0%, rgba(12, 23, 38, 0.42) 62%, rgba(5, 8, 14, 0.9) 100%),
    linear-gradient(105deg, rgba(13, 31, 54, 0.62), rgba(216, 232, 250, 0.08) 44%, rgba(12, 21, 34, 0.42)),
    url("/assets/backgrounds/future-bright-home.jpg");
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.app::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 68% 22%, rgba(255, 235, 188, 0.18), transparent 24%),
    radial-gradient(circle at 18% 76%, rgba(73, 152, 255, 0.18), transparent 30%);
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 1.2s ease;
}

.app.video-ready::before {
  opacity: 0.5;
}

.background-video-stack,
.bg-video,
.bg-wash {
  position: fixed;
  inset: 0;
}

.background-video-stack {
  z-index: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(238, 247, 255, 0.02) 0%, rgba(7, 12, 20, 0.66) 100%),
    url("/assets/backgrounds/future-bright-home.jpg") center / cover no-repeat;
  transform: scale(1.025);
  animation: static-bg-drift 26s ease-in-out infinite alternate;
  will-change: transform;
}

.bg-video {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.025);
  transition:
    opacity 1.9s ease,
    transform 7s ease;
  will-change: opacity, transform;
}

.bg-video.active {
  opacity: 1;
  transform: scale(1);
}

.app:not(.video-ready) .bg-video.active {
  opacity: 0;
}

.bg-wash {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(4, 8, 14, 0.08) 0%, rgba(4, 8, 14, 0.18) 42%, rgba(3, 5, 9, 0.82) 100%),
    linear-gradient(90deg, rgba(4, 8, 14, 0.5) 0%, rgba(4, 8, 14, 0.04) 34%, rgba(4, 8, 14, 0.18) 100%);
  pointer-events: none;
}

@keyframes static-bg-drift {
  from {
    transform: scale(1.025) translate3d(-0.4%, -0.3%, 0);
  }

  to {
    transform: scale(1.045) translate3d(0.5%, 0.4%, 0);
  }
}

.announcement-bar {
  position: fixed;
  z-index: 48;
  top: 20px;
  right: 26px;
  left: 96px;
  display: block;
  align-items: center;
  min-height: 30px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #f7f8fb;
  pointer-events: none;
}

.announcement-icon,
.announcement-close {
  display: none;
  width: 34px;
  height: 34px;
  place-items: center;
}

.announcement-icon {
  color: var(--accent);
}

.announcement-icon svg,
.announcement-close svg {
  width: 18px;
  height: 18px;
}

.announcement-track {
  overflow: hidden;
  white-space: nowrap;
}

.announcement-track span {
  display: inline-block;
  min-width: 100%;
  padding-left: 100%;
  color: rgba(255, 255, 255, 0.94);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.62);
  animation: announcement-marquee 24s linear infinite;
}

.announcement-close {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.64);
  padding: 0;
}

.announcement-close:hover {
  color: #fff;
}

.app.has-announcement .side-drawer,
.app.has-announcement .records-panel {
  top: 72px;
}

@keyframes announcement-marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

.rail {
  position: fixed;
  z-index: 20;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: 78px;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 0 max(18px, env(safe-area-inset-bottom));
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
}

.rail::-webkit-scrollbar {
  width: 6px;
}

.rail::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.logo {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background:
    radial-gradient(circle at 28% 22%, rgba(83, 230, 242, 0.34), transparent 30%),
    linear-gradient(145deg, #151b24 0%, #050608 68%);
  box-shadow:
    0 14px 38px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.logo-mark {
  position: relative;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  color: #f8fbff;
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.logo-mark.has-logo-image {
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  color: transparent;
  text-shadow: none;
}

.logo-mark::after {
  position: absolute;
  right: 1px;
  bottom: 3px;
  width: 13px;
  height: 3px;
  border-radius: 999px;
  background: #4fddea;
  box-shadow: 0 0 14px rgba(79, 221, 234, 0.72);
  content: "";
}

.rail-nav {
  display: grid;
  flex: 0 0 auto;
  gap: 5px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(30, 35, 43, 0.7);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(24px);
}

.rail-item {
  display: grid;
  width: 58px;
  min-height: 72px;
  place-items: center;
  gap: 5px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  transition:
    color 0.18s ease,
    background 0.18s ease;
}

.rail-item span {
  font-size: 13px;
}

.rail-item.active,
.rail-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.rail-bottom {
  display: grid;
  flex: 0 0 auto;
  margin-top: auto;
  place-items: center;
  gap: 10px;
}

.credit-card {
  display: grid;
  width: 76px;
  min-height: 52px;
  align-content: center;
  justify-items: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  background: rgba(15, 18, 24, 0.62);
  padding: 8px 6px;
  text-align: center;
  backdrop-filter: blur(18px);
}

.credit-card span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.credit-card strong {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.account-entry {
  display: inline-flex;
  width: 76px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(233, 237, 243, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.15;
  padding: 0 10px;
  white-space: nowrap;
}

.account-entry:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.mobile-quick-actions {
  display: none;
}

.menu-button {
  display: grid;
  width: 42px;
  height: 34px;
  gap: 6px;
  align-content: center;
  border: 0;
  background: transparent;
}

.menu-button span {
  width: 22px;
  height: 3px;
  border-radius: 999px;
  background: var(--muted);
}

.home-stage {
  position: relative;
  z-index: 10;
  display: flex;
  height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18vh 5vw 4vh 96px;
}

h1,
h2,
p {
  margin: 0;
}

.home-stage h1 {
  margin: 0 0 22px;
  color: #fff;
  font-size: clamp(30px, 3.5vw, 46px);
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.34);
}

.composer {
  width: min(960px, calc(100vw - 132px));
  flex: 0 0 auto;
  min-height: 236px;
  margin-top: 58px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(22px);
}

.prompt-wrap {
  position: relative;
  min-height: 170px;
  max-height: 280px;
  overflow: visible;
  padding: 96px 18px 0;
  scrollbar-width: thin;
}

.prompt-wrap:has(.media-list:not([hidden])) {
  padding-top: 116px;
}

textarea {
  width: 100%;
  min-height: 88px;
  max-height: 188px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  outline: none;
  resize: none;
  overflow-y: auto;
  scrollbar-width: thin;
}

textarea.is-scrollable {
  overflow-y: auto;
}

textarea::placeholder {
  color: var(--muted);
}

.media-tray {
  position: absolute;
  top: 16px;
  left: 18px;
  right: 18px;
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 9px;
  min-height: 68px;
  padding: 0;
  overflow: visible;
}

.media-tile {
  position: relative;
  display: grid;
  width: 58px;
  height: 68px;
  place-items: center;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 10px;
  background: rgba(7, 9, 13, 0.34);
  transform: rotate(-4deg);
}

.media-tile:nth-child(2) {
  transform: rotate(-2deg);
}

.media-tile input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.media-tile span {
  font-size: 27px;
  line-height: 1;
}

.media-tile small {
  color: var(--muted);
  font-size: 11px;
}

.media-list {
  display: flex;
  max-width: min(650px, calc(100% - 220px));
  flex-wrap: nowrap;
  align-self: flex-start;
  gap: 8px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 0 2px 8px;
  scrollbar-width: thin;
}

.media-thumb {
  position: relative;
  display: grid;
  flex: 0 0 58px;
  width: 58px;
  height: 68px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 10px;
  background: rgba(9, 12, 18, 0.44);
  padding: 0;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.media-thumb.is-invalid {
  border-color: rgba(255, 91, 91, 0.85);
  box-shadow: 0 0 0 1px rgba(255, 91, 91, 0.25), 0 10px 28px rgba(0, 0, 0, 0.24);
}

.media-thumb img,
.media-thumb video,
.media-thumb audio {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-thumb::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(to top, rgba(0, 0, 0, 0.38), transparent 48%);
  pointer-events: none;
}

.media-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 1;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.58);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  line-height: 1;
}

.media-compliance-button {
  position: absolute;
  left: 4px;
  bottom: 4px;
  z-index: 2;
  max-width: 48px;
  min-height: 18px;
  padding: 0 5px;
  border: 0;
  border-radius: 999px;
  background: rgba(19, 216, 223, 0.92);
  color: #061015;
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.34);
}

.media-compliance-button.is-loading {
  background: rgba(255, 255, 255, 0.78);
  color: #141820;
  cursor: wait;
}

.media-compliance-state {
  position: absolute;
  right: 4px;
  bottom: 24px;
  left: 4px;
  z-index: 2;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(5, 9, 14, 0.72);
  color: rgba(255, 255, 255, 0.94);
  font-size: 10px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-compliance-state.is-success {
  background: rgba(34, 197, 94, 0.88);
  color: #04120a;
}

.media-compliance-state.is-failed {
  background: rgba(255, 91, 91, 0.9);
  color: #fff;
}

.media-compliance-state.is-processing {
  background: rgba(250, 204, 21, 0.9);
  color: #191307;
}

.media-thumb-icon {
  z-index: 1;
  color: rgba(255, 255, 255, 0.78);
  font-size: 24px;
}

.media-thumb-audio {
  background: linear-gradient(180deg, rgba(28, 32, 40, 0.86), rgba(6, 8, 12, 0.92));
}

.media-duration {
  position: absolute;
  right: 5px;
  bottom: 4px;
  z-index: 1;
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.media-preview-popover {
  display: none;
}

.media-floating-preview {
  position: fixed;
  top: var(--preview-top, 0);
  left: var(--preview-left, 0);
  z-index: 42;
  display: grid;
  width: var(--preview-width, 320px);
  height: var(--preview-height, 320px);
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background: rgba(9, 12, 18, 0.92);
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(14px);
  transform: translateY(8px) scale(0.98);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.media-floating-preview img {
  display: block;
  max-width: calc(100% - 16px);
  max-height: calc(100% - 16px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

.media-thumb:hover {
  overflow: visible;
}

.media-floating-preview.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.media-audio-popover {
  height: 112px;
  gap: 8px;
  color: rgba(255, 255, 255, 0.86);
}

.media-audio-popover span {
  font-size: 42px;
}

.media-audio-popover small {
  color: var(--muted);
  font-size: 12px;
}

@media (hover: none), (pointer: coarse) {
  .media-floating-preview {
    display: none;
  }
}

.media-status {
  align-self: end;
  max-width: min(210px, 42vw);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-status.active {
  color: #d9f6e2;
  border-color: rgba(136, 230, 165, 0.42);
}

.mention-popover {
  position: fixed;
  z-index: 70;
  display: grid;
  width: min(330px, calc(100vw - 24px));
  max-height: 244px;
  overflow: auto;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(18, 22, 30, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
  padding: 7px;
  backdrop-filter: blur(18px);
  scrollbar-width: thin;
}

.mention-popover button {
  display: grid;
  min-height: 48px;
  grid-template-columns: 42px minmax(58px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  padding: 5px 8px 5px 5px;
  text-align: left;
}

.mention-popover button.active,
.mention-popover button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.mention-popover img,
.mention-audio {
  width: 42px;
  height: 38px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  object-fit: cover;
}

.mention-audio {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.82);
  font-size: 24px;
}

.mention-popover span {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.mention-popover small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-popover small em {
  margin-right: 6px;
  color: rgba(73, 224, 236, 0.88);
  font-style: normal;
  font-weight: 800;
}

.mention-empty {
  min-height: 42px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  padding: 8px;
}

.composer-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 15px 13px;
  background: rgba(18, 22, 29, 0.7);
}

.tool-group,
.submit-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-pill,
.icon-button {
  display: inline-flex;
  min-height: 34px;
  min-width: 0;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  padding: 0 11px;
  font-size: 14px;
}

.tool-pill:hover,
.icon-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.tool-pill .chevron {
  width: 15px;
  height: 15px;
  opacity: 0.72;
}

.tool-pill span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-pill .bars {
  flex: 0 0 auto;
}

.bars {
  width: 15px;
  height: 15px;
  background:
    linear-gradient(to top, currentColor 72%, transparent 72%) 0 0 / 4px 100% no-repeat,
    linear-gradient(to top, currentColor 44%, transparent 44%) 7px 0 / 4px 100% no-repeat,
    linear-gradient(to top, currentColor 88%, transparent 88%) 14px 0 / 4px 100% no-repeat;
}

.icon-button {
  width: 38px;
  justify-content: center;
  padding: 0;
  background: transparent;
}

.icon-button.active {
  color: rgba(255, 255, 255, 0.92);
}

.cost {
  min-width: 52px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 15px;
  text-align: right;
}

.choice-popover {
  position: fixed;
  z-index: 60;
  width: 250px;
  max-width: calc(100vw - 24px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(22, 27, 35, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  padding: 10px;
  backdrop-filter: blur(20px);
}

.choice-popover-spec {
  width: 318px;
}

.choice-popover-type {
  width: 188px;
}

.choice-popover-reference {
  width: 210px;
}

.choice-popover-model {
  width: min(760px, calc(100vw - 24px));
}

.choice-title {
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 800;
}

.choice-title.sub {
  margin-top: 14px;
}

.choice-list {
  display: grid;
  gap: 7px;
}

.choice-empty {
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.choice-option,
.spec-option {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(7, 10, 15, 0.42);
  color: rgba(255, 255, 255, 0.84);
  text-align: left;
}

.choice-option {
  position: relative;
  align-items: center;
  justify-content: flex-start;
  flex-direction: row;
  padding: 0 12px;
  text-align: center;
}

.choice-option span,
.spec-option span {
  font-size: 12px;
  font-weight: 700;
}

.choice-option small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.type-icon {
  position: relative;
  display: inline-block;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.72);
}

.type-icon.video::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 15px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.type-icon.video::after {
  content: "";
  position: absolute;
  right: 1px;
  top: 8px;
  width: 7px;
  height: 8px;
  border: 2px solid currentColor;
  border-left: 0;
  border-radius: 2px;
}

.type-icon.image::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.type-icon.image::after {
  content: "";
  position: absolute;
  left: 7px;
  bottom: 7px;
  width: 10px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

.type-icon.bot::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 16px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.type-icon.bot::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 2px;
  width: 4px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: -7px 12px 0 -1px currentColor, 7px 12px 0 -1px currentColor;
}

.model-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 388px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.34) rgba(255, 255, 255, 0.06);
}

.model-list::-webkit-scrollbar {
  width: 6px;
}

.model-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
}

.model-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.model-option {
  position: relative;
  display: grid;
  min-height: 58px;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 38px 8px 10px;
  text-align: left;
}

.model-option .model-icon {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.08);
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.model-option .model-icon::before,
.model-option .model-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.model-logo-jimeng {
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.32), transparent 34%),
    linear-gradient(145deg, rgba(24, 37, 69, 0.82), rgba(10, 14, 26, 0.92));
}

.model-logo-jimeng::before {
  inset: 5px;
  background: url("/assets/logos/jimeng-icon.png") center / contain no-repeat;
  filter: drop-shadow(0 4px 8px rgba(0, 208, 255, 0.24));
}

.model-logo-grok {
  background: linear-gradient(145deg, #ffffff, #d9dde4);
  color: #0f172a;
}

.model-logo-grok::before {
  inset: 8px;
  background: currentColor;
  -webkit-mask: url("/assets/logos/grok-logo.svg") center / contain no-repeat;
  mask: url("/assets/logos/grok-logo.svg") center / contain no-repeat;
}

.model-logo-video {
  background: url("/assets/logos/video-model.svg") center / cover no-repeat;
}

.model-option .model-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.model-option strong {
  color: #fff;
  font-size: 14px;
  line-height: 1.2;
  overflow-wrap: anywhere;
  white-space: normal;
}

.model-option .model-copy small {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.model-desc {
  min-width: 0;
  flex: 1 1 160px;
}

.model-price {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  border: 1px solid rgba(250, 204, 21, 0.34);
  border-radius: 999px;
  padding: 1px 8px;
  background: rgba(250, 204, 21, 0.13);
  color: #fde68a;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  white-space: nowrap;
}

.model-option.active .model-price {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.16);
  color: #fff7c2;
}

.model-option.active::after {
  content: "\2713";
  position: absolute;
  right: 10px;
  top: 50%;
  color: #fff;
  font-size: 19px;
  line-height: 1;
  transform: translateY(-50%);
}

.choice-popover-type .choice-option.active::after,
.choice-popover-reference .choice-option.active::after,
.choice-popover-concurrency .choice-option.active::after {
  content: "✓";
  position: absolute;
  right: 12px;
  top: 50%;
  color: rgba(255, 255, 255, 0.86);
  font-size: 16px;
  transform: translateY(-50%);
}

.choice-option.active,
.choice-option:hover,
.spec-option.active,
.spec-option:hover {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.spec-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ratio-icon {
  display: inline-block;
  width: 19px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 4px;
  opacity: 0.9;
}

.ratio-icon.tall {
  width: 11px;
  height: 19px;
}

.ratio-icon.square {
  width: 16px;
  height: 16px;
}

.ratio-icon.wide {
  width: 22px;
  height: 9px;
}

.send-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  grid-auto-flow: column;
  gap: 0;
  border: 0;
  border-radius: 50%;
  background: #cfd5df;
  color: #151920;
  transition:
    width 0.18s ease,
    border-radius 0.18s ease,
    gap 0.18s ease,
    opacity 0.18s ease;
}

.send-button:disabled {
  cursor: not-allowed;
  opacity: 0.78;
}

.send-button.is-submitting {
  width: 92px;
  border-radius: 999px;
  gap: 7px;
}

.send-button.is-submitting svg {
  width: 18px;
  height: 18px;
  animation: submit-spin 0.85s linear infinite;
}

.send-button-label {
  display: none;
  max-width: 48px;
  overflow: hidden;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.send-button.is-submitting .send-button-label {
  display: inline-block;
}

@keyframes submit-spin {
  to {
    transform: rotate(360deg);
  }
}

.side-drawer,
.records-panel {
  position: fixed;
  z-index: 18;
  top: 34px;
  bottom: 34px;
  left: 96px;
  width: min(460px, calc(100vw - 124px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 18, 24, 0.82);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
  padding: 24px;
  backdrop-filter: blur(24px);
}

.side-drawer header,
.records-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.side-drawer header span,
.records-panel header span {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.records-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.records-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 0 14px;
  color: var(--muted);
}

.records-tab.active,
.records-tab:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
}

.contact-tab {
  position: relative;
  overflow: visible;
}

.contact-qr-popover {
  position: absolute;
  z-index: 8;
  top: calc(100% + 10px);
  right: 0;
  display: block;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(10, 13, 18, 0.92);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.contact-tab:hover .contact-qr-popover,
.contact-tab:focus-visible .contact-qr-popover,
.contact-tab:focus-within .contact-qr-popover {
  opacity: 1;
  transform: translateY(0);
}

.contact-qr-popover img {
  display: block;
  width: 168px;
  height: 168px;
  border-radius: 8px;
  object-fit: contain;
}

.side-drawer h2,
.records-panel h2,
.login-card h2 {
  font-size: 28px;
  letter-spacing: 0;
}

.chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.chip,
.plain-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.chip.active,
.chip:hover,
.plain-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.concurrency-button {
  width: auto;
  min-width: 54px;
  padding: 0 14px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.concurrency-button span {
  font-size: 16px;
  line-height: 1;
}

.plain-button:disabled,
.plain-button.is-loading {
  cursor: wait;
  opacity: 0.58;
}

.plain-button.subtle {
  color: var(--muted);
}

.plain-button.danger {
  border-color: rgba(255, 107, 107, 0.42);
  color: #ffd6d6;
}

.drawer-card {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  padding: 16px;
}

.drawer-card strong {
  display: block;
  margin-bottom: 8px;
}

.drawer-card p {
  color: var(--muted);
  line-height: 1.7;
}

.api-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.drawer-section-title {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plain-link {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 0 14px;
  text-decoration: none;
}

.api-secret,
.api-row,
.api-log-row,
.api-empty {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  padding: 12px;
}

.api-secret {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border-color: rgba(73, 224, 236, 0.46);
  background: rgba(73, 224, 236, 0.08);
}

.api-secret div {
  display: grid;
  gap: 4px;
}

.api-secret span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.api-secret code {
  overflow-wrap: anywhere;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: #9af2fb;
  padding: 10px;
  font-family: "SFMono-Regular", Consolas, monospace;
  line-height: 1.45;
}

.api-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.api-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.api-row div,
.api-log-row {
  display: grid;
  gap: 5px;
}

.api-row code {
  width: fit-content;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  color: #9af2fb;
  padding: 4px 8px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.api-secret-inline {
  display: grid !important;
  gap: 8px !important;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid rgba(73, 224, 236, 0.32);
  border-radius: 10px;
  background: rgba(73, 224, 236, 0.08);
}

.api-secret-inline small {
  color: var(--muted);
  font-size: 12px;
}

.api-secret-inline code {
  width: 100%;
  border-radius: 8px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.api-secret-inline button {
  width: fit-content;
}

.api-row span,
.api-row em,
.api-log-row em,
.api-empty {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.api-row-actions {
  display: flex !important;
  flex-shrink: 0;
  grid-template-columns: none;
  gap: 8px !important;
}

.api-log-row {
  grid-template-columns: 1fr auto auto;
  align-items: center;
}

.api-log-row strong {
  font-size: 13px;
  font-weight: 700;
}

.api-log-row b,
.api-log-row span {
  color: var(--text);
  font-size: 13px;
}

.api-row button,
.api-secret button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 0 12px;
}

.story-flow,
.asset-grid {
  display: grid;
  gap: 10px;
}

.story-flow div,
.asset-grid div {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  padding: 0 14px;
}

.story-flow b {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.asset-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.side-drawer[data-panel="story"],
.side-drawer[data-panel="assets"] {
  width: min(760px, calc(100vw - 124px));
}

.story-workspace,
.asset-library {
  display: grid;
  gap: 14px;
}

.workspace-toolbar,
.workspace-actions,
.workspace-row-actions,
.workspace-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.workspace-toolbar,
.workspace-section-head {
  justify-content: space-between;
}

.workspace-toolbar .danger,
.workspace-row-actions [data-asset-delete],
.workspace-row-actions [data-shot-delete],
.workspace-row-actions [data-board-delete] {
  border-color: rgba(255, 105, 105, 0.42);
  color: #ffb5b5;
}

.story-project-list,
.workspace-tabs,
.asset-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.story-project,
.workspace-tabs button,
.extension-grid button {
  flex: 0 0 auto;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 8px 12px;
}

.story-project {
  display: grid;
  min-width: 178px;
  max-width: 240px;
  gap: 4px;
  text-align: left;
}

.story-project strong,
.story-project span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-project span,
.workspace-empty,
.asset-meta,
.generation-records em {
  color: var(--muted);
  font-size: 13px;
}

.story-project.active,
.workspace-tabs button.active {
  border-color: rgba(73, 224, 236, 0.56);
  background: rgba(73, 224, 236, 0.13);
}

.story-editor,
.asset-form,
.workspace-edit-row,
.asset-row,
.workspace-row,
.generation-records > div,
.workspace-empty {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.story-editor,
.asset-form,
.workspace-edit-row,
.asset-row {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.story-editor label,
.asset-form label,
.wide-field {
  display: grid;
  gap: 7px;
}

.story-editor label span,
.asset-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.story-editor input,
.story-editor textarea,
.story-editor select,
.workspace-edit-row input,
.workspace-edit-row textarea,
.workspace-edit-row select,
.asset-form input,
.asset-form textarea,
.asset-row input,
.asset-row textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  padding: 10px 12px;
}

.story-editor textarea,
.workspace-edit-row textarea,
.asset-form textarea,
.asset-row textarea {
  resize: vertical;
  line-height: 1.55;
}

.story-tab-panel,
.workspace-list,
.segment-list,
.asset-list,
.generation-records {
  display: grid;
  gap: 10px;
}

.workspace-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.workspace-split section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.workspace-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.workspace-row div,
.generation-records > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.workspace-row span,
.generation-records span {
  overflow-wrap: anywhere;
}

.workspace-row button,
.workspace-section-head button,
.workspace-row-actions button,
.asset-upload,
.asset-replace,
.asset-row button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 0 10px;
}

.workspace-edit-row select[multiple] {
  min-height: 104px;
}

.shot-grid,
.asset-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.extension-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.extension-grid button[disabled] {
  cursor: not-allowed;
  opacity: 0.56;
}

.workspace-empty {
  display: grid;
  min-height: 52px;
  place-items: center;
  padding: 14px;
  text-align: center;
}

.workspace-empty.large {
  min-height: 132px;
  gap: 12px;
}

.workspace-empty.error {
  color: #ffb5b5;
}

.asset-form {
  gap: 10px;
}

.workspace-toolbar > [data-asset-action="save-new"] {
  display: none;
}

.asset-form-compact {
  padding: 12px;
}

.asset-create-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.asset-create-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.asset-upload {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: fit-content;
  cursor: pointer;
}

.asset-upload input {
  display: none;
}

.asset-replace {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  cursor: pointer;
  padding: 0 10px;
}

.asset-replace.disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.asset-replace input {
  display: none;
}

.asset-upload-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
}

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

.asset-upload-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12px;
}

.asset-upload-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-upload-item em {
  color: var(--muted);
  font-style: normal;
}

.asset-upload-item.success em {
  color: #9af0c6;
}

.asset-upload-item.failed em {
  color: #ffb5b5;
}

.asset-row {
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: start;
}

.asset-row-compact {
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.asset-row-compact input,
.asset-row-compact textarea {
  min-height: 34px;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 13px;
}

.asset-row-compact textarea {
  line-height: 1.4;
}

.asset-row-main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 8px;
}

.asset-preview-wrap {
  display: grid;
  gap: 6px;
}

.asset-select {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.asset-select input {
  width: 14px;
  min-height: 14px;
}

.asset-preview {
  display: grid;
  width: 112px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--muted);
}

.asset-row-compact .asset-preview,
.asset-draft-preview {
  display: grid;
  width: 72px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--muted);
  font-size: 12px;
}

.asset-draft-preview {
  width: 68px;
}

.asset-preview img,
.asset-preview video,
.asset-draft-preview img,
.asset-draft-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-fields {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.asset-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
}

.records-panel {
  width: min(860px, calc(100vw - 124px));
}

.records-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.records-summary article {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  padding: 13px 14px;
}

.records-summary span {
  color: var(--muted);
  font-size: 12px;
}

.records-summary strong {
  font-size: 24px;
}

.account-summary-card {
  align-content: start;
  min-width: 0;
}

.account-summary-value {
  overflow: hidden;
  font-size: 14px !important;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.records-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

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

.record-filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(118px, 0.7fr) minmax(118px, 0.7fr) auto auto;
  align-items: end;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  padding: 12px;
}

.record-filter-bar label {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.record-filter-bar label span,
.record-filter-bar em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.record-filter-bar input,
.record-filter-bar select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(8, 11, 16, 0.58);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  outline: none;
  padding: 0 10px;
}

.record-filter-bar input:focus,
.record-filter-bar select:focus {
  border-color: rgba(110, 231, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(110, 231, 255, 0.12);
}

.record-filter-bar em {
  align-self: center;
  justify-self: end;
  white-space: nowrap;
}

.records-load-state {
  display: grid;
  gap: 6px;
  margin: 10px 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.records-load-state strong {
  color: var(--text);
  font-size: 13px;
}

.records-load-state.error {
  border-color: rgba(255, 106, 106, 0.3);
  background: rgba(255, 106, 106, 0.1);
}

.records-load-state .plain-button {
  width: max-content;
  min-height: 30px;
  margin-top: 2px;
}

.records-load-more {
  width: 100%;
  margin-top: 12px;
}

.record-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.record-thumb {
  display: grid;
  min-height: 150px;
  place-items: center;
  background: rgba(0, 0, 0, 0.24);
  color: var(--muted);
}

.record-thumb video,
.record-thumb img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.video-lazy-button {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: inherit;
  place-items: center;
  gap: 6px;
  border: 0;
  border-radius: 0;
  background: radial-gradient(circle at center, rgba(242, 189, 99, 0.16), rgba(0, 0, 0, 0.18));
  color: var(--text);
  padding: 0;
}

.video-lazy-button strong {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-size: 14px;
}

.video-lazy-button span {
  color: var(--muted);
  font-size: 12px;
}

.record-body {
  padding: 12px;
}

.record-body h3 {
  min-height: 42px;
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.5;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.record-detail-line {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  line-height: 1.35;
}

.record-detail-line span {
  color: var(--muted);
}

.record-detail-line b,
.record-detail-line code {
  overflow: hidden;
  font: inherit;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-detail-line code {
  color: rgba(180, 236, 255, 0.95);
}

.record-error,
.inline-task-error {
  border: 1px solid rgba(255, 106, 106, 0.32);
  border-radius: 8px;
  background: rgba(255, 106, 106, 0.1);
  color: #ffd0d0;
  font-size: 12px;
  line-height: 1.45;
}

.record-error {
  display: -webkit-box;
  margin-top: 10px;
  max-height: 54px;
  overflow: hidden;
  padding: 8px 10px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.record-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.record-actions button,
.record-actions a {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
}

.record-actions button:disabled,
.record-actions a[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.45;
  pointer-events: none;
}

.profile-list {
  display: grid;
  gap: 10px;
}

.profile-row,
.profile-empty {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  padding: 12px 14px;
}

.profile-row div {
  display: grid;
  gap: 5px;
}

.profile-row span,
.profile-row em,
.profile-empty {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.profile-row b {
  text-align: right;
}

.logout-button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  cursor: pointer;
}

.logout-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.credit-plus {
  color: #88e6a5;
}

.credit-minus {
  color: #ffb28a;
}

.referral-panel {
  width: min(900px, calc(100vw - 124px));
}

.referral-link-card {
  gap: 12px;
}

.referral-link-card p {
  color: var(--muted);
  line-height: 1.7;
}

.referral-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.referral-copy-row input {
  min-width: 0;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  padding: 0 12px;
  text-overflow: ellipsis;
}

.referral-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.referral-summary article,
.referral-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.referral-summary article {
  display: grid;
  gap: 7px;
  padding: 13px 14px;
}

.referral-summary span,
.referral-row span,
.referral-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.referral-summary strong {
  overflow-wrap: anywhere;
  font-size: 22px;
}

.referral-section {
  gap: 12px;
}

.drawer-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.referral-list {
  display: grid;
  gap: 10px;
}

.referral-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(130px, 0.85fr) minmax(120px, 0.8fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.referral-row div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.referral-row strong,
.referral-row b,
.referral-row span,
.referral-row em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tag-like {
  width: max-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
}

.tag-like.active {
  border-color: rgba(136, 230, 165, 0.42);
  color: #88e6a5;
}

.task-feed {
  position: relative;
  width: min(960px, calc(100vw - 132px));
  flex: 0 0 auto;
  max-height: min(31vh, 320px);
  margin-top: 34px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(14, 17, 23, 0.5);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.24);
  padding: 14px;
  backdrop-filter: blur(18px);
  scrollbar-width: thin;
}

.task-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.task-feed-head span,
.task-feed-status {
  color: var(--muted);
  font-size: 12px;
}

.task-feed-hint {
  flex: 1;
  min-width: 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.task-feed-head h2 {
  margin-top: 2px;
  font-size: 17px;
}

.task-feed-head button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 0 12px;
}

.task-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.task-feed.is-empty {
  padding: 12px 14px;
}

.task-feed.is-empty .task-list,
.task-feed.is-empty .task-feed-progress {
  display: none;
}

.inline-task-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.inline-task-card.succeeded {
  border-color: rgba(136, 230, 165, 0.34);
}

.inline-task-card.failed {
  border-color: rgba(255, 106, 106, 0.38);
}

.inline-task-media {
  display: grid;
  aspect-ratio: 16 / 9;
  min-height: 112px;
  place-items: center;
  background: rgba(0, 0, 0, 0.28);
}

.inline-task-media video,
.inline-task-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inline-task-placeholder {
  display: grid;
  place-items: center;
  gap: 6px;
  color: var(--muted);
  text-align: center;
}

.inline-task-placeholder strong {
  color: var(--text);
  font-size: 14px;
}

.inline-task-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.inline-task-title,
.inline-task-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.inline-task-title strong {
  font-size: 14px;
}

.inline-task-title span,
.inline-task-meta {
  color: var(--muted);
  font-size: 12px;
}

.inline-task-body p {
  display: -webkit-box;
  min-height: 36px;
  overflow: hidden;
  color: rgba(247, 248, 251, 0.78);
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.inline-task-error {
  display: -webkit-box;
  max-height: 52px;
  overflow: hidden;
  padding: 7px 9px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.inline-task-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.inline-task-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #eef2f7, var(--accent));
  transition: width 0.3s ease;
}

.inline-task-meta > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-task-meta div {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.inline-task-meta button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 0 9px;
  font-size: 12px;
}

.task-feed-progress {
  height: 0;
  margin-top: 0;
  opacity: 0;
}

.dialog-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.video-stage {
  display: grid;
  min-height: 360px;
  place-items: center;
  background: #050608;
}

.video-stage video {
  width: 100%;
  max-height: 64vh;
  object-fit: contain;
}

.empty-state {
  max-width: 280px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

.progress-wrap {
  height: 7px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #eef2f7, var(--accent));
  transition: width 0.3s ease;
}

.login-page {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  border: 0;
  padding: 0;
  background: #10151d;
  color: var(--text);
}

.login-page::backdrop {
  background: #10151d;
}

.login-page[open] {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.login-visual {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 26% 24%, rgba(72, 109, 133, 0.34), transparent 34%),
    linear-gradient(135deg, #071018, #111821 52%, #05070a);
}

.login-video-stack,
.login-visual video {
  position: absolute;
  inset: 0;
}

.login-video-stack {
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(5, 7, 10, 0.08) 0%, rgba(16, 21, 29, 0.38) 100%),
    url("/assets/backgrounds/future-bright-home.jpg") center / cover no-repeat;
  filter: saturate(0.9) contrast(1.08);
  transform: scale(1.02);
}

.login-visual video {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: saturate(0.86) contrast(1.08);
  transform: scale(1.02);
  transition:
    opacity 1.9s ease,
    transform 7s ease;
  will-change: opacity, transform;
}

.login-visual video.active {
  opacity: 0.64;
  transform: scale(1);
}

.login-visual div {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 7, 10, 0.1) 0%, rgba(16, 21, 29, 0.56) 100%),
    linear-gradient(180deg, rgba(5, 7, 10, 0.12) 0%, rgba(5, 7, 10, 0.42) 100%);
}

.login-form {
  position: relative;
  display: flex;
  width: min(420px, calc(100% - 56px));
  flex-direction: column;
  justify-content: center;
  justify-self: center;
  gap: 14px;
  padding: 24px 0;
}

.login-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}

.login-tab {
  min-width: 52px;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
}

.login-tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.login-form input {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(74, 88, 112, 0.38);
  color: var(--text);
  outline: none;
  padding: 0 12px;
  font-size: 15px;
}

.login-form input:focus {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.login-form input.invalid {
  border-color: rgba(255, 106, 106, 0.76);
  box-shadow: 0 0 0 3px rgba(255, 106, 106, 0.1);
}

.field-hint {
  min-height: 16px;
  color: #ff9f9f;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.field-hint.show {
  opacity: 1;
  transform: translateY(0);
}

.code-row {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 10px;
}

.code-row button {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 14px;
  white-space: nowrap;
}

.code-row button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.dialog-close {
  position: absolute;
  top: 22px;
  right: 0;
}

.login-submit {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: #eef0f4;
  color: #141922;
  font-weight: 800;
  font-size: 16px;
}

.agreement-line {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  text-align: center;
}

.agreement-line button {
  border: 0;
  background: transparent;
  color: #dbe7ff;
  font-size: inherit;
  text-decoration: underline;
}

.agreement-line button:hover {
  color: #fff;
}

.policy-dialog {
  width: min(760px, calc(100vw - 36px));
  max-height: min(760px, calc(100vh - 36px));
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.recharge-dialog {
  width: min(780px, calc(100vw - 36px));
  max-height: min(780px, calc(100vh - 36px));
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.recharge-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
}

.recharge-card {
  position: relative;
  max-height: min(780px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 21, 29, 0.98);
  padding: 28px;
}

.recharge-card header {
  margin-bottom: 20px;
}

.recharge-card header span,
.order-section span {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.recharge-card h2,
.order-section h3 {
  margin: 5px 0 8px;
}

.recharge-card p {
  color: var(--muted);
  line-height: 1.7;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.plan-card {
  position: relative;
  display: grid;
  min-height: 168px;
  align-content: center;
  gap: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(8, 10, 15, 0.44);
  padding: 18px;
}

.plan-card:hover {
  border-color: rgba(71, 220, 232, 0.85);
}

.plan-card em {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 88px;
  border-bottom-left-radius: 12px;
  background: #47dce8;
  color: #031014;
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
  padding: 7px 10px;
  text-align: center;
}

.plan-card span {
  color: var(--muted);
  font-size: 13px;
}

.plan-card strong {
  color: #fff;
  font-size: 25px;
}

.plan-card p {
  color: #fff;
  font-size: 28px;
  font-weight: 800;
}

.plan-card button {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: #eef0f4;
  color: #141922;
  font-weight: 800;
}

.custom-plan label {
  display: grid;
  gap: 6px;
}

.custom-plan small {
  color: var(--muted);
  font-size: 12px;
}

.custom-plan input {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.34);
  color: #fff;
  outline: none;
  padding: 0 12px;
}

.custom-plan input:focus {
  border-color: rgba(71, 220, 232, 0.75);
}

.order-section {
  margin-top: 24px;
}

.orders-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.order-item,
.order-empty {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 14px;
}

.order-item div {
  display: grid;
  gap: 4px;
}

.order-item span,
.order-empty {
  color: var(--muted);
  font-size: 13px;
}

.order-item b {
  text-align: right;
}

.order-item em {
  color: var(--accent);
  font-style: normal;
  font-size: 13px;
  text-align: right;
}

.pay-link {
  display: inline-grid;
  min-height: 30px;
  place-items: center;
  border-radius: 8px;
  background: #eef0f4;
  padding: 0 12px;
  color: #141922;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.policy-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
}

.policy-card {
  position: relative;
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 21, 29, 0.98);
  padding: 28px;
}

.policy-card h2 {
  margin: 0 0 18px;
}

.policy-content {
  display: grid;
  gap: 12px;
  color: rgba(247, 248, 251, 0.78);
  line-height: 1.8;
}

.policy-content h3 {
  margin: 8px 0 0;
  color: #fff;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 18, 24, 0.92);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
  padding: 12px 14px;
  opacity: 0;
  transform: translateY(12px);
  transition: 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .app {
    min-height: 100vh;
    height: auto;
    overflow: min(visible, auto);
  }

  .rail {
    right: 12px;
    bottom: 12px;
    left: 12px;
    top: auto;
    width: auto;
    height: 74px;
    max-height: none;
    flex-direction: row;
    gap: 0;
    overflow: visible;
    padding: 0;
    pointer-events: none;
  }

  .announcement-bar {
    top: 10px;
    right: 10px;
    left: 10px;
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    min-height: 40px;
  }

  .announcement-track span {
    font-size: 13px;
    animation-duration: 18s;
  }

  .logo,
  .rail-bottom {
    display: none;
  }

  .mobile-quick-actions {
    position: fixed;
    top: max(54px, calc(env(safe-area-inset-top) + 44px));
    right: 12px;
    z-index: 68;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
  }

  .mobile-credit-button,
  .mobile-account-button {
    min-height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
  }

  .mobile-credit-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(12, 16, 22, 0.72);
    color: #fff;
    padding: 0 12px;
    font-weight: 850;
  }

  .mobile-credit-button span {
    display: inline-flex;
    align-items: center;
    gap: 2px;
  }

  .mobile-credit-button strong {
    color: var(--accent);
    font-size: 12px;
    white-space: nowrap;
  }

  .mobile-account-button {
    background: linear-gradient(135deg, #f4d99a, #d59a3f);
    color: #1c1710;
    padding: 0 14px;
    font-weight: 900;
    white-space: nowrap;
  }

  @media (max-width: 380px) {
    .mobile-quick-actions {
      right: 8px;
      gap: 6px;
    }

    .mobile-credit-button {
      padding: 0 9px;
    }

    .mobile-account-button {
      padding: 0 11px;
    }

    .mobile-credit-button strong {
      font-size: 11px;
    }
  }

  .rail-nav {
    width: 100%;
    grid-auto-flow: column;
    grid-auto-columns: minmax(54px, 1fr);
    grid-template-columns: none;
    overflow-x: auto;
    overflow-y: hidden;
    pointer-events: auto;
    scrollbar-width: none;
  }

  .rail-nav::-webkit-scrollbar {
    display: none;
  }

  .rail-item {
    width: auto;
    min-height: 56px;
  }

  .rail-item span {
    font-size: 10px;
  }

  .home-stage {
    min-height: 100vh;
    height: auto;
    padding: 15vh 14px 110px;
  }

  .composer {
    width: 100%;
    margin-top: 34px;
  }

  .prompt-wrap {
    padding-top: 96px;
  }

  .prompt-wrap:has(.media-list:not([hidden])) {
    padding-top: 116px;
  }

  .media-tray {
    left: 14px;
    right: 14px;
  }

  .media-list {
    max-width: calc(100% - 204px);
  }

  .mention-popover {
    max-height: min(240px, 34vh);
  }

  .media-compliance-button {
    max-width: 42px;
    padding: 0 4px;
    font-size: 9px;
  }

  .media-compliance-state {
    font-size: 9px;
  }

  .task-feed {
    width: 100%;
    max-height: none;
    margin-top: 26px;
  }

  .task-list {
    grid-template-columns: 1fr;
  }

  .composer-tools,
  .tool-group {
    flex-wrap: wrap;
  }

  .tool-pill {
    max-width: 100%;
  }

  .tool-pill[data-menu="model"] {
    max-width: min(100%, 260px);
  }

  .submit-group {
    width: 100%;
    justify-content: flex-end;
  }

  .choice-popover-model {
    width: calc(100vw - 24px);
  }

  .model-list {
    grid-template-columns: 1fr;
    max-height: min(70vh, 390px);
  }

  .model-option {
    min-height: 64px;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 9px;
    padding: 8px 36px 8px 9px;
  }

  .model-option .model-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .side-drawer,
  .records-panel {
    top: 14px;
    right: 14px;
    bottom: 96px;
    left: 14px;
    width: auto;
  }

  .side-drawer[data-panel="story"],
  .side-drawer[data-panel="assets"] {
    width: auto;
  }

  .workspace-split,
  .shot-grid,
  .asset-form-grid,
  .asset-create-row,
  .asset-row-main,
  .extension-grid,
  .asset-row {
    grid-template-columns: 1fr;
  }

  .workspace-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .workspace-row button,
  .workspace-row-actions button {
    width: 100%;
  }

  .asset-preview {
    width: 100%;
    max-height: 220px;
  }

  .asset-row-compact .asset-preview,
  .asset-draft-preview {
    width: 72px;
  }

  .records-result-grid {
    grid-template-columns: 1fr;
  }

  .record-filter-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .record-filter-bar .plain-button {
    width: 100%;
  }

  .record-filter-bar em {
    justify-self: start;
  }

  .referral-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .referral-copy-row,
  .referral-row {
    grid-template-columns: 1fr;
  }

  .referral-copy-row .plain-button {
    width: 100%;
  }

  .login-page[open] {
    grid-template-columns: 1fr;
  }

  .login-visual {
    position: absolute;
    inset: 0;
  }

  .login-form {
    z-index: 1;
    width: min(430px, calc(100vw - 36px));
  }

  .plan-grid {
    grid-template-columns: 1fr;
  }

  .order-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .order-item b,
  .order-item em {
    text-align: left;
  }
}

/* secondary-ui-type-scale: 2026-06-20 */
.side-drawer,
.records-panel {
  font-size: 13px;
  line-height: 1.5;
}

.side-drawer header,
.records-panel header {
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.side-drawer header span,
.records-panel header span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.side-drawer h2,
.records-panel h2,
.login-card h2 {
  font-size: 24px;
  font-weight: 850;
  line-height: 1.18;
}

.records-actions,
.api-actions,
.workspace-toolbar,
.workspace-actions,
.workspace-row-actions,
.workspace-section-head,
.drawer-section-head {
  gap: 8px;
}

.records-tab,
.chip,
.plain-button,
.story-project,
.workspace-tabs button,
.extension-grid button {
  min-height: 36px;
  border-radius: 9px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.story-project {
  min-height: 50px;
  padding: 8px 12px;
}

.drawer-card {
  margin-top: 14px;
  border-radius: 12px;
  padding: 14px;
}

.drawer-card strong,
.drawer-section-title,
.workspace-section-head strong,
.referral-section > strong {
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}

.drawer-card p,
.referral-link-card p,
.workspace-empty,
.api-empty,
.profile-empty,
.order-empty,
.empty-state {
  font-size: 12px;
  line-height: 1.55;
}

.api-secret,
.api-row,
.api-log-row,
.profile-row,
.referral-row,
.referral-summary article,
.records-summary article,
.workspace-row,
.workspace-edit-row,
.asset-row,
.story-editor,
.asset-form,
.generation-records > div,
.workspace-empty {
  border-radius: 11px;
}

.records-summary {
  gap: 9px;
}

.records-summary article,
.referral-summary article {
  gap: 5px;
  padding: 11px 12px;
}

.records-summary span,
.referral-summary span,
.referral-row span,
.referral-row em,
.profile-row span,
.profile-row em,
.api-row span,
.api-row em,
.api-log-row em,
.asset-meta,
.story-project span,
.generation-records em {
  font-size: 12px;
  line-height: 1.4;
}

.records-summary strong,
.referral-summary strong {
  font-size: 20px;
  line-height: 1.18;
}

.account-summary-value {
  font-size: 13px !important;
}

.record-body {
  padding: 11px;
}

.record-body h3 {
  min-height: 38px;
  margin-bottom: 7px;
  font-size: 13px;
  line-height: 1.42;
}

.record-meta,
.record-detail-line,
.record-error,
.inline-task-error,
.video-lazy-button span {
  font-size: 11px;
}

.record-actions {
  gap: 7px;
  margin-top: 10px;
}

.record-actions button,
.record-actions a,
.workspace-row button,
.workspace-section-head button,
.workspace-row-actions button,
.asset-upload,
.asset-row button,
.api-row button,
.api-secret button,
.logout-button {
  min-height: 32px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.story-workspace,
.asset-library,
.story-tab-panel,
.workspace-list,
.segment-list,
.asset-list,
.generation-records,
.api-list,
.profile-list,
.referral-list {
  gap: 9px;
}

.story-editor,
.asset-form,
.workspace-edit-row,
.asset-row {
  gap: 10px;
  padding: 12px;
}

.story-editor label,
.asset-form label,
.wide-field {
  gap: 6px;
}

.story-editor label span,
.asset-form label span {
  font-size: 11px;
  line-height: 1.35;
}

.story-editor input,
.story-editor textarea,
.story-editor select,
.workspace-edit-row input,
.workspace-edit-row textarea,
.workspace-edit-row select,
.asset-form input,
.asset-form textarea,
.asset-row input,
.asset-row textarea,
.referral-copy-row input,
.login-form input,
.custom-plan input {
  min-height: 38px;
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 13px;
  line-height: 1.45;
}

.story-editor textarea,
.workspace-edit-row textarea,
.asset-form textarea,
.asset-row textarea {
  line-height: 1.5;
}

.api-secret span,
.api-secret-inline small {
  font-size: 12px;
}

.api-secret code,
.api-secret-inline code {
  font-size: 12px;
  line-height: 1.42;
}

.api-log-row strong,
.api-log-row b,
.api-log-row span,
.api-row code {
  font-size: 12px;
}

.story-project strong,
.workspace-row strong,
.referral-row strong,
.referral-row b,
.profile-row b,
.asset-row strong,
.api-row strong {
  font-size: 13px;
  line-height: 1.35;
}

.profile-row,
.profile-empty {
  min-height: 58px;
  gap: 12px;
  padding: 11px 12px;
}

.referral-row {
  gap: 10px;
  padding: 11px 12px;
}

.contact-qr-popover img {
  width: 156px;
  height: 156px;
}

@media (max-width: 820px) {
  .side-drawer,
  .records-panel {
    padding: 18px;
    font-size: 12px;
  }

  .side-drawer header,
  .records-panel header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .side-drawer h2,
  .records-panel h2 {
    font-size: 22px;
  }

  .records-actions {
    justify-content: flex-start;
  }

  .records-tab,
  .chip,
  .plain-button,
  .workspace-tabs button,
  .extension-grid button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .records-summary strong,
  .referral-summary strong {
    font-size: 18px;
  }

  .record-body h3,
  .story-project strong,
  .workspace-row strong,
  .referral-row strong,
  .referral-row b,
  .profile-row b,
  .asset-row strong,
  .api-row strong {
    font-size: 12px;
  }

  .contact-qr-popover {
    right: auto;
    left: 0;
  }

  .contact-qr-popover img {
    width: 148px;
    height: 148px;
  }
}
.credit-task-id {
  max-width: 220px;
}

.credit-task-id .link-button {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

@media (max-width: 720px) {
  .credit-task-id {
    max-width: 150px;
  }
}
