:root {
  color-scheme: dark;
  --bg: #07090d;
  --panel: rgba(18, 22, 28, .82);
  --panel-strong: rgba(24, 29, 38, .94);
  --panel-soft: rgba(255, 255, 255, .055);
  --line: rgba(255, 255, 255, .11);
  --line-strong: rgba(94, 234, 212, .34);
  --text: #f5f8ff;
  --muted: #9ca7b8;
  --muted-2: #687386;
  --lime: #5eead4;
  --cyan: #7aa7ff;
  --pink: #d77bff;
  --orange: #ff9b45;
  --danger: #ff6b6b;
  --ok: #61e8a0;
  --shadow: 0 22px 80px rgba(0, 0, 0, .48);
  --tile-min: 168px;
  --tile-size: 168px;
  --grid-cols: 6;
  --composer-safe-space: 208px;
  --chat-composer-safe-space: 286px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(94, 234, 212, .42) rgba(255, 255, 255, .045);
}

*::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .035);
}

*::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(94, 234, 212, .72), rgba(122, 167, 255, .46));
}

*::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% -10%, rgba(122, 167, 255, .16), transparent 30rem),
    radial-gradient(circle at 84% 6%, rgba(94, 234, 212, .12), transparent 30rem),
    linear-gradient(180deg, #07090d 0%, #0b0e13 48%, #07090d 100%);
  color: var(--text);
}

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

button,
select,
input,
textarea {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, .07);
}

button {
  cursor: pointer;
}

button:focus {
  outline: none;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 1px solid rgba(94, 234, 212, .55);
  outline-offset: 2px;
}

textarea {
  resize: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

body.guest-view {
  overflow: auto;
  background: #05070b;
}

body.auth-view {
  overflow: hidden;
}

.private-shell {
  min-height: 100vh;
}

.landing-page {
  min-height: 100vh;
  padding: 12px 0 28px;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0%, rgba(94, 234, 212, .11), transparent 340px),
    linear-gradient(180deg, #05070b 0%, #070a0f 48%, #05070b 100%),
    #05070b;
}

.landing-stage {
  width: min(1080px, calc(100vw - 18px));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 6px;
  background: rgba(8, 11, 16, .94);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, .1),
    0 32px 120px rgba(0, 0, 0, .62);
}

.landing-nav {
  z-index: 20;
  position: relative;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  background: rgba(5, 7, 11, .66);
  backdrop-filter: blur(20px);
}

.landing-brand,
.landing-links,
.landing-nav-login {
  display: inline-flex;
  align-items: center;
}

.landing-brand {
  flex: 0 0 auto;
  gap: 9px;
  color: rgba(245, 248, 255, .95);
  font-size: 14px;
  font-weight: 860;
}

.landing-brand-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  color: #071014;
  background: linear-gradient(135deg, var(--lime), var(--cyan));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, .42),
    inset 0 -8px 16px rgba(0, 0, 0, .18),
    0 14px 34px rgba(57, 217, 255, .18);
}

.landing-links {
  flex: 1 1 auto;
  justify-content: center;
  gap: 26px;
  min-width: 0;
}

.landing-links a {
  color: rgba(239, 245, 247, .74);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.landing-links a:hover {
  color: var(--lime);
}

.landing-nav-login {
  flex: 0 0 auto;
  position: relative;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  color: rgba(239, 245, 247, .92);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .04)),
    rgba(18, 23, 31, .8);
  box-shadow: inset 0 1px rgba(255, 255, 255, .12), 0 10px 26px rgba(0, 0, 0, .3);
  font-size: 12px;
  font-weight: 820;
}

.landing-nav-login:hover {
  border-color: rgba(94, 234, 212, .42);
  color: #071014;
  background: linear-gradient(135deg, rgba(94, 234, 212, .95), rgba(57, 217, 255, .82));
}

.landing-plane,
.landing-telegram-icon {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #4ad8ff, #2f83ff);
  box-shadow: inset 0 1px rgba(255, 255, 255, .42);
}

.landing-plane {
  width: 18px;
  height: 18px;
}

.landing-plane::before,
.landing-telegram-icon::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid #fff;
}

.landing-hero {
  position: relative;
  min-height: 718px;
  padding: 160px 92px 120px;
  overflow: hidden;
  isolation: isolate;
}

.landing-hero-bg,
.landing-hero-shade {
  position: absolute;
  inset: 0;
}

.landing-hero-bg {
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.04) contrast(1.04);
}

.landing-hero-shade {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(5, 7, 11, .82) 0%, rgba(5, 7, 11, .54) 45%, rgba(5, 7, 11, .22) 72%, rgba(5, 7, 11, .5) 100%),
    linear-gradient(180deg, rgba(5, 7, 11, .08) 0%, rgba(5, 7, 11, .22) 46%, rgba(5, 7, 11, .9) 100%);
}

.landing-hero-content {
  position: relative;
  z-index: 1;
  width: min(650px, 100%);
}

.landing-kicker,
.landing-note,
.landing-thumb-rail article div,
.landing-feature-grid p,
.landing-model-grid span {
  margin: 0;
}

.landing-kicker {
  margin-bottom: 12px;
  color: var(--lime);
  font-size: 12px;
  font-weight: 880;
  text-transform: uppercase;
}

.landing-hero h1 {
  margin: 0;
  max-width: 610px;
  font-size: 60px;
  line-height: 1.05;
  letter-spacing: 0;
}

.landing-hero h1 span,
.landing-section h2 span {
  color: var(--lime);
}

.landing-feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.landing-feature-chips span {
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(94, 234, 212, .2);
  border-radius: 8px;
  color: rgba(245, 248, 255, .88);
  background: rgba(5, 7, 11, .46);
  box-shadow: inset 0 1px rgba(255, 255, 255, .08);
  font-size: 12px;
  font-weight: 760;
}

.landing-auth-wrap {
  position: relative;
  width: 260px;
  height: 66px;
  margin-top: 42px;
}

.landing-telegram-button {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(94, 234, 212, .72);
  border-radius: 8px;
  color: rgba(245, 248, 255, .96);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .08) 42%, rgba(0, 0, 0, .26)),
    linear-gradient(135deg, rgba(57, 217, 255, .42), rgba(94, 234, 212, .22)),
    rgba(31, 38, 47, .9);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, .44),
    inset 0 -14px 22px rgba(0, 0, 0, .26),
    0 0 0 2px rgba(94, 234, 212, .12),
    0 20px 44px rgba(0, 0, 0, .5),
    0 0 30px rgba(94, 234, 212, .32);
  font-size: 16px;
  font-weight: 860;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.landing-auth-wrap:hover .landing-telegram-button {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, .48),
    inset 0 -14px 22px rgba(0, 0, 0, .24),
    0 0 0 2px rgba(94, 234, 212, .16),
    0 22px 50px rgba(0, 0, 0, .54),
    0 0 40px rgba(94, 234, 212, .42);
}

.landing-auth-option:hover .landing-telegram-button {
  transform: translateY(-1px);
}

.landing-telegram-icon {
  width: 28px;
  height: 28px;
}

.landing-telegram-hitbox {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  border-radius: 8px;
}

.landing-telegram-hitbox iframe {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  opacity: .01;
}

.landing-note {
  margin-top: 14px;
  color: rgba(245, 248, 255, .72);
  font-size: 12px;
}

.landing-auth-dialog {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(2, 4, 8, .74);
  backdrop-filter: blur(18px);
}

.landing-auth-panel {
  position: relative;
  width: min(560px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .035)),
    rgba(12, 16, 22, .96);
  box-shadow: 0 32px 110px rgba(0, 0, 0, .72), 0 0 40px rgba(94, 234, 212, .12);
}

.landing-auth-panel h2 {
  margin: 0 0 12px;
  font-size: 28px;
}

.landing-auth-panel p {
  margin: 0;
  color: rgba(221, 230, 242, .82);
  font-size: 14px;
  line-height: 1.55;
}

.landing-auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  color: rgba(245, 248, 255, .86);
  background: rgba(255, 255, 255, .06);
  font-size: 20px;
}

.landing-auth-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.landing-auth-option,
.landing-google-button {
  position: relative;
  min-height: 64px;
  border-radius: 8px;
}

.landing-google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, .16);
  color: rgba(245, 248, 255, .94);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05)),
    rgba(255, 255, 255, .07);
  box-shadow: inset 0 1px rgba(255, 255, 255, .14), 0 16px 36px rgba(0, 0, 0, .28);
}

.landing-google-button:hover {
  border-color: rgba(57, 217, 255, .44);
  transform: translateY(-1px);
}

.landing-google-button span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #10141a;
  background: #fff;
  font-weight: 900;
}

.landing-google-button strong {
  font-size: 15px;
}

.landing-sound-card {
  position: absolute;
  top: 58px;
  right: 38px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  color: rgba(245, 248, 255, .86);
  background: rgba(5, 7, 11, .5);
  backdrop-filter: blur(16px);
  font-size: 12px;
  font-weight: 760;
}

.landing-sound-card strong {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  font-size: 11px;
}

.landing-thumb-rail {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 22px;
  z-index: 2;
  display: grid;
  grid-template-columns: 28px repeat(6, minmax(0, 1fr)) 28px;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(7, 10, 15, .72);
  box-shadow: inset 0 1px rgba(255, 255, 255, .09), 0 20px 60px rgba(0, 0, 0, .46);
  backdrop-filter: blur(20px);
}

.landing-arrow {
  width: 28px;
  min-height: 84px;
  border: 0;
  border-radius: 6px;
  color: rgba(239, 245, 247, .86);
  background: rgba(255, 255, 255, .05);
  font-size: 24px;
}

.landing-thumb-rail article,
.landing-feature-grid article,
.landing-model-grid article {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 8px;
  background: rgba(255, 255, 255, .055);
}

.landing-thumb-rail article {
  height: 96px;
}

.landing-thumb-rail img,
.landing-thumb-rail video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.landing-thumb-rail article::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, .82));
  pointer-events: none;
}

.landing-thumb-rail article div {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 7px;
  z-index: 1;
  min-width: 0;
}

.landing-thumb-rail article span {
  display: inline-flex;
  padding: 2px 5px;
  border-radius: 6px;
  color: var(--lime);
  background: rgba(5, 7, 11, .72);
  font-size: 10px;
  font-weight: 850;
}

.landing-thumb-rail article strong {
  display: block;
  overflow: hidden;
  color: rgba(245, 248, 255, .92);
  font-size: 10px;
  font-weight: 720;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.landing-section {
  padding: 58px 20px 0;
}

.landing-section h2 {
  width: min(560px, 100%);
  margin: 0 auto 26px;
  text-align: center;
  font-size: 25px;
  line-height: 1.22;
  letter-spacing: 0;
}

.landing-feature-grid,
.landing-model-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.landing-feature-grid article {
  min-height: 144px;
  padding: 18px;
}

.landing-feature-grid article > span {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 7px;
  color: var(--lime);
  background: rgba(94, 234, 212, .11);
  box-shadow: inset 0 1px rgba(255, 255, 255, .12);
  font-weight: 850;
}

.landing-feature-grid strong,
.landing-model-grid strong {
  display: block;
  color: rgba(245, 248, 255, .95);
  font-size: 13px;
}

.landing-feature-grid p {
  margin-top: 10px;
  color: rgba(191, 202, 219, .78);
  font-size: 12px;
  line-height: 1.45;
}

.landing-models {
  padding-bottom: 0;
}

.landing-model-grid article {
  min-height: 266px;
  padding: 10px;
}

.landing-model-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  border-radius: 7px;
  object-fit: cover;
}

.landing-model-grid div {
  padding: 12px 4px 2px;
}

.landing-model-grid span {
  display: block;
  margin-top: 5px;
  color: rgba(191, 202, 219, .76);
  font-size: 11px;
  line-height: 1.35;
}

.landing-tariff-grid article,
.landing-spending-table {
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 8px;
  background: rgba(255, 255, 255, .055);
  box-shadow: inset 0 1px rgba(255, 255, 255, .08);
}

.landing-tariffs {
  padding-bottom: 30px;
}

.landing-tariff-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.landing-tariff-group {
  display: grid;
  gap: 12px;
}

.landing-tariff-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.landing-tariff-heading h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.landing-tariff-heading p {
  max-width: 520px;
  margin: 0;
  color: rgba(191, 202, 219, .78);
  font-size: 13px;
  line-height: 1.45;
  text-align: right;
}

.landing-tariff-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.landing-tariff-grid article {
  min-height: 210px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.landing-tariff-grid h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.landing-tariff-price {
  margin-top: 14px;
  color: var(--lime);
  font-size: 24px;
  font-weight: 900;
}

.landing-tariff-meta {
  margin-top: 10px;
  color: rgba(191, 202, 219, .78);
  font-size: 12px;
  line-height: 1.45;
}

.landing-tariff-grid ul {
  margin: 12px 0 14px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  color: rgba(221, 230, 242, .84);
  font-size: 12px;
  line-height: 1.35;
}

.landing-tariff-grid li::before {
  content: "• ";
  color: var(--lime);
  font-weight: 900;
}

.landing-pay-button {
  width: 100%;
  min-height: 38px;
  margin-top: auto;
  border: 0;
  border-radius: 8px;
  color: #07100c;
  background: linear-gradient(135deg, var(--lime), #80f4e4 58%, #7aa7ff);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(120, 255, 150, .18);
  transition: transform .18s ease, filter .18s ease;
}

.landing-pay-button:hover {
  transform: translateY(-1px) scale(1.02);
  filter: brightness(1.04);
}

.landing-pay-button:disabled {
  cursor: wait;
  opacity: .72;
  transform: none;
  filter: saturate(.86);
}

.landing-spending-table {
  padding: 14px;
}

.landing-spending-table strong {
  display: block;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, .94);
  font-size: 13px;
}

.landing-spending-table div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.landing-spending-table span {
  color: rgba(191, 202, 219, .82);
  font-size: 12px;
  line-height: 1.35;
}

.announce {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(239, 245, 255, .86);
  background:
    linear-gradient(90deg, rgba(94, 234, 212, .16), rgba(122, 167, 255, .12) 54%, rgba(215, 123, 255, .13)),
    rgba(7, 10, 14, .94);
  border-bottom: 1px solid rgba(94, 234, 212, .18);
  box-shadow: 0 10px 38px rgba(0, 0, 0, .22);
  font-size: 13px;
  letter-spacing: 0;
}

.announce span {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(94, 234, 212, .13);
  border: 1px solid rgba(94, 234, 212, .24);
  color: var(--lime);
  font-weight: 800;
}

.topbar {
  height: 74px;
  display: grid;
  grid-template-columns: 210px 1fr minmax(500px, auto);
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(7, 9, 13, .84);
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #081014;
  background: linear-gradient(135deg, var(--lime), var(--cyan));
  font-weight: 900;
  box-shadow: 0 0 26px rgba(94, 234, 212, .28);
}

.brand h1,
.brand p,
.workspace-head h2,
.workspace-head p,
.panel-head h2,
.panel-head p,
.chat-head h2,
.chat-head p,
.section-title h3 {
  margin: 0;
}

.brand h1 {
  font-size: 14px;
  line-height: 1.15;
  white-space: nowrap;
}

.brand p,
.workspace-head p,
.panel-head p,
.chat-head p {
  color: var(--muted);
  font-size: 12px;
}

.mode-tabs {
  display: inline-flex;
  justify-self: center;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 17px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(0, 0, 0, .12)),
    rgba(10, 14, 20, .68);
  box-shadow: inset 0 1px rgba(255, 255, 255, .045);
}

.mode-tab {
  position: relative;
  min-width: 82px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #d9dee8;
  background: transparent;
  font-weight: 620;
  transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.mode-tab.active {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035)),
    rgba(94, 234, 212, .08);
  border-color: rgba(94, 234, 212, .22);
  font-weight: 680;
}

.mode-tab:hover {
  color: #091014;
  background: linear-gradient(145deg, var(--lime), var(--cyan));
  border-color: transparent;
  box-shadow: 0 0 24px rgba(94, 234, 212, .26);
  transform: translateY(-1px);
}

.mode-tab:hover::after {
  background: rgba(9, 16, 20, .42);
  box-shadow: none;
}

.mode-tab:active {
  transform: translateY(0);
}

.mode-tab.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 3px;
  height: 2px;
  border-radius: 999px;
  background: var(--lime);
  box-shadow: 0 0 18px rgba(94, 234, 212, .5);
}

.mode-tab .ui-icon {
  width: 15px;
  height: 15px;
  opacity: .9;
}

.mode-tab:hover .ui-icon {
  opacity: 1;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.top-tariffs-btn {
  min-width: 86px;
}

.search-box {
  width: min(260px, 22vw);
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .07);
  color: var(--muted);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0;
}

.balance-chip {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .06);
}

.balance-chip span {
  color: var(--muted);
  font-size: 12px;
}

.balance-chip strong {
  font-size: 13px;
}

.soft-btn,
.ghost-btn,
.mini-btn,
.icon-btn,
.avatar,
.rail-btn,
.grid-btn,
.project-pill,
.composer-icon,
.generate-btn {
  border-radius: 12px;
  min-height: 36px;
}

.soft-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  background: rgba(255, 255, 255, .09);
  border-color: var(--line);
  font-weight: 620;
}

.soft-btn.danger {
  color: #fff1f2;
  background: rgba(255, 89, 116, .14);
  border-color: rgba(255, 89, 116, .36);
}

.ghost-btn {
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
}

.mini-btn,
.icon-btn,
.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .08);
  border-color: var(--line);
}

.ui-icon {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.icon-btn,
.mini-btn {
  color: rgba(226, 234, 245, .86);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(0, 0, 0, .08)),
    rgba(15, 19, 26, .82);
  border-color: rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px rgba(255, 255, 255, .04);
  transition: transform .14s ease, color .14s ease, background .14s ease, border-color .14s ease;
}

.icon-btn:hover:not(:disabled),
.mini-btn:hover:not(:disabled) {
  color: #061014;
  background: linear-gradient(135deg, var(--lime), var(--cyan));
  border-color: transparent;
  transform: translateY(-1px);
}

.icon-btn:active:not(:disabled),
.mini-btn:active:not(:disabled) {
  transform: translateY(0);
}

.avatar {
  border-radius: 50%;
  color: #0b1114;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  font-weight: 900;
}

.danger-icon:hover:not(:disabled) {
  color: #071014;
  border-color: transparent;
  background: #ff6b7a;
}

.app-shell {
  height: calc(100vh - 34px - 74px);
  min-height: 520px;
  display: grid;
  grid-template-columns: 60px 280px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 8px 0;
  overflow: hidden;
}

body[data-mode="image"] .app-shell,
body[data-mode="video"] .app-shell {
  grid-template-columns: 60px minmax(0, 1fr);
}

body[data-mode="image"] .left-panel,
body[data-mode="video"] .left-panel {
  display: none;
}

.rail,
.left-panel,
.inspector {
  border: 1px solid var(--line);
  background: rgba(12, 15, 21, .64);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 13px 8px;
  border-radius: 18px;
  background: rgba(9, 12, 17, .7);
}

.rail-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
  color: var(--muted);
  border-color: rgba(255, 255, 255, .06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(0, 0, 0, .08)),
    rgba(9, 13, 18, .56);
  box-shadow: inset 0 1px rgba(255, 255, 255, .035);
  transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.rail-btn.active,
.rail-btn:hover {
  color: #091014;
  background: linear-gradient(145deg, var(--lime), var(--cyan));
  border-color: transparent;
  box-shadow: 0 0 24px rgba(94, 234, 212, .26);
}

.rail-btn:hover {
  transform: translateY(-1px);
}

.rail-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: currentColor;
}

.rail-icon svg {
  width: 21px;
  height: 21px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.left-panel,
.inspector {
  overflow: hidden;
  border-radius: 16px;
}

.left-panel {
  display: flex;
  flex-direction: column;
}

.panel-head,
.workspace-head,
.chat-head,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.text-sidebar,
.media-sidebar {
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.project-strip {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  gap: 6px;
  margin-bottom: 12px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 15px;
  background: rgba(255, 255, 255, .035);
  overflow: visible;
}

.project-pill {
  position: relative;
  padding: 0 13px;
  min-width: fit-content;
  color: var(--muted);
  border-color: transparent;
  background: transparent;
  font-weight: 500;
}

.project-pill.active {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(0, 0, 0, .08)),
    rgba(94, 234, 212, .075);
  border-color: rgba(94, 234, 212, .24);
  font-weight: 560;
  box-shadow: inset 0 -2px rgba(94, 234, 212, .72);
}

.project-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 12px;
}

.project-filter,
.project-menu-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 11px;
  color: var(--muted);
  border-color: rgba(255, 255, 255, .08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(0, 0, 0, .1)),
    rgba(12, 16, 22, .68);
  font-size: 12px;
  font-weight: 450;
}

.project-folder {
  padding: 0 5px 0 10px;
}

.project-filter-main,
.project-action {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.project-filter-main {
  max-width: 122px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-action {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: rgba(239, 245, 247, .66);
}

.project-action:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .08);
}

.project-filter.active,
.project-menu-item.active {
  color: #071014;
  border-color: transparent;
  background: var(--lime);
}

.project-filter.active .project-action {
  color: rgba(7, 16, 20, .66);
}

.project-filter.active .project-action:hover {
  color: #071014;
  background: rgba(7, 16, 20, .12);
}

.project-filter.add,
.project-menu-item.add {
  color: var(--text);
  border-color: rgba(57, 217, 255, .22);
  background: rgba(57, 217, 255, .08);
}

.conversation-list,
.history-list,
.assets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.conversation-list {
  gap: 10px;
}

.conversation-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.conversation-item,
.history-item,
.asset-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px;
  background: rgba(255, 255, 255, .055);
}

.conversation-item {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.asset-item {
  cursor: pointer;
}

.conversation-item.active,
.history-item.active {
  border-color: var(--line-strong);
  background: rgba(94, 234, 212, .1);
}

.conversation-title,
.history-title,
.asset-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 560;
  font-size: 13px;
}

.conversation-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.conversation-star,
.conversation-delete {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: rgba(239, 245, 247, .78);
  border-color: transparent;
  background: transparent;
  border-radius: 9px;
}

.conversation-star:hover,
.conversation-delete:hover {
  color: #0b1114;
  background: var(--lime);
}

.conversation-delete:hover {
  background: #ff6b7a;
}

.conversation-delete .ui-icon {
  width: 14px;
  height: 14px;
}

.mini-btn.danger:hover {
  color: #071014;
  background: #ff6b7a;
  border-color: transparent;
}

.conversation-meta,
.history-meta,
.asset-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  position: relative;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(circle at 84% 4%, rgba(94, 234, 212, .09), transparent 22rem),
    linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 42%),
    rgba(255, 255, 255, .012);
}

.gallery-view,
.chat-view {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.workspace-head,
.chat-head {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 10px;
  z-index: 4;
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 15px;
  background: rgba(8, 10, 14, .58);
  backdrop-filter: blur(22px);
}

.workspace-head h2,
.chat-head h2 {
  font-size: 20px;
  font-weight: 620;
}

.grid-control {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(0, 0, 0, .08)),
    rgba(255, 255, 255, .045);
}

.grid-control span {
  color: var(--muted);
  font-size: 11px;
  padding: 0 3px 0 4px;
}

.grid-btn {
  width: 27px;
  height: 27px;
  min-height: 27px;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
}

.grid-btn.active {
  color: #0b1114;
  background: var(--lime);
  border-color: transparent;
  font-weight: 850;
}

#gridSlider {
  width: 58px;
  accent-color: var(--lime);
}

.gallery-grid {
  --gap: 8px;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
  grid-auto-rows: var(--tile-size);
  justify-content: start;
  align-content: start;
  gap: var(--gap);
  padding: 84px 8px var(--composer-safe-space);
  direction: ltr;
  scrollbar-gutter: stable;
}

.gallery-empty {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, .12);
  border-radius: 18px;
  background: rgba(255, 255, 255, .025);
}

.gallery-empty strong {
  color: var(--text);
  font-weight: 520;
}

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

.generation-card {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .065);
  border-radius: 7px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .025));
  direction: ltr;
  isolation: isolate;
}

.generation-card.selected {
  border-color: var(--lime);
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, .4), 0 0 26px rgba(94, 234, 212, .13);
}

.generation-card.local-fallback {
  border-color: rgba(255, 107, 107, .5);
  box-shadow:
    inset 0 0 0 1px rgba(255, 107, 107, .24),
    inset 0 0 42px rgba(255, 77, 118, .12),
    0 0 34px rgba(255, 77, 118, .18);
}

.generation-card.local-fallback::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 77, 118, .18), transparent 32%),
    radial-gradient(circle at 18% 14%, rgba(255, 107, 107, .18), transparent 36%);
}

.generation-card.local-fallback.selected {
  border-color: rgba(255, 107, 107, .72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 107, 107, .36),
    inset 0 0 46px rgba(255, 77, 118, .16),
    0 0 36px rgba(255, 77, 118, .2);
}

.generation-card.media-error {
  border-color: rgba(255, 107, 107, .62);
  box-shadow:
    inset 0 0 0 1px rgba(255, 107, 107, .3),
    inset 0 0 48px rgba(255, 77, 118, .14),
    0 0 38px rgba(255, 77, 118, .2);
}

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

.video-hover-preview {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: rgba(0, 0, 0, .26);
}

.video-hover-preview img,
.video-hover-preview video {
  position: absolute;
  inset: 0;
}

.video-hover-player {
  opacity: 0;
  transition: opacity .16s ease;
}

.video-hover-preview.is-playing .video-hover-player {
  opacity: 1;
}

.video-hover-preview.is-playing .video-hover-poster {
  opacity: 0;
}

.generation-card.media-error img,
.generation-card.media-error video {
  opacity: 0;
}

.generation-card.media-error::before {
  content: "Файл недоступен";
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  white-space: pre;
  text-align: center;
  color: rgba(255, 231, 231, .92);
  font-size: 12px;
  line-height: 1.35;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 107, 107, .22), transparent 45%),
    linear-gradient(145deg, rgba(22, 17, 21, .98), rgba(8, 10, 15, .98));
}

.fallback-card-warning {
  position: absolute;
  left: 9px;
  right: 9px;
  top: 9px;
  z-index: 5;
  padding: 6px 8px;
  border: 1px solid rgba(255, 107, 107, .44);
  border-radius: 10px;
  color: #ffe7e7;
  background:
    linear-gradient(135deg, rgba(255, 107, 107, .36), rgba(255, 77, 175, .18)),
    rgba(28, 7, 12, .78);
  box-shadow: 0 10px 24px rgba(255, 107, 107, .14);
  font-size: 11px;
  line-height: 1.25;
}

.generation-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  background:
    radial-gradient(circle at 50% 40%, rgba(94, 234, 212, .14), transparent 44%),
    linear-gradient(135deg, #161b24, #0b0f16);
}

.file-preview {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 12px;
  text-align: center;
  color: rgba(239, 245, 247, .92);
  background:
    radial-gradient(circle at 50% 34%, rgba(57, 217, 255, .16), transparent 42%),
    linear-gradient(145deg, rgba(20, 25, 34, .98), rgba(8, 11, 16, .98));
}

.file-preview strong {
  min-width: 54px;
  padding: 8px 10px;
  border: 1px solid rgba(94, 234, 212, .28);
  border-radius: 14px;
  color: var(--lime);
  background: rgba(94, 234, 212, .08);
  box-shadow: 0 0 24px rgba(94, 234, 212, .08);
  font-size: 13px;
  font-weight: 620;
}

.file-preview span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.generation-placeholder .spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .13);
  border-top-color: var(--lime);
  animation: spin 1.1s linear infinite;
}

.generation-text-result {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 18px;
  text-align: center;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 38%, rgba(94, 234, 212, .22), transparent 42%),
    linear-gradient(145deg, rgba(26, 34, 41, .98), rgba(8, 11, 16, .98));
}

.generation-text-result strong {
  font-size: 18px;
  font-weight: 650;
}

.generation-text-result span {
  padding: 10px 14px;
  border: 1px solid rgba(94, 234, 212, .32);
  border-radius: 14px;
  color: var(--lime);
  background: rgba(94, 234, 212, .08);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
}

.generation-progress,
.generation-failed {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 14px;
  background:
    radial-gradient(circle at 50% 40%, rgba(94, 234, 212, .12), transparent 48%),
    linear-gradient(145deg, rgba(16, 21, 28, .96), rgba(7, 10, 15, .98));
}

.generation-progress {
  align-content: center;
  justify-items: center;
  gap: 6px;
}

.progress-ring {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, #111820 0 55%, transparent 57%),
    conic-gradient(var(--lime) var(--progress), rgba(255, 255, 255, .14) 0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), 0 0 26px rgba(94, 234, 212, .12);
}

.progress-ring span {
  color: rgba(239, 245, 247, .9);
  font-size: 13px;
  font-weight: 650;
}

.generation-progress strong {
  color: rgba(239, 245, 247, .94);
  font-size: 13px;
}

.generation-progress span,
.generation-progress small,
.generation-progress em {
  color: rgba(170, 182, 190, .86);
  font-size: 11px;
  font-style: normal;
}

.generation-progress small {
  max-width: 210px;
  line-height: 1.35;
}

.generation-failed {
  align-content: center;
  gap: 8px;
  color: rgba(239, 245, 247, .92);
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 89, 116, .16), transparent 46%),
    linear-gradient(145deg, rgba(22, 17, 21, .98), rgba(8, 10, 15, .98));
}

.failed-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  border: 1px solid rgba(255, 89, 116, .45);
  background: rgba(255, 89, 116, .16);
  font-weight: 780;
}

.generation-failed strong {
  font-size: 13px;
}

.generation-failed span {
  max-width: 100%;
  color: rgba(239, 245, 247, .78);
  font-size: 11px;
  line-height: 1.35;
  white-space: pre-line;
}

.placeholder-copy {
  position: absolute;
  left: 11px;
  bottom: 11px;
  font-size: 12px;
  color: rgba(255, 255, 255, .76);
}

.card-meta-badges {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.card-badge {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  color: rgba(246, 249, 255, .94);
  background: rgba(5, 8, 12, .68);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
  font-size: 11px;
  font-weight: 680;
  line-height: 1;
}

.card-badge .ui-icon {
  width: 12px;
  height: 12px;
}

.age-badge {
  margin-left: auto;
  color: rgba(226, 235, 245, .82);
  font-weight: 620;
}

.card-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  min-height: 56px;
  padding: 10px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .72));
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}

.generation-card:hover .card-overlay,
.generation-card.selected .card-overlay {
  opacity: 1;
}

.card-overlay strong {
  display: block;
  font-size: 12px;
}

.card-overlay span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
}

.heart-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: rgba(246, 249, 255, .9);
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(10, 14, 19, .58);
  backdrop-filter: blur(12px);
}

.heart-btn:hover {
  color: #061014;
  background: linear-gradient(135deg, var(--lime), var(--cyan));
  border-color: transparent;
}

.card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: auto;
}

.trash-btn,
.select-run-btn {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .12);
  color: rgba(239, 245, 247, .9);
  background: rgba(10, 14, 19, .58);
  backdrop-filter: blur(12px);
}

.trash-btn {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.trash-btn:hover {
  color: #0b1114;
  background: #ff6b7a;
  border-color: transparent;
}

.heart-btn .ui-icon,
.trash-btn .ui-icon,
.select-run-btn .ui-icon {
  width: 15px;
  height: 15px;
}

.select-run-btn {
  position: absolute;
  z-index: 4;
  left: 10px;
  top: 10px;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  opacity: 0;
  transition: opacity .16s ease, transform .16s ease, background .16s ease;
}

.generation-card:hover .select-run-btn,
.generation-card.bulk-selected .select-run-btn {
  opacity: 1;
}

.generation-card.bulk-selected {
  outline: 2px solid var(--lime);
  box-shadow: 0 0 0 1px rgba(94, 234, 212, .32), 0 0 30px rgba(94, 234, 212, .16);
}

.generation-card.bulk-selected .select-run-btn {
  color: #071014;
  background: var(--lime);
  border-color: transparent;
}

.chat-view {
  border: 1px solid var(--line);
  background: rgba(11, 14, 20, .54);
}

.chat-view .chat-head {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  flex: 0 0 auto;
  margin: 10px 12px 0;
}

.chat-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

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

.project-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 67;
  min-width: 190px;
  max-height: 280px;
  overflow: auto;
  padding: 7px;
  border: 1px solid rgba(94, 234, 212, .22);
  border-radius: 15px;
  background: rgba(14, 18, 24, .97);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .72), 0 0 24px rgba(57, 217, 255, .08);
  backdrop-filter: blur(22px);
}

.project-menu-item {
  width: 100%;
  display: block;
  margin-bottom: 5px;
  text-align: left;
}

.project-menu-item:last-child {
  margin-bottom: 0;
}

.messages-list {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px 18px var(--chat-composer-safe-space);
}

.message {
  max-width: min(720px, 84%);
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .06);
  white-space: pre-wrap;
  line-height: 1.36;
}

.message.user {
  align-self: flex-end;
  color: #071014;
  background: linear-gradient(135deg, var(--lime), #8eb8ff);
}

.message.assistant {
  align-self: flex-start;
  white-space: normal;
}

.message.pending {
  color: rgba(239, 245, 247, .62);
  font-style: italic;
  white-space: pre-wrap;
}

.message-streaming {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 10px;
  margin-top: 7px;
}

.message-streaming span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(239, 245, 247, .55);
  animation: chatTypingPulse 1.15s ease-in-out infinite;
}

.message-streaming span:nth-child(2) {
  animation-delay: .14s;
}

.message-streaming span:nth-child(3) {
  animation-delay: .28s;
}

@keyframes chatTypingPulse {
  0%,
  80%,
  100% {
    opacity: .28;
    transform: translateY(0);
  }

  40% {
    opacity: .95;
    transform: translateY(-2px);
  }
}

.message.assistant p,
.message.assistant ul,
.message.assistant ol,
.message.assistant blockquote,
.message.assistant h3,
.message.assistant h4,
.message.assistant h5,
.message.assistant h6,
.message.assistant .chat-table-wrap,
.message.assistant .chat-code-block {
  margin: 0 0 9px;
}

.message.assistant p:last-child,
.message.assistant ul:last-child,
.message.assistant ol:last-child,
.message.assistant blockquote:last-child,
.message.assistant .chat-table-wrap:last-child,
.message.assistant .chat-code-block:last-child {
  margin-bottom: 0;
}

.message.assistant ul,
.message.assistant ol {
  padding-left: 20px;
}

.message.assistant li + li {
  margin-top: 4px;
}

.message.assistant h3,
.message.assistant h4,
.message.assistant h5,
.message.assistant h6 {
  color: rgba(248, 252, 253, .95);
  font-size: 14px;
  line-height: 1.28;
  font-weight: 760;
}

.message.assistant blockquote {
  padding: 7px 10px;
  border-left: 3px solid rgba(57, 217, 255, .65);
  border-radius: 0 10px 10px 0;
  background: rgba(57, 217, 255, .07);
  color: rgba(239, 245, 247, .78);
}

.message.assistant hr {
  height: 1px;
  margin: 11px 0;
  border: 0;
  background: rgba(255, 255, 255, .12);
}

.message.assistant a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(57, 217, 255, .38);
}

.message.assistant a:hover {
  border-bottom-color: var(--cyan);
}

.message.assistant :not(pre) > code {
  padding: 1px 5px;
  border: 1px solid rgba(57, 217, 255, .22);
  border-radius: 6px;
  color: #c8ff49;
  background: rgba(255, 255, 255, .07);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: .92em;
}

.chat-code-block {
  overflow: hidden;
  border: 1px solid rgba(255, 105, 180, .32);
  border-radius: 10px;
  background: rgba(255, 234, 246, .06);
  box-shadow: inset 3px 0 rgba(255, 105, 180, .72);
}

.chat-code-block figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
  padding: 6px 9px 6px 12px;
  color: #ff77b7;
  background: rgba(255, 105, 180, .13);
  font-size: 12px;
  font-weight: 780;
}

.chat-code-copy {
  min-width: 44px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid rgba(255, 105, 180, .36);
  border-radius: 7px;
  color: rgba(248, 252, 253, .9);
  background: rgba(255, 255, 255, .08);
  font-size: 11px;
  font-weight: 700;
}

.chat-code-copy:hover {
  border-color: rgba(255, 105, 180, .72);
  background: rgba(255, 105, 180, .16);
}

.chat-code-block pre {
  max-width: 100%;
  margin: 0;
  padding: 11px 13px;
  overflow: auto;
  color: rgba(248, 252, 253, .94);
  background: rgba(13, 15, 21, .72);
  white-space: pre;
  tab-size: 2;
}

.chat-code-block code {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.code-keyword {
  color: #ff77b7;
  font-weight: 760;
}

.code-string {
  color: #8ef5e4;
}

.code-number {
  color: #ffd166;
}

.code-comment {
  color: rgba(170, 182, 190, .72);
  font-style: italic;
}

.chat-table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 10px;
}

.chat-table-wrap table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 12px;
}

.chat-table-wrap th,
.chat-table-wrap td {
  padding: 7px 9px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  vertical-align: top;
}

.chat-table-wrap th {
  color: rgba(248, 252, 253, .94);
  background: rgba(255, 255, 255, .07);
  font-weight: 760;
}

.chat-table-wrap tr:last-child td {
  border-bottom: 0;
}

.message.billing {
  align-self: flex-start;
  max-width: min(520px, 72%);
  padding: 8px 10px;
  border-color: rgba(57, 217, 255, .18);
  background:
    linear-gradient(135deg, rgba(57, 217, 255, .08), rgba(94, 234, 212, .04)),
    rgba(255, 255, 255, .045);
  color: rgba(239, 245, 247, .86);
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
}

.message.billing summary {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  list-style: none;
}

.message.billing summary::-webkit-details-marker {
  display: none;
}

.message.billing summary::before {
  content: ">";
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 5px;
  color: rgba(239, 245, 247, .72);
  background: rgba(255, 255, 255, .08);
  font-size: 10px;
  line-height: 1;
  transition: transform .16s ease;
}

.message.billing[open] summary::before {
  transform: rotate(90deg);
}

.billing-details {
  margin-top: 7px;
}

.message.billing strong,
.message.billing span,
.message.billing small {
  display: block;
}

.message.billing strong {
  margin: 0;
  color: var(--lime);
  font-weight: 560;
}

.message.billing span {
  margin-bottom: 4px;
  color: rgba(239, 245, 247, .72);
}

.message.billing ul {
  margin: 0;
  padding-left: 16px;
}

.message.billing li + li {
  margin-top: 2px;
}

.message.billing small {
  margin-top: 6px;
  color: rgba(170, 182, 190, .86);
  white-space: normal;
}

.message .message-assets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.message .message-assets a {
  padding: 6px 8px;
  border-radius: 9px;
  color: #0b1114;
  background: var(--cyan);
  font-weight: 800;
  font-size: 11px;
}

.message .message-assets span {
  padding: 6px 8px;
  border-radius: 9px;
  color: rgba(239, 245, 247, .72);
  background: rgba(255, 255, 255, .08);
  font-size: 11px;
}

.inspector {
  position: fixed;
  top: 92px;
  right: 18px;
  z-index: 80;
  width: min(430px, calc(100vw - 36px));
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 10px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .018)),
    rgba(9, 12, 17, .9);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px) scale(.98);
  transition: opacity .16s ease, transform .16s ease;
}

.inspector.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.overlay-scrim {
  position: fixed;
  inset: 0;
  z-index: 79;
  background: rgba(0, 0, 0, .42);
  backdrop-filter: blur(6px);
}

.dialog-scrim {
  position: fixed;
  inset: 0;
  z-index: 119;
  background: rgba(0, 0, 0, .54);
  backdrop-filter: blur(8px);
}

.text-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 120;
  width: min(430px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  padding: 16px;
  border: 1px solid rgba(94, 234, 212, .22);
  border-radius: 18px;
  background:
    linear-gradient(150deg, rgba(57, 217, 255, .08), transparent 42%),
    linear-gradient(330deg, rgba(94, 234, 212, .1), transparent 40%),
    rgba(13, 17, 22, .96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55), inset 0 1px rgba(255, 255, 255, .08);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.dialog-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--lime);
  font-size: 11px;
  font-weight: 680;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.dialog-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 620;
}

.dialog-body {
  margin: -2px 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.dialog-field {
  display: grid;
  gap: 8px;
}

.dialog-field span {
  color: var(--muted);
  font-size: 12px;
}

.dialog-field input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border-radius: 13px;
  border-color: rgba(255, 255, 255, .11);
  background: rgba(255, 255, 255, .06);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.inspector-card {
  display: none;
  margin-bottom: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .055);
}

.inspector[data-view="account"] .account-card,
.inspector[data-view="assets"] .assets-card,
.inspector[data-view="selected"] .result-card {
  display: block;
}

.account-card {
  margin-bottom: 0;
}

.section-title {
  margin-bottom: 12px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title h3 {
  font-size: 14px;
}

.profile-hero {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 8px 0 14px;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #071014;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  box-shadow: 0 0 28px rgba(57, 217, 255, .2);
  font-size: 21px;
  font-weight: 780;
}

.profile-kicker,
.profile-hero small,
.profile-metrics span,
.profile-lines span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.profile-hero strong {
  display: block;
  margin: 2px 0 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 19px;
  font-weight: 620;
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.profile-metrics div,
.profile-lines div {
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 14px;
  background: rgba(255, 255, 255, .045);
}

.profile-metrics div {
  min-height: 76px;
  padding: 11px;
}

.profile-metrics strong {
  display: block;
  margin-top: 7px;
  font-size: 16px;
  font-weight: 620;
}

.profile-lines {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.profile-lines div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 11px;
}

.profile-lines strong {
  font-size: 13px;
  font-weight: 560;
  text-align: right;
}

.profile-auth {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding-top: 10px;
}

.tariffs-dialog {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 8, 12, .68);
  backdrop-filter: blur(18px);
}

.tariffs-dialog.hidden {
  display: none;
}

.tariffs-panel {
  width: min(1060px, calc(100vw - 32px));
  max-height: min(84vh, 860px);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(34, 39, 45, .98), rgba(18, 22, 27, .98));
  box-shadow: 0 34px 90px rgba(0, 0, 0, .44);
}

.tariffs-panel .section-title {
  align-items: flex-start;
}

.tariffs-panel .section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.tariffs-notice {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 214, 102, .34);
  border-radius: 12px;
  background: rgba(255, 214, 102, .12);
  color: #ffe7a6;
  font-size: 13px;
  line-height: 1.45;
}

.tariffs-notice.warning {
  border-color: rgba(255, 214, 102, .46);
  background: rgba(255, 214, 102, .15);
}

.tariffs-dialog-grid {
  margin-top: 18px;
}

.payment-redirect-overlay {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 8, 12, .72);
  backdrop-filter: blur(18px);
}

.payment-redirect-overlay.hidden {
  display: none;
}

.payment-redirect-card {
  width: min(420px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid rgba(203, 255, 35, .28);
  border-radius: 22px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(203, 255, 35, .22), transparent 44%),
    linear-gradient(180deg, rgba(34, 39, 45, .98), rgba(12, 16, 20, .98));
  box-shadow: 0 34px 90px rgba(0, 0, 0, .5);
}

.payment-redirect-card h2 {
  margin: 16px 0 8px;
  font-size: 24px;
  letter-spacing: 0;
}

.payment-redirect-card p {
  margin: 0 auto;
  color: rgba(239, 245, 247, .92);
  line-height: 1.45;
}

.payment-redirect-card span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.payment-spinner {
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border: 4px solid rgba(255, 255, 255, .16);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: spin .85s linear infinite;
}

.tiny-badge {
  padding: 5px 8px;
  border-radius: 999px;
  color: #0a1014;
  background: var(--lime);
  font-size: 11px;
  font-weight: 850;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 11px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
}

.field input,
.field select,
.field textarea,
.dynamic-settings select,
.dynamic-settings input {
  width: 100%;
  min-height: 38px;
  border-radius: 12px;
  padding: 0 11px;
  outline: none;
}

.field textarea {
  padding: 10px 11px;
}

.inline-actions,
.action-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-grid .soft-btn,
.action-grid .ghost-btn {
  flex: 1 1 130px;
  min-height: 38px;
}

.disabled {
  pointer-events: none;
  opacity: .5;
}

.selected-preview {
  min-height: 190px;
  margin-bottom: 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, .28);
}

.selected-preview img,
.selected-preview video {
  width: 100%;
  max-height: 270px;
  object-fit: contain;
  display: block;
}

.inspector[data-view="selected"] {
  top: 18px;
  right: 18px;
  bottom: 18px;
  left: 18px;
  width: auto;
  max-height: none;
  overflow: hidden;
  padding: 0;
  border-radius: 22px;
  background:
    radial-gradient(circle at 35% 18%, rgba(94, 234, 212, .1), transparent 34%),
    radial-gradient(circle at 82% 72%, rgba(57, 217, 255, .08), transparent 32%),
    rgba(5, 8, 12, .94);
  box-shadow: 0 24px 100px rgba(0, 0, 0, .62), inset 0 1px rgba(255, 255, 255, .06);
}

.inspector[data-view="selected"] .result-card {
  height: 100%;
  margin: 0;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  grid-template-rows: minmax(0, 1fr);
  gap: 16px 20px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.selected-side-scroll {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  height: 100%;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  display: block;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(94, 234, 212, .46) rgba(255, 255, 255, .06);
}

.selected-side-scroll > * + * {
  margin-top: 12px;
}

.selected-side-scroll::-webkit-scrollbar {
  width: 10px;
}

.selected-side-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .075);
  border-radius: 999px;
}

.selected-side-scroll::-webkit-scrollbar-thumb {
  min-height: 42px;
  border-radius: 999px;
  border: 2px solid rgba(12, 16, 22, .84);
  background: linear-gradient(180deg, rgba(94, 234, 212, .95), rgba(57, 217, 255, .72));
}

.inspector[data-view="selected"] .result-card .section-title {
  min-height: 54px;
  margin: 0;
  padding: 8px 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.inspector[data-view="selected"] .result-card .section-title h3 {
  font-size: 18px;
  font-weight: 620;
}

.inspector[data-view="selected"] .selected-preview {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  min-height: 0;
  height: 100%;
  margin: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, .08), transparent 34%),
    linear-gradient(90deg, rgba(0, 0, 0, .38), transparent 18%, transparent 82%, rgba(0, 0, 0, .3));
}

.fallback-warning {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 18px;
  z-index: 4;
  padding: 10px 12px;
  border: 1px solid rgba(255, 107, 107, .42);
  border-radius: 14px;
  color: #ffe7e7;
  background:
    linear-gradient(135deg, rgba(255, 107, 107, .34), rgba(255, 77, 175, .16)),
    rgba(28, 7, 12, .78);
  box-shadow: 0 14px 34px rgba(255, 107, 107, .13);
  font-size: 12px;
  line-height: 1.35;
}

.selected-details .fallback-warning {
  position: static;
  margin-top: 0;
}

.inspector[data-view="selected"] .selected-preview img,
.inspector[data-view="selected"] .selected-preview video {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 36px);
  object-fit: contain;
  border-radius: 18px;
}

.inspector[data-view="selected"] .empty-preview,
.inspector[data-view="selected"] .run-failure-detail,
.inspector[data-view="selected"] .run-failure-detail .generation-failed {
  min-height: 100%;
  width: 100%;
}

.inspector[data-view="selected"] .action-grid {
  align-content: start;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.inspector[data-view="selected"] .action-grid .soft-btn,
.inspector[data-view="selected"] .action-grid .ghost-btn {
  min-height: 46px;
  flex: initial;
  border-radius: 14px;
  background: rgba(255, 255, 255, .075);
}

.inspector[data-view="selected"] .action-grid .soft-btn:first-child {
  grid-column: 1 / -1;
  color: #071014;
  background: linear-gradient(135deg, var(--lime), #8eb8ff);
  border-color: transparent;
  font-weight: 560;
}

.selected-details {
  min-height: 0;
  overflow: visible;
  display: grid;
  align-content: start;
  gap: 12px;
  padding-right: 0;
}

.detail-block,
.detail-grid {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .018)),
    rgba(10, 14, 19, .64);
  box-shadow: inset 0 1px rgba(255, 255, 255, .055);
}

.detail-block {
  padding: 12px;
}

.detail-heading {
  margin-bottom: 8px;
  color: rgba(239, 245, 247, .56);
  font-size: 11px;
  font-weight: 680;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.detail-prompt {
  margin: 0;
  color: rgba(239, 245, 247, .88);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.midjourney-actions {
  background:
    radial-gradient(circle at 12% 20%, rgba(212, 255, 31, .16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)),
    rgba(10, 14, 19, .68);
}

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

.midjourney-action-btn {
  min-height: 56px;
  padding: 7px 8px;
  border: 1px solid rgba(216, 255, 31, .2);
  border-radius: 13px;
  color: rgba(239, 245, 247, .92);
  background:
    linear-gradient(180deg, rgba(216, 255, 31, .1), rgba(255, 255, 255, .025)),
    rgba(255, 255, 255, .045);
  box-shadow: inset 0 1px rgba(255, 255, 255, .06);
  text-align: left;
}

.midjourney-action-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(216, 255, 31, .54);
  background:
    linear-gradient(180deg, rgba(216, 255, 31, .18), rgba(57, 217, 255, .045)),
    rgba(255, 255, 255, .055);
}

.midjourney-action-btn:disabled {
  cursor: not-allowed;
  opacity: .45;
  transform: none;
}

.midjourney-action-btn.kind-reroll,
.midjourney-action-btn.kind-seed {
  grid-column: 1 / -1;
  min-height: 44px;
  text-align: center;
}

.midjourney-action-btn span,
.midjourney-action-btn small {
  display: block;
  overflow: hidden;
  white-space: normal;
}

.midjourney-action-btn span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
  line-height: 1.16;
  font-size: 12px;
  font-weight: 620;
}

.midjourney-action-btn small {
  margin-top: 3px;
  color: rgba(239, 245, 247, .48);
  font-size: 10px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-grid {
  display: grid;
  overflow: hidden;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(78px, .72fr) minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, .055);
}

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

.detail-row span {
  color: rgba(239, 245, 247, .52);
  font-size: 12px;
}

.detail-row strong {
  min-width: 0;
  overflow: hidden;
  color: rgba(239, 245, 247, .91);
  font-size: 12px;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-reference-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.selected-reference-thumb {
  position: relative;
  min-height: 92px;
  padding: 0;
  overflow: hidden;
  border-radius: 13px;
  background: rgba(255, 255, 255, .045);
  border-color: rgba(255, 255, 255, .08);
}

.selected-reference-thumb:hover {
  border-color: rgba(94, 234, 212, .54);
  box-shadow: 0 0 24px rgba(94, 234, 212, .14);
}

.selected-output-thumb.active {
  border-color: rgba(94, 234, 212, .78);
  box-shadow: 0 0 0 1px rgba(94, 234, 212, .35), 0 0 26px rgba(94, 234, 212, .16);
}

.selected-reference-thumb > span {
  position: absolute;
  left: 7px;
  top: 7px;
  z-index: 2;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #071014;
  background: var(--lime);
  font-size: 11px;
  font-weight: 740;
}

.selected-reference-thumb .empty-preview,
.selected-reference-thumb img,
.selected-reference-thumb video {
  width: 100%;
  height: 72px;
  min-height: 72px;
  display: block;
  object-fit: cover;
}

.selected-reference-thumb em {
  display: block;
  padding: 6px 7px 7px;
  overflow: hidden;
  color: rgba(239, 245, 247, .72);
  font-size: 11px;
  font-style: normal;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-preview {
  min-height: 190px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.run-failure-detail {
  min-height: 190px;
  overflow: hidden;
  border-radius: 14px;
}

.run-failure-detail .generation-failed {
  min-height: 190px;
}

.dynamic-settings {
  display: grid;
  gap: 10px;
}

.setting-control {
  display: grid;
  gap: 6px;
}

.setting-control label {
  color: var(--muted);
  font-size: 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .055);
}

.toggle-row input {
  width: auto;
  accent-color: var(--lime);
}

.upload-drop {
  min-height: 46px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, .24);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, .035);
}

.upload-drop input {
  display: none;
}

.asset-item {
  display: grid;
  gap: 7px;
}

.asset-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 11px;
  background: rgba(255, 255, 255, .055);
}

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

.composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding: 0 18px 16px;
  pointer-events: none;
}

body.bulk-selecting .composer {
  display: none;
}

body.composer-hidden {
  --composer-safe-space: 36px;
  --chat-composer-safe-space: 36px;
}

body.composer-hidden .composer {
  display: none;
}

.bulk-toolbar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 65;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .035)),
    rgba(18, 21, 26, .92);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, .12),
    0 24px 80px rgba(0, 0, 0, .72),
    0 0 34px rgba(94, 234, 212, .1);
  backdrop-filter: blur(22px);
}

.bulk-count,
.bulk-action,
.bulk-icon {
  min-height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
}

.bulk-count {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
}

.bulk-count span {
  width: 18px;
  height: 22px;
  border-radius: 5px;
  background: linear-gradient(135deg, #ff6b7a 0 42%, #e9f6f3 43% 100%);
}

.bulk-count strong,
.bulk-action {
  font-weight: 560;
}

.bulk-action {
  padding: 0 18px;
  color: var(--text);
}

.bulk-icon {
  width: 44px;
  display: grid;
  place-items: center;
  color: rgba(239, 245, 247, .84);
}

.bulk-icon .ui-icon {
  width: 17px;
  height: 17px;
}

.bulk-icon:hover,
.bulk-action:hover {
  color: #071014;
  background: var(--lime);
}

.bulk-icon.danger:hover {
  background: #ff6b7a;
}

.bulk-action:disabled,
.bulk-action.disabled {
  opacity: .45;
  cursor: not-allowed;
}

.composer-shell {
  width: min(1080px, calc(100vw - 210px));
  min-height: 96px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .105), rgba(255, 255, 255, .025) 42%, rgba(0, 0, 0, .2)),
    linear-gradient(135deg, rgba(57, 217, 255, .08), rgba(94, 234, 212, .045) 58%, rgba(255, 77, 175, .07)),
    rgba(16, 20, 27, .92);
  backdrop-filter: blur(28px);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, .16),
    inset 0 -14px 34px rgba(0, 0, 0, .22),
    0 30px 110px rgba(0, 0, 0, .7),
    0 0 0 1px rgba(94, 234, 212, .035),
    0 0 46px rgba(57, 217, 255, .08);
  pointer-events: auto;
}

.composer-icon {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  width: 44px;
  height: 44px;
  color: #dce5ef;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(0, 0, 0, .18)),
    rgba(12, 16, 22, .86);
  border-color: rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px rgba(255, 255, 255, .08), 0 10px 26px rgba(0, 0, 0, .24);
  font-size: 22px;
}

.composer-icon:hover:not(:disabled) {
  color: #071014;
  border-color: rgba(94, 234, 212, .62);
  background: linear-gradient(135deg, rgba(94, 234, 212, .96), rgba(57, 217, 255, .82));
  box-shadow: 0 0 26px rgba(94, 234, 212, .22), inset 0 1px rgba(255, 255, 255, .2);
}

.composer-icon:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.composer-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 80;
  width: max-content;
  max-width: 280px;
  padding: 8px 10px;
  border: 1px solid rgba(94, 234, 212, .28);
  border-radius: 12px;
  color: rgba(239, 245, 247, .92);
  background: rgba(12, 16, 22, .96);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .46), 0 0 22px rgba(94, 234, 212, .08);
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease;
}

.composer-icon:hover::after {
  opacity: 1;
  transform: translateY(0);
}

#promptInput {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  min-height: 40px;
  max-height: 120px;
  padding: 4px 2px 8px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
  line-height: 1.35;
}

#promptInput.prompt-locked {
  color: var(--muted);
  cursor: default;
  min-height: 48px;
  font-size: 13px;
  line-height: 1.25;
}

.reference-tray {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.reference-chip {
  position: relative;
  min-width: 94px;
  max-width: 112px;
  height: 44px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 6px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(0, 0, 0, .14)),
    rgba(12, 16, 22, .86);
  box-shadow: inset 0 1px rgba(255, 255, 255, .08);
}

.reference-thumb {
  width: 38px;
  height: 38px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, .07);
}

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

.reference-thumb .empty-preview {
  min-height: 38px;
  padding: 3px;
  font-size: 10px;
}

.reference-thumb .file-preview {
  gap: 0;
  padding: 2px;
}

.reference-thumb .file-preview strong {
  min-width: 0;
  padding: 3px 4px;
  border-radius: 7px;
  font-size: 8px;
}

.reference-thumb .file-preview span {
  display: none;
}

.asset-preview-wrap {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
}

.asset-preview-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 15, .42);
}

.asset-upload-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .28);
  border-top-color: var(--lime);
  box-shadow: 0 0 18px rgba(94, 234, 212, .22);
  animation: spin .9s linear infinite;
}

.reference-order {
  position: absolute;
  left: -5px;
  top: -6px;
  z-index: 2;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #071014;
  background: linear-gradient(135deg, var(--lime), rgba(119, 255, 104, .96));
  box-shadow: 0 0 14px rgba(94, 234, 212, .24);
  font-size: 10px;
  font-weight: 700;
}

.reference-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

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

.reference-text strong {
  font-size: 11px;
  font-weight: 520;
}

.reference-text span,
.reference-status {
  color: var(--muted);
  font-size: 10px;
}

.reference-text > span {
  display: none;
}

.reference-remove {
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 8px;
  color: rgba(239, 245, 247, .82);
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .12);
}

.reference-remove:hover {
  color: #071014;
  background: var(--lime);
  border-color: transparent;
}

.composer-controls {
  grid-column: 1 / -1;
  grid-row: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.native-model-select {
  display: none;
}

.model-picker {
  position: relative;
  min-width: 220px;
  max-width: 300px;
}

.model-picker-button {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-radius: 13px;
  padding: 0 13px;
  color: var(--text);
  text-align: left;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(0, 0, 0, .14)),
    rgba(12, 16, 22, .88);
  border-color: rgba(255, 255, 255, .13);
  box-shadow: inset 0 1px rgba(255, 255, 255, .08), 0 10px 26px rgba(0, 0, 0, .18);
}

.model-picker-button:hover,
.model-picker.open .model-picker-button {
  border-color: rgba(94, 234, 212, .56);
  box-shadow: 0 0 22px rgba(94, 234, 212, .13);
}

#modelPickerLabel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 400;
}

.model-picker-arrow {
  color: var(--muted);
}

.model-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 65;
  max-height: 310px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(94, 234, 212, .24);
  border-radius: 16px;
  background: rgba(14, 18, 24, .96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .72), 0 0 28px rgba(94, 234, 212, .12);
  backdrop-filter: blur(24px);
}

.model-menu-group {
  margin: 4px 0 8px;
}

.model-menu-title {
  padding: 5px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
  text-transform: uppercase;
}

.model-option {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  border: 0;
  border-radius: 11px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.model-option span {
  font-weight: 400;
}

.model-option:hover,
.model-option.active {
  color: #071014;
  background: var(--lime);
}

.model-option:disabled,
.model-option.disabled {
  cursor: not-allowed;
  opacity: .48;
}

.model-option:disabled:hover,
.model-option.disabled:hover {
  color: var(--text);
  background: transparent;
}

.model-option small {
  color: inherit;
  opacity: .64;
}

.quick-settings {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-chip {
  position: relative;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .065), rgba(0, 0, 0, .12)),
    rgba(12, 16, 22, .76);
}

.quick-chip.param-picker {
  padding: 0;
}

.quick-chip span {
  color: var(--muted);
  font-size: 12px;
}

.quick-chip input {
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: 0;
}

.quick-chip[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 85;
  width: max-content;
  max-width: min(360px, calc(100vw - 48px));
  padding: 9px 11px;
  border: 1px solid rgba(94, 234, 212, .28);
  border-radius: 12px;
  color: rgba(239, 245, 247, .94);
  background: rgba(12, 16, 22, .97);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .48), 0 0 22px rgba(94, 234, 212, .08);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity .16s ease, transform .16s ease;
}

.quick-chip[data-tooltip]:hover::after,
.quick-chip[data-tooltip]:focus-within::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.param-picker-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--text);
}

.param-picker-button strong {
  font-size: 13px;
  font-weight: 400;
}

.param-picker-button i {
  color: var(--muted);
  font-style: normal;
}

.param-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 66;
  min-width: 100%;
  max-height: 280px;
  overflow: auto;
  padding: 7px;
  border: 1px solid rgba(94, 234, 212, .22);
  border-radius: 15px;
  background: rgba(14, 18, 24, .97);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .72), 0 0 24px rgba(57, 217, 255, .08);
  backdrop-filter: blur(22px);
}

.param-option {
  width: 100%;
  min-height: 34px;
  display: block;
  padding: 0 11px;
  border: 0;
  border-radius: 10px;
  color: var(--text);
  background: transparent;
  text-align: left;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 400;
}

.param-option:hover,
.param-option.active {
  color: #071014;
  background: var(--lime);
}

.generate-btn {
  min-width: 150px;
  min-height: 50px;
  margin-left: auto;
  padding: 0 18px;
  border: 0;
  color: #071014;
  background: var(--lime);
  font-weight: 540;
  box-shadow: 0 0 28px rgba(94, 234, 212, .24);
}

.generate-btn:disabled {
  cursor: not-allowed;
  opacity: .52;
}

.toast {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: max(56px, calc(var(--composer-safe-space) + 28px));
  z-index: 90;
  width: min(520px, calc(100vw - 36px));
  max-width: calc(100vw - 36px);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  color: var(--text);
  pointer-events: none;
  transform: translateX(-50%);
}

.version-banner {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: max(56px, calc(var(--composer-safe-space) + 28px));
  z-index: 91;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: min(520px, calc(100vw - 36px));
  max-width: calc(100vw - 36px);
  padding: 10px 12px;
  border: 1px solid rgba(94, 234, 212, .32);
  border-radius: 14px;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(94, 234, 212, .18), rgba(57, 217, 255, .10)),
    rgba(12, 16, 22, .94);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .36);
  transform: translateX(-50%);
}

.version-banner span {
  font-size: 13px;
  font-weight: 560;
}

.version-banner button {
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  color: #071014;
  background: var(--lime);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, .12);
  border-radius: 12px;
  direction: ltr;
}

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

@media (max-width: 1260px) {
  .landing-stage {
    width: min(1080px, calc(100vw - 18px));
  }

  .landing-links {
    gap: 16px;
  }

  .landing-hero {
    padding-left: 70px;
    padding-right: 70px;
  }

  .landing-hero h1 {
    font-size: 56px;
  }

  .topbar {
    grid-template-columns: 210px 1fr;
  }

  .top-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
    padding-bottom: 10px;
  }

  .topbar {
    height: 122px;
  }

  .app-shell {
    height: calc(100vh - 34px - 122px);
    grid-template-columns: 56px 220px minmax(0, 1fr);
  }

  .inspector {
    top: 146px;
    right: 12px;
    width: min(410px, calc(100vw - 24px));
  }
}

@media (max-width: 900px) {
  body {
    overflow: hidden;
  }

  body.guest-view {
    overflow: auto;
  }

  .landing-page {
    padding: 0;
  }

  .landing-stage {
    width: 100%;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .landing-nav {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    padding: 12px 18px;
  }

  .landing-links {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .landing-nav-login {
    min-height: 34px;
    padding: 0 12px;
  }

  .landing-hero {
    min-height: 740px;
    padding: 104px 28px 210px;
  }

  .landing-hero-shade {
    background:
      linear-gradient(90deg, rgba(5, 7, 11, .86), rgba(5, 7, 11, .5)),
      linear-gradient(180deg, rgba(5, 7, 11, .16), rgba(5, 7, 11, .94));
  }

  .landing-hero h1 {
    font-size: 48px;
  }

  .landing-sound-card {
    top: 88px;
    right: 20px;
  }

  .landing-thumb-rail {
    grid-template-columns: 28px repeat(6, 154px) 28px;
    overflow-x: auto;
  }

  .landing-feature-grid,
  .landing-model-grid,
  .landing-tariff-cards {
    grid-template-columns: 1fr 1fr;
  }

  .landing-spending-table div {
    grid-template-columns: 1fr 1fr;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 9;
    height: auto;
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .top-actions,
  .mode-tabs {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .mode-tabs {
    width: 100%;
    justify-self: stretch;
  }

  .mode-tab {
    flex: 0 0 auto;
    min-width: 86px;
  }

  .search-box {
    width: 100%;
  }

  .app-shell {
    height: calc(100vh - 34px - 122px);
    min-height: 430px;
    grid-template-columns: 52px minmax(0, 1fr);
    padding: 8px 8px 0;
  }

  .rail {
    flex-direction: column;
  }

  .left-panel {
    display: none;
  }

  .inspector {
    top: 92px;
    right: 10px;
    width: calc(100vw - 20px);
  }

  .inspector[data-view="selected"] {
    inset: 8px;
  }

  .inspector[data-view="selected"] .result-card {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(180px, auto);
    gap: 12px;
    padding: 12px;
  }

  .inspector[data-view="selected"] .selected-preview,
  .inspector[data-view="selected"] .selected-side-scroll {
    grid-column: 1;
  }

  .inspector[data-view="selected"] .selected-preview {
    grid-row: 1;
  }

  .inspector[data-view="selected"] .selected-side-scroll {
    grid-row: 2;
    max-height: min(48vh, 430px);
  }

  .workspace {
    min-height: 0;
  }

  .gallery-grid {
    padding-top: 76px;
  }

  .workspace-head {
    left: 8px;
    right: 8px;
  }

  .grid-control {
    flex: 0 0 auto;
    gap: 3px;
    padding: 3px;
  }

  .grid-control span {
    display: none;
  }

  .grid-btn {
    width: 26px;
    height: 26px;
    min-height: 26px;
    font-size: 12px;
  }

  #gridSlider {
    width: 46px;
  }

  .composer-shell {
    grid-template-columns: 44px minmax(0, 1fr);
    width: calc(100vw - 24px);
  }

  .composer-icon {
    grid-column: 1;
  }

  .reference-tray {
    grid-column: 2;
    align-items: stretch;
  }

  .composer-controls {
    grid-column: 1 / -1;
    align-items: stretch;
  }

  .generate-btn {
    width: auto;
    margin-left: auto;
  }
}

@media (max-width: 620px) {
  .landing-nav {
    align-items: flex-start;
  }

  .landing-brand-mark {
    width: 42px;
    height: 42px;
  }

  .landing-links {
    gap: 14px;
  }

  .landing-hero {
    min-height: 720px;
    padding: 88px 18px 210px;
  }

  .landing-hero h1 {
    max-width: 350px;
    font-size: 38px;
  }

  .landing-feature-chips {
    gap: 8px;
  }

  .landing-feature-chips span {
    min-height: 28px;
    font-size: 11px;
  }

  .landing-telegram-button {
    font-size: 15px;
  }

  .landing-sound-card {
    display: none;
  }

  .landing-thumb-rail {
    left: 10px;
    right: 10px;
    bottom: 14px;
    grid-template-columns: 26px repeat(6, 138px) 26px;
    gap: 8px;
    padding: 8px;
  }

  .landing-thumb-rail article {
    height: 88px;
  }

  .landing-section {
    padding: 42px 14px 0;
  }

  .landing-section h2 {
    font-size: 22px;
  }

  .landing-feature-grid,
  .landing-model-grid,
  .landing-tariff-cards,
  .landing-auth-options {
    grid-template-columns: 1fr;
  }

  .landing-tariff-heading {
    display: grid;
    gap: 8px;
    align-items: start;
  }

  .landing-tariff-heading p {
    max-width: none;
    text-align: left;
  }

  .landing-spending-table div {
    grid-template-columns: 1fr;
  }

  .landing-auth-panel {
    padding: 24px 18px;
  }

  .landing-model-grid article {
    min-height: auto;
  }

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

  .composer-icon,
  .composer-controls,
  .reference-tray {
    grid-column: 1;
  }

  .composer-icon {
    grid-row: 1;
  }

  .reference-tray {
    grid-row: 2;
  }

  #promptInput {
    grid-row: 3;
  }

  .composer-controls {
    grid-row: 4;
  }

  .generate-btn {
    width: 100%;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-telegram-button {
    transition: none;
  }
}
