:root {
  color-scheme: dark;
  --bg: #080b13;
  --text: #f5f7ff;
  --muted: rgba(224, 230, 248, 0.62);
  --soft: rgba(224, 230, 248, 0.42);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(190, 204, 255, 0.28);
  --panel: rgba(16, 21, 34, 0.48);
  --panel-strong: rgba(15, 20, 33, 0.78);
  --accent: #b9c9ff;
  --accent-2: #d5abff;
  --premium: #f1d6a3;
  --premium-soft: #e6c8ff;
  --green: #8be0bd;
  --red: #ff9caf;
  --radius: 24px;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.38), inset 0 1px rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[contenteditable="true"]:focus-visible {
  outline: 2px solid rgba(185, 201, 255, 0.75);
  outline-offset: 3px;
}

.theme-stage {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: #080b13;
}

.theme-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.theme-media#theme-video {
  opacity: 0;
  transition: opacity 1s ease;
}

.theme-media#theme-video.is-playing {
  opacity: 1;
}

.theme-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 62% 12%, transparent 8%, rgba(4, 7, 14, 0.18) 48%, rgba(3, 5, 10, 0.72) 112%);
}

.theme-mask {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 16, 0.6);
  transition: background 0.2s;
}

.theme-grain {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.glass {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(26px) saturate(1.28);
  backdrop-filter: blur(26px) saturate(1.28);
}

.raised {
  border-radius: var(--radius);
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(1220px, calc(100% - 28px));
  min-height: 72px;
  margin: 14px auto 0;
  padding: 10px 12px;
  border-radius: 22px;
}

.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-icon,
.modal-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(137, 158, 255, 0.42), rgba(166, 91, 218, 0.32));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.22), 0 10px 25px rgba(0, 0, 0, 0.25);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 14px;
  letter-spacing: 0.02em;
}

.brand small {
  margin-top: 3px;
  color: rgba(225, 232, 255, 0.48);
  font-size: 10px;
}

.product-tabs {
  display: flex;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(3, 6, 14, 0.25);
}

.product-tab {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 0 19px;
  border-radius: 12px;
  background: transparent;
  color: rgba(229, 235, 255, 0.56);
  font-size: 13px;
  transition: color 0.2s, background 0.2s;
}

.product-tab:hover {
  color: rgba(245, 247, 255, 0.88);
}

.product-tab svg {
  width: 17px;
}

.product-tab b {
  padding: 2px 7px;
  border: 1px solid rgba(210, 169, 255, 0.24);
  border-radius: 99px;
  color: #dec2ff;
  font-size: 9px;
  font-weight: 500;
}

.product-tab.is-active {
  background: rgba(119, 141, 222, 0.24);
  color: #fff;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.12);
}

.top-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: flex-end;
}

.connection {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-right: 3px;
  color: rgba(224, 231, 251, 0.55);
  font-size: 11px;
}

.connection i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e4bc74;
  box-shadow: 0 0 10px currentColor;
}

.connection.ok i {
  background: #72d9b0;
}

.connection.bad i {
  background: #ff879c;
}

.icon-btn,
.account-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 13px;
  background: rgba(9, 12, 23, 0.3);
  color: rgba(235, 239, 255, 0.82);
  transition: background 0.2s, border-color 0.2s;
}

.icon-btn:hover,
.account-button:hover {
  border-color: rgba(185, 201, 255, 0.26);
  background: rgba(27, 34, 57, 0.48);
}

.icon-btn {
  width: 42px;
}

.account-button {
  position: relative;
  gap: 8px;
  padding: 0 14px;
  font-size: 12px;
}

.account-button svg {
  width: 16px;
}

.member-badge {
  padding: 3px 7px;
  border: 1px solid rgba(185, 201, 255, 0.2);
  border-radius: 99px;
  color: #dbe4ff;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.member-badge.basic {
  background: linear-gradient(135deg, rgba(100, 128, 212, 0.2), rgba(91, 116, 185, 0.08));
}

.member-badge.advanced {
  padding: 5px 9px;
  border-color: rgba(241, 214, 163, 0.44);
  background: linear-gradient(135deg, rgba(103, 78, 183, 0.64), rgba(169, 105, 187, 0.42) 58%, rgba(155, 112, 67, 0.3));
  color: #fff4df;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 0 22px rgba(173, 121, 231, 0.28), inset 0 1px rgba(255, 255, 255, 0.22);
}

.member-badge.advanced::before {
  margin-right: 4px;
  color: var(--premium);
  content: "✦";
}

body.member-advanced .topbar {
  border-color: rgba(225, 195, 255, 0.2);
  background: linear-gradient(112deg, rgba(17, 21, 35, 0.72), rgba(35, 27, 50, 0.7) 72%, rgba(58, 43, 42, 0.62));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(241, 214, 163, 0.05), inset 0 1px rgba(255, 255, 255, 0.13);
}

body.member-advanced .brand-icon {
  border-color: rgba(241, 214, 163, 0.24);
  background: linear-gradient(145deg, rgba(123, 105, 216, 0.5), rgba(171, 100, 192, 0.34) 58%, rgba(196, 150, 85, 0.24));
  color: #fff2d8;
}

body.member-advanced .account-button {
  border-color: rgba(222, 189, 255, 0.2);
  background: linear-gradient(135deg, rgba(20, 23, 39, 0.58), rgba(70, 47, 83, 0.32));
}

main {
  width: min(1160px, calc(100% - 34px));
  margin: 0 auto;
  padding: 104px 0 76px;
}

.hero {
  max-width: 820px;
  margin: 0 auto 76px;
  text-align: center;
}

body.image-workspace-active main {
  width: min(1240px, calc(100% - 34px));
  padding-top: 58px;
}

body.image-workspace-active .hero {
  max-width: 940px;
  margin-bottom: 38px;
}

body.image-workspace-active .hero h1 {
  margin: 14px 0;
  font-size: clamp(42px, 5vw, 56px);
}

body.image-workspace-active .hero h1 br {
  display: none;
}

body.image-workspace-active .hero h1 em {
  margin-left: 0.22em;
}

body.image-workspace-active .hero p {
  max-width: 780px;
  font-size: 14px;
  line-height: 1.72;
}

body.image-workspace-active .hero-metrics {
  margin-top: 18px;
}

body.image-workspace-active .member-welcome {
  margin-top: 16px;
}

.hero-kicker {
  display: flex;
  gap: 11px;
  align-items: center;
  justify-content: center;
  color: rgba(210, 220, 247, 0.68);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.hero-kicker span {
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #b9caff);
}

.hero h1 {
  margin: 20px 0;
  font-size: clamp(46px, 7vw, 76px);
  font-weight: 650;
  letter-spacing: -0.052em;
  line-height: 1.06;
  text-shadow: 0 14px 50px rgba(0, 0, 0, 0.44);
}

.hero h1 em {
  color: transparent;
  font-style: normal;
  background: linear-gradient(105deg, #fff 10%, #bdceff 55%, #e0b7ff);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero p {
  max-width: 720px;
  margin: 0 auto;
  color: rgba(229, 234, 249, 0.7);
  font-size: 15px;
  line-height: 1.9;
}

.hero-metrics {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 28px;
}

.hero-metrics span {
  padding: 9px 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  background: rgba(11, 15, 27, 0.28);
  color: rgba(220, 228, 250, 0.58);
  font-size: 11px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.hero-metrics strong {
  margin-right: 5px;
  color: #fff;
  font-weight: 600;
}

.member-welcome {
  position: relative;
  display: flex;
  width: min(700px, 100%);
  gap: 14px;
  align-items: center;
  margin: 22px auto 0;
  padding: 14px 17px;
  overflow: hidden;
  border-radius: 18px;
  text-align: left;
}

.member-welcome::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: radial-gradient(circle at 12% 40%, rgba(155, 181, 255, 0.12), transparent 36%);
}

.member-welcome.advanced {
  width: min(760px, 100%);
  border-color: rgba(231, 199, 255, 0.3);
  background: linear-gradient(112deg, rgba(35, 40, 72, 0.72), rgba(78, 47, 101, 0.58) 68%, rgba(103, 71, 62, 0.48));
  box-shadow: 0 22px 60px rgba(14, 12, 35, 0.4), 0 0 0 1px rgba(241, 214, 163, 0.06), inset 0 1px rgba(255, 255, 255, 0.15);
}

.member-welcome.advanced::before {
  background: linear-gradient(108deg, transparent 15%, rgba(255, 255, 255, 0.08) 43%, transparent 68%), radial-gradient(circle at 86% 40%, rgba(217, 170, 255, 0.14), transparent 38%);
  transform: translateX(-110%);
}

.member-welcome.is-entering {
  animation: welcome-arrive 0.75s cubic-bezier(0.2, 0.72, 0.2, 1) both;
}

.member-welcome.advanced.is-entering::before {
  animation: welcome-sheen 1.35s 0.25s ease-out both;
}

.welcome-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(186, 202, 255, 0.18);
  border-radius: 13px;
  background: rgba(105, 128, 211, 0.14);
  color: #d6e0ff;
}

.advanced .welcome-icon {
  border-color: rgba(241, 214, 163, 0.32);
  background: linear-gradient(145deg, rgba(131, 105, 224, 0.46), rgba(193, 119, 213, 0.26), rgba(188, 140, 77, 0.22));
  color: #fff0d2;
  box-shadow: 0 8px 24px rgba(74, 42, 115, 0.32), inset 0 1px rgba(255, 255, 255, 0.16);
}

.member-welcome > div {
  position: relative;
  z-index: 1;
  min-width: 0;
  flex: 1;
}

.member-welcome strong,
.member-welcome p {
  display: block;
  margin: 0;
}

.member-welcome strong {
  font-size: 13px;
  letter-spacing: 0.01em;
}

.member-welcome p {
  margin-top: 4px;
  color: rgba(222, 230, 251, 0.5);
  font-size: 10px;
  line-height: 1.55;
}

.welcome-tier {
  position: relative;
  z-index: 1;
  padding: 5px 9px;
  border: 1px solid rgba(185, 201, 255, 0.16);
  border-radius: 99px;
  color: rgba(225, 233, 255, 0.7);
  font-size: 10px;
  white-space: nowrap;
}

.advanced .welcome-tier {
  border-color: rgba(241, 214, 163, 0.3);
  color: #fff0d2;
  background: linear-gradient(135deg, rgba(143, 91, 184, 0.24), rgba(150, 111, 65, 0.18));
  font-weight: 650;
  letter-spacing: 0.035em;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.75fr);
  gap: 20px;
}

.image-workspace {
  grid-template-columns: minmax(0, 1.78fr) minmax(300px, 0.62fr);
  scroll-margin-top: 104px;
}

.workspace-main,
.workspace-aside {
  padding: 28px;
}

.workspace-aside {
  align-self: start;
}

.full-span {
  grid-column: 1 / -1;
}

.section-head,
.results-head,
.label-row,
.form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-head {
  margin-bottom: 24px;
}

.section-head > div,
.results-head > div {
  display: flex;
  gap: 12px;
  align-items: center;
}

.section-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(185, 201, 255, 0.17);
  border-radius: 13px;
  background: rgba(112, 134, 216, 0.12);
  color: #c5d3ff;
}

.section-head h2,
.results-head h2 {
  margin: 3px 0 0;
  font-size: 17px;
  font-weight: 630;
}

.section-eyebrow {
  display: block;
  color: rgba(191, 205, 243, 0.42);
  font-size: 9px;
  letter-spacing: 0.13em;
}

.status-chip {
  padding: 7px 11px;
  border: 1px solid rgba(139, 224, 189, 0.18);
  border-radius: 99px;
  background: rgba(63, 178, 137, 0.08);
  color: #9ce8c7;
  font-size: 11px;
  white-space: nowrap;
}

body.member-advanced #image-quota {
  border-color: rgba(241, 214, 163, 0.28);
  background: linear-gradient(135deg, rgba(87, 61, 139, 0.25), rgba(126, 88, 48, 0.16));
  color: #f8dfb1;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.09);
}

.segmented,
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(2, 5, 12, 0.24);
}

.segmented button,
.auth-tabs button {
  min-height: 42px;
  border-radius: 10px;
  background: transparent;
  color: rgba(225, 232, 251, 0.5);
  font-size: 13px;
  transition: background 0.2s, color 0.2s;
}

.segmented button.is-active,
.auth-tabs button.is-active {
  background: rgba(118, 137, 201, 0.24);
  color: #fff;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.1);
}

.field-block {
  margin-top: 22px;
}

.field-block label {
  display: block;
  margin-bottom: 10px;
  color: rgba(238, 242, 255, 0.8);
  font-size: 13px;
  font-weight: 500;
}

.optional {
  margin-left: 5px;
  color: rgba(222, 229, 249, 0.38);
  font-size: 11px;
  font-weight: 400;
}

.label-row {
  color: rgba(217, 225, 248, 0.48);
  font-size: 11px;
}

.label-row label {
  margin: 0;
}

.label-row .over-limit {
  color: var(--red);
}

.field-tip {
  margin: 9px 2px 0;
  color: rgba(216, 224, 246, 0.42);
  font-size: 11px;
  line-height: 1.6;
}

.field-help {
  margin: -3px 2px 2px;
  color: rgba(216, 224, 246, 0.43);
  font-size: 10px;
  line-height: 1.6;
}

.prompt-editor-shell {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  background: rgba(3, 6, 13, 0.34);
  box-shadow: inset 0 4px 18px rgba(0, 0, 0, 0.16);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.prompt-editor-shell:focus-within {
  border-color: rgba(178, 196, 255, 0.46);
  box-shadow: 0 0 0 3px rgba(137, 158, 235, 0.11), inset 0 4px 18px rgba(0, 0, 0, 0.16);
}

.prompt-editor {
  min-height: 150px;
  padding: 16px;
  outline: none;
  color: #f4f6ff;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.prompt-editor:empty::before {
  color: rgba(211, 220, 246, 0.28);
  pointer-events: none;
  content: attr(data-placeholder);
}

.prompt-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 43px;
  padding: 7px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(216, 224, 246, 0.42);
  font-size: 10px;
}

.prompt-toolbar > span:nth-last-child(2) {
  flex: 1;
}

.mention-button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(183, 199, 255, 0.16);
  border-radius: 9px;
  background: rgba(101, 123, 199, 0.12);
  color: #cad7ff;
  font-size: 10px;
}

.mention-button:hover {
  border-color: rgba(185, 201, 255, 0.32);
  background: rgba(101, 123, 199, 0.22);
}

.prompt-mention {
  display: inline-flex;
  max-width: 150px;
  height: 30px;
  gap: 6px;
  align-items: center;
  margin: 0 3px;
  padding: 3px 8px 3px 3px;
  border: 1px solid rgba(187, 202, 255, 0.24);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(98, 119, 196, 0.3), rgba(137, 91, 181, 0.2));
  color: #edf1ff;
  font-size: 11px;
  line-height: 1;
  vertical-align: middle;
  cursor: zoom-in;
  user-select: none;
}

.prompt-mention img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
}

.image-mention-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 25;
  display: grid;
  width: min(390px, 100%);
  max-height: 260px;
  gap: 5px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(189, 204, 255, 0.2);
  border-radius: 14px;
  background: rgba(13, 17, 29, 0.96);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}

.image-mention-menu button {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 50px;
  padding: 6px;
  border-radius: 10px;
  background: transparent;
  color: rgba(239, 243, 255, 0.82);
  text-align: left;
}

.image-mention-menu button:hover {
  background: rgba(109, 130, 207, 0.16);
}

.image-mention-menu img {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
}

.image-mention-menu strong,
.image-mention-menu small {
  display: block;
}

.image-mention-menu strong {
  font-size: 11px;
}

.image-mention-menu small {
  overflow: hidden;
  max-width: 270px;
  margin-top: 3px;
  color: rgba(220, 228, 248, 0.4);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-empty {
  padding: 15px;
  color: rgba(220, 228, 248, 0.46);
  font-size: 11px;
  text-align: center;
}

.input-shell {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(3, 6, 13, 0.34);
  box-shadow: inset 0 4px 18px rgba(0, 0, 0, 0.16);
}

.input-shell svg {
  flex: 0 0 auto;
  color: rgba(192, 207, 247, 0.48);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  outline: 0;
  border-radius: 14px;
  background: rgba(3, 6, 13, 0.34);
  color: #f4f6ff;
  box-shadow: inset 0 4px 18px rgba(0, 0, 0, 0.16);
}

input {
  height: 54px;
  padding: 0 16px;
}

.input-shell input {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

textarea {
  min-height: 128px;
  resize: vertical;
  padding: 15px 16px;
  line-height: 1.75;
}

select {
  height: 54px;
  padding: 0 15px;
}

input:focus,
textarea:focus,
select:focus,
.input-shell:focus-within {
  border-color: rgba(178, 196, 255, 0.46);
  box-shadow: 0 0 0 3px rgba(137, 158, 235, 0.11), inset 0 4px 18px rgba(0, 0, 0, 0.16);
}

::placeholder {
  color: rgba(211, 220, 246, 0.28);
}

.form-foot {
  margin-top: 24px;
}

.form-foot p {
  display: flex;
  gap: 7px;
  align-items: center;
  max-width: 450px;
  margin: 0;
  color: rgba(211, 219, 242, 0.48);
  font-size: 11px;
  line-height: 1.6;
}

.form-foot p svg {
  flex: 0 0 auto;
  color: #8be0bd;
}

.primary-btn {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 21px;
  border: 1px solid rgba(194, 208, 255, 0.34);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(96, 121, 216, 0.8), rgba(150, 86, 197, 0.76));
  color: #fff;
  font-size: 13px;
  font-weight: 620;
  box-shadow: 0 12px 30px rgba(34, 43, 87, 0.34), inset 0 1px rgba(255, 255, 255, 0.21);
  transition: transform 0.2s, filter 0.2s;
}

.primary-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.primary-btn:disabled,
.mini-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.wide-btn {
  width: 100%;
}

.button-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.flow-list {
  display: grid;
  gap: 19px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-list li {
  display: flex;
  gap: 13px;
  align-items: center;
}

.flow-list i {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: rgba(96, 120, 198, 0.12);
  color: #c2d2ff;
  font-size: 11px;
  font-style: normal;
}

.flow-list strong,
.flow-list span {
  display: block;
}

.flow-list strong {
  font-size: 13px;
}

.flow-list span {
  margin-top: 5px;
  color: rgba(215, 223, 246, 0.46);
  font-size: 11px;
  line-height: 1.5;
}

.privacy-box {
  display: flex;
  gap: 12px;
  margin-top: 25px;
  padding: 16px;
  border: 1px solid rgba(142, 224, 190, 0.14);
  border-radius: 16px;
  background: rgba(59, 152, 120, 0.07);
}

.privacy-box svg {
  flex: 0 0 21px;
  color: #8be0bd;
}

.privacy-box strong,
.privacy-box span {
  display: block;
  font-size: 12px;
}

.privacy-box span {
  margin-top: 5px;
  color: rgba(194, 226, 214, 0.52);
  font-size: 10px;
  line-height: 1.65;
}

.results-area {
  margin-top: 46px;
}

.results-head {
  margin-bottom: 16px;
  padding: 0 5px;
}

.results-head > span,
.results-tools > span {
  color: rgba(219, 227, 247, 0.48);
  font-size: 11px;
}

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

.empty {
  display: grid;
  min-height: 240px;
  grid-column: 1 / -1;
  place-items: center;
  align-content: center;
  padding: 30px;
  border-radius: 22px;
  text-align: center;
}

.empty-icon,
.lock-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 15px;
  place-items: center;
  border: 1px solid rgba(185, 201, 255, 0.15);
  border-radius: 17px;
  background: rgba(112, 134, 216, 0.1);
  color: rgba(191, 207, 248, 0.66);
}

.empty-icon svg {
  width: 26px;
  height: 26px;
}

.empty-icon.error {
  border-color: rgba(255, 156, 175, 0.18);
  background: rgba(150, 50, 73, 0.12);
  color: var(--red);
}

.empty strong {
  font-size: 15px;
}

.empty > span:last-child {
  max-width: 480px;
  margin-top: 8px;
  color: rgba(217, 224, 246, 0.46);
  font-size: 11px;
  line-height: 1.65;
}

.result-card {
  overflow: hidden;
  border-radius: 22px;
}

.result-media {
  position: relative;
  display: grid;
  min-height: 230px;
  place-items: center;
  background: rgba(2, 4, 10, 0.58);
}

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

.result-body {
  padding: 19px;
}

.result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.platform {
  padding: 5px 9px;
  border: 1px solid rgba(180, 199, 255, 0.18);
  border-radius: 99px;
  color: #c1d1ff;
  font-size: 10px;
}

.source-ok {
  color: #8be0bd;
  font-size: 11px;
}

.result-card h3 {
  overflow: hidden;
  margin: 13px 0 7px;
  font-size: 14px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 14px 0;
}

.result-meta span {
  padding: 8px 6px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.12);
  color: rgba(224, 231, 251, 0.58);
  font-size: 10px;
  text-align: center;
}

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

.secondary-btn {
  display: inline-flex;
  min-width: 0;
  min-height: 39px;
  flex: 1;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: rgba(13, 17, 29, 0.44);
  color: rgba(239, 243, 255, 0.82);
  font-size: 11px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.secondary-btn:hover {
  border-color: rgba(185, 201, 255, 0.25);
  background: rgba(30, 38, 64, 0.48);
}

.error-card {
  padding: 20px;
  border-color: rgba(255, 137, 157, 0.19);
  background: rgba(66, 19, 33, 0.3);
}

.error-card h3 {
  white-space: normal;
  overflow-wrap: anywhere;
}

.error-card p {
  color: rgba(255, 202, 213, 0.68);
  font-size: 12px;
  line-height: 1.7;
}

.error-advice {
  color: rgba(255, 202, 213, 0.42);
  font-size: 10px;
}

.loading-card {
  display: grid;
  min-height: 230px;
  place-items: center;
  text-align: center;
}

.loading-card p {
  margin: 12px 0 0;
  color: var(--soft);
  font-size: 12px;
}

.spinner {
  display: inline-block;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(200, 213, 255, 0.15);
  border-top-color: #c7d5ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.image-composer {
  min-height: 0;
  padding: 30px;
}

.composer-head {
  align-items: flex-start;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.composer-head h2 + p {
  max-width: 570px;
  margin: 7px 0 0;
  color: rgba(216, 224, 246, 0.48);
  font-size: 11px;
  line-height: 1.65;
}

.composer-step {
  margin-top: 0;
}

.field-heading {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.field-heading .step-number {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border: 1px solid rgba(185, 201, 255, 0.17);
  border-radius: 10px;
  background: rgba(105, 126, 202, 0.12);
  color: #c8d5ff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

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

.field-heading label {
  margin: 0;
  color: rgba(244, 246, 255, 0.92);
  font-size: 13px;
  font-weight: 620;
}

.field-heading small {
  display: block;
  margin-top: 4px;
  color: rgba(216, 224, 246, 0.42);
  font-size: 10px;
  line-height: 1.5;
}

.prompt-step {
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(6, 9, 18, 0.16);
}

.prompt-step .prompt-editor {
  min-height: 178px;
}

.composer-row {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(235px, 0.58fr);
  gap: 16px;
  margin-top: 16px;
}

.composer-row > .composer-step {
  min-width: 0;
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(6, 9, 18, 0.16);
}

.upload-zone {
  display: flex !important;
  gap: 12px;
  align-items: center;
  min-height: 104px;
  margin: 0 !important;
  padding: 14px 16px;
  border: 1px dashed rgba(190, 205, 247, 0.27);
  border-radius: 14px;
  background: rgba(7, 10, 19, 0.22);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.upload-zone:hover,
.upload-zone.is-dragging {
  border-color: rgba(185, 201, 255, 0.55);
  background: rgba(83, 102, 171, 0.12);
}

.upload-zone svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.upload-zone span,
.upload-zone small {
  display: block;
}

.upload-zone small {
  margin-top: 5px;
  color: rgba(220, 228, 248, 0.42);
  font-size: 10px;
}

.image-previews {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.image-previews:empty {
  display: none;
}

.video-generation-workspace {
  scroll-margin-top: 104px;
}

.video-composer {
  position: relative;
  overflow: hidden;
}

.video-composer::before {
  position: absolute;
  top: -180px;
  right: -150px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(132, 99, 213, 0.13), transparent 68%);
  pointer-events: none;
  content: "";
}

.video-ai-icon {
  border-color: rgba(238, 212, 162, 0.2);
  background: linear-gradient(145deg, rgba(99, 118, 207, 0.21), rgba(153, 91, 183, 0.18));
  color: #f2dcb4;
  box-shadow: 0 8px 26px rgba(91, 66, 154, 0.18);
}

.video-head-stats {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.premium-chip {
  border-color: rgba(241, 214, 163, 0.25);
  background: linear-gradient(135deg, rgba(94, 67, 151, 0.25), rgba(135, 89, 48, 0.16));
  color: #f6ddb0;
}

.video-composer-row {
  grid-template-columns: minmax(0, 1.38fr) minmax(240px, 0.62fr);
}

.video-settings-step {
  display: flex;
  flex-direction: column;
}

.compact-field {
  margin: 0 0 10px !important;
}

.compact-field > span {
  display: block;
  margin: 0 0 6px;
  color: rgba(216, 224, 246, 0.46);
  font-size: 9px;
}

.compact-field select {
  height: 48px;
}

.video-output-ready {
  margin-top: auto;
}

.noncancel-notice {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 13px 15px;
  border: 1px solid rgba(244, 205, 135, 0.13);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(116, 82, 37, 0.08), rgba(54, 43, 78, 0.09));
}

.noncancel-notice svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: #e8c98e;
}

.noncancel-notice strong,
.noncancel-notice span {
  display: block;
}

.noncancel-notice strong {
  color: rgba(249, 231, 197, 0.85);
  font-size: 11px;
}

.noncancel-notice span {
  margin-top: 4px;
  color: rgba(232, 221, 204, 0.45);
  font-size: 9px;
  line-height: 1.65;
}

.media-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 9px;
}

.media-preview {
  position: relative;
  min-width: 0;
  min-height: 96px;
  overflow: hidden;
  border: 1px solid rgba(190, 205, 247, 0.14);
  border-radius: 13px;
  background: rgba(3, 6, 13, 0.35);
}

.media-preview-main {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 96px;
  padding: 0;
  place-items: center;
  background: transparent;
  color: #eef2ff;
  text-align: left;
}

.media-preview img,
.media-preview video {
  display: block;
  width: 100%;
  height: 96px;
  object-fit: cover;
}

.media-preview-audio {
  display: grid;
  width: 100%;
  height: 96px;
  place-items: center;
  background: linear-gradient(145deg, rgba(79, 99, 176, 0.2), rgba(128, 76, 159, 0.15));
}

.media-preview-audio svg {
  width: 27px;
  height: 27px;
  opacity: 0.75;
}

.media-preview-label {
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  overflow: hidden;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(2, 4, 9, 0.77);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-preview .remove-image-button {
  z-index: 2;
}

.media-mention-menu button > .mention-media-thumb {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  overflow: hidden;
  place-items: center;
  border-radius: 8px;
  background: rgba(93, 111, 183, 0.18);
}

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

.mention-media-thumb svg {
  width: 19px;
  height: 19px;
  color: #cbd7ff;
}

.prompt-mention.media-mention svg {
  width: 18px;
  height: 18px;
  margin: 3px;
  color: #d5deff;
}

.queue-panel {
  position: sticky;
  top: 104px;
  overflow: hidden;
}

.queue-panel::before {
  position: absolute;
  top: -90px;
  right: -90px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(100, 211, 173, 0.11), transparent 68%);
  pointer-events: none;
  content: "";
}

.queue-live {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  color: #9ce8c7;
  font-size: 9px;
  letter-spacing: 0.1em;
}

.queue-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(139, 224, 189, 0.72);
  animation: queue-pulse 1.8s ease-in-out infinite;
}

.queue-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.queue-overview > div {
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(3, 6, 13, 0.22);
}

.queue-overview span,
.queue-overview small,
.queue-overview strong {
  display: block;
}

.queue-overview span,
.queue-overview small {
  color: rgba(216, 224, 246, 0.4);
  font-size: 9px;
}

.queue-overview strong {
  margin: 7px 0 4px;
  color: #f4f6ff;
  font-size: 24px;
}

.queue-current {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid rgba(185, 201, 255, 0.12);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(91, 109, 178, 0.12), rgba(91, 57, 126, 0.08));
}

.queue-current > span,
.queue-current > strong,
.queue-current > small {
  display: block;
}

.queue-current > span {
  color: rgba(214, 223, 246, 0.4);
  font-size: 9px;
}

.queue-current > strong {
  margin-top: 6px;
  font-size: 12px;
}

.queue-current > small {
  margin-top: 5px;
  color: rgba(214, 223, 246, 0.46);
  font-size: 9px;
  line-height: 1.55;
}

.queue-progress,
.task-progress {
  height: 6px;
  overflow: hidden;
  margin-top: 13px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
}

.queue-progress i,
.task-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6c83de, #9b68c8, #dfbd7d);
  box-shadow: 0 0 12px rgba(141, 108, 202, 0.4);
  transition: width 0.45s ease;
}

.queue-policy {
  margin-top: 18px;
}

.video-task-card .result-media {
  min-height: 220px;
}

.video-task-card .task-progress {
  margin: 15px 0 5px;
}

.video-task-card .task-progress-copy {
  display: flex;
  justify-content: space-between;
  color: rgba(220, 228, 248, 0.46);
  font-size: 9px;
}

.video-task-card .task-note {
  min-height: 0;
  margin: 11px 0 0;
  color: rgba(220, 228, 248, 0.56);
  font-size: 10px;
  line-height: 1.65;
}

.video-task-card.error-card .task-error-advice {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 220, 188, 0.58);
}

.task-error-details {
  overflow: hidden;
  margin-top: 14px;
  border: 1px solid rgba(255, 194, 157, 0.16);
  border-radius: 14px;
  background: rgba(8, 10, 18, 0.28);
}

.task-error-details summary {
  position: relative;
  display: flex;
  gap: 5px;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  min-height: 58px;
  padding: 10px 42px 10px 14px;
  color: rgba(255, 231, 217, 0.88);
  cursor: pointer;
  list-style: none;
  transition: background 0.2s;
}

.task-error-details summary::-webkit-details-marker {
  display: none;
}

.task-error-details summary::after {
  position: absolute;
  top: 50%;
  right: 16px;
  color: rgba(255, 220, 199, 0.66);
  font-size: 17px;
  content: "+";
  transform: translateY(-50%);
}

.task-error-details[open] summary::after {
  content: "−";
}

.task-error-details summary:hover {
  background: rgba(151, 77, 83, 0.09);
}

.task-error-details summary span,
.task-error-details summary small {
  display: block;
}

.task-error-details summary span {
  font-size: 11px;
  font-weight: 650;
}

.task-error-details summary small {
  color: rgba(238, 217, 207, 0.43);
  font-size: 9px;
}

.task-error-detail-body {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.task-error-detail-body dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.task-error-detail-body dl > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.12);
}

.task-error-detail-body dt,
.task-error-detail-body dd {
  margin: 0;
}

.task-error-detail-body dt {
  color: rgba(230, 213, 207, 0.4);
  font-size: 8px;
}

.task-error-detail-body dd {
  margin-top: 5px;
  color: rgba(255, 235, 225, 0.76);
  font-size: 9px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.task-error-detail-body code {
  color: #ffd1bc;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.upstream-error-message {
  margin-top: 9px;
}

.upstream-error-message > span {
  color: rgba(230, 213, 207, 0.44);
  font-size: 8px;
}

.upstream-error-message pre {
  max-height: 190px;
  overflow: auto;
  margin: 6px 0 0;
  padding: 11px;
  border: 1px solid rgba(255, 182, 162, 0.11);
  border-radius: 10px;
  background: rgba(1, 3, 8, 0.4);
  color: rgba(255, 227, 215, 0.76);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@keyframes queue-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.08); }
}

.ratio-select-shell {
  position: relative;
}

.ratio-select-shell select {
  height: 56px;
  padding-right: 90px;
  font-weight: 570;
}

.ratio-select-shell > span {
  position: absolute;
  top: 50%;
  right: 13px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
  color: rgba(216, 224, 246, 0.36);
  font-size: 9px;
  pointer-events: none;
  transform: translateY(-50%);
}

.output-ready {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(139, 224, 189, 0.11);
  border-radius: 13px;
  background: rgba(56, 150, 117, 0.055);
}

.output-ready > i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(139, 224, 189, 0.54);
}

.output-ready strong,
.output-ready small {
  display: block;
}

.output-ready strong {
  color: rgba(234, 247, 241, 0.78);
  font-size: 10px;
}

.output-ready small {
  margin-top: 3px;
  color: rgba(211, 231, 222, 0.4);
  font-size: 9px;
  line-height: 1.4;
}

.composer-actions {
  margin-top: 18px;
  padding: 15px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.composer-actions .primary-btn {
  min-width: 154px;
  min-height: 50px;
}

.image-preview {
  position: relative;
  width: 80px;
  height: 80px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
}

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

.preview-image-button {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  background: transparent;
  color: #fff;
}

.preview-image-button span {
  position: absolute;
  right: 4px;
  bottom: 4px;
  left: 4px;
  overflow: hidden;
  padding: 3px 4px;
  border-radius: 6px;
  background: rgba(2, 4, 9, 0.72);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-image-button {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  background: rgba(2, 4, 9, 0.78);
  color: #fff;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(2, 4, 9, 0.84);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.image-lightbox figure {
  display: grid;
  max-width: min(1100px, 92vw);
  max-height: 88vh;
  gap: 10px;
  margin: 0;
  place-items: center;
}

.image-lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(88vh - 42px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  object-fit: contain;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.58);
}

.image-lightbox figcaption {
  color: rgba(232, 237, 252, 0.64);
  font-size: 11px;
}

.lightbox-close {
  position: fixed;
  top: 22px;
  right: 22px;
  display: grid;
  width: 42px;
  height: 42px;
  z-index: 1;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 13px;
  background: rgba(15, 20, 33, 0.8);
  color: #fff;
}

.feature-lock {
  display: grid;
  min-height: 350px;
  place-items: center;
  align-content: center;
  padding: 34px;
  text-align: center;
}

.lock-icon {
  color: #d6b5ff;
}

.lock-icon svg {
  width: 26px;
  height: 26px;
}

.feature-lock h3 {
  margin: 2px 0 10px;
  font-size: 18px;
}

.feature-lock p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.membership-panel {
  position: sticky;
  top: 104px;
  overflow: hidden;
}

.membership-panel::before {
  position: absolute;
  top: -80px;
  right: -90px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(160, 108, 205, 0.14), transparent 68%);
  pointer-events: none;
  content: "";
}

.membership-mark {
  position: relative;
  z-index: 1;
  padding: 5px 8px;
  border: 1px solid rgba(206, 178, 242, 0.16);
  border-radius: 99px;
  color: rgba(222, 200, 250, 0.56);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.tier-card {
  padding: 19px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(112, 132, 209, 0.2), rgba(145, 88, 188, 0.15));
}

.tier-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.tier-emblem {
  display: grid !important;
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  place-items: center;
  border: 1px solid rgba(201, 181, 244, 0.2);
  border-radius: 14px;
  background: rgba(103, 84, 174, 0.18);
  color: #d9c9ff !important;
}

.tier-emblem svg {
  width: 19px;
  height: 19px;
}

.tier-card .tier-card-head strong {
  margin: 5px 0 0;
  font-size: 18px;
}

.tier-card > small {
  margin-top: 14px;
}

.tier-signature {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 17px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.tier-card .tier-signature span {
  color: rgba(221, 226, 245, 0.34);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.tier-signature b {
  color: rgba(223, 231, 252, 0.68);
  font-size: 9px;
  font-weight: 600;
}

.tier-card.advanced {
  border-color: rgba(235, 207, 168, 0.25);
  background: linear-gradient(145deg, rgba(99, 78, 170, 0.32), rgba(149, 83, 165, 0.22) 58%, rgba(137, 99, 52, 0.18));
  box-shadow: 0 22px 50px rgba(24, 14, 39, 0.24), inset 0 1px rgba(255, 255, 255, 0.12);
}

.tier-card.advanced .tier-emblem {
  border-color: rgba(241, 214, 163, 0.32);
  background: linear-gradient(145deg, rgba(128, 101, 218, 0.48), rgba(183, 111, 191, 0.31), rgba(185, 139, 77, 0.23));
  color: #fff0d1 !important;
  box-shadow: 0 10px 28px rgba(67, 39, 100, 0.3);
}

.tier-card.advanced .tier-card-head strong {
  color: #fff3df;
}

.tier-card.advanced .tier-signature b {
  color: var(--premium);
}

.quota-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  align-items: end;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 15px;
  background: rgba(5, 8, 16, 0.18);
}

.quota-panel span {
  color: rgba(220, 227, 247, 0.56);
  font-size: 10px;
}

.quota-panel strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: #eef2ff;
  font-size: 18px;
  font-weight: 650;
}

.quota-panel small {
  color: rgba(216, 224, 246, 0.34);
  font-size: 9px;
}

body.member-advanced .membership-mark {
  border-color: rgba(241, 214, 163, 0.28);
  background: rgba(132, 92, 151, 0.18);
  color: var(--premium);
}

body.member-advanced .quota-panel {
  border-color: rgba(139, 224, 189, 0.13);
  background: linear-gradient(135deg, rgba(41, 111, 87, 0.09), rgba(69, 47, 90, 0.1));
}

body.member-advanced .quota-panel strong {
  color: #a9edcf;
}

.tier-card span,
.tier-card strong,
.tier-card small {
  display: block;
}

.tier-card span {
  color: var(--muted);
  font-size: 11px;
}

.tier-card strong {
  margin: 8px 0;
  font-size: 20px;
}

.tier-card small {
  color: rgba(220, 228, 249, 0.48);
  font-size: 11px;
  line-height: 1.65;
}

.policy-list {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  color: rgba(226, 232, 250, 0.64);
  font-size: 12px;
}

.policy-list li {
  display: flex;
  gap: 10px;
  align-items: center;
}

.policy-list i {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(139, 224, 189, 0.15);
  border-radius: 50%;
  background: rgba(79, 170, 134, 0.09);
  color: #9ae4c4;
  box-shadow: 0 0 10px rgba(119, 222, 181, 0.12);
}

.policy-list i::after {
  font-size: 9px;
  font-style: normal;
  content: "✓";
}

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

.mini-btn {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(13, 17, 29, 0.5);
  color: rgba(239, 243, 255, 0.76);
  font-size: 11px;
}

.mini-btn:hover {
  border-color: rgba(178, 196, 255, 0.34);
  color: #fff;
}

.primary-mini {
  border-color: rgba(185, 201, 255, 0.26);
  background: rgba(108, 128, 207, 0.28);
}

.task-time {
  color: rgba(216, 224, 246, 0.44);
  font-size: 10px;
}

.task-prompt {
  display: -webkit-box;
  overflow: hidden;
  min-height: 46px;
  margin: 13px 0 0;
  color: rgba(238, 242, 255, 0.8);
  font-size: 13px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.task-note {
  margin: 10px 0 0;
  color: rgba(216, 224, 246, 0.54);
  font-size: 11px;
  line-height: 1.7;
}

.task-footer {
  margin-top: 17px;
}

.task-refunded {
  color: #9ce8c7;
  font-size: 10px;
}

.task-status.failed,
.task-status.error,
.task-status.cancelled,
.task-status.interrupted {
  color: #ff9caf;
}

.task-loading {
  align-content: center;
  gap: 13px;
  color: var(--soft);
  font-size: 12px;
}

footer {
  display: flex;
  justify-content: space-between;
  width: min(1160px, calc(100% - 34px));
  margin: 0 auto;
  padding: 24px 0 calc(34px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(218, 226, 248, 0.38);
  font-size: 11px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(2, 4, 9, 0.66);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 90;
  width: min(480px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  padding: 36px;
  border-radius: 28px;
  transform: translate(-50%, -50%);
}

.modal-mark {
  margin-bottom: 20px;
}

.modal-kicker {
  margin: 0;
  color: rgba(193, 207, 244, 0.52) !important;
  font-size: 11px !important;
  letter-spacing: 0.08em;
}

.modal h2 {
  margin: 8px 0 10px;
  font-size: 27px;
  letter-spacing: -0.02em;
}

.modal-description {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.auth-tabs {
  margin-top: 24px;
}

.modal form {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.modal label {
  margin-top: 6px;
  color: rgba(237, 241, 255, 0.76);
  font-size: 12px;
  font-weight: 500;
}

.modal .primary-btn {
  margin-top: 11px;
}

.auth-help {
  margin: 7px 0 0;
  color: rgba(216, 225, 247, 0.52);
  font-size: 11px;
  line-height: 1.75;
}

.registration-result {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(139, 224, 189, 0.18);
  border-radius: 15px;
  background: rgba(63, 178, 137, 0.08);
}

.registration-result span {
  color: rgba(216, 233, 226, 0.6);
  font-size: 11px;
}

.registration-result .success-label {
  color: #9ce8c7;
  font-size: 13px;
  font-weight: 600;
}

.registration-result p {
  margin: 0 0 5px;
  color: rgba(216, 233, 226, 0.58);
  font-size: 11px;
  line-height: 1.65;
}

.registration-result strong {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.registration-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.form-error {
  display: block;
  min-height: 19px;
  margin-top: 11px;
  color: var(--red);
  font-size: 11px;
  line-height: 1.55;
}

.modal-security {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  margin: 3px 0 0;
  color: rgba(216, 225, 247, 0.36);
  font-size: 10px;
}

.modal-security svg {
  color: rgba(139, 224, 189, 0.6);
}

#turnstile-container {
  margin-top: 14px;
}

.theme-panel {
  position: fixed;
  top: 98px;
  right: max(18px, calc((100vw - 1220px) / 2));
  z-index: 60;
  width: min(350px, calc(100% - 28px));
  padding: 22px;
  border-radius: 22px;
}

.section-head.compact {
  margin-bottom: 17px;
}

.theme-preview {
  position: relative;
  height: 160px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.theme-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.theme-preview span {
  position: absolute;
  right: 9px;
  bottom: 9px;
  padding: 6px 9px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.6);
  font-size: 10px;
}

.theme-panel > label {
  display: flex;
  justify-content: space-between;
  margin: 19px 0 11px;
  color: rgba(236, 240, 255, 0.72);
  font-size: 12px;
}

.theme-panel input[type="range"] {
  height: 5px;
  padding: 0;
  accent-color: #b8c9ff;
}

.theme-panel > p {
  margin: 15px 0 0;
  color: rgba(219, 226, 246, 0.48);
  font-size: 11px;
  line-height: 1.7;
}

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: grid;
  width: min(370px, calc(100% - 36px));
  gap: 9px;
}

.toast {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(18, 23, 37, 0.94);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
  color: rgba(244, 247, 255, 0.9);
  font-size: 12px;
  line-height: 1.5;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  animation: toast-in 0.2s;
}

.toast.success {
  border-color: rgba(139, 224, 189, 0.24);
}

.toast.error {
  border-color: rgba(255, 137, 157, 0.25);
  color: #ffc0cb;
}

[hidden] {
  display: none !important;
}

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

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

@keyframes welcome-arrive {
  0% { opacity: 0; transform: translateY(12px) scale(0.985); filter: blur(5px); }
  55% { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes welcome-sheen {
  0% { transform: translateX(-110%); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: translateX(110%); opacity: 0; }
}

@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .glass { background: rgba(16, 21, 34, 0.95); }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .product-tabs {
    position: fixed;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 12px;
    z-index: 70;
    justify-content: center;
    background: rgba(14, 18, 30, 0.88);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.52);
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
  }

  .product-tab {
    flex: 1;
    justify-content: center;
  }

  .product-tab span {
    white-space: nowrap;
  }

  .connection {
    display: none;
  }

  main {
    padding-top: 74px;
  }

  body.image-workspace-active main {
    width: min(calc(100% - 24px), 760px);
    padding-top: 52px;
  }

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

  .full-span {
    grid-column: auto;
  }

  .workspace-aside {
    order: 2;
  }

  .membership-panel {
    position: relative;
    top: auto;
  }

  .queue-panel {
    position: relative;
    top: auto;
  }

  .results-area {
    order: 3;
  }

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

  footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 620px) {
  .topbar {
    top: 7px;
    width: calc(100% - 14px);
    min-height: 60px;
    margin-top: 7px;
    border-radius: 18px;
  }

  .brand-icon {
    width: 38px;
    height: 38px;
  }

  .brand small,
  .account-button span {
    display: none;
  }

  .product-tab {
    min-width: 0;
    gap: 5px;
    padding: 0 7px;
    font-size: 10px;
  }

  .product-tab b {
    display: none;
  }

  .account-button {
    width: 42px;
    padding: 0;
  }

  .member-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 27px;
    padding: 3px 5px;
    font-size: 0;
    text-align: center;
  }

  .member-badge::after {
    content: attr(data-short);
    font-size: 8px;
  }

  .top-actions {
    gap: 6px;
  }

  main {
    width: calc(100% - 20px);
    padding-bottom: 54px;
  }

  body.image-workspace-active main {
    width: calc(100% - 20px);
    padding-top: 42px;
  }

  .hero {
    margin-bottom: 48px;
  }

  .hero-kicker {
    font-size: 10px;
  }

  .hero h1 {
    font-size: clamp(40px, 12vw, 56px);
  }

  body.image-workspace-active .hero h1 {
    font-size: clamp(36px, 11vw, 48px);
  }

  body.image-workspace-active .hero h1 br {
    display: initial;
  }

  body.image-workspace-active .hero h1 em {
    margin-left: 0;
  }

  .hero p {
    font-size: 13px;
    line-height: 1.8;
  }

  .hero-metrics {
    flex-wrap: wrap;
  }

  .member-welcome {
    align-items: flex-start;
    padding: 13px;
  }

  .member-welcome p {
    font-size: 9px;
  }

  .welcome-tier {
    display: none;
  }

  .workspace-main,
  .workspace-aside {
    padding: 20px;
    border-radius: 20px;
  }

  .image-composer {
    padding: 18px;
  }

  .composer-head {
    margin-bottom: 20px;
    padding-bottom: 16px;
  }

  .composer-head h2 + p {
    font-size: 10px;
  }

  .prompt-step,
  .composer-row > .composer-step {
    padding: 14px;
  }

  .prompt-step .prompt-editor {
    min-height: 160px;
  }

  .section-head {
    align-items: flex-start;
  }

  .section-icon {
    display: none;
  }

  .status-chip {
    font-size: 10px;
  }

  .form-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .form-foot .primary-btn {
    width: 100%;
  }

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

  .video-composer-row {
    grid-template-columns: 1fr;
  }

  .video-head-stats {
    align-items: flex-end;
    flex-direction: column;
  }

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

  .task-error-detail-body dl {
    grid-template-columns: 1fr;
  }

  .prompt-toolbar > span:nth-last-child(2) {
    display: none;
  }

  .image-mention-menu {
    width: 100%;
  }

  .result-media video,
  .result-media img {
    height: 250px;
  }

  .result-meta {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-actions {
    flex-wrap: wrap;
  }

  .secondary-btn {
    min-width: calc(50% - 4px);
  }

  .results-head {
    align-items: flex-end;
  }

  .results-tools {
    align-items: flex-end;
    flex-direction: column;
  }

  footer {
    width: calc(100% - 22px);
    align-items: center;
    flex-direction: column;
    gap: 7px;
    text-align: center;
  }

  .modal {
    padding: 25px;
    border-radius: 23px;
  }

  .modal h2 {
    font-size: 24px;
  }

  .theme-panel {
    top: auto;
    right: 7px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    left: 7px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
