﻿:root,
.agent-test-root {
  --at-white: #f5f5f7;
  --at-blue: #1c69d4;
  --at-blue-soft: #3b8bfd;
  --at-blue-deep: #0b3d91;
  --at-blue-glow: rgba(28, 105, 212, 0.28);
  --at-red: #e51c23;
  --at-bg: #07080c;
  --at-sidebar: #0a0c12;
  --at-sidebar-border: rgba(255, 255, 255, 0.07);
  --at-surface: #12151e;
  --at-surface-hover: #1a1e2a;
  --at-border: rgba(255, 255, 255, 0.1);
  --at-text: var(--at-white);
  --at-muted: rgba(245, 245, 247, 0.64);
  --at-muted-soft: rgba(245, 245, 247, 0.42);
  --composer-shell-border: rgba(28, 105, 212, 0.38);
  --composer-shell-bg: rgba(12, 14, 22, 0.96);
  --composer-shine-a: rgba(255, 255, 255, 0.08);
  --composer-shine-b: rgba(28, 105, 212, 0.1);
  --composer-depth: rgba(0, 0, 0, 0.5);
  --at-radius-lg: 24px;
  --at-radius-md: 16px;
  --at-radius-sm: 12px;
  --at-font: "Inter", system-ui, -apple-system, sans-serif;
  --at-sidebar-width: 252px;
  --shadow-card: 0 12px 36px rgba(0, 0, 0, 0.28);
  --home-hub-media-width: 220px;
  --at-input-bg: rgba(0, 0, 0, 0.28);
  --at-overlay: rgba(2, 3, 6, 0.55);
  --at-chip-bg: rgba(255, 255, 255, 0.08);
  --at-composer-inner: rgba(7, 8, 12, 0.78);
  --at-chrome: rgba(10, 12, 18, 0.92);
  --cmp-glow-blue: rgba(48, 110, 255, 0.32);
  --cmp-glow-pink: rgba(255, 45, 138, 0.26);
  --cmp-glow-violet: rgba(150, 70, 220, 0.12);
}

html[data-theme="light"],
html[data-theme="light"] .agent-test-root {
  --at-bg: #eef0f5;
  --at-sidebar: #f8f9fc;
  --at-sidebar-border: rgba(18, 21, 30, 0.1);
  --at-surface: #ffffff;
  --at-surface-hover: #e8ebf2;
  --at-border: rgba(18, 21, 30, 0.12);
  --at-text: #141824;
  --at-muted: rgba(20, 24, 36, 0.66);
  --at-muted-soft: rgba(20, 24, 36, 0.45);
  --at-blue-soft: #1a5fbf;
  --at-blue-glow: rgba(28, 105, 212, 0.18);
  --composer-shell-border: rgba(28, 105, 212, 0.28);
  --composer-shell-bg: rgba(255, 255, 255, 0.96);
  --composer-shine-a: rgba(28, 105, 212, 0.06);
  --composer-shine-b: rgba(28, 105, 212, 0.08);
  --composer-depth: rgba(18, 21, 30, 0.06);
  --shadow-card: 0 10px 28px rgba(18, 24, 40, 0.08);
  --at-input-bg: rgba(18, 21, 30, 0.05);
  --at-overlay: rgba(18, 24, 40, 0.35);
  --at-chip-bg: rgba(18, 21, 30, 0.06);
  --at-composer-inner: rgba(255, 255, 255, 0.92);
  --at-chrome: rgba(248, 249, 252, 0.96);
  --cmp-glow-blue: rgba(60, 120, 255, 0.2);
  --cmp-glow-pink: rgba(255, 45, 138, 0.16);
  --cmp-glow-violet: rgba(120, 100, 230, 0.1);
}

html {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--at-bg);
  color: var(--at-text);
  font-family: var(--at-font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* Suno-like sphere dots — sits behind all UI */
.space-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: block;
}

html[data-theme="light"] .space-bg {
  opacity: 0.55;
}

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

a {
  color: var(--at-blue-soft);
  text-decoration: none;
}

.agent-test-root {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  background: transparent;
}


/* toasts */

.toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  display: grid;
  gap: 0.45rem;
  justify-items: end;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 380px;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
  box-shadow: var(--shadow-card);
  font-size: 0.85rem;
  animation: fadeIn 0.18s ease;
}

.toast::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--at-blue-soft);
}

.toast.is-error {
  border-color: color-mix(in srgb, var(--at-red) 55%, transparent);
}

.toast.is-error::before {
  background: var(--at-red);
}

.toast.is-ok::before {
  background: #4fd18b;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.25rem;
  cursor: pointer;
  border: 0;
  background: transparent;
  text-align: left;
  text-decoration: none;
  color: inherit;
  flex: 1;
  min-width: 0;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  background:
    linear-gradient(135deg, var(--at-blue), transparent 60%),
    linear-gradient(225deg, var(--at-red), #12151e 70%);
  box-shadow: inset 2px 0 0 #fff, inset 0 -2px 0 var(--at-red), inset -2px 0 0 var(--at-blue);
}

.brand-text strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.15;
}

.brand-text span {
  display: block;
  font-size: 0.7rem;
  color: var(--at-muted-soft);
}

.icon-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--at-muted);
  border-radius: 9px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--at-surface-hover);
  color: var(--at-text);
}

.icon-btn .ico {
  width: 17px;
  height: 17px;
}

.icon-btn .flip {
  transform: rotate(180deg);
}

.credits {
  display: grid;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  border-radius: 11px;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
  color: var(--at-text);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  touch-action: manipulation;
}

.credits:hover {
  background: var(--at-surface-hover);
}

.credits-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
}

.credits-top .nav-label {
  flex: 1;
  color: var(--at-muted);
}

.credits-value {
  font-weight: 650;
}

.credits-bar {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: var(--at-chip-bg);
  overflow: hidden;
}

.credits-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--at-blue-soft), var(--at-blue));
}

.credits-note {
  font-size: 0.7rem;
  color: var(--at-muted-soft);
}

.credits-note:empty {
  display: none;
}

.profile-wrap {
  position: relative;
}

.profile-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.6rem;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--at-text);
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
}

.profile-btn:hover,
.profile-btn.is-open {
  background: var(--at-surface);
  border-color: var(--at-border);
}

.profile-btn .chev {
  transform: rotate(-90deg);
  opacity: 0.5;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-weight: 650;
  font-size: 0.8rem;
  color: #fff;
  background: linear-gradient(135deg, var(--at-blue), var(--at-blue-deep));
}

.avatar--lg {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  font-size: 1.6rem;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.avatar-pick {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.avatar-pick button {
  width: 84px;
  height: 84px;
  padding: 0;
  border-radius: 20px;
  border: 2px solid transparent;
  background: var(--at-surface);
  cursor: pointer;
  overflow: hidden;
}

.avatar-pick button.is-active {
  border-color: var(--at-blue);
}

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

.profile-text {
  flex: 1;
  min-width: 0;
}

.profile-text strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-text span {
  display: block;
  font-size: 0.7rem;
  color: var(--at-muted-soft);
}

.profile-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 210px;
  z-index: 30;
  display: grid;
  gap: 0.1rem;
  padding: 0.35rem;
  border-radius: 13px;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
  box-shadow: var(--shadow-card);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--at-text);
  font-size: 0.85rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}

.menu-item:hover {
  background: var(--at-surface-hover);
}

.menu-item.is-muted {
  color: var(--at-muted-soft);
}

.menu-item .ico {
  width: 17px;
  height: 17px;
  opacity: 0.75;
}

.menu-sep {
  height: 1px;
  margin: 0.25rem 0;
  background: var(--at-border);
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: auto;
}

/* Only lock scroll when the flow panel is the page itself — not an embed inside .page */
.main:has(> .flow-panel) {
  overflow: hidden;
}

/* --------------------------------------------------------------- Flow panel */

.flow-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.flow-panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--at-border);
  background: color-mix(in srgb, var(--at-sidebar) 88%, transparent);
  flex-shrink: 0;
}

.flow-panel-bar h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.flow-panel-bar p {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--at-muted);
}

.flow-panel-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.flow-panel-frame {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: 0;
  background: #0a0a0f;
}

.flow-panel-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.flow-panel-stage .flow-panel-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.flow-panel-boot {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #030014;
}

.flow-panel-boot[hidden] {
  display: none !important;
}

.flow-panel-boot__stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1.2px 1.2px at 12% 18%, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1px 1px at 28% 62%, rgba(180, 220, 255, 0.75), transparent),
    radial-gradient(1.4px 1.4px at 44% 28%, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(1px 1px at 61% 74%, rgba(160, 200, 255, 0.7), transparent),
    radial-gradient(1.2px 1.2px at 73% 22%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 86% 58%, rgba(200, 230, 255, 0.65), transparent),
    radial-gradient(1200px 700px at 50% -10%, rgba(40, 70, 160, 0.35), transparent),
    #030014;
}

.flow-panel-boot__card {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1rem;
}

.flow-panel-boot__brand {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.flow-panel-boot__wait {
  margin: 0;
  font-size: 0.9rem;
  color: var(--at-muted);
}

/* ChatGPT desk — sizes match Flow Mini (600×900 → 2/3) */
.chatgpt-desk {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 14px 28px;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.chatgpt-desk__top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.chatgpt-desk__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin: 0;
}

.chatgpt-desk__node {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  opacity: 0.78;
}

.chatgpt-desk__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.18);
}

.chatgpt-desk__dot--ok {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.chatgpt-desk__dot--warn {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.chatgpt-desk__dot--bad {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.chatgpt-desk__spacer {
  flex: 1 1 auto;
}

.chatgpt-desk__channels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.chatgpt-desk__channelChip {
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--at-accent, #00f0ff) 28%, transparent);
  opacity: 0.85;
}

.chatgpt-desk__channelChip--local {
  border-color: color-mix(in srgb, #22c55e 45%, transparent);
}

.chatgpt-desk__channelChip--vps {
  border-color: color-mix(in srgb, #38bdf8 45%, transparent);
}

.chatgpt-desk__channelChip--app {
  border-color: color-mix(in srgb, #f59e0b 45%, transparent);
}

.chatgpt-desk__channelChip.is-dead {
  opacity: 0.45;
}

.chatgpt-desk__channelChip.is-live {
  opacity: 1;
}

.chatgpt-desk__card.is-offline {
  opacity: 0.72;
}

.chatgpt-desk__overlay--offline {
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  text-align: left;
  align-items: stretch;
  justify-content: center;
}

.chatgpt-desk__overlay--offline strong {
  font-size: 15px;
}

.chatgpt-desk__howto {
  margin: 0;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0.9;
}

.chatgpt-desk__novnc {
  width: 100%;
  height: 100%;
  border: 0;
  background: #0b0f1a;
}

.chatgpt-desk__hintSoft {
  opacity: 0.7;
  font-size: 11px;
}

.chatgpt-desk__body {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.chatgpt-desk__shell {
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--at-accent, #00f0ff) 22%, transparent);
  background: color-mix(in srgb, var(--at-sidebar) 72%, #080c1c);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.chatgpt-desk__shell--slots {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chatgpt-desk__slotsHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
  padding: 0 2px;
}

.chatgpt-desk__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 2px;
  align-items: stretch;
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.chatgpt-desk__card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.chatgpt-desk__card.is-active {
  border-color: color-mix(in srgb, var(--at-accent, #00f0ff) 50%, transparent);
  background: color-mix(in srgb, var(--at-accent, #00d4ff) 9%, transparent);
}

.chatgpt-desk__cardHit {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 16px 0 0 16px;
}

.chatgpt-desk__cardClose {
  align-self: start;
  margin: 6px 6px 0 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.45;
  padding: 0;
}

.chatgpt-desk__cardClose:hover {
  opacity: 1;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

.chatgpt-desk__thumbImg,
.chatgpt-desk__thumb {
  width: 66px;
  height: 99px;
  object-fit: cover;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chatgpt-desk__thumb {
  display: grid;
  place-items: center;
  color: var(--at-text);
}

.chatgpt-desk__thumb svg {
  width: 22px;
  height: 22px;
}

.chatgpt-desk__empty {
  margin: 0.4rem 0;
  font-size: 0.85rem;
  color: var(--at-muted);
}

.chatgpt-desk__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 20px;
  font-size: 13px;
  background: rgba(5, 7, 15, 0.82);
  color: var(--at-muted);
}

.chatgpt-desk__meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.chatgpt-desk__meta strong {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chatgpt-desk__meta em {
  font-style: normal;
  font-size: 11px;
  opacity: 0.62;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chatgpt-desk__badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.chatgpt-desk__badge--ok {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
}

.chatgpt-desk__badge--warn {
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
}

.chatgpt-desk__badge--bad {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
}

.chatgpt-desk__shell--stage {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  border-radius: 20px;
  background: color-mix(in srgb, var(--at-sidebar) 72%, #080c1c);
}

.chatgpt-desk__screenWrap {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background: #05070f;
  border: 1px solid rgba(255, 255, 255, 0.09);
  aspect-ratio: var(--chatgpt-desk-aspect, 2 / 3);
  outline: none;
  touch-action: none;
  cursor: crosshair;
}

.chatgpt-desk__screenWrap:focus-visible {
  border-color: color-mix(in srgb, var(--at-accent, #00f0ff) 55%, transparent);
}

.chatgpt-desk__screen {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  background: #111;
}

.chatgpt-desk__tap {
  position: absolute;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  border: 2px solid rgba(0, 240, 255, 0.9);
  pointer-events: none;
  animation: chatgpt-desk-tap 0.45s ease-out forwards;
}

@keyframes chatgpt-desk-tap {
  from {
    transform: scale(0.4);
    opacity: 1;
  }
  to {
    transform: scale(1.5);
    opacity: 0;
  }
}

.chatgpt-desk__warn {
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
  color: #fcd34d;
  padding: 8px 12px;
  font-size: 12px;
}

.chatgpt-desk__hint {
  margin: 0;
  font-size: 12px;
  opacity: 0.62;
  line-height: 1.4;
}

.chatgpt-desk__controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 0 0;
}

.chatgpt-desk__controlsGroup {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  margin: 0;
}

.chatgpt-desk__controlsLabel {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.55;
  padding-left: 2px;
}

.chatgpt-desk__row,
.chatgpt-desk__urlRow,
.chatgpt-desk__typeRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chatgpt-desk__urlRow,
.chatgpt-desk__typeRow {
  flex-wrap: nowrap;
  align-items: stretch;
}

.chatgpt-desk__btn {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
  white-space: nowrap;
  font-family: inherit;
}

.chatgpt-desk__btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.09);
}

.chatgpt-desk__btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.chatgpt-desk__btn--primary {
  border-color: color-mix(in srgb, var(--at-accent, #00f0ff) 50%, transparent);
  background: rgba(0, 212, 255, 0.14);
}

.chatgpt-desk__input {
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.28);
  color: inherit;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 38px;
  max-height: 120px;
}

.chatgpt-desk__input--url {
  resize: none;
  min-height: 38px;
  max-height: 38px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.chatgpt-desk__screenWrap:fullscreen,
.chatgpt-desk__screenWrap:-webkit-full-screen {
  max-width: none;
  max-height: none;
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
  background: #000;
}

@media (max-width: 900px) {
  .chatgpt-desk__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .chatgpt-desk__shell--slots {
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .chatgpt-desk__slotsHead {
    display: none;
  }

  .chatgpt-desk__card {
    min-width: 232px;
    scroll-snap-align: start;
  }

  .chatgpt-desk__screenWrap {
    width: min(100%, 360px);
    margin: 0 auto;
  }

  .chatgpt-desk__urlRow,
  .chatgpt-desk__typeRow {
    flex-wrap: wrap;
  }
}

.admin-access-strip {
  flex-shrink: 0;
  padding: 0.85rem 1.15rem 1rem;
  border-bottom: 1px solid var(--at-border);
  background: color-mix(in srgb, var(--at-surface) 70%, transparent);
  max-height: 42vh;
  overflow: auto;
}

.admin-access-strip[hidden] {
  display: none;
}

.admin-panel .flow-panel-frame {
  min-height: 60vh;
}

.admin-desk {
  min-height: 0;
  height: 100%;
  background:
    radial-gradient(900px 280px at 0% -10%, rgba(28, 105, 212, 0.16), transparent 55%),
    var(--at-bg);
}

.admin-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0.75rem 1.15rem 0;
  flex-shrink: 0;
}

.admin-tab {
  border: 1px solid var(--at-border);
  background: transparent;
  color: var(--at-muted);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font: inherit;
  cursor: pointer;
}

.admin-tab.is-on {
  color: var(--at-text);
  border-color: rgba(28, 105, 212, 0.7);
  background: rgba(28, 105, 212, 0.18);
}

.admin-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.9rem 1.15rem 0.4rem;
}

.admin-scroll:has(.admin-nasmo) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0.2rem;
}

.admin-nasmo {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--nasmo-left, 300px) 8px minmax(0, 1fr);
  gap: 0;
  height: 100%;
}

.admin-nasmo.is-resizing {
  cursor: col-resize;
  user-select: none;
}

.admin-nasmo.is-resizing iframe,
.admin-nasmo.is-resizing .admin-nasmo-detail {
  pointer-events: none;
}

.admin-nasmo-left,
.admin-nasmo-right {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--at-border);
  border-radius: 16px;
  background: var(--at-surface);
  overflow: hidden;
}

.admin-nasmo-left {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.admin-nasmo-right {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.admin-nasmo-split {
  position: relative;
  z-index: 2;
  width: 8px;
  margin: 0 -1px;
  cursor: col-resize;
  touch-action: none;
  background: transparent;
}

.admin-nasmo-split::before {
  content: "";
  position: absolute;
  top: 12%;
  bottom: 12%;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: rgba(28, 105, 212, 0.35);
}

.admin-nasmo-split:hover::before,
.admin-nasmo-split:focus-visible::before,
.admin-nasmo.is-resizing .admin-nasmo-split::before {
  background: rgba(28, 105, 212, 0.85);
  width: 3px;
}

.admin-nasmo-split:focus-visible {
  outline: none;
}

.admin-nasmo-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--at-border);
  flex-shrink: 0;
}

.admin-nasmo-search input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(28, 105, 212, 0.4);
  background: var(--at-input-bg);
  color: var(--at-text);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font: inherit;
}

.admin-nasmo-search span {
  color: var(--at-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.admin-nasmo-sort {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem 0.55rem;
  border-bottom: 1px solid var(--at-border);
  flex-shrink: 0;
  color: var(--at-muted);
  font-size: 0.8rem;
}

.admin-nasmo-sort select {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--at-border);
  background: var(--at-input-bg);
  color: var(--at-text);
  border-radius: 10px;
  padding: 0.35rem 0.55rem;
  font: inherit;
}

.admin-nasmo-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.35rem;
}

.admin-nasmo-item {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  border-radius: 12px;
  padding: 0.55rem 0.45rem 0.55rem 0.65rem;
  cursor: pointer;
  font: inherit;
}

.admin-nasmo-item-main {
  flex: 1;
  min-width: 0;
}

.admin-nasmo-item strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.25;
}

.admin-nasmo-item span,
.admin-nasmo-item em {
  display: block;
  color: var(--at-muted);
  font-size: 0.78rem;
  font-style: normal;
  margin-top: 0.15rem;
}

.admin-nasmo-item:hover,
.admin-nasmo-item.is-on {
  border-color: rgba(28, 105, 212, 0.45);
  background: rgba(28, 105, 212, 0.12);
}

.admin-nasmo-del {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--at-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.admin-nasmo-del:hover,
.admin-nasmo-del-main:hover {
  color: #ff8f8f;
  background: rgba(220, 60, 60, 0.12);
}

.admin-nasmo-right {
  background:
    radial-gradient(700px 220px at 100% 0%, rgba(28, 105, 212, 0.1), transparent 55%),
    var(--at-surface);
}

.admin-nasmo-right > .admin-read,
.admin-nasmo-detail {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
  margin: 0;
}

.admin-nasmo-empty {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 2rem;
  color: var(--at-muted);
  text-align: center;
}

.admin-nasmo-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.admin-nasmo-del-main {
  flex-shrink: 0;
  border: 1px solid rgba(220, 60, 60, 0.35);
  background: transparent;
  color: #ffb4b4;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  font: inherit;
}

.admin-nasmo-links a {
  word-break: break-all;
}

.admin-nasmo-block {
  margin-top: 0.95rem;
}

.admin-nasmo-block h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.admin-nasmo-fact {
  margin-top: 0.55rem;
}

.admin-nasmo-fact b {
  display: block;
  font-size: 0.86rem;
  color: var(--at-muted);
  font-weight: 600;
}

.admin-points {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.admin-points--fixed .admin-point.is-emotion {
  border-left: 3px solid #e8a04a;
  padding-left: 0.65rem;
  background: rgba(232, 160, 74, 0.08);
}

.admin-points--fixed .admin-point.is-taste {
  border-left: 3px solid #8b6cff;
  padding-left: 0.65rem;
}

.admin-points--fixed .admin-point.is-style {
  border-left: 3px solid #34d399;
  padding-left: 0.65rem;
  background: rgba(52, 211, 153, 0.08);
}

.admin-points--fixed .admin-point.is-visual {
  border-left: 3px solid #4a90e8;
  padding-left: 0.65rem;
  background: rgba(74, 144, 232, 0.08);
}

.admin-visual-card {
  margin: 0.35rem 0 0.2rem;
  white-space: pre-wrap;
}

.admin-visual-prompt {
  margin: 0.35rem 0 0;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.admin-visual-prompt p {
  margin: 0.25rem 0 0.45rem;
  white-space: pre-wrap;
}

.admin-points--fixed .admin-point.is-empty {
  opacity: 0.55;
}

.admin-points--fixed .admin-point.is-empty p {
  font-style: italic;
}

.admin-point-meta {
  display: block;
  color: var(--at-muted);
  font-size: 0.75rem;
  margin: 0.1rem 0 0.2rem;
}

@media (max-width: 960px) {
  .admin-nasmo {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 38vh) minmax(0, 1fr);
  }

  .admin-nasmo-split {
    display: none;
  }

  .admin-nasmo-left,
  .admin-nasmo-right {
    border-radius: 16px;
  }
}

.admin-scroll > .admin-read {
  margin-top: 0.55rem;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.admin-fold,
.admin-card,
.admin-list,
.admin-note {
  margin-bottom: 0.85rem;
}

.admin-note:last-child,
.admin-list:last-child,
.admin-fold:last-child,
.admin-card:last-child {
  margin-bottom: 0;
}

.admin-stats article {
  border: 1px solid var(--at-border);
  border-radius: 16px;
  background: var(--at-surface);
  padding: 0.85rem 0.95rem;
}

.admin-stats b {
  display: block;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.admin-stats span,
.admin-note {
  color: var(--at-muted);
  font-size: 0.86rem;
}

.admin-card,
.admin-read,
.admin-fold {
  border: 1px solid var(--at-border);
  border-radius: 16px;
  background: var(--at-surface);
  padding: 0.9rem 1rem;
}

.admin-fold {
  padding: 0;
}

.admin-fold summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
  font-weight: 650;
}

.admin-fold summary::-webkit-details-marker {
  display: none;
}

.admin-fold summary em {
  font-style: normal;
  color: var(--at-muted);
  font-weight: 500;
}

.admin-fold-body {
  padding: 0 0.6rem 0.8rem;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.admin-row {
  text-align: left;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
  color: inherit;
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  font: inherit;
}

.admin-row strong {
  display: block;
}

.admin-row span,
.admin-read header p,
.admin-tags {
  color: var(--at-muted);
  font-size: 0.86rem;
}

.admin-row:hover {
  border-color: rgba(28, 105, 212, 0.55);
}

.admin-read h2,
.admin-read h3 {
  margin: 0 0 0.35rem;
}

.admin-read section {
  margin-top: 0.85rem;
}

.admin-episodes {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.admin-episodes i {
  display: block;
  color: var(--at-muted);
  font-style: normal;
}

.admin-speech {
  white-space: pre-wrap;
  margin: 0;
  padding: 0 1rem 0.9rem;
}

.admin-cell {
  max-width: 28rem;
  white-space: pre-wrap;
}

.admin-dock {
  flex-shrink: 0;
  border-top: 1px solid var(--at-border);
  background: rgba(10, 12, 18, 0.96);
  padding: 0.55rem 1rem 0.75rem;
}

.admin-dock-reply {
  margin: 0 0 0.35rem;
  color: var(--at-muted);
  font-size: 0.86rem;
}

.admin-dock-field input {
  width: 100%;
  border: 1px solid rgba(28, 105, 212, 0.45);
  background: var(--at-input-bg);
  color: var(--at-text);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font: inherit;
}

.admin-classic-frame {
  min-height: 62vh;
  border: 0;
  border-radius: 16px;
}

@media (max-width: 800px) {
  .admin-stats {
    grid-template-columns: 1fr 1fr;
  }
}

.character-embed-panel {
  min-height: 72vh;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
}

.character-embed-panel .flow-panel-frame {
  min-height: 64vh;
  flex: 1;
}

.billing-page {
  gap: 1.1rem;
}

.billing-pay {
  overflow: hidden;
}

.billing-pay-frame {
  display: block;
  width: 100%;
  height: min(78vh, 860px);
  border: 0;
  border-radius: 12px;
  background: #0a0a0f;
}

.panel-fold {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.panel-fold-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--at-muted);
}

.panel-fold .fold-chev {
  width: 16px;
  height: 16px;
  transition: transform 0.18s ease;
}

.panel.is-folded .fold-chev {
  transform: rotate(-90deg);
}

.panel-fold-body {
  overflow: hidden;
}

.panel.is-folded .panel-fold-body {
  display: none;
}


.prompt-submit {
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  height: 34px;
  min-height: 34px;
  padding: 0 0.85rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--at-white);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, transparent 38%),
    linear-gradient(180deg, var(--at-blue-soft) 0%, var(--at-blue) 55%, var(--at-blue-deep) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28),
    0 4px 18px var(--at-blue-glow);
}

.prompt-submit:hover:not(:disabled) {
  filter: brightness(1.07);
}

.prompt-submit:disabled,
.prompt-submit.is-soon {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  filter: none;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 139, 253, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(59, 139, 253, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 139, 253, 0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------- pages v2 */

.page {
  width: min(980px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1.85rem 0 3.5rem;
  display: grid;
  gap: 1.35rem;
  align-content: start;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.page-head p {
  margin: 0.3rem 0 0;
  color: var(--at-muted);
  font-size: 13px;
}

.page-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.head-tag,
.tag {
  font-size: 0.7rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--at-border);
  color: var(--at-muted-soft);
  white-space: nowrap;
}

.head-tag.is-live,
.tag.is-live {
  border-color: color-mix(in srgb, var(--at-blue) 55%, transparent);
  background: color-mix(in srgb, var(--at-blue) 22%, transparent);
  color: #dce9ff;
}

.tag {
  margin-left: 0.4rem;
  font-weight: 500;
}

.panel {
  border-radius: 20px;
  border: 1px solid var(--composer-shell-border);
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--composer-shine-a) 70%, transparent),
      color-mix(in srgb, var(--composer-shine-b) 55%, transparent)
    ),
    var(--composer-shell-bg);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 12%, transparent), var(--shadow-card);
  padding: 1rem 1rem 1.15rem;
  display: grid;
  gap: 0.85rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.panel-head h2 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 650;
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--at-blue-soft);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
}

.link-btn--sm {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  border: 1px solid var(--at-border);
  border-radius: 8px;
  opacity: 0.88;
  text-decoration: none;
}

.link-btn--sm:hover {
  text-decoration: none;
  opacity: 1;
  border-color: color-mix(in srgb, var(--at-blue-soft) 45%, var(--at-border));
}

.link-btn:hover {
  text-decoration: underline;
}

.empty {
  margin: 0;
  color: var(--at-muted-soft);
  font-size: 0.86rem;
  padding: 0.6rem 0.1rem;
}

.muted {
  color: var(--at-muted-soft);
}

.neg {
  color: #ff8080;
}

.pos {
  color: #7ee0a5;
}

/* chat rows */

.chat-rows {
  display: grid;
  gap: 0.3rem;
}

.chat-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  color: var(--at-text);
  text-align: left;
  cursor: pointer;
}

.chat-row:hover {
  background: var(--at-surface-hover);
  border-color: var(--at-border);
}

.chat-row-ico .ico {
  width: 17px;
  height: 17px;
  opacity: 0.65;
}

.chat-row-body {
  flex: 1;
  min-width: 0;
}

.chat-row-body strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-row-body span {
  display: block;
  font-size: 0.72rem;
  color: var(--at-muted-soft);
}

/* library */

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.75rem;
}

.library-grid--sm {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.library-card {
  position: relative;
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--at-border);
  background: #000;
}

.library-card-hit {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  text-align: left;
}

.library-card-pending {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: grid;
  place-content: center;
  gap: 0.55rem;
  justify-items: center;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(120, 160, 255, 0.18), transparent 55%),
    linear-gradient(180deg, #141820, #0a0c10);
  color: var(--at-muted-soft);
  text-align: center;
  padding: 1rem;
}

.library-card-pending p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  max-width: 12rem;
}

.library-grid--pending {
  margin-bottom: 0.75rem;
}

.library-card.is-pending {
  border-color: color-mix(in srgb, var(--at-accent, #7aa2ff) 35%, var(--at-border));
}

.library-card img,
.library-card video {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}

.library-card figcaption {
  padding: 0.55rem 0.65rem 0.65rem;
  background: var(--at-surface);
}

.library-card figcaption strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-card figcaption span {
  font-size: 0.7rem;
  color: var(--at-muted-soft);
}

.library-actions {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  display: flex;
  gap: 0.3rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}

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

@media (hover: none) {
  .library-actions {
    opacity: 1;
  }
}

.library-actions a,
.library-actions button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  border: 1px solid var(--at-border);
  background: rgba(8, 10, 16, 0.82);
  color: var(--at-text);
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.library-actions .ico {
  width: 15px;
  height: 15px;
}

/* profile / stats */

.profile-card {
  grid-auto-flow: column;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.profile-card-body h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
}

.profile-card-body p {
  margin: 0.15rem 0 0.6rem;
  color: var(--at-muted-soft);
  font-size: 0.84rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--at-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--at-muted);
}

.chip .ico {
  width: 13px;
  height: 13px;
}

.chip.is-admin {
  border-color: color-mix(in srgb, var(--at-red) 50%, transparent);
  color: #ffc7c9;
}

.worker-note,
.worker-warn {
  margin: 0 0 0.8rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--at-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--at-muted-soft);
  font-size: 0.86rem;
  line-height: 1.45;
}

.worker-warn {
  border-color: color-mix(in srgb, #e0b15a 45%, transparent);
  color: #f0deb6;
}

.worker-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
}

.worker-filters .chip {
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.worker-filters .chip.is-on {
  color: #fff;
  border-color: color-mix(in srgb, var(--at-red) 55%, transparent);
}

.worker-card {
  margin-bottom: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
}

.worker-card h3 {
  margin: 0;
  font-size: 0.95rem;
}

.worker-meta {
  margin: 0.28rem 0 0;
  color: var(--at-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.worker-gpt {
  margin: 0.55rem 0 0;
  display: grid;
  gap: 0.45rem;
}

.worker-shot {
  padding-top: 0.4rem;
  border-top: 1px solid var(--at-border);
  font-size: 0.8rem;
}

.worker-shot summary {
  cursor: pointer;
  color: var(--at-muted-soft);
}

.worker-prompt {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
  color: var(--at-muted);
  font-family: inherit;
  font-size: 0.78rem;
  line-height: 1.4;
}

.tag-ok {
  color: #b7d7a8;
}

.tag-bad {
  color: #f0b4b4;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.6rem;
}

.stat {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
}

.stat b {
  display: block;
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.stat span {
  font-size: 0.75rem;
  color: var(--at-muted-soft);
}

/* forms */

.form-grid {
  display: grid;
  gap: 0.75rem;
  max-width: 460px;
}

.field {
  display: grid;
  gap: 0.3rem;
}

.field > span {
  font-size: 0.78rem;
  color: var(--at-muted-soft);
}

.field input,
.field select {
  border-radius: 11px;
  border: 1px solid var(--at-border);
  background: var(--at-input-bg);
  padding: 0.55rem 0.75rem;
  outline: none;
  font-size: 0.88rem;
}

.field input:focus,
.field select:focus {
  border-color: var(--composer-shell-border);
}

.form-actions {
  margin-top: 0.25rem;
}

/* plans */

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.plan {
  padding: 1.1rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
  display: grid;
  gap: 0.4rem;
  align-content: start;
}

.plan.is-current {
  border-color: var(--composer-shell-border);
  box-shadow: 0 0 0 1px var(--at-blue-glow);
}

.plan h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

.plan-credits {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.88rem;
}

.plan-credits .ico {
  width: 14px;
  height: 14px;
  color: var(--at-blue-soft);
}

.plan-note {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  color: var(--at-muted-soft);
}

/* tables & prompts */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.table th {
  text-align: left;
  font-weight: 550;
  color: var(--at-muted-soft);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.5rem;
}

.table td {
  padding: 0.5rem;
  border-top: 1px solid var(--at-border);
  color: var(--at-muted);
  vertical-align: top;
}

.table td:first-child {
  color: var(--at-text);
  white-space: nowrap;
}

.table .ellipsis {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompt-view {
  display: grid;
  gap: 0.35rem;
}

.prompt-view pre {
  margin: 0;
  max-height: 200px;
  overflow: auto;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--at-border);
  background: rgba(0, 0, 0, 0.32);
  font-size: 0.76rem;
  line-height: 1.45;
  white-space: pre-wrap;
  color: var(--at-muted);
}

/* ------------------------------------------------------------- producer */

.producer-choices {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.65rem;
  max-width: 28rem;
}

.producer-choices[hidden] {
  display: none;
}

.producer-choices-prompt {
  margin: 0 0 0.15rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--at-text);
}

.producer-choice {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--at-border);
  background: rgba(0, 0, 0, 0.28);
  color: var(--at-text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.producer-choice:hover {
  border-color: color-mix(in srgb, var(--at-blue) 55%, var(--at-border));
  background: rgba(0, 0, 0, 0.4);
}

.producer-choice-id {
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid var(--at-border);
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--at-muted);
}

.producer-choice-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.producer-choice-label {
  font-size: 0.9rem;
  font-weight: 550;
  line-height: 1.3;
}

.producer-choice-hint {
  font-size: 0.75rem;
  color: var(--at-muted);
  line-height: 1.35;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
  color: var(--at-text);
  font-size: 0.82rem;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  background: var(--at-surface-hover);
}

.btn .ico {
  width: 15px;
  height: 15px;
}

.btn.is-primary {
  border-color: var(--composer-shell-border);
  background: linear-gradient(135deg, var(--at-blue), var(--at-blue-deep));
  color: #fff;
  box-shadow: 0 6px 16px var(--at-blue-glow);
}

.btn.is-danger {
  color: #ff8080;
  border-color: rgba(229, 28, 35, 0.35);
}

.btn.is-danger:hover {
  background: rgba(229, 28, 35, 0.12);
}

.input {
  border-radius: 11px;
  border: 1px solid var(--at-border);
  background: var(--at-input-bg);
  color: var(--at-text);
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.86rem;
  outline: none;
  width: 100%;
}

.input:focus {
  border-color: var(--composer-shell-border);
}

.field textarea {
  border-radius: 11px;
  border: 1px solid var(--at-border);
  background: var(--at-input-bg);
  color: var(--at-text);
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.86rem;
  outline: none;
  resize: vertical;
}

.field textarea:focus {
  border-color: var(--composer-shell-border);
}

.form-grid.is-two {
  max-width: none;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-grid.is-two .field.is-wide,
.form-grid.is-two .form-actions {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
}

.panel-note {
  font-size: 0.75rem;
  color: var(--at-muted-soft);
}

.stat.is-good b {
  color: #6ee7a8;
}
.stat.is-warn b {
  color: #ffcf70;
}
.stat.is-bad b {
  color: #ff8080;
}

.pill {
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--at-border);
  color: var(--at-muted-soft);
  white-space: nowrap;
}

.pill.is-review {
  color: #ffcf70;
  border-color: rgba(255, 207, 112, 0.35);
}
.pill.is-changes,
.pill.is-late {
  color: #ff8080;
  border-color: rgba(255, 128, 128, 0.35);
}
.pill.is-done {
  color: #6ee7a8;
  border-color: rgba(110, 231, 168, 0.35);
}
.pill.is-in_progress {
  color: var(--at-blue-soft);
  border-color: rgba(59, 139, 253, 0.35);
}

/* task cards */

.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.7rem;
}

.task-card {
  display: grid;
  gap: 0.5rem;
  align-content: start;
  padding: 0.9rem 1rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
}

.task-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.task-proj {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--at-muted-soft);
}

.task-card h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}

.task-meta {
  margin: 0;
  font-size: 0.76rem;
  color: var(--at-muted-soft);
}

.task-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.task-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  text-decoration: none;
  border: 1px solid var(--composer-shell-border);
  background: linear-gradient(135deg, var(--at-blue), var(--at-blue-deep));
  color: #fff;
}

.task-link.is-ghost {
  background: transparent;
  border-color: var(--at-border);
  color: var(--at-muted);
}

.task-link.is-ghost:hover {
  color: var(--at-text);
  background: var(--at-surface-hover);
}

.task-link .ico {
  width: 14px;
  height: 14px;
}

.task-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--at-muted);
}

.task-check {
  margin: 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.2rem;
  font-size: 0.78rem;
  color: var(--at-muted-soft);
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.task-actions .input {
  flex: 1 1 160px;
  width: auto;
}

.fixme {
  padding: 0.55rem 0.7rem;
  border-radius: 11px;
  border: 1px solid rgba(255, 128, 128, 0.3);
  background: rgba(229, 28, 35, 0.1);
  font-size: 0.8rem;
  color: #ffc4c4;
}

.brief-list {
  margin: 0;
  display: grid;
  gap: 0.3rem;
  font-size: 0.78rem;
}

.brief-list > div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 0.5rem;
}

.brief-list dt {
  color: var(--at-muted-soft);
}

.brief-list dd {
  margin: 0;
  color: var(--at-muted);
}

.ref-block {
  display: grid;
  gap: 0.4rem;
}

.ref-label {
  margin: 0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--at-muted-soft);
}

.ref-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ref-card {
  display: grid;
  gap: 0.35rem;
  width: 148px;
  text-decoration: none;
  color: var(--at-text);
  border-radius: 12px;
  border: 1px solid var(--at-border);
  background: rgba(0, 0, 0, 0.22);
  overflow: hidden;
  padding-bottom: 0.45rem;
}

.ref-card img {
  width: 100%;
  height: 148px;
  object-fit: cover;
  display: block;
  background: #111;
}

.ref-card span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-size: 0.74rem;
  color: var(--at-blue-soft);
}

.ref-card .ico {
  width: 13px;
  height: 13px;
}

.submit-form {
  display: grid;
  gap: 0.4rem;
  padding-top: 0.15rem;
}

/* attention list */

.attn-list {
  display: grid;
  gap: 0.4rem;
}

.attn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
}

.attn-main {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.attn-main strong {
  font-size: 0.84rem;
}

.attn-main span {
  font-size: 0.8rem;
  color: var(--at-muted);
}

.attn-main em {
  font-size: 0.76rem;
  color: #ffc4c4;
  font-style: normal;
}

.attn-side {
  display: grid;
  justify-items: end;
  gap: 0.2rem;
  flex-shrink: 0;
}

.attn-due {
  font-size: 0.72rem;
  color: var(--at-muted-soft);
}

/* ready videos */

.ready-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.5rem;
}

.ready-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  border-radius: 13px;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
  text-decoration: none;
  color: inherit;
}

.ready-card:hover {
  background: var(--at-surface-hover);
}

.ready-ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--at-blue), var(--at-blue-deep));
  color: #fff;
  flex-shrink: 0;
}

.ready-ico .ico {
  width: 16px;
  height: 16px;
}

.ready-body {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.ready-body strong {
  font-size: 0.82rem;
}

.ready-body span {
  font-size: 0.76rem;
  color: var(--at-muted-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* project rows */

.proj-list {
  display: grid;
  gap: 0.4rem;
}

.proj-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 0.85rem;
  border-radius: 13px;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.proj-row:hover {
  background: var(--at-surface-hover);
}

.proj-main {
  display: grid;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.proj-main strong {
  font-size: 0.88rem;
}

.proj-main > span {
  font-size: 0.76rem;
  color: var(--at-muted-soft);
}

.proj-progress {
  display: grid;
  gap: 0.25rem;
  width: 130px;
  flex-shrink: 0;
}

.proj-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.proj-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--at-blue-soft), var(--at-blue));
}

.proj-num {
  font-size: 0.72rem;
  color: var(--at-muted-soft);
  text-align: right;
}

/* editor cabinet */

.editor-shell {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
  display: grid;
  gap: 1rem;
}

.editor-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.editor-head h1 {
  margin: 0;
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.editor-head p {
  margin: 0.2rem 0 0;
  font-size: 13px;
  color: var(--at-muted);
}

.editor-head-actions {
  margin-left: auto;
  display: flex;
  gap: 0.4rem;
}


/* ------------------------------------------------------------ characters */

.char-pick {
  position: relative;
  display: inline-flex;
}

.char-chip {
  gap: 0.35rem;
}

.char-chip.is-picked {
  border-color: var(--composer-shell-border);
  color: var(--at-text);
}

.char-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--at-border);
}

.char-avatar--empty {
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  font-weight: 650;
  background: rgba(28, 105, 212, 0.22);
}

.char-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(280px, 78vw);
  padding: 0.6rem;
  border-radius: 14px;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
  box-shadow: var(--shadow-card);
}

.char-pop[hidden] {
  display: none;
}

/* In the chat the composer sits at the bottom — open the list upwards. */
.chat-dock .char-pop {
  top: auto;
  bottom: calc(100% + 8px);
}

.char-pop-title {
  margin: 0 0 0.45rem;
  padding-left: 0.35rem;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--at-muted-soft);
}

.char-pop-list {
  display: grid;
  gap: 0.15rem;
  max-height: 220px;
  overflow: auto;
}

.char-opt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4rem 0.45rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--at-text);
  cursor: pointer;
  text-align: left;
}

.char-opt:hover {
  background: var(--at-surface-hover);
}

.char-opt.is-active {
  background: rgba(28, 105, 212, 0.18);
}

.char-opt .char-avatar {
  width: 24px;
  height: 24px;
}

.char-opt-name {
  flex: 1;
  min-width: 0;
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.char-opt-tag {
  font-size: 0.7rem;
  color: var(--at-muted-soft);
}

.char-pop-empty {
  margin: 0.1rem 0.35rem 0.5rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--at-muted-soft);
}

.char-pop-action {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.45rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--at-muted);
  font-size: 0.8rem;
  cursor: pointer;
  text-align: left;
}

.char-pop-action:hover {
  background: var(--at-surface-hover);
  color: var(--at-text);
}

.char-pop-action.is-muted {
  color: var(--at-muted-soft);
}

.char-pop-action input {
  display: none;
}

.char-pop-action .ico {
  width: 15px;
  height: 15px;
}

.char-form {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.char-form--edit {
  flex-direction: column;
}

.char-photo-col {
  display: grid;
  gap: 0.55rem;
  justify-items: stretch;
  width: 128px;
  flex-shrink: 0;
}

.char-form-photo {
  position: relative;
  width: 128px;
  height: 168px;
  border-radius: 22px;
  border: 2px solid rgba(255, 140, 40, 0.55);
  background: #ff7a1a;
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 122, 26, 0.35), 0 10px 28px rgba(255, 122, 26, 0.22);
}

.char-form-photo:hover {
  border-color: #ffb060;
  filter: brightness(1.04);
}

.char-form-photo input {
  display: none;
}

.char-form-photo > span[data-photo-slot] {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.char-form-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.char-form-photo img.is-doodle {
  object-fit: cover;
  background: #ff7a1a;
  transform: scale(1.14);
  transform-origin: center 58%;
}

.char-photo-empty {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  padding: 0.5rem;
}

.char-photo-empty .ico {
  width: 28px;
  height: 28px;
  opacity: 0.9;
}

.char-photo-upload-btn {
  width: 100%;
  justify-content: center;
  font-size: 0.78rem;
  padding: 0.45rem 0.5rem;
}

.char-form--studio {
  align-items: stretch;
}

.char-form-fields {
  flex: 1;
  min-width: 220px;
  display: grid;
  gap: 0.55rem;
  align-content: start;
}

.char-studio-lead {
  margin: 0 0 0.9rem;
  max-width: 42rem;
  color: var(--at-muted);
  line-height: 1.45;
}

.char-studio .char-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.9rem;
  padding: 0;
  list-style: none;
}

.char-studio .char-steps li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: var(--at-chip-bg);
  border: 1px solid var(--at-border);
  color: var(--at-muted);
  font-size: 0.75rem;
}

.char-studio .char-steps li::before {
  content: counter(char-step);
  counter-increment: char-step;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--at-blue);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 650;
}

.char-studio .char-steps {
  counter-reset: char-step;
}

.char-photo-col--studio {
  width: 168px;
}

.char-form-photo--studio {
  width: 168px;
  height: 210px;
  border-radius: 18px;
  border-color: var(--at-border);
  background:
    linear-gradient(180deg, rgba(28, 105, 212, 0.18), rgba(28, 105, 212, 0.04)),
    var(--at-input-bg);
  box-shadow: none;
  color: var(--at-text);
}

.char-form-photo--studio:hover {
  border-color: var(--at-blue);
  filter: none;
}

.char-form-fields textarea.input {
  min-height: 4.2rem;
  resize: vertical;
  line-height: 1.4;
}

.char-gender {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.char-gender-btn {
  border: 1px solid var(--at-border);
  background: var(--at-chip-bg);
  color: var(--at-muted);
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  cursor: pointer;
}

.char-gender-btn.is-on {
  border-color: rgba(28, 105, 212, 0.7);
  background: rgba(28, 105, 212, 0.16);
  color: var(--at-text);
}

.char-form-photo .char-photo-empty span {
  font-size: 0.78rem;
}

.char-form-fields .hint {
  margin: 0;
  font-size: 0.76rem;
  color: var(--at-muted-soft);
}

.char-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.char-form-grid .input--full,
.char-form-actions {
  grid-column: 1 / -1;
}

.char-form-label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: var(--at-muted-soft);
}

.char-form-label .input {
  width: 100%;
}

.char-form-section {
  grid-column: 1 / -1;
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--at-muted-soft);
}

.char-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.char-edit-panel {
  border: 1px solid rgba(28, 105, 212, 0.45);
  box-shadow: 0 0 0 1px rgba(28, 105, 212, 0.12);
}

.char-card.is-editing {
  border-color: rgba(28, 105, 212, 0.55);
}

.char-voice {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.35rem;
  padding: 0.75rem;
  border-radius: 14px;
  border: 1px solid var(--at-border);
  background: rgba(0, 0, 0, 0.22);
}

.char-voice-ready {
  display: grid;
  gap: 0.55rem;
}

.char-voice-id {
  display: block;
  font-size: 0.7rem;
  word-break: break-all;
  margin-top: 0.15rem;
}

.char-voice-ready-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.char-voice-ready-actions audio {
  width: min(100%, 240px);
  height: 32px;
}

.char-voice-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.char-voice-tab {
  border: 1px solid var(--at-border);
  background: transparent;
  color: var(--at-muted);
  border-radius: 10px;
  padding: 0.4rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.char-voice-tab.is-active {
  border-color: rgba(28, 105, 212, 0.55);
  color: var(--at-text);
  background: rgba(28, 105, 212, 0.16);
}

.char-voice-pane {
  display: grid;
  gap: 0.45rem;
}

.char-voice-clone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.char-socials {
  display: grid;
  gap: 0.45rem;
}

.char-socials-list {
  display: grid;
  gap: 0.4rem;
}

.char-social-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.35fr) 1fr auto;
  gap: 0.35rem;
  align-items: center;
}

.char-social-add {
  justify-self: start;
}

.char-analysis {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.35rem;
  padding: 0.75rem;
  border-radius: 14px;
  border: 1px dashed rgba(28, 105, 212, 0.4);
  background: rgba(28, 105, 212, 0.06);
}

.char-analysis-body {
  max-height: 280px;
  overflow: auto;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--at-text);
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--at-border);
}

.char-analysis-empty {
  margin: 0;
}

@media (max-width: 640px) {
  .char-form-grid {
    grid-template-columns: 1fr;
  }

  .char-social-row {
    grid-template-columns: 1fr auto;
  }

  .char-social-row [data-social-network] {
    grid-column: 1 / -1;
  }
}

.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem;
}

.char-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.75rem;
  border-radius: 14px;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
}

.char-card-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 11px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  display: grid;
  place-items: center;
  color: var(--at-muted-soft);
}

.char-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.char-card-empty .ico {
  width: 26px;
  height: 26px;
}

.char-card-body strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 620;
}

.char-card-body p {
  margin: 0.3rem 0 0;
  font-size: 0.77rem;
  line-height: 1.35;
  color: var(--at-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.char-card-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: auto;
}

.char-card-actions .btn:first-child {
  flex: 1;
  justify-content: center;
}

.signal-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.signal-cards--stack {
  grid-template-columns: 1fr;
  margin-top: 0;
}

.signal-card {
  border: 1px solid var(--at-border);
  background: var(--at-surface);
  border-radius: 14px;
  padding: 0.8rem 0.85rem;
  display: grid;
  gap: 0.4rem;
}

.signal-card-ref {
  width: 100%;
  height: 148px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.signal-card.is-used {
  opacity: 0.7;
}

.signal-card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
}

.signal-card-top span,
.signal-card p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--at-muted);
}

.signal-card-actions {
  display: flex;
  gap: 0.4rem;
}

.chat-thread .signal-cards {
  grid-template-columns: 1fr;
}

.signal-card-actions button,
.signal-card .btn {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--composer-shell-border);
  background: rgba(28, 105, 212, 0.16);
  color: var(--at-text);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.signal-card-actions button:hover,
.signal-card .btn:hover {
  filter: brightness(1.08);
}

.trend-cards {
  display: none;
}

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

.trend-tile {
  display: grid;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.trend-tile-media {
  display: block;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--at-border);
  background: #0b0d12;
}

.trend-tile-media video,
.trend-tile-media img,
.trend-detail-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trend-tile-meta {
  display: grid;
  gap: 2px;
  padding: 0 2px;
}

.trend-tile-meta strong {
  font-size: 12px;
  line-height: 1.3;
}

.trend-tile-stats {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 11px;
  color: var(--at-muted);
}

.trend-tile-stats .ico {
  width: 12px;
  height: 12px;
}

.trend-tile:hover .trend-tile-media {
  border-color: color-mix(in srgb, var(--at-text) 24%, transparent);
}

.trend-detail {
  display: grid;
  gap: 12px;
}

.trend-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: fit-content;
  border: 0;
  background: transparent;
  color: var(--at-muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}

.trend-back:hover {
  color: var(--at-text);
}

.trend-back .flip {
  transform: scaleX(-1);
}

.trend-detail-media {
  aspect-ratio: 9 / 16;
  max-height: min(62vh, 520px);
  margin: 0 auto;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--at-border);
  background: #0b0d12;
}

.trend-detail-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trend-detail-body {
  display: grid;
  gap: 10px;
}

.trend-detail-body strong {
  font-size: 1rem;
}

.trend-detail-body p {
  margin: 0;
  color: var(--at-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.trend-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--at-muted);
  font-size: 0.85rem;
}

.trend-stats span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.trend-stats .ico {
  width: 14px;
  height: 14px;
}

.trend-detail-body .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.trend-link {
  text-decoration: none;
}

.msg-text.is-typing::after {
  content: "▍";
  margin-left: 2px;
  opacity: 0.55;
  animation: blink 0.9s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.idea-block {
  margin-top: 0.6rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--composer-shell-border);
  background: rgba(28, 105, 212, 0.08);
}

.idea-block p,
.idea-block ol {
  margin: 0.4rem 0 0;
}

.idea-caption {
  color: var(--at-muted);
  font-size: 0.88rem;
}

.queue-note {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: var(--at-muted);
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: var(--at-text);
}

.toggle-row input {
  margin-top: 0.2rem;
}

.toggle-row.is-disabled {
  opacity: 0.5;
}

/* ------------------------------------------------------------ theme toggle */

.theme-toggle {
  display: inline-flex;
  gap: 0.3rem;
  padding: 0.25rem;
  border-radius: 12px;
  border: 1px solid var(--at-border);
  background: var(--at-input-bg);
  max-width: 100%;
}

.theme-opt {
  border: 1px solid transparent;
  background: transparent;
  color: var(--at-muted);
  border-radius: 9px;
  padding: 0.45rem 0.95rem;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 550;
  cursor: pointer;
}

.theme-opt:hover {
  color: var(--at-text);
  background: var(--at-surface-hover);
}

.theme-opt.is-active {
  color: var(--at-text);
  background: var(--at-surface);
  border-color: var(--composer-shell-border);
  box-shadow: var(--shadow-card);
}

/* ------------------------------------------------------------ light theme surfaces */

html[data-theme="light"] .home-hub-block-head h2 {
  color: var(--at-text);
}

html[data-theme="light"] .prompt-submit {
  color: #fff;
}

html[data-theme="light"] .video-replica-edits-input::placeholder,
html[data-theme="light"] .home-hub-replica-edits::placeholder,
html[data-theme="light"] .composer-lite-input::placeholder {
  color: rgba(20, 24, 36, 0.4);
}

html[data-theme="light"] .prompt-view pre,
html[data-theme="light"] .char-pop,
html[data-theme="light"] .profile-menu,
html[data-theme="light"] .modal,
html[data-theme="light"] .market-drawer {
  background: var(--at-surface);
}

html[data-theme="light"] .head-tag {
  color: var(--at-blue-deep);
}

html[data-theme="light"] .msg.is-assistant .bubble {
  background: var(--at-surface);
  border-color: var(--at-border);
}

html[data-theme="light"] .hub-example-phone {
  background: #dde3ef;
  border-color: rgba(18, 21, 30, 0.12);
}

html[data-theme="light"] .hub-example-phone-fill {
  color: rgba(20, 24, 36, 0.55);
}

/* login */

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(900px 420px at 20% -10%, rgba(88, 140, 255, 0.18), transparent 60%),
    radial-gradient(700px 380px at 90% 110%, rgba(40, 210, 170, 0.1), transparent 55%),
    var(--at-bg);
}

.login-card {
  width: min(100%, 380px);
  display: grid;
  gap: 0.75rem;
  padding: 1.4rem 1.25rem 1.25rem;
  border-radius: 18px;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.login-brand {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--at-muted-soft);
}

.login-card h1 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.login-sub {
  margin: 0 0 0.35rem;
  color: var(--at-muted-soft);
  font-size: 0.9rem;
}

.login-error {
  margin: 0;
  color: #ff7b7b;
  font-size: 0.85rem;
}

.maintenance-message {
  font-size: 1.05rem;
  color: var(--at-text, #e8ecf5);
  font-weight: 560;
}

.admin-maintenance-strip {
  margin: 0 1rem 0.75rem;
}

.access-fresh {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px dashed var(--at-border);
  background: rgba(88, 140, 255, 0.08);
  display: grid;
  gap: 0.45rem;
}

.access-code-value {
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  word-break: break-all;
}

/* ======================================================================
   33агент 2.0 — оболочка: левая панель, главная, композер, чат
   ====================================================================== */

:root {
  --sb-w: 264px;
  --sb-w-collapsed: 64px;
  --ide-side-w: 340px;
  --at-green: #4fd18b;
}

.layout {
  display: flex;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
}

/* ------------------------------------------------------------- sidebar */

.sb {
  width: var(--sb-w);
  flex-shrink: 0;
  background: color-mix(in srgb, var(--at-sidebar) 82%, transparent);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--at-sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.85rem 0.7rem 0.9rem;
  transition: width 0.18s ease;
  position: relative;
  z-index: 2;
  isolation: isolate;
  transform: translateZ(0);
}

.sb .ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sb-head {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.1rem 0.15rem;
}

.sb-head .brand {
  padding: 0.2rem 0.3rem;
}

.sb-create {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 44px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--at-blue-soft) 55%, transparent);
  background: linear-gradient(180deg, var(--at-blue-soft), var(--at-blue) 60%, var(--at-blue-deep));
  color: #fff;
  font-weight: 650;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 8px 22px var(--at-blue-glow);
}

.sb-create:hover {
  filter: brightness(1.07);
}

.sb-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.sb-pair .sb-item {
  min-width: 0;
  gap: 0.35rem;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.sb-pair .sb-label-text {
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb.is-collapsed .sb-pair {
  grid-template-columns: 1fr;
}

.archive-tabs {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: wrap;
}

.archive-tab {
  border: 0;
  background: transparent;
  color: var(--at-muted);
  font: inherit;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  cursor: pointer;
  padding: 0.12rem 0.5rem;
  border-radius: 8px;
}

.page-head .archive-tab {
  font-size: clamp(20px, 2.6vw, 26px);
}

.archive-tab.is-active {
  color: var(--at-text);
}

.archive-tab:hover {
  text-decoration: underline;
}

.sb-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
}

.sb-group {
  margin: 0.8rem 0.55rem 0.25rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--at-muted-soft);
}

.sb-group--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sb-group-link {
  border: 0;
  background: transparent;
  color: var(--at-muted-soft);
  font: inherit;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: none;
  cursor: pointer;
  padding: 0;
}

.sb-group-link:hover {
  color: var(--at-text);
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 36px;
  padding: 0.35rem 0.6rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--at-muted);
  font: inherit;
  font-size: 0.86rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  z-index: 1;
  touch-action: manipulation;
}

.sb-item:hover {
  background: var(--at-surface-hover);
  color: var(--at-text);
}

.sb-item.is-active {
  background: var(--at-surface);
  border-color: var(--at-border);
  color: var(--at-text);
  box-shadow: inset 2px 0 0 var(--at-blue);
}

.sb-item.is-active .ico {
  color: var(--at-blue-soft);
}

button.sb-item--mascot {
  width: 100%;
}

.sb-item--mascot.is-on {
  color: var(--at-text);
}

.sb-item--mascot.is-on .ico {
  color: var(--at-blue-soft);
}

.sb-mascot-panel {
  display: grid;
  gap: 0.55rem;
  margin: 0.15rem 0.35rem 0.45rem;
  padding: 0.75rem;
  border-radius: 14px;
  border: 1px solid var(--at-border);
  background: color-mix(in srgb, var(--at-surface) 88%, transparent);
}

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

.sb-mascot-title {
  margin: 0;
  font-size: 0.78rem;
  color: var(--at-muted);
}

.sb-mascot-power {
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--at-border);
  background: transparent;
  color: var(--at-text);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.sb-mascot-colors {
  display: flex;
  gap: 0.4rem;
}

.sb-mascot-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}

.sb-mascot-swatch.is-on {
  border-color: #fff;
}

.sb-mascot-swatch.is-gray { background: #8e949e; }
.sb-mascot-swatch.is-blue { background: #3b8bfd; }
.sb-mascot-swatch.is-mint { background: #3ddc97; }
.sb-mascot-swatch.is-pink { background: #ff8fb0; }
.sb-mascot-swatch.is-lilac { background: #b9a6f2; }

.at-buddy[data-tint="blue"] .at-mascot-svg { filter: hue-rotate(190deg) saturate(1.35) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.3)); }
.at-buddy[data-tint="mint"] .at-mascot-svg { filter: hue-rotate(80deg) saturate(1.2) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.3)); }
.at-buddy[data-tint="pink"] .at-mascot-svg { filter: hue-rotate(300deg) saturate(1.25) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.3)); }
.at-buddy[data-tint="lilac"] .at-mascot-svg { filter: hue-rotate(240deg) saturate(1.15) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.3)); }

.sb-item.is-soon {
  color: var(--at-muted-soft);
}

.sb-item.is-soon:hover {
  color: var(--at-muted);
}

.sb-label {
  flex: 1;
  min-width: 0;
  display: grid;
  line-height: 1.2;
}

.sb-label-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-label-sub {
  font-size: 0.68rem;
  color: var(--at-muted-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-item--thread {
  min-height: 32px;
  font-size: 0.82rem;
}

.sb-item--thread .ico {
  width: 15px;
  height: 15px;
  opacity: 0.7;
}

.sb-badge {
  font-size: 0.66rem;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  background: var(--at-chip-bg);
  color: var(--at-muted-soft);
  white-space: nowrap;
}

.sb-badge.is-live {
  background: color-mix(in srgb, var(--at-blue) 40%, transparent);
  color: #fff;
}

.sb-badge.is-soon {
  background: transparent;
  border: 1px solid var(--at-border);
}

.sb-lamp {
  width: 9px;
  height: 9px;
  margin-left: auto;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #3dd68c;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}

.sb-lamp.is-green {
  background: #3dd68c;
}

.sb-lamp.is-yellow {
  background: #f5c542;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 10px rgba(245, 197, 66, 0.85);
}

.sb-lamp.is-red {
  background: #ff4d4f;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 10px rgba(255, 77, 79, 0.85);
}

.sb.is-collapsed .sb-lamp {
  position: absolute;
  top: 7px;
  right: 7px;
  margin-left: 0;
}

.sb-foot {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.35rem;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  width: 100%;
  padding-right: 2.5rem;
}

.password-eye {
  position: absolute;
  top: 50%;
  right: 0.3rem;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--at-muted-soft);
  cursor: pointer;
}

.password-eye:hover,
.password-eye.is-on {
  color: var(--at-text);
}

.password-eye.is-on .ico {
  opacity: 0.55;
}

.scenarist-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.65rem;
  align-items: stretch;
}

.scenarist-actions .scenarist-btn-agent {
  flex: 1 1 10rem;
}

.scenarist-actions .scenarist-btn-manual {
  flex: 1 1 10rem;
  min-height: 2.6rem;
}

.sb-ops {
  display: grid;
  gap: 0.15rem;
  position: relative;
  z-index: 1;
}

/* collapsed */

.sb.is-collapsed {
  width: var(--sb-w-collapsed);
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.sb.is-collapsed .sb-label,
.sb.is-collapsed .sb-label-text,
.sb.is-collapsed .brand-text,
.sb.is-collapsed .sb-group,
.sb.is-collapsed .sb-badge,
.sb.is-collapsed .credits-bar,
.sb.is-collapsed .credits-value,
.sb.is-collapsed .profile-btn .chev,
.sb.is-collapsed .sb-item--thread {
  display: none;
}

.sb.is-collapsed .sb-head {
  flex-direction: column;
  gap: 0.3rem;
}

.sb.is-collapsed .brand {
  flex: none;
  justify-content: center;
  padding: 0;
}

.sb.is-collapsed .sb-item,
.sb.is-collapsed .sb-create,
.sb.is-collapsed .credits,
.sb.is-collapsed .profile-btn {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sb.is-collapsed .credits-top {
  justify-content: center;
}

.sb.is-collapsed .profile-menu {
  left: 0;
  right: auto;
  min-width: 220px;
}

.icon-btn.is-active {
  background: var(--at-surface);
  color: var(--at-text);
  border-color: var(--at-border);
}

.profile-menu a.menu-item {
  text-decoration: none;
}

/* ------------------------------------------------------- drawer (phone) */

.drawer-btn {
  display: none;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 62;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  border: 1px solid var(--at-border);
  background: var(--at-chrome);
  color: var(--at-muted);
  cursor: pointer;
  padding: 0;
}

.drawer-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 58;
  background: var(--at-overlay);
}

/* Drawer open / just-closed: do not let Flow iframe or page links steal the tap. */
body.is-drawer-open .main,
body.is-drawer-closing .main,
body.is-drawer-open .flow-panel-frame,
body.is-drawer-closing .flow-panel-frame {
  pointer-events: none;
}

body.is-drawer-open .sb,
body.is-drawer-closing .sb,
body.is-drawer-open .drawer-btn,
body.is-drawer-closing .drawer-btn {
  pointer-events: auto;
}

body.is-drawer-open .toasts,
body.is-drawer-closing .toasts {
  z-index: 50;
}

/* ---------------------------------------------------------------- home */

.home {
  width: min(920px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
  display: grid;
  gap: 2.4rem;
  align-content: start;
}

.home--discover {
  gap: 2rem;
  padding-top: 1.5rem;
}

.home--discover .home-hero {
  margin-top: clamp(1rem, 6vh, 3.5rem);
}

.home-section--cards,
.home-section--tariffs {
  width: min(1100px, 100%);
  margin: 0.5rem auto 0;
}

.home-tariffs-head {
  text-align: center;
  margin-bottom: 0.85rem;
  display: grid;
  gap: 0.45rem;
  justify-items: center;
}

.home-tariffs-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.home-tariffs-lead {
  margin: 0;
  max-width: 36rem;
  color: var(--at-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.home-tariffs-grid {
  margin-top: 0.35rem;
}

.home-tariffs-note {
  margin: 1.1rem auto 0;
  max-width: 42rem;
  text-align: center;
  color: var(--at-muted-soft);
  font-size: 0.82rem;
  line-height: 1.5;
}

.ai-disclaimer {
  margin: 0.85rem auto 0;
  max-width: 42rem;
  text-align: center;
  color: var(--at-muted-soft);
  font-size: 0.78rem;
  line-height: 1.45;
  opacity: 0.92;
}

.chat-ai-disclaimer {
  margin: 0 0 0.45rem;
  padding: 0 0.25rem;
  text-align: center;
  color: var(--at-muted-soft);
  font-size: 0.72rem;
  line-height: 1.4;
  opacity: 0.88;
}

.tariff-card-media {
  display: grid;
  place-content: center;
  gap: 0.35rem;
  text-align: center;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--at-blue-soft) 32%, transparent), transparent 55%),
    linear-gradient(160deg, color-mix(in srgb, var(--at-surface-hover) 85%, transparent), var(--at-surface));
}

.tariff-card.is-featured .tariff-card-media {
  background:
    radial-gradient(circle at 70% 15%, color-mix(in srgb, #ffd666 28%, transparent), transparent 50%),
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--at-blue-soft) 36%, transparent), transparent 55%),
    linear-gradient(160deg, color-mix(in srgb, var(--at-surface-hover) 85%, transparent), var(--at-surface));
}

.tariff-card-badge {
  left: 12px;
  right: auto;
}

.tariff-card-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.3rem;
  color: var(--at-text);
  font-size: 1rem;
  font-weight: 550;
}

.tariff-card-price b {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1;
}

.tariff-card-tokens {
  color: var(--at-muted);
  font-size: 0.92rem;
  font-weight: 550;
}

@media (max-width: 560px) {
  .home-composer {
    width: 100%;
    margin-top: 0;
  }

  .home-hero h1 {
    font-size: 1.55rem;
  }

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

.labs--post {
  width: min(920px, 100%);
  gap: 1.5rem;
}

.labs-char-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
}

.labs-char-card {
  display: grid;
  gap: 0.4rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: center;
  font: inherit;
  cursor: pointer;
}

.labs-char-card.is-on img,
.labs-char-card.is-on .labs-char-fallback {
  outline: 2px solid var(--at-text);
  outline-offset: 2px;
}

.post-desk {
  margin-top: 1rem;
}

.post-speak {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.post-speak textarea {
  width: 100%;
  resize: vertical;
}

.home-works-more {
  margin-top: 0.75rem;
}

.labs-char-card img,
.labs-char-fallback {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: var(--at-surface);
  border: 1px solid var(--at-border);
}

.labs-char-fallback {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--at-muted);
}

.labs-char-card strong {
  font-size: 0.82rem;
  font-weight: 500;
}

.home-hero-accent {
  background: linear-gradient(105deg, var(--at-blue-soft), #c44dff 55%, var(--at-red-soft, #ff4d55));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page--scenarist .home-composer {
  width: min(820px, 100%);
}

.scenarist-free-note {
  margin: 0.15rem auto 0;
  max-width: 52ch;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--at-muted-soft);
}

.scenarist-steps {
  width: min(720px, 100%);
  margin: 0.5rem auto 0;
}

.cmp-tools--scenarist {
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
}

.page--scenarist .cmp {
  overflow: visible;
}

.page--scenarist .cmp-bar {
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  overflow: visible;
}

.page--scenarist .cmp-pop-wrap {
  position: relative;
  z-index: 60;
}

.page--scenarist .scenarist-mini-pop {
  min-width: 9.5rem;
  width: max-content;
}

.page--scenarist .scenarist-mini-pop .char-pop-list {
  max-height: 14rem;
}

.page--scenarist .scenarist-mini-pop .char-opt {
  gap: 0.45rem;
}

.page--scenarist .cmp-send--label,
.page--scenarist .cmp-send.cmp-send--label {
  flex: 0 0 auto;
  flex-shrink: 0;
  margin-left: auto;
  align-self: center;
}

.cmp-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  height: 32px;
  padding: 0 0.35rem 0 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--at-border);
  background: var(--at-chip-bg);
  color: var(--at-text);
  cursor: pointer;
}

.cmp-select-wrap:hover {
  color: var(--at-text);
  border-color: color-mix(in srgb, var(--at-blue-soft) 45%, var(--at-border));
}

.cmp-select-ico {
  display: grid;
  place-items: center;
  pointer-events: none;
  color: var(--at-muted);
}

.cmp-select-ico .ico {
  width: 14px;
  height: 14px;
  opacity: 0.85;
}

.cmp-select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: var(--at-text);
  color-scheme: light;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 550;
  padding: 0 1rem 0 0;
  max-width: 10.5rem;
  cursor: pointer;
  outline: none;
}

/* Windows/Chrome рисует белый native popup и игнорирует тёмный option-фон —
   светлый color у select тогда сливается. Закрытый чип остаётся светлым. */
.cmp-select option,
.cmp-select optgroup {
  background-color: #ffffff;
  color: #111827;
}

.cmp-select-wrap::after {
  content: "";
  position: absolute;
  right: 0.55rem;
  top: 50%;
  width: 0.35rem;
  height: 0.35rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
  opacity: 0.55;
  pointer-events: none;
}

.cmp-send--label {
  width: auto;
  min-width: 36px;
  height: 36px;
  padding: 0 0.95rem 0 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.cmp-send--label .ico {
  width: 15px;
  height: 15px;
  opacity: 0.95;
}

@media (max-width: 720px) {
  .page--scenarist .cmp-bar {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .page--scenarist .cmp-tools--scenarist {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }
  .page--scenarist .cmp-send--label {
    margin-left: auto;
  }
  .cmp-tools--scenarist .cmp-select {
    max-width: 7.2rem;
  }
  .cmp-send--label span {
    display: inline;
  }
  .cmp-send--label {
    width: auto;
    min-width: 36px;
    padding: 0 0.95rem 0 1.05rem;
    justify-content: center;
  }
}

.home-hero {
  text-align: center;
  display: grid;
  gap: 0.5rem;
  justify-items: center;
}

.home-eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--at-blue-soft);
}

.home-hero h1 {
  margin: 0;
  font-size: clamp(30px, 4.6vw, 42px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.home-sub {
  margin: 0.1rem 0 0;
  max-width: 46ch;
  color: var(--at-muted);
  font-size: 15px;
  line-height: 1.5;
}

.home-composer {
  display: grid;
  gap: 0.75rem;
  width: min(760px, 100%);
  max-width: 100%;
  margin: -0.6rem auto 0;
  overflow: hidden;
}

.home-composer .cmp {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.home-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}

.chat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--at-border);
  background: transparent;
  color: var(--at-muted);
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.chat-chip:hover {
  color: var(--at-text);
  border-color: color-mix(in srgb, var(--at-text) 22%, transparent);
  background: var(--at-chip-bg);
}

.chat-chip .ico {
  width: 14px;
  height: 14px;
}

.home-section {
  display: grid;
  gap: 0.85rem;
}

.home-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.home-section-head h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.home-section-head h2 .home-section-link {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  padding: 0;
}

.home-section-head h2 .home-section-link:hover {
  text-decoration: underline;
}

.chronology {
  margin-top: 1.5rem;
}

.chronology-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0.15rem 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.chronology-toggle span {
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.chronology-toggle b {
  font-size: 0.82rem;
  font-weight: 550;
  color: var(--at-blue-soft);
}

.chronology-toggle:hover b {
  text-decoration: underline;
}

.chronology-body {
  margin-top: 0.85rem;
}

.home-section-head .muted {
  font-size: 0.8rem;
}

.home-two {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.5rem 2rem;
}

/* tool cards */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 0.7rem;
}

.mode-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.mode-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
  color: var(--at-text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.mode-card:hover {
  border-color: color-mix(in srgb, var(--at-blue-soft) 45%, transparent);
  background: var(--at-surface-hover);
  transform: translateY(-1px);
}

.mode-card.is-soon {
  opacity: 0.78;
}

.mode-card-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--at-blue) 14%, transparent);
  color: var(--at-blue-soft);
}

.mode-card-ico .ico {
  width: 20px;
  height: 20px;
}

.mode-card-body {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.mode-card-body strong {
  font-size: 0.95rem;
  font-weight: 620;
}

.mode-card-body span {
  font-size: 0.8rem;
  color: var(--at-muted);
  line-height: 1.35;
}

.mode-card-tag {
  flex-shrink: 0;
  align-self: flex-start;
}

.tool-list {
  display: grid;
  gap: 0.55rem;
}

.tool-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 0.95rem;
  border-radius: 16px;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
  color: var(--at-text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.tool-card:hover {
  border-color: color-mix(in srgb, var(--at-blue-soft) 45%, transparent);
  background: var(--at-surface-hover);
  transform: translateY(-1px);
}

.tool-card.is-soon {
  opacity: 0.78;
}

.tool-card-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--at-blue-soft);
  background: color-mix(in srgb, var(--at-blue) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--at-blue) 30%, transparent);
}

.tool-card-ico .ico {
  width: 20px;
  height: 20px;
}

.tool-card-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.tool-card-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: 650;
}

.tool-card-title .tag {
  margin-left: 0;
}

.tool-card-about {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--at-muted);
}

.tool-card-chev {
  width: 16px;
  height: 16px;
  color: var(--at-muted-soft);
  flex-shrink: 0;
}

/* pipeline */

.pipeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  counter-reset: step;
}

.pipeline-step {
  position: relative;
  display: grid;
  gap: 0.45rem;
  padding: 0.85rem 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--at-border);
  background: color-mix(in srgb, var(--at-surface) 70%, transparent);
}

.pipeline-step.is-soon {
  border-style: dashed;
  opacity: 0.75;
}

.pipeline-step:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -0.5rem;
  top: 50%;
  width: 0.5rem;
  height: 1px;
  background: var(--at-border);
}

.pipeline-num {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--at-muted-soft);
}

.pipeline-ico .ico {
  width: 20px;
  height: 20px;
  color: var(--at-blue-soft);
}

.pipeline-step.is-soon .pipeline-ico .ico {
  color: var(--at-muted-soft);
}

.pipeline-text {
  display: grid;
  gap: 0.15rem;
}

.pipeline-text strong {
  font-size: 0.84rem;
  font-weight: 620;
  line-height: 1.25;
}

.pipeline-text span {
  font-size: 0.72rem;
  color: var(--at-muted-soft);
  line-height: 1.3;
}

/* works strip */

.works-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.work-thumb-wrap {
  position: relative;
}

.work-kind {
  position: absolute;
  z-index: 1;
  top: 0.4rem;
  left: 0.4rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 0.68rem;
  line-height: 1.3;
  pointer-events: none;
}

.work-thumb {
  padding: 0;
  border: 1px solid var(--at-border);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  aspect-ratio: 3 / 4;
  width: 100%;
  display: block;
}

.work-thumb img,
.work-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.work-thumb:hover img {
  transform: scale(1.04);
}

.work-thumb-del {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  border: 1px solid var(--at-border);
  background: rgba(8, 10, 16, 0.82);
  color: var(--at-text);
  cursor: pointer;
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.work-thumb-wrap:hover .work-thumb-del,
.work-thumb-del:focus-visible {
  opacity: 1;
}

.work-thumb-del .ico {
  width: 14px;
  height: 14px;
}

@media (hover: none) {
  .work-thumb-del {
    opacity: 1;
  }
}

/* ----------------------------------------------------------- tool pages */

.page--tool {
  width: min(820px, calc(100% - 2.5rem));
  gap: 1.8rem;
}

.tool-hero {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.tool-hero-ico {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--at-blue-soft);
  background: color-mix(in srgb, var(--at-blue) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--at-blue) 30%, transparent);
}

.tool-hero-ico .ico {
  width: 26px;
  height: 26px;
}

.tool-hero-body h1 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.tool-hero-tag {
  margin-left: 0;
  font-weight: 500;
}

.tool-hero-body p {
  margin: 0.45rem 0 0;
  max-width: 60ch;
  color: var(--at-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.tool-composer {
  display: grid;
  gap: 0.5rem;
}

.tool-composer-note {
  margin: 0;
  padding-left: 0.3rem;
  font-size: 0.78rem;
  color: var(--at-muted-soft);
}

.tool-soon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tool-soon-actions .btn {
  text-decoration: none;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--at-border);
  background: color-mix(in srgb, var(--at-surface) 70%, transparent);
  font-size: 0.88rem;
}

.steps-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--at-blue-soft);
  background: color-mix(in srgb, var(--at-blue) 16%, transparent);
}

/* ------------------------------------------------------------- composer */

.cmp {
  position: relative;
  isolation: isolate;
  z-index: 1;
  display: grid;
  gap: 0.35rem;
  padding: 0.6rem 0.7rem 0.55rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(14, 16, 24, 0.78);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 18px 40px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(70, 120, 255, 0.08);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Soft blue → pink wash around every composer (Suno-like, low intensity) */
.cmp::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 118%;
  height: 210%;
  transform: translate(-50%, -48%);
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 58% 52% at 32% 48%, var(--cmp-glow-blue), transparent 68%),
    radial-gradient(ellipse 52% 48% at 72% 55%, var(--cmp-glow-pink), transparent 70%),
    radial-gradient(ellipse 70% 60% at 50% 50%, var(--cmp-glow-violet), transparent 72%);
  filter: blur(28px);
  opacity: 0.55;
  animation: cmp-glow-shift 9s ease-in-out infinite alternate;
}

.cmp::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    rgba(70, 130, 255, 0.22),
    rgba(150, 80, 220, 0.08) 45%,
    rgba(255, 45, 138, 0.18)
  );
  opacity: 0.45;
  filter: blur(10px);
  animation: cmp-glow-ring 7s ease-in-out infinite alternate;
}

@keyframes cmp-glow-shift {
  from {
    opacity: 0.42;
    transform: translate(-52%, -50%) scale(0.98);
  }
  to {
    opacity: 0.62;
    transform: translate(-48%, -46%) scale(1.04);
  }
}

@keyframes cmp-glow-ring {
  from {
    opacity: 0.28;
  }
  to {
    opacity: 0.5;
  }
}

.cmp:focus-within {
  border-color: rgba(120, 160, 255, 0.42);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 18px 44px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(90, 140, 255, 0.16),
    0 0 28px rgba(255, 45, 138, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .cmp::before,
  .cmp::after {
    animation: none;
  }
}

.cmp.is-drop {
  border-color: var(--at-blue-soft);
  border-style: dashed;
}

.cmp.is-busy {
  opacity: 1;
}

.cmp-send.is-stop {
  width: 30px;
  height: 30px;
  background: linear-gradient(180deg, #c47a74, #a8625c 58%, #8f524e);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 3px 10px rgba(120, 50, 46, 0.22);
}

.cmp-send.is-stop .ico {
  width: 13px;
  height: 13px;
}

.cmp--lg {
  padding: 0.85rem 0.85rem 0.7rem;
  border-radius: 22px;
}

.cmp-input {
  width: 100%;
  min-height: 2.2rem;
  max-height: 220px;
  resize: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0.3rem 0.3rem 0.1rem;
  font: inherit;
  /* ≥16px: iOS Safari zoom on focus (body is 14px) */
  font-size: max(16px, 0.96rem);
  line-height: 1.5;
  outline: none;
}

.cmp--attach-collapsed .cmp-input {
  min-height: 3.1rem;
  padding: 0.45rem 0.3rem 0.35rem;
}

.cmp--lg .cmp-input {
  min-height: 3rem;
  font-size: max(16px, 1.02rem);
}

.cmp-input::placeholder {
  color: var(--at-muted-soft);
}

.cmp-attach-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
  padding: 0.1rem 0.15rem 0;
}

.cmp-attach-row--photo {
  position: relative;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  max-width: 100%;
  padding: 0.15rem 0.15rem 0.35rem;
}

.cmp-trend-preview {
  flex: 0 0 auto;
  width: 44px;
  height: 64px;
  padding: 0;
  border: 1px solid var(--at-border);
  border-radius: 10px;
  overflow: hidden;
  background: #0b0d12;
  cursor: pointer;
}

.cmp-trend-preview video,
.cmp-trend-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cmp-attach-row--photo .cmp-chip--url {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  height: 36px;
  padding: 0 0.35rem 0 0.7rem;
  border-radius: 12px;
}

.cmp-attach-row--photo .cmp-chip--url input {
  flex: 1 1 auto;
  width: 0;
  min-width: 0;
  font-size: 0.88rem;
}

.cmp-attach-row--photo .cmp-icon-btn,
.cmp-attach-row--photo .cmp-char-btn,
.cmp-attach-row--photo .cmp-file-btn {
  flex-shrink: 0;
}

.cmp-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0 0.85rem 0 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--at-border);
  background: var(--at-chip-bg);
  color: var(--at-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
}

.cmp-file-btn:hover:not(:disabled) {
  color: var(--at-text);
  border-color: color-mix(in srgb, var(--at-text) 25%, transparent);
}

.cmp-file-btn .ico {
  width: 15px;
  height: 15px;
  color: var(--at-blue-soft);
}

.cmp-attach-row--photo:has([data-file-chip]:not([hidden])) .cmp-file-btn {
  display: none;
}

.cmp-attach-row--photo:has([data-file-chip]:not([hidden])) [data-file-chip] {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  height: 36px;
  overflow: hidden;
  border-radius: 12px;
}

.cmp-attach-row--photo .cmp-pop-wrap {
  position: relative;
  flex-shrink: 0;
}

.cmp-attach-row--photo .char-pop {
  right: 0;
  left: auto;
}

.cmp-attach-row[hidden] {
  display: none;
}

.cmp-chip--lock {
  height: 32px;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--at-border);
  background: color-mix(in srgb, var(--at-chip-bg) 80%, transparent);
  color: var(--at-muted);
  font-size: 0.72rem;
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.msg-images .is-video .result {
  width: min(280px, 100%);
  border-radius: 14px;
  background: #000;
  display: block;
}

.cmp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  height: 30px;
  padding: 0 0.3rem 0 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--at-border);
  background: var(--at-chip-bg);
  color: var(--at-muted);
  font-size: 0.78rem;
}

.cmp-chip.is-hidden,
.cmp-chip[hidden] {
  display: none;
}

.cmp-chip .ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.cmp-frame-settings {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.cmp-chip--duration {
  padding-right: 0.6rem;
  border-color: color-mix(in srgb, var(--at-blue) 55%, var(--at-border));
  background: color-mix(in srgb, var(--at-blue) 16%, var(--at-chip-bg));
  color: var(--at-text);
  cursor: pointer;
}

.cmp-chip--duration:hover:not(:disabled),
.cmp-chip--duration:focus-visible {
  border-color: var(--at-blue);
  background: color-mix(in srgb, var(--at-blue) 25%, var(--at-chip-bg));
}

.cmp-chip > span,
.cmp-chip [data-file-name] {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--at-text);
}

.cmp-chip input {
  border: 0;
  background: transparent;
  color: var(--at-text);
  font: inherit;
  font-size: 0.8rem;
  width: min(360px, 56vw);
  outline: none;
}

.cmp-chip .char-avatar {
  width: 18px;
  height: 18px;
}

.cmp-chip-x {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--at-muted-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.cmp-chip-x:hover {
  background: var(--at-surface-hover);
  color: var(--at-text);
}

.cmp-chip-x .ico {
  width: 12px;
  height: 12px;
}

.cmp-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cmp-tools {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 1;
  min-width: 0;
}

.cmp-pop-wrap {
  position: relative;
}

.cmp-icon-btn,
.cmp-char-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--at-border);
  background: transparent;
  color: var(--at-muted);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.cmp-icon-btn:hover:not(:disabled),
.cmp-char-btn:hover:not(:disabled),
.cmp-mode:hover:not(:disabled) {
  color: var(--at-text);
  border-color: color-mix(in srgb, var(--at-text) 25%, transparent);
  background: var(--at-chip-bg);
}

.cmp-icon-btn .ico,
.cmp-char-btn .ico {
  width: 16px;
  height: 16px;
}

.cmp-char-btn.is-picked {
  border-color: color-mix(in srgb, var(--at-blue-soft) 50%, transparent);
  padding: 0;
  overflow: hidden;
}

.cmp-char-btn .char-avatar {
  width: 30px;
  height: 30px;
  border: 0;
}

.cmp-mode {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 32px;
  padding: 0 0.7rem 0 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--at-border);
  background: transparent;
  color: var(--at-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
}

.cmp-mode.is-static {
  cursor: default;
  color: var(--at-muted);
}

.cmp-char-mode .char-avatar {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.cmp-char-mode.is-picked {
  border-color: color-mix(in srgb, var(--at-blue-soft) 50%, transparent);
  color: var(--at-text);
}

.cmp-mode .ico {
  width: 15px;
  height: 15px;
}

.cmp-mode .chev {
  width: 13px;
  height: 13px;
  opacity: 0.6;
}

.cmp-hint {
  font-size: 0.7rem;
  color: var(--at-muted-soft);
  white-space: nowrap;
}

.cmp-send {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 0;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, var(--at-blue-soft), var(--at-blue) 60%, var(--at-blue-deep));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 6px 18px var(--at-blue-glow);
}

.cmp-send:hover:not(:disabled) {
  filter: brightness(1.08);
}

.cmp-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.cmp-send .ico {
  width: 17px;
  height: 17px;
}

/* Лейбл «С агентом»: выше специфичность — иначе .cmp-send (ниже по файлу) сжимает в круг 36px. */
.cmp-send.cmp-send--label {
  width: auto;
  min-width: 36px;
  height: 36px;
  padding: 0 0.95rem 0 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  border-radius: 999px;
}

.cmp-send.cmp-send--label .ico {
  width: 15px;
  height: 15px;
  opacity: 0.95;
  flex-shrink: 0;
}

/* popovers */

.cmp-pop {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 40;
  min-width: 220px;
  display: grid;
  gap: 2px;
  padding: 0.4rem;
  border-radius: 14px;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
  box-shadow: var(--shadow-card);
}

.cmp-pop[hidden] {
  display: none;
}

.cmp .char-pop {
  top: auto;
  right: auto;
  left: 0;
  bottom: calc(100% + 8px);
  width: min(300px, 80vw);
}

/* Home composer sits high — open popovers down so the list is not clipped */
.home-composer .cmp-pop,
.home-composer .cmp .char-pop {
  top: calc(100% + 8px);
  bottom: auto;
}

.home-composer .char-pop-list {
  max-height: min(280px, 42vh);
}

.cmp-pop.is-pop-down,
.cmp .char-pop.is-pop-down {
  top: calc(100% + 8px);
  bottom: auto;
}

.cmp-pop.is-pop-up,
.cmp .char-pop.is-pop-up {
  top: auto;
  bottom: calc(100% + 8px);
}

/* Fixed placement (JS) — escapes .cmp backdrop-filter clipping on mobile WebKit */
.cmp-pop.is-pop-fixed,
.cmp .char-pop.is-pop-fixed {
  position: fixed;
  right: auto;
  max-width: calc(100vw - 16px);
  /* top / left / bottom / width / max-height set inline by placeComposerPop */
}

.cmp-pop-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--at-text);
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}

.cmp-pop-item:hover:not(:disabled) {
  background: var(--at-surface-hover);
}

.cmp-pop-item .ico {
  width: 15px;
  height: 15px;
  color: var(--at-muted);
}

.cmp-pop-item.is-active {
  background: color-mix(in srgb, var(--at-blue) 16%, transparent);
}

.cmp-pop-item.is-soon,
.cmp-pop-item:disabled {
  color: var(--at-muted-soft);
  cursor: not-allowed;
}

.cmp-pop-item em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.68rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--at-border);
}

.prompt-chip {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--at-border);
  background: var(--at-chip-bg);
  color: inherit;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 550;
  cursor: pointer;
}

.prompt-chip:hover {
  border-color: var(--composer-shell-border);
}

/* ------------------------------------------------------------------ IDE */

.ide {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.main:has(.ide) {
  overflow: hidden;
}

.ide-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 52px;
  padding: 0.45rem 0.9rem 0.45rem 0.7rem;
  border-bottom: 1px solid var(--at-sidebar-border);
  background: var(--at-bg);
  flex-shrink: 0;
}

.ide-title {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 0.1rem;
}

.ide-title h1 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ide-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: var(--at-muted-soft);
  white-space: nowrap;
  overflow: hidden;
}

.ide-agent {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--at-muted);
}

.ide-agent .ico {
  width: 13px;
  height: 13px;
}

.ide-status.is-live {
  color: var(--at-blue-soft);
}

.ide-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.ide-topic-btn {
  height: 30px;
  padding: 0 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--at-border);
  background: transparent;
  color: var(--at-text);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.ide-topic-btn:hover {
  background: var(--at-surface-hover);
}

.ide-topic-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.home-tool-switch {
  position: relative;
}

.home-tool-switch .cmp-pop {
  top: calc(100% + 6px);
  right: 0;
  bottom: auto;
  left: auto;
  min-width: 190px;
}

.producer-sound.is-on {
  color: var(--at-blue-soft);
}

.thread-earlier {
  margin: 0 0 0.85rem;
  border: 1px solid var(--at-border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--at-surface) 72%, transparent);
}

.thread-earlier summary {
  cursor: pointer;
  padding: 0.65rem 0.85rem;
  color: var(--at-muted);
  font-size: 0.84rem;
}

.thread-earlier-body {
  padding: 0 0.35rem 0.45rem;
}

.topic-break {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.15rem 0 0.35rem;
  color: var(--at-muted);
  font-size: 0.75rem;
}

.topic-break::before,
.topic-break::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--at-border);
}

.ide-body {
  flex: 1;
  display: flex;
  min-height: 0;
  min-width: 0;
  position: relative;
}

.ide-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

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

.ide-thread {
  width: min(760px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1.6rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

/* Previous producer chats — expand above the thread */
.prev-chats {
  margin: -0.35rem 0 0.15rem;
}

.prev-chats-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: var(--at-muted, #8b93a7);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  padding: 0.2rem 0.15rem;
  border-radius: 8px;
}

.prev-chats-toggle:hover {
  color: var(--at-text, #e8eaef);
}

.prev-chats-chev {
  display: inline-flex;
  transition: transform 0.18s ease;
  opacity: 0.85;
}

.prev-chats-chev .ico {
  width: 14px;
  height: 14px;
}

.prev-chats.is-open .prev-chats-chev {
  transform: rotate(180deg);
}

.prev-chats-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.15rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--at-border) 70%, transparent);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--at-muted, #8b93a7);
}

.prev-chats-panel {
  margin-top: 0.55rem;
  padding: 0.35rem;
  border: 1px solid var(--at-sidebar-border, var(--at-border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--at-panel, #14161c) 88%, transparent);
}

.prev-chats-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-height: min(42vh, 320px);
  overflow-y: auto;
}

.prev-chats-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
}

.prev-chats-item:hover {
  background: color-mix(in srgb, var(--at-blue-soft, #6ea8ff) 12%, transparent);
}

.prev-chats-thumb,
.prev-chats-ico {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
}

.prev-chats-ico {
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--at-border) 55%, transparent);
  color: var(--at-muted, #8b93a7);
}

.prev-chats-ico .ico {
  width: 16px;
  height: 16px;
}

.prev-chats-body {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 0.1rem;
}

.prev-chats-body strong {
  font-size: 0.84rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prev-chats-body span {
  font-size: 0.72rem;
  color: var(--at-muted, #8b93a7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prev-chats-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-top: 1px solid var(--at-sidebar-border, var(--at-border));
  border-radius: 0 0 10px 10px;
  background: transparent;
  color: var(--at-blue-soft, #6ea8ff);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 550;
  cursor: pointer;
}

.prev-chats-new:hover {
  background: color-mix(in srgb, var(--at-blue-soft, #6ea8ff) 10%, transparent);
}

.prev-chats-new .ico {
  width: 14px;
  height: 14px;
}

.ide-dock {
  flex-shrink: 0;
  padding: 0.85rem 1.25rem 1.15rem;
  background: linear-gradient(180deg, transparent, var(--at-bg) 30%);
  overflow: visible;
}

.ide-dock-inner {
  position: relative;
  width: min(760px, 100%);
  margin: 0 auto;
  overflow: visible;
}

.ide-scrim {
  display: none;
}

/* right panel */

.ide-side {
  width: 0;
  flex-shrink: 0;
  border-left: 1px solid transparent;
  background: var(--at-sidebar);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  transition: width 0.18s ease;
}

.ide-side.is-open {
  width: var(--ide-side-w);
  border-left-color: var(--at-sidebar-border);
}

.brain-rail {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  width: min(760px, calc(100% - 2.5rem));
  margin: 0.55rem auto 0;
  padding: 0.35rem 0.4rem 0.35rem 0.55rem;
  border: 1px solid var(--at-sidebar-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--at-sidebar) 88%, transparent);
  color: var(--at-muted);
}

.ide-body:has(.ide-side.is-open) .brain-rail {
  display: none;
}

.brain-rail-open {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  min-width: 0;
  padding: 0.15rem 0.2rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.brain-rail-open:hover {
  color: var(--at-text);
}

.brain-rail-max,
.brain-rail-min {
  font-size: 0.62rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.brain-rail-num {
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1;
  color: var(--at-text);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 1.6rem;
  text-align: center;
}

.brain-rail-track {
  flex: 1;
  height: 8px;
  min-width: 48px;
  border-radius: 999px;
  background: var(--at-chip-bg);
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
}

.brain-rail-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: color-mix(in srgb, var(--at-blue) 72%, white);
}

.brain-rail-close {
  flex-shrink: 0;
  width: 1.7rem;
  height: 1.7rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--at-muted);
  font: inherit;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

.brain-rail-close:hover {
  color: var(--at-text);
  background: var(--at-surface-hover);
}

.ide-side-head {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.6rem 0.5rem 0.7rem;
  border-bottom: 1px solid var(--at-sidebar-border);
  flex-shrink: 0;
  min-width: var(--ide-side-w);
}

.ide-tabs {
  display: flex;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.ide-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 30px;
  padding: 0 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--at-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
}

.ide-tab:hover {
  color: var(--at-text);
  background: var(--at-surface-hover);
}

.ide-tab.is-active {
  color: var(--at-text);
  background: var(--at-surface);
  border-color: var(--at-border);
}

.ide-tab .ico {
  width: 14px;
  height: 14px;
}

.ide-side-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.85rem 0.85rem 1.2rem;
  display: grid;
  gap: 1rem;
  align-content: start;
  min-width: var(--ide-side-w);
  scrollbar-width: thin;
}

.side-empty {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  text-align: center;
  padding: 2.2rem 1rem;
  border: 1px dashed color-mix(in srgb, var(--at-text) 14%, transparent);
  border-radius: 16px;
  color: var(--at-muted-soft);
}

.side-empty .ico {
  width: 26px;
  height: 26px;
  margin-bottom: 0.3rem;
}

.side-empty p {
  margin: 0;
  color: var(--at-muted);
  font-size: 0.92rem;
  font-weight: 550;
}

.side-empty span {
  font-size: 0.78rem;
  line-height: 1.4;
}

.side-figure {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--at-border);
  background: #000;
}

.side-figure img {
  display: block;
  width: 100%;
  max-height: min(52vh, 520px);
  object-fit: contain;
  cursor: zoom-in;
}

.side-block {
  display: grid;
  gap: 0.5rem;
}

.side-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--at-muted-soft);
}

.side-note {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--at-muted-soft);
}

.side-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.side-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--at-muted);
}

.side-status .ico {
  width: 12px;
  height: 12px;
  color: var(--at-green);
}

.side-status .ico.is-live {
  color: var(--at-blue-soft);
}

.side-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.side-refs a {
  display: grid;
  gap: 0.25rem;
  width: 84px;
  color: var(--at-muted-soft);
  font-size: 0.7rem;
  text-align: center;
}

.side-refs img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--at-border);
  background: #000;
}

.side-history {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}

.side-history-thumb {
  padding: 0;
  border: 1px solid var(--at-border);
  border-radius: 9px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  aspect-ratio: 1;
}

.side-history-thumb.is-active {
  border-color: var(--at-blue-soft);
}

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

.side-facts {
  margin: 0;
  display: grid;
  gap: 0.3rem;
}

.side-facts div {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.82rem;
}

.side-facts dt {
  color: var(--at-muted-soft);
}

.side-facts dd {
  margin: 0;
  color: var(--at-text);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mem-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.mem-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.55rem 0.4rem 0.55rem 0.65rem;
  border-radius: 11px;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
  font-size: 0.83rem;
  line-height: 1.35;
}

.mem-item > .ico {
  width: 14px;
  height: 14px;
  margin-top: 0.15rem;
  color: var(--at-blue-soft);
  flex-shrink: 0;
}

.mem-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.mem-del {
  width: 24px;
  height: 24px;
  margin: -0.1rem 0;
}

.mem-del .ico {
  width: 13px;
  height: 13px;
}

.mem-form,
.signal-form {
  display: grid;
  gap: 0.4rem;
}

.mem-form {
  grid-template-columns: 1fr auto;
}

.mem-form input,
.signal-form .input {
  height: 36px;
  border: 1px solid var(--at-border);
  border-radius: 10px;
  background: var(--at-input-bg);
  color: inherit;
  padding: 0 0.7rem;
  font: inherit;
  font-size: 0.84rem;
  outline: none;
}

.mem-form input:focus,
.signal-form .input:focus {
  border-color: var(--composer-shell-border);
}

.mem-form .btn {
  padding: 0 0.6rem;
}

.signal-form .btn {
  justify-self: start;
}

/* план продюсера: связка работ на несколько шагов */

.producer-plan {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.producer-plan-step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--at-border);
  border-radius: 12px;
}

.producer-plan-step.is-done,
.producer-plan-step.is-skipped {
  opacity: 0.55;
}

.producer-plan-step.is-skipped {
  text-decoration: line-through;
}

.producer-plan-mark {
  flex: none;
  display: inline-flex;
  margin-top: 0.15rem;
  color: var(--at-muted);
}

/* .ico без размера сворачивается в ноль — каждый контекст задаёт его сам. */
.producer-plan-mark .ico {
  width: 14px;
  height: 14px;
}

.producer-plan-step.is-done .producer-plan-mark {
  color: var(--at-blue);
}

.producer-plan-body {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.producer-plan-body span {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--at-muted);
}

.producer-plan-why {
  color: var(--at-muted-soft);
}

/* brief — админская вкладка продюсера */

.brief-form {
  display: grid;
  gap: 1rem;
}

/* ------------------------------------------------ мозг продюсера */

.brain-panel {
  display: grid;
  gap: 0.85rem;
}

.brain-fold {
  border: 1px solid var(--at-border);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  background: var(--at-surface);
}

.brain-fold summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--at-muted);
  list-style: none;
}

.brain-fold summary::-webkit-details-marker {
  display: none;
}

.brain-guide ol {
  margin: 0.65rem 0 0.15rem;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.4rem;
  font-size: 0.8rem;
  line-height: 1.4;
}

.brain-guide li strong {
  font-weight: 650;
}

.brain-dump textarea,
.brain-rules textarea,
.brain-owner input,
.brief-field textarea {
  width: 100%;
}

.brain-dump {
  display: grid;
  gap: 0.45rem;
}

.brain-dump textarea {
  min-height: 8.5rem;
  resize: vertical;
  border: 1px solid var(--at-border);
  border-radius: 12px;
  background: var(--at-input-bg);
  color: inherit;
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.4;
}

.brain-dump .btn {
  justify-self: start;
}

.brain-accounts {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--at-muted);
}

.mem-edit {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.83rem;
  line-height: 1.35;
  padding: 0;
  outline: none;
}

.brain-nudge {
  display: block;
  width: 100%;
  margin: 0 0 0.45rem;
  padding: 0.45rem 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--at-border);
  background: transparent;
  color: var(--at-muted);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.brain-nudge:hover {
  color: var(--at-text);
  background: var(--at-surface-hover);
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.btn--tiny {
  padding: 0.22rem 0.5rem;
  font-size: 0.74rem;
  border-radius: 8px;
}

.brain-projects {
  display: grid;
  gap: 0.35rem;
}

.brain-project {
  display: grid;
  gap: 0.1rem;
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--at-border);
  background: var(--at-input-bg);
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.brain-project:hover {
  border-color: var(--composer-shell-border);
}

.brain-project.is-active {
  border-color: color-mix(in srgb, var(--at-blue) 60%, transparent);
  background: color-mix(in srgb, var(--at-blue) 10%, transparent);
}

.brain-chars {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.brain-char {
  display: grid;
  gap: 0.05rem;
  text-align: left;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--at-border);
  background: var(--at-input-bg);
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.brain-char strong {
  font-size: 0.8rem;
}

.brain-char span {
  font-size: 0.68rem;
  color: var(--at-muted);
}

.brain-char.is-active {
  border-color: color-mix(in srgb, var(--at-blue) 60%, transparent);
  background: color-mix(in srgb, var(--at-blue) 10%, transparent);
}

.producer-plan-skip {
  border: 0;
  background: transparent;
  color: var(--at-muted);
  font: inherit;
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0.15rem 0;
}

.producer-plan-skip:hover {
  color: inherit;
}

.brain-project-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.brain-project-sub {
  font-size: 0.72rem;
  color: var(--at-muted);
}

.brain-owner,
.brain-rules {
  display: grid;
  gap: 0.4rem;
}

.brain-owner input,
.brain-rules textarea {
  border: 1px solid var(--at-border);
  border-radius: 10px;
  background: var(--at-input-bg);
  color: inherit;
  font: inherit;
  font-size: 0.82rem;
  padding: 0.45rem 0.6rem;
  outline: none;
  resize: vertical;
}

.brain-owner input:focus,
.brain-rules textarea:focus {
  border-color: var(--composer-shell-border);
}

.brain-lessons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.brain-lesson {
  font-size: 0.78rem;
  line-height: 1.35;
  padding: 0.4rem 0.55rem;
  border-radius: 9px;
  border-left: 2px solid transparent;
  background: var(--at-chip-bg);
}

.brain-lesson.is-ok {
  border-left-color: color-mix(in srgb, #3ecf8e 70%, transparent);
}

.brain-taste-row {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.brain-taste-row span {
  flex: 1;
}

.brain-lesson.is-no {
  border-left-color: color-mix(in srgb, #f27d7d 70%, transparent);
}

.brain-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.brain-mode-btn {
  display: grid;
  gap: 0.15rem;
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--at-border);
  background: var(--at-input-bg);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.brain-mode-btn strong {
  font-size: 0.82rem;
}

.brain-mode-btn span {
  font-size: 0.7rem;
  color: var(--at-muted);
}

.brain-mode-btn.is-active {
  border-color: color-mix(in srgb, var(--at-blue) 60%, transparent);
  background: color-mix(in srgb, var(--at-blue) 10%, transparent);
}

/* --------------------------------------- бренд в шапке и приёмка */

.ide-project-wrap {
  position: relative;
  display: inline-flex;
}

.ide-project {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--at-border);
  background: var(--at-chip-bg);
  color: inherit;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.ide-project:hover {
  border-color: var(--composer-shell-border);
}

.ide-project .ico {
  width: 13px;
  height: 13px;
}

.ide-project-pop {
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 180px;
}

.msg-verdict {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.74rem;
  color: var(--at-muted);
}

.msg-verdict.is-ok {
  color: color-mix(in srgb, #3ecf8e 85%, var(--at-text));
}

.msg-verdict.is-no {
  color: color-mix(in srgb, #f27d7d 85%, var(--at-text));
}

/* ------------------------------------------- @-контекст в композере */

.cmp-mention-pop {
  position: absolute;
  bottom: calc(100% + 0.4rem);
  left: 0.5rem;
  right: 0.5rem;
  max-height: 260px;
  overflow-y: auto;
  z-index: 40;
  display: grid;
  gap: 0.1rem;
  padding: 0.3rem;
  border-radius: 12px;
  border: 1px solid var(--at-border);
  background: var(--at-pop-bg, var(--at-card));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.cmp-mention-pop[hidden] {
  display: none !important;
}

.cmp-mention {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.5rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}

.cmp-mention:hover,
.cmp-mention.is-active {
  background: var(--at-chip-bg);
}

.cmp-mention-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmp-mention-hint {
  font-size: 0.7rem;
  color: var(--at-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 45%;
}

.brief-meter {
  height: 5px;
  border-radius: 999px;
  background: var(--at-chip-bg);
  overflow: hidden;
}

.brief-meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: color-mix(in srgb, var(--at-blue) 65%, transparent);
  transition: width 0.2s ease;
}

.brief-field {
  display: grid;
  gap: 0.25rem;
}

.brief-field-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--at-muted);
}

.brief-field textarea,
.brief-acc input {
  border: 1px solid var(--at-border);
  border-radius: 10px;
  background: var(--at-input-bg);
  color: inherit;
  font: inherit;
  font-size: 0.82rem;
  padding: 0.45rem 0.6rem;
  outline: none;
  resize: vertical;
}

.brief-field textarea:focus,
.brief-acc input:focus {
  border-color: var(--composer-shell-border);
}

.brief-accs {
  display: grid;
  gap: 0.5rem;
}

/* Панель узкая: ссылка занимает свою строку, иначе поля не влезают. */
.brief-acc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "network del"
    "url     url"
    "role    size";
  gap: 0.3rem;
  align-items: center;
  padding: 0.45rem;
  border: 1px solid var(--at-border);
  border-radius: 12px;
}

/* Без этого поля в grid распирают панель и появляется горизонтальный скролл. */
.brief-acc input {
  min-width: 0;
}

.brief-acc input[name="network"] {
  grid-area: network;
}
.brief-acc input[name="url"] {
  grid-area: url;
}
.brief-acc input[name="role"] {
  grid-area: role;
}
.brief-acc input[name="size"] {
  grid-area: size;
}

.brief-acc button {
  grid-area: del;
  justify-self: end;
}

.brief-acc-add {
  justify-self: start;
}

.brief-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.brief-caps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.brief-cap {
  display: grid;
  gap: 0.3rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--at-border);
  border-radius: 12px;
}

.brief-cap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.brief-cap-makes {
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--at-muted-soft);
}

.brief-cap-tag {
  flex: none;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: var(--at-chip-bg);
  color: var(--at-muted);
}

.brief-cap-tag.is-live {
  background: color-mix(in srgb, var(--at-blue) 22%, transparent);
  color: var(--at-blue);
}

.brief-cap-tag.is-soon,
.brief-cap-tag.is-off {
  opacity: 0.75;
}

/* switch */

.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--at-muted);
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  position: relative;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: var(--at-chip-bg);
  border: 1px solid var(--at-border);
  transition: background 0.15s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--at-muted);
  transition: transform 0.15s ease, background 0.15s ease;
}

.switch input:checked + .switch-track {
  background: color-mix(in srgb, var(--at-blue) 55%, transparent);
  border-color: transparent;
}

.switch input:checked + .switch-track::after {
  transform: translateX(14px);
  background: #fff;
}

/* ------------------------------------------------------------- messages */

.msg {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  max-width: 100%;
}

.msg.is-new {
  animation: fadeIn 0.2s ease;
}

.msg.is-flash .msg-bubble {
  box-shadow: 0 0 0 2px var(--at-blue-soft);
  border-radius: 12px;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 0.74rem;
  font-weight: 650;
  margin-top: 0.1rem;
}

.msg-avatar--agent {
  color: var(--at-blue-soft);
  background: color-mix(in srgb, var(--at-blue) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--at-blue) 30%, transparent);
}

.msg-avatar--agent .ico {
  width: 15px;
  height: 15px;
}

.msg-avatar--mascot-mark,
.msg-avatar--char {
  width: 34px;
  height: 34px;
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
}

.msg-avatar--mascot-mark {
  background: linear-gradient(115deg, #3b78ff 0%, #5b45d6 52%, #8d38c8 100%);
}

.msg-avatar--char {
  background: var(--at-surface);
  border: 1px solid var(--at-border);
}

.msg-avatar--char-empty {
  color: var(--at-text);
  font-size: 0.85rem;
}

.msg-avatar--mascot-mark img,
.msg-avatar--char img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.msg-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.25rem;
}

.msg-meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.74rem;
  color: var(--at-muted-soft);
}

.msg-meta strong {
  font-weight: 620;
  color: var(--at-muted);
}

.msg-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-top: 0.35rem;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

.msg:hover .msg-toolbar,
.msg-toolbar:focus-within,
.msg-toolbar:has(.is-speaking) {
  opacity: 1;
}

.msg-speak,
.msg-speak-rate {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 0.35rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--at-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 620;
  letter-spacing: 0.01em;
}

.msg-speak:hover,
.msg-speak.is-speaking,
.msg-speak.is-paused,
.msg-speak-rate:hover,
.msg-speak-voice-btn:hover {
  color: var(--at-blue-soft);
  background: color-mix(in srgb, var(--at-blue) 14%, transparent);
}

.msg-speak-voices {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
}

.msg-speak-voice-opt {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--at-muted);
  text-align: center;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 620;
  padding: 0 0.4rem;
  height: 28px;
  cursor: pointer;
  flex: 0 0 auto;
}

.msg-speak-voice-opt:hover,
.msg-speak-voice-opt.is-active {
  background: color-mix(in srgb, var(--at-blue) 18%, transparent);
  color: var(--at-text);
}

.msg-toolbar:has(.msg-speak-voice-menu:not([hidden])) {
  opacity: 1;
}

.msg-speak:disabled {
  opacity: 0.55;
  cursor: wait;
}

.msg-speak .ico {
  width: 15px;
  height: 15px;
}

.msg-bubble {
  font-size: 0.94rem;
  line-height: 1.55;
  min-width: 0;
}

.msg-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-text a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  word-break: break-all;
}

.msg-text a:hover {
  opacity: 0.85;
}

.msg--user {
  flex-direction: row;
  justify-content: flex-end;
  width: 100%;
}

.msg--user .msg-body {
  justify-items: end;
}

.msg--user .msg-meta {
  justify-content: flex-end;
}

.msg--user .msg-bubble {
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  padding: 0.7rem 0.95rem;
  border-radius: 16px 16px 6px 16px;
  border: 1px solid color-mix(in srgb, var(--at-blue) 28%, transparent);
  background: color-mix(in srgb, var(--at-blue) 16%, transparent);
  direction: ltr;
  text-align: left;
}

.msg--user .msg-text {
  text-align: left;
  direction: ltr;
}

.msg--user .msg-images {
  justify-content: flex-end;
}

.msg--agent,
.msg--thinking {
  width: 100%;
}

.msg--agent .msg-bubble,
.msg--thinking .msg-bubble {
  text-align: left;
}

.msg--thinking .msg-bubble {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0;
  color: var(--at-muted);
  font-size: 0.9rem;
}

.msg--workshop {
  max-width: min(720px, 100%);
}

.msg--workshop .msg-body--workshop {
  width: 100%;
  padding: 0.2rem 0 0.6rem;
}

.msg--workshop masik-workshop {
  display: block;
  width: 100%;
}

.zalipalka {
  width: min(300px, calc(100% - 2.6rem));
  margin: 0.15rem 0 0.85rem 2.5rem;
  border: 1px solid var(--at-border);
  border-radius: 16px;
  overflow: hidden;
  background: color-mix(in srgb, var(--at-bg, #111) 88%, #000);
}

.zalipalka-frame {
  position: relative;
  background: #000;
}

.zalipalka video {
  display: block;
  width: 100%;
  max-height: 210px;
  object-fit: contain;
  background: #000;
}

.zalipalka-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.zalipalka-close:hover {
  background: rgba(0, 0, 0, 0.78);
}

.zalipalka-close .ico {
  width: 14px;
  height: 14px;
}

.zalipalka p {
  margin: 0;
  padding: 0.65rem 0.75rem 0.75rem;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--at-muted);
}

.msg-avatar--mascot {
  visibility: hidden;
}

.msg-mascot {
  width: 46px;
  height: 48px;
  flex-shrink: 0;
  display: block;
}

.msg-mascot.at-mascot-svg,
.msg-mascot .at-mascot-svg {
  width: 46px;
  height: 48px;
  filter: none;
}

.msg-mascot .at-mascot-arm:not(.is-on) {
  display: none;
}

.msg-mascot.is-working {
  animation: producer-mascot-work 0.85s ease-in-out infinite;
  transform-origin: center bottom;
}

@keyframes producer-mascot-work {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg) scale(1);
  }
  50% {
    transform: translateY(-7px) rotate(4deg) scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .msg-mascot.is-working {
    animation: none;
  }
}

.thinking-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--at-blue-soft);
  box-shadow: 0 0 0 0 rgba(59, 139, 253, 0.55);
  animation: pulse 1.2s infinite;
  flex-shrink: 0;
}

.msg-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.msg-images figure {
  margin: 0;
  width: 120px;
}

.msg-images figcaption,
.msg-images .fig-label {
  font-size: 0.7rem;
  color: var(--at-muted-soft);
  margin-bottom: 0.25rem;
}

.msg-images img,
.msg-images figure.is-ref video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--at-border);
  background: color-mix(in srgb, var(--at-surface) 88%, #000);
  display: block;
}

.msg-images figure.is-ref {
  width: 120px;
}

.msg-images figure.is-ref img {
  cursor: zoom-in;
}

.msg-images .fig-open {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.3rem;
  border: 0;
  background: transparent;
  color: var(--at-muted);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0;
}

.msg-images .fig-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.3rem;
}

.msg-images .fig-actions .fig-open {
  margin-top: 0;
}

.msg-images .fig-link {
  color: var(--at-muted);
  font-size: 0.72rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.msg-images .fig-link:hover,
.msg-images .fig-open:hover {
  color: var(--at-text);
}

.msg-images .fig-open:hover {
  color: var(--at-text);
}

.msg-images figure.is-result {
  width: auto;
  max-width: 100%;
}

.msg-images img.result {
  width: auto;
  max-width: min(380px, 100%);
  max-height: 420px;
  aspect-ratio: auto;
  cursor: zoom-in;
}

.docs-list {
  display: grid;
  gap: 0.7rem;
  max-width: 720px;
}

.docs-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--at-border);
  background: color-mix(in srgb, var(--at-surface) 80%, transparent);
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.docs-ico,
.docs-go {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--at-blue) 16%, transparent);
  color: var(--at-text);
}

.docs-go {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  background: transparent;
  color: var(--at-muted);
}

.docs-item .ico {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.docs-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}

.docs-copy strong {
  font-size: 0.98rem;
  font-weight: 650;
}

.docs-copy em {
  font-style: normal;
  color: var(--at-muted);
  font-size: 0.82rem;
}

.docs-item:hover {
  border-color: color-mix(in srgb, var(--at-blue-soft) 45%, var(--at-border));
}

/* Suno-like token packs */
.suno-billing-hero {
  text-align: center;
  margin: 0.5rem 0 1.4rem;
}

.suno-billing-title {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.suno-billing-sub {
  margin: 0.55rem auto 0;
  max-width: 36rem;
  color: var(--at-muted);
  font-size: 0.95rem;
}

.suno-pack-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

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

.suno-pack {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.25rem 1.2rem 1.35rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #141414;
  color: #f5f5f5;
}

.suno-pack.is-featured {
  border-color: #ff4d8d;
  box-shadow: 0 0 0 1px rgba(255, 77, 141, 0.25);
}

.suno-pack-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.suno-pack-top h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 650;
}

.suno-pack-badge {
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.suno-pack-badge.is-muted {
  opacity: 0.7;
}

.suno-pack-blurb {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
  min-height: 2.4em;
}

.suno-pack-price {
  margin: 0.35rem 0 0;
  font-size: 1.85rem;
}

.suno-pack-price b {
  font-weight: 700;
}

.suno-pack-tokens {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
}

.suno-pack-cta {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 0.4rem;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.suno-pack.is-featured .suno-pack-cta {
  background: rgba(255, 255, 255, 0.16);
}

.suno-pack-cta:hover {
  background: rgba(255, 255, 255, 0.2);
}

.suno-pack-feats {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.82);
}

.suno-pack-feats li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  min-width: 0;
}

.suno-pack-feats .ico {
  width: 1.05em;
  height: 1.05em;
  color: #3dd68c;
  flex-shrink: 0;
  margin-top: 0.12em;
}

.suno-billing-note {
  margin: 1.1rem 0 0;
  color: var(--at-muted);
  font-size: 0.8rem;
  text-align: center;
}

.flow-panel:fullscreen {
  background: #0a0a0f;
}

.msg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.msg-actions a,
.msg-actions button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--at-border);
  background: transparent;
  color: var(--at-muted);
  border-radius: 999px;
  padding: 0.32rem 0.75rem;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.msg-actions a:hover,
.msg-actions button:hover {
  color: var(--at-text);
  border-color: color-mix(in srgb, var(--at-text) 25%, transparent);
  background: var(--at-chip-bg);
}

.msg-actions .ico {
  width: 14px;
  height: 14px;
}

.ide-thread .signal-cards {
  grid-template-columns: 1fr;
}

/* empty state */

.chat-empty {
  text-align: center;
  padding: 3rem 1rem 1.2rem;
  display: grid;
  gap: 0.45rem;
  justify-items: center;
}

.chat-empty-ico {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--at-blue-soft);
  background: color-mix(in srgb, var(--at-blue) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--at-blue) 30%, transparent);
  margin-bottom: 0.4rem;
}

.chat-empty-ico .ico {
  width: 22px;
  height: 22px;
}

.chat-empty-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.chat-empty-sub {
  margin: 0;
  max-width: 44ch;
  color: var(--at-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.chat-empty-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-top: 0.6rem;
}

/* lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  background: rgba(2, 3, 6, 0.86);
  animation: fadeIn 0.15s ease;
  align-content: center;
}

.lightbox--gallery {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  place-items: unset;
  align-content: stretch;
  gap: 0.5rem 0.35rem;
  padding: 1rem;
}

.lightbox-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  max-width: 100%;
}

.lightbox--gallery .lightbox-stage {
  grid-column: 2;
  grid-row: 1;
}

.lightbox img {
  max-width: min(92vw, 1100px);
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.lightbox--gallery img {
  max-width: min(78vw, 980px);
  max-height: 78vh;
}

.lightbox video {
  display: block;
  width: min(92vw, 420px);
  max-height: 80vh;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.lightbox--video {
  gap: 1rem;
}

.lightbox-counter {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.lightbox-nav {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lightbox-nav .ico {
  width: 20px;
  height: 20px;
}

.lightbox--gallery .lightbox-nav--prev {
  grid-column: 1;
  grid-row: 1;
}

.lightbox--gallery .lightbox-nav--next {
  grid-column: 3;
  grid-row: 1;
}

.lightbox-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}

.lightbox--gallery .lightbox-actions {
  grid-column: 1 / -1;
  grid-row: 2;
}

.lightbox-title {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  margin-right: 0.35rem;
}

.lightbox-actions .btn {
  text-decoration: none;
}

/* ------------------------------------------------------------ photo pan in slide editor */

.crsl-photo-edit[hidden] {
  display: none;
}

.crsl-photo-edit {
  display: grid;
  gap: 0.4rem;
}

.crsl-photo-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 220px;
  margin-inline: auto;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0a0c;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.crsl-photo-stage.is-dragging {
  cursor: grabbing;
}

.crsl-photo-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  pointer-events: none;
  display: block;
}

.crsl-photo-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--at-muted);
}

.crsl-photo-reset {
  border: 0;
  background: transparent;
  color: var(--at-accent, #4c8dff);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  padding: 0;
}

.crsl-photo-reset:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1180px) {
  :root {
    --ide-side-w: 300px;
  }
}

@media (max-width: 1000px) {
  .pipeline {
    grid-template-columns: repeat(3, 1fr);
  }

  .pipeline-step:not(:last-child)::after {
    display: none;
  }

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

  /* right panel becomes an overlay */
  .ide-side {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    width: min(360px, 92vw);
    transform: translateX(100%);
    transition: transform 0.2s ease;
    border-left: 1px solid var(--at-sidebar-border);
    box-shadow: -16px 0 48px rgba(0, 0, 0, 0.35);
  }

  .ide-side.is-open {
    width: min(360px, 92vw);
    transform: none;
  }

  .ide-side-head,
  .ide-side-body {
    min-width: 0;
  }

  .ide-scrim {
    position: absolute;
    inset: 0;
    z-index: 39;
    background: var(--at-overlay);
  }

  .ide-scrim.is-shown {
    display: block;
  }
}

@media (max-width: 860px) {
  .sb {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 60;
    width: min(300px, 84vw);
    transform: translate3d(-100%, 0, 0);
    transition: transform 0.22s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(0.9rem + env(safe-area-inset-bottom, 0px));
  }

  .sb.is-collapsed {
    width: min(300px, 84vw);
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }

  .sb.is-collapsed .sb-label,
  .sb.is-collapsed .sb-label-text,
  .sb.is-collapsed .brand-text,
  .sb.is-collapsed .sb-group,
  .sb.is-collapsed .sb-badge,
  .sb.is-collapsed .credits-bar,
  .sb.is-collapsed .credits-value,
  .sb.is-collapsed .sb-item--thread {
    display: revert;
  }

  .sb.is-collapsed .sb-label {
    display: grid;
  }

  .sb.is-collapsed .sb-item,
  .sb.is-collapsed .sb-create,
  .sb.is-collapsed .credits,
  .sb.is-collapsed .profile-btn {
    justify-content: flex-start;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }

  .sb.is-collapsed .sb-create {
    justify-content: center;
  }

  .sb-toggle {
    display: none;
  }

  .sb.is-open {
    transform: translate3d(0, 0, 0);
    box-shadow: 0 0 48px rgba(0, 0, 0, 0.65);
  }

  .drawer-btn {
    display: grid;
  }

  .drawer-scrim.is-shown {
    display: block;
  }

  .main {
    width: 100%;
  }

  .home {
    width: calc(100% - 1.6rem);
    padding-top: 3.6rem;
    gap: 1.8rem;
  }

  .home-hero h1 {
    font-size: 1.8rem;
  }

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

  .works-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .page {
    width: calc(100% - 1.5rem);
    padding-top: 3.1rem;
  }

  .ide-top {
    padding-left: 3.2rem;
  }

  .ide-thread {
    width: calc(100% - 1.5rem);
    padding-top: 1rem;
  }

  .ide-dock {
    padding: 0.4rem 0.75rem 0.8rem;
  }

  .cmp-hint {
    display: none;
  }

  .msg-images img.result {
    max-width: 100%;
  }

  .char-form-photo,
  .char-form-photo img {
    width: 92px;
    height: 122px;
  }

  .profile-card {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .tool-grid,
  .mode-row {
    grid-template-columns: 1fr;
  }

  .cmp-mode span:not(.chev) {
    display: none;
  }

  .cmp-mode {
    padding: 0 0.5rem;
  }

  .cmp-attach-row--photo {
    flex-wrap: wrap;
  }

  .cmp-attach-row--photo .cmp-chip--url {
    flex: 1 1 100%;
  }
}

/* ------------------------------------------------------------------- Labs */

.labs {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  display: grid;
  gap: 2rem;
}

.labs--hub {
  min-height: calc(100dvh - 2rem);
  align-content: center;
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

.labs-hero {
  text-align: center;
  display: grid;
  gap: 0.65rem;
  justify-items: center;
  max-width: 40rem;
  margin: 0 auto;
}

.labs-hero h1 {
  margin: 0;
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.labs-sub {
  margin: 0;
  color: var(--at-muted);
  font-size: 1rem;
  line-height: 1.55;
}

.labs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.35rem;
}

.labs-grid--hub {
  margin-top: 0.5rem;
}

.labs--hub .labs-grid--hub {
  width: min(780px, 100%);
  margin-inline: auto;
  gap: 1rem;
}

.home-section--cards .labs-grid--hub {
  width: min(780px, 100%);
  margin-inline: auto;
  gap: 1rem;
}

.labs-grid--pins {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.labs-grid--pins .labs-card-media {
  aspect-ratio: var(--labs-ratio, 1);
}

.labs--hub .labs-card {
  gap: 0.6rem;
}

.labs--hub .labs-card-media {
  border-radius: 14px;
}

.labs-card-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: #171a22;
  color: var(--at-muted-soft);
}

.labs-card-placeholder .ico {
  width: 42px;
  height: 42px;
}

.labs--hub .labs-card-body strong {
  font-size: 0.98rem;
}

.labs--hub .labs-card-body span {
  font-size: 0.8rem;
  line-height: 1.4;
}

.labs-card {
  display: grid;
  gap: 0.85rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.labs-card.is-soon {
  opacity: 0.92;
}

.labs-card-media {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--at-surface);
}

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

.labs-soon {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  margin: 0;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(28, 105, 212, 0.92);
  border: 0;
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
}

.labs-card-body {
  display: grid;
  gap: 0.35rem;
  padding: 0 0.1rem;
}

.labs-card-body strong {
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.labs-card-body span {
  color: var(--at-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.labs-card:hover .labs-card-body strong {
  color: var(--at-blue-soft);
}

.projects-card-media {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--at-blue-soft) 28%, transparent), transparent 55%),
    linear-gradient(160deg, color-mix(in srgb, var(--at-surface-hover) 80%, transparent), var(--at-surface));
}

.projects-card-media--create {
  color: var(--at-muted);
}

.projects-card-media--create .ico {
  width: 42px;
  height: 42px;
}

.projects-card-mark {
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--at-text);
  opacity: 0.88;
}

.labs--create {
  width: min(920px, 100%);
  gap: 1.25rem;
}

.labs-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: auto;
  min-width: 36px;
  padding: 0 0.65rem 0 0.45rem;
  border-radius: 999px;
  justify-self: start;
}

.labs-back .flip {
  transform: scaleX(-1);
}

.labs-back-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--at-muted);
}

.labs-back:hover .labs-back-label {
  color: var(--at-text);
}

.labs-create-head {
  display: grid;
  gap: 0.75rem;
  position: relative;
}

.labs-create-head .trend-back,
.labs-create-head .labs-back {
  justify-self: start;
}

.labs-create-titles {
  text-align: center;
  justify-self: center;
  max-width: 36rem;
}

.labs-post-soon {
  display: grid;
  gap: 1rem;
  justify-items: center;
  text-align: center;
  max-width: 28rem;
  margin: 0 auto;
}

.labs-post-soon img {
  width: min(280px, 100%);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 16px;
}

.labs-post-soon p {
  margin: 0;
  color: var(--at-muted);
}

.labs-post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.labs-create-head h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: -0.03em;
}

.labs-create-head p {
  margin: 0.35rem 0 0;
  color: var(--at-muted);
}

.labs--learn {
  width: min(860px, 100%);
}

.learn-body {
  display: grid;
  gap: 1rem;
  width: min(820px, 100%);
  justify-self: center;
}

.learn-stage {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
  gap: 1.25rem 1.5rem;
  align-items: center;
  padding: 1rem;
  border-radius: 24px;
  background: var(--at-surface);
  border: 1px solid var(--at-border);
  min-width: 0;
}

.learn-sticker {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px;
  background: #efe6f8;
}

.learn-copy {
  display: grid;
  gap: 0.85rem;
  align-content: center;
  min-width: 0;
}

.learn-kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--at-blue-soft);
}

.learn-say {
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.45;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.learn-actions,
.learn-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.learn-count {
  color: var(--at-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.learn-pack {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  justify-content: center;
}

.learn-pick {
  flex: 0 0 auto;
  display: grid;
  gap: 0.35rem;
  width: 84px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.learn-pick img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 16px;
  background: #efe6f8;
  border: 2px solid transparent;
}

.learn-pick span {
  font-size: 0.72rem;
  color: var(--at-muted);
  line-height: 1.2;
}

.learn-pick.is-on img {
  border-color: var(--at-blue-soft);
}

.learn-pick.is-on span {
  color: var(--at-text);
}

@media (max-width: 720px) {
  .learn-stage {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .learn-sticker {
    width: min(220px, 78%);
  }

  .learn-actions,
  .learn-nav,
  .learn-pack {
    justify-content: center;
  }
}

.labs-create-composer {
  width: 100%;
}

.labs-mode-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.28rem;
  border-radius: 999px;
  background: var(--at-surface);
  border: 1px solid var(--at-border);
  width: fit-content;
  max-width: 100%;
  justify-self: start;
}

.labs-mode {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: transparent;
  color: var(--at-muted);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.labs-mode .ico {
  width: 15px;
  height: 15px;
}

.labs-mode.is-active {
  background: color-mix(in srgb, var(--at-blue) 22%, transparent);
  color: var(--at-text);
}

.labs-viz-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 320px));
  gap: 1rem;
}

.labs-viz-pin {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #0b0d12;
  cursor: pointer;
}

.labs-viz-pin img {
  display: block;
  width: 100%;
  height: auto;
}

.labs-trend-card.is-on .labs-trend-media {
  outline: 2px solid var(--at-blue);
  outline-offset: 2px;
}

.cmp-aspect {
  display: inline-flex;
  gap: 0.15rem;
  padding: 0.12rem;
  border-radius: 999px;
  border: 1px solid var(--at-border);
}

.cmp-aspect-btn {
  border: 0;
  background: transparent;
  color: var(--at-muted);
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.cmp-aspect-btn.is-on {
  background: color-mix(in srgb, var(--at-blue) 22%, transparent);
  color: var(--at-text);
}

.labs-trends-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.35rem;
}

.labs-photo-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.55rem 0 0.85rem;
}

.labs-photo-sort-btn {
  border: 1px solid var(--at-border);
  background: transparent;
  color: var(--at-muted-soft);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
}

.labs-photo-sort-btn.is-active {
  color: var(--at-text);
  border-color: color-mix(in srgb, var(--at-blue) 55%, var(--at-border));
  background: color-mix(in srgb, var(--at-blue) 18%, transparent);
}

.labs-trends-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.labs-trend-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.labs-trend-card {
  display: grid;
  gap: 0.65rem;
  position: relative;
}

.labs-trend-del {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 2;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(8, 10, 14, 0.72);
  color: #fff;
  cursor: pointer;
}

.labs-trend-del .ico {
  width: 0.85rem;
  height: 0.85rem;
}

.labs-trend-del:hover {
  background: #c0392b;
}

.labs-trend-media {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  background: #0b0d12;
  cursor: pointer;
  position: relative;
}

.labs-trend-media video,
.labs-trend-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.labs-trend-play {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  pointer-events: none;
}

.labs-trend-play .ico {
  width: 14px;
  height: 14px;
}

.labs-trend-meta {
  display: grid;
  gap: 0.35rem;
}

.labs-trend-meta strong {
  font-size: 0.95rem;
}

.labs-trend-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--at-muted);
  font-size: 0.8rem;
}

.labs-trend-likes .labs-trend-heart {
  width: 13px;
  height: 13px;
  color: #e11d48;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.labs-trend-meta > span.labs-trend-likes {
  color: var(--at-muted);
}

.labs-trend-meta > span.labs-trend-likes .labs-trend-heart {
  width: 13px;
  height: 13px;
}

.labs-trend-credit {
  margin: 0;
  color: var(--at-muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.labs-trend-credit a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.labs-trend-meta .ico {
  width: 12px;
  height: 12px;
}

.labs-trend-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.labs-trend-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.85rem;
  border: 1px solid var(--at-border);
  border-radius: 14px;
}

.labs-trend-add textarea,
.labs-trend-add-row {
  grid-column: 1 / -1;
}

.labs-trend-add input,
.labs-trend-add textarea,
.labs-trend-edit input,
.labs-trend-edit textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--at-border);
  border-radius: 10px;
  background: transparent;
  color: var(--at-text);
  font: inherit;
  font-size: 0.85rem;
  resize: vertical;
}

.labs-trend-add-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
}

.labs-trend-note {
  margin: 0;
  color: var(--at-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.labs-trend-meta > span.labs-trend-status {
  justify-self: start;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  background: color-mix(in srgb, var(--at-muted) 16%, transparent);
}

.labs-trend-meta > span.labs-trend-status.is-ready {
  color: #16a34a;
  background: color-mix(in srgb, #16a34a 14%, transparent);
}

.labs-trend-meta > span.labs-trend-status.is-failed {
  color: #dc2626;
  background: color-mix(in srgb, #dc2626 14%, transparent);
}

.labs-trend-wait {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  color: var(--at-muted);
  font-size: 0.8rem;
  text-align: center;
}

.labs-trend-edit summary {
  cursor: pointer;
  color: var(--at-muted);
  font-size: 0.78rem;
}

.labs-trend-edit form {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

@media (max-width: 640px) {
  .labs-trend-add {
    grid-template-columns: minmax(0, 1fr);
  }
}

.labs-trend-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  padding: 0.4rem 0.7rem;
}

@media (max-width: 900px) {
  .labs-trend-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .labs-grid--hub {
    gap: 0.85rem;
  }

  .labs-grid--hub .labs-card {
    gap: 0.55rem;
  }

  .labs-grid--hub .labs-card-media {
    border-radius: 12px;
  }

  .labs-grid--hub .labs-card-body {
    gap: 0.2rem;
  }

  .labs-grid--hub .labs-card-body strong {
    font-size: 0.92rem;
  }

  .labs-grid--hub .labs-card-body span {
    font-size: 0.72rem;
    line-height: 1.35;
  }
}

@media (max-width: 560px) {
  .labs {
    padding: 1.25rem 0.5rem 2.5rem;
  }

  .labs-trend-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .labs-trend-card {
    gap: 0.4rem;
  }

  /* Pinterest-style pins: natural photo height, not fullscreen 9:16 */
  .labs-trend-media {
    aspect-ratio: auto;
    border-radius: 10px;
  }

  .labs-trend-media img {
    height: auto;
    object-fit: unset;
  }

  .labs-trend-media:has(video) {
    aspect-ratio: 9 / 16;
  }

  .labs-trend-media video {
    height: 100%;
    object-fit: cover;
  }

  .labs-trend-meta strong {
    font-size: 0.78rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .labs-trend-meta > span {
    font-size: 0.72rem;
  }

  .labs-trend-credit {
    font-size: 0.62rem;
    line-height: 1.3;
  }

  .labs-trend-actions {
    gap: 0.3rem;
  }

  .labs-trend-actions .btn {
    font-size: 0.72rem;
    padding: 0.32rem 0.5rem;
  }

  .labs-grid--hub {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .labs-grid--hub .labs-card {
    gap: 0.35rem;
  }

  .labs-grid--hub .labs-card-media {
    border-radius: 10px;
  }

  .labs-grid--hub .labs-soon {
    top: 5px;
    right: 5px;
    font-size: 0.52rem;
    padding: 0.12rem 0.32rem;
  }

  .labs-grid--hub .labs-card-body strong {
    font-size: 0.72rem;
    letter-spacing: -0.02em;
  }

  .labs-grid--hub .labs-card-body span {
    font-size: 0.58rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* ----------------------------------------------------------- light theme */

html[data-theme="light"] .cmp {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(28, 105, 212, 0.18);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 14px 32px rgba(18, 30, 60, 0.08),
    0 0 0 1px rgba(70, 120, 255, 0.06);
}

html[data-theme="light"] .cmp-send,
html[data-theme="light"] .sb-create {
  color: #fff;
}

html[data-theme="light"] .lightbox {
  background: rgba(18, 24, 40, 0.8);
}

html[data-theme="light"] .work-thumb,
html[data-theme="light"] .side-figure,
html[data-theme="light"] .side-history-thumb {
  background: #e6e9f0;
}

/* --------------------------------------------------------------- карусель */

.crsl {
  margin-top: 0.7rem;
  border: 1px solid var(--at-border);
  border-radius: var(--at-radius-md);
  background: var(--at-input-bg);
  padding: 0.85rem;
  display: grid;
  gap: 0.75rem;
  /* Без этого лента слайдов распирает пузырь вместо того, чтобы скроллиться. */
  min-width: 0;
}

.crsl > *,
.crsl-stage {
  min-width: 0;
}

.crsl-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.crsl-top strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.3;
}

.crsl-meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--at-muted);
}

.crsl-progress {
  flex: none;
  font-size: 0.74rem;
  color: var(--at-muted);
  border: 1px solid var(--at-border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
}

.crsl-load[hidden] {
  display: none;
}

.crsl-load {
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--at-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--at-surface) 88%, var(--at-blue) 12%);
}

.crsl-load.is-active {
  animation: crsl-load-glow 2.4s ease-in-out infinite;
}

@keyframes crsl-load-glow {
  0%,
  100% {
    border-color: var(--at-border);
  }
  50% {
    border-color: color-mix(in srgb, var(--at-blue) 45%, var(--at-border));
  }
}

.crsl-load-track {
  height: 4px;
  border-radius: 999px;
  background: var(--at-chip-bg);
  overflow: hidden;
}

.crsl-load-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--at-blue) 70%, transparent),
    var(--at-blue)
  );
  transition: width 0.35s ease;
}

.crsl-load-segs {
  display: flex;
  gap: 0.28rem;
}

.crsl-load-seg {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--at-chip-bg);
}

.crsl-load-seg.is-done {
  background: var(--at-blue);
}

.crsl-load-seg.is-running {
  background: color-mix(in srgb, var(--at-blue) 55%, #fff);
  animation: crsl-seg-pulse 1s ease-in-out infinite;
}

.crsl-load-seg.is-error {
  background: color-mix(in srgb, var(--at-red, #e25555) 70%, var(--at-chip-bg));
}

.crsl-load-seg.is-pending {
  background: var(--at-chip-bg);
}

@keyframes crsl-seg-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.crsl-load-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--at-text);
}

.crsl-load-pulse {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--at-blue);
  flex: none;
  animation: crsl-seg-pulse 1s ease-in-out infinite;
}

.crsl-load-label {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.crsl-load-count {
  flex: none;
  font-variant-numeric: tabular-nums;
  color: var(--at-muted);
  font-size: 0.74rem;
}

.crsl-stage {
  position: relative;
}

/* Лента со снапом — свайп пальцем работает так же, как в самой ленте Instagram. */
.crsl-strip {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 0.5rem;
  padding: 0.15rem 0.15rem 0.5rem;
  scrollbar-width: thin;
}

.crsl-strip::-webkit-scrollbar {
  height: 6px;
}

.crsl-strip::-webkit-scrollbar-thumb {
  background: var(--at-border);
  border-radius: 999px;
}

.crsl-slide {
  margin: 0;
  flex: 0 0 auto;
  width: min(238px, 62vw);
  scroll-snap-align: start;
  display: grid;
  gap: 0.35rem;
  position: relative;
}

.crsl-slide canvas {
  width: 100%;
  aspect-ratio: 4 / 5;
  height: auto;
  display: block;
  border-radius: 14px;
  background: var(--at-surface);
  box-shadow: var(--shadow-card);
  cursor: zoom-in;
}

.crsl-slide.is-waiting canvas {
  animation: crsl-pulse 1.8s ease-in-out infinite;
}

.crsl-slide.is-waiting::after {
  content: attr(data-crsl-wait);
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  max-width: calc(100% - 1.1rem);
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: rgba(8, 10, 16, 0.72);
  color: #fff;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  pointer-events: none;
  z-index: 1;
}

@keyframes crsl-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.62;
  }
}

.crsl-slide figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--at-muted);
}

.crsl-role {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.crsl-state {
  color: var(--at-muted-soft);
}

.crsl-nav {
  position: absolute;
  top: calc(50% - 24px);
  transform: translateY(-50%);
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--at-border);
  background: var(--at-chrome);
  color: var(--at-text);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.crsl-stage:hover .crsl-nav {
  opacity: 1;
}

.crsl-nav--prev {
  left: -6px;
}

.crsl-nav--next {
  right: -6px;
}

.crsl-nav .ico.flip {
  transform: rotate(180deg);
}

.crsl-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
}

.crsl-tools-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.74rem;
  color: var(--at-muted);
}

.crsl-tools-label .ico {
  width: 15px;
  height: 15px;
}

.crsl-swatches,
.crsl-chips {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.crsl-swatch {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--at-border);
  background: var(--sw-paper);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.crsl-swatch span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sw-accent);
}

.crsl-swatch.is-active {
  outline: 2px solid var(--at-blue-soft);
  outline-offset: 1px;
}

.crsl-chip {
  font-size: 0.74rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--at-border);
  background: transparent;
  color: var(--at-muted);
  cursor: pointer;
}

.crsl-chip.is-active {
  color: var(--at-text);
  border-color: var(--composer-shell-border);
  background: rgba(28, 105, 212, 0.14);
}

.crsl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.crsl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  padding: 0.42rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--at-border);
  background: var(--at-surface);
  color: var(--at-text);
  cursor: pointer;
}

.crsl-btn:hover:not(:disabled) {
  background: var(--at-surface-hover);
}

.crsl-btn:disabled {
  opacity: 0.55;
  cursor: progress;
}

.crsl-btn.is-primary {
  background: var(--at-blue);
  border-color: var(--at-blue);
  color: #fff;
}

.crsl-btn .ico {
  width: 16px;
  height: 16px;
}

/* display:grid перебивает атрибут hidden — возвращаем его обратно. */
.crsl-editor[hidden] {
  display: none;
}

.crsl-editor {
  display: grid;
  gap: 0.5rem;
  padding: 0.7rem;
  border: 1px solid var(--at-border);
  border-radius: 12px;
  background: var(--at-surface);
}

.crsl-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--at-muted);
}

.crsl-editor-close {
  border: 0;
  background: transparent;
  color: var(--at-muted);
  cursor: pointer;
  padding: 0;
  line-height: 0;
}

.crsl-field {
  display: grid;
  gap: 0.2rem;
}

.crsl-field > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.74rem;
  color: var(--at-muted);
}

.crsl-field em {
  font-style: normal;
  font-size: 0.7rem;
  color: var(--at-muted-soft);
}

.crsl-field em.is-over {
  color: var(--at-red);
}

.crsl-field input,
.crsl-field textarea {
  width: 100%;
  font: inherit;
  font-size: 0.86rem;
  color: var(--at-text);
  background: var(--at-input-bg);
  border: 1px solid var(--at-border);
  border-radius: 10px;
  padding: 0.4rem 0.55rem;
  resize: vertical;
}

.crsl-field input:focus,
.crsl-field textarea:focus {
  outline: none;
  border-color: var(--composer-shell-border);
}

.crsl-caption summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--at-muted);
}

.crsl-caption-body {
  margin-top: 0.5rem;
  white-space: pre-wrap;
  font-size: 0.86rem;
  line-height: 1.5;
}

.crsl-tags {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--at-blue-soft);
  word-break: break-word;
}

@media (max-width: 720px) {
  .crsl-nav {
    display: none;
  }

  .crsl-slide {
    width: min(210px, 66vw);
  }
}

/* ============================================================
   Phone / narrow layout — desktop rules untouched.
   Placed last so it wins over earlier conflicting media queries
   (e.g. works-strip 4-col @860 overriding 2-col @560).
   ============================================================ */

@media (max-width: 860px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  .layout,
  .main,
  .agent-test-root {
    max-width: 100%;
    overflow-x: clip;
  }

  .home,
  .page,
  .page--tool,
  .page--scenarist,
  .ide-thread,
  .editor-shell,
  .labs--create,
  .labs--post {
    width: calc(100% - 1.25rem);
    max-width: 100%;
    box-sizing: border-box;
  }

  .labs,
  .labs--hub {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

  .home {
    padding-top: 3.4rem;
    padding-bottom: 3rem;
    gap: 1.5rem;
  }

  .home--discover {
    gap: 1.35rem;
  }

  .home-section--cards,
  .home-section--tariffs {
    width: 100%;
  }

  .home-composer,
  .page--scenarist .home-composer,
  .ide-dock-inner {
    width: 100%;
    max-width: 100%;
  }

  /* Keep popovers (+ / mode / character) tappable — never clip .cmp.
     Glow blur used to widen scrollWidth; contain it on the pseudo-elements. */
  .cmp {
    overflow: visible;
    z-index: 20;
    /* backdrop-filter makes WebKit clip overflowing absolute menus */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .cmp-pop-wrap {
    z-index: 5;
  }

  .cmp-bar,
  .cmp-tools,
  .cmp-icon-btn,
  .cmp-mode,
  .cmp-char-btn,
  .cmp-send,
  .cmp-file-btn,
  .cmp-chip-x {
    position: relative;
    z-index: 2;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .cmp-icon-btn .ico,
  .cmp-mode .ico,
  .cmp-char-btn .ico,
  .cmp-send .ico,
  .cmp-file-btn .ico,
  .cmp-chip-x .ico,
  .cmp-pop-item .ico {
    pointer-events: none;
  }

  .cmp::before,
  .cmp::after {
    animation: none;
  }

  .cmp::before {
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    transform: none;
    filter: blur(18px);
    opacity: 0.42;
    clip-path: inset(0 round 16px);
  }

  .cmp::after {
    inset: 0;
    filter: blur(6px);
    opacity: 0.32;
  }

  .cmp-bar {
    flex-wrap: wrap;
    row-gap: 0.45rem;
  }

  .cmp-tools {
    flex-wrap: wrap;
  }

  .cmp-attach-row--photo {
    flex-wrap: wrap;
  }

  .cmp-chip input {
    width: min(100%, 56vw);
  }

  .home-hero h1 {
    font-size: clamp(1.55rem, 7vw, 1.9rem);
    padding-inline: 0.15rem;
  }

  .home-sub {
    font-size: 0.92rem;
    padding-inline: 0.35rem;
  }

  .home-chips {
    padding-inline: 0.15rem;
  }

  .chat-chip {
    max-width: 100%;
  }

  /* Feature + tariff hub cards: Pinterest-like masonry on phone */
  .labs-grid,
  .labs-grid--hub,
  .home-tariffs-grid.labs-grid--hub,
  .labs--hub .labs-grid--hub {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .labs--hub .labs-grid--pins {
    display: block;
    columns: 2;
    column-gap: 0.55rem;
  }

  .labs--hub .labs-grid--pins .labs-card {
    break-inside: avoid;
    page-break-inside: avoid;
    display: inline-block;
    width: 100%;
    margin: 0 0 0.7rem;
    vertical-align: top;
  }

  .labs--hub .labs-grid--pins .labs-card-media {
    aspect-ratio: var(--labs-ratio, 3 / 4);
    border-radius: 12px;
  }

  .labs-grid--hub .labs-card,
  .home-tariffs-grid .labs-card {
    min-width: 0;
    gap: 0.35rem;
  }

  .labs-grid--hub .labs-card-media,
  .home-tariffs-grid .labs-card-media {
    border-radius: 10px;
    min-width: 0;
  }

  .labs-grid--hub .labs-card-body,
  .home-tariffs-grid .labs-card-body {
    min-width: 0;
    gap: 0.15rem;
    padding: 0;
  }

  .labs-grid--hub .labs-card-body strong,
  .home-tariffs-grid .labs-card-body strong {
    font-size: 0.72rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .labs-grid--hub .labs-card-body span,
  .home-tariffs-grid .labs-card-body span {
    font-size: 0.58rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .labs-grid--hub .labs-soon {
    top: 5px;
    right: 5px;
    font-size: 0.52rem;
    padding: 0.12rem 0.32rem;
  }

  .tariff-card-price {
    gap: 0.15rem;
    font-size: 0.72rem;
  }

  .tariff-card-price b {
    font-size: clamp(1rem, 5.2vw, 1.35rem);
  }

  .tariff-card-tokens {
    font-size: 0.68rem;
  }

  .tariff-card-badge {
    left: 6px;
    font-size: 0.52rem;
    padding: 0.12rem 0.35rem;
  }

  .labs-trend-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .works-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .pipeline {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .tool-grid,
  .mode-row,
  .task-grid,
  .plan-grid,
  .char-grid,
  .signal-cards,
  .form-grid.is-two {
    grid-template-columns: 1fr;
  }

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

  .docs-list {
    max-width: none;
  }

  /* Billing packs need readable feature rows — stack on phone */
  .suno-pack-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .suno-pack {
    min-width: 0;
    padding: 1.05rem 0.95rem 1.15rem;
    border-radius: 16px;
    gap: 0.45rem;
  }

  .suno-pack-top h3 {
    font-size: 1.1rem;
  }

  .suno-pack-badge {
    font-size: 0.6rem;
    padding: 0.18rem 0.42rem;
  }

  .suno-pack-blurb {
    font-size: 0.82rem;
    min-height: 0;
  }

  .suno-pack-price {
    font-size: clamp(1.35rem, 6vw, 1.7rem);
    margin-top: 0.2rem;
  }

  .suno-pack-tokens,
  .suno-pack-feats {
    font-size: 0.84rem;
  }

  .suno-pack-cta {
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
  }

  .page-head,
  .panel-head,
  .flow-panel-bar,
  .editor-head,
  .home-section-head {
    flex-wrap: wrap;
    gap: 0.65rem;
  }

  .flow-panel-bar {
    padding: 0.7rem 0.85rem;
  }

  .flow-panel-actions,
  .page-actions,
  .editor-head-actions,
  .form-actions,
  .crsl-actions,
  .crsl-tools {
    flex-wrap: wrap;
  }

  .panel {
    padding: 0.85rem 0.8rem 1rem;
    border-radius: 16px;
  }

  .ide-top {
    padding-left: 3rem;
    padding-right: 0.55rem;
    gap: 0.35rem;
  }

  .ide-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .ide-meta {
    flex-wrap: wrap;
  }

  .ide-dock {
    padding: 0.45rem 0.7rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
  }

  .ide-thread {
    padding-top: 0.85rem;
  }

  .msg-images figure,
  .msg-images figure.is-ref {
    width: min(100%, 160px);
  }

  .msg-images figure.is-result {
    width: min(100%, 280px);
  }

  .msg-images img,
  .msg-images img.result {
    max-width: 100%;
  }

  .char-form {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0.85rem;
  }

  .char-photo-col {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .char-form-photo {
    width: 112px;
    height: 148px;
    flex-shrink: 0;
  }

  .char-photo-upload-btn {
    width: auto;
    min-width: 112px;
    position: static;
    z-index: 1;
  }

  .char-photo-col--studio,
  .char-form-photo--studio {
    width: 100%;
    max-width: 220px;
  }

  .char-form-photo--studio {
    height: 240px;
  }

  .char-form-fields {
    width: 100%;
    min-width: 0;
    flex: none;
  }

  .page-actions .link-btn,
  .page-actions .btn {
    white-space: normal;
  }

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

  .char-social-row {
    grid-template-columns: 1fr auto;
  }

  .profile-card {
    grid-template-columns: 1fr;
  }

  .toasts {
    left: 0.75rem;
    right: 0.75rem;
    justify-items: stretch;
  }

  .toast {
    max-width: none;
  }

  .lightbox {
    padding: 0.75rem;
  }

  .lightbox img {
    max-width: 100%;
    max-height: 72vh;
  }

  .lightbox video {
    width: min(100%, 420px);
    max-height: 72vh;
  }

  img,
  video,
  canvas,
  svg,
  iframe {
    max-width: 100%;
  }

  .btn {
    max-width: 100%;
  }

  .crsl {
    padding: 0.7rem;
  }

  .crsl-top {
    flex-wrap: wrap;
  }

  .crsl-slide {
    width: min(220px, 72vw);
  }

  .login-screen {
    padding: 1rem;
    align-content: center;
  }

  .login-card {
    width: 100%;
    padding: 1.15rem 1rem 1.05rem;
  }

  .drawer-btn {
    top: 0.65rem;
    left: 0.65rem;
  }
}

@media (max-width: 560px) {
  .home,
  .page,
  .page--tool,
  .page--scenarist,
  .ide-thread,
  .editor-shell,
  .labs--create,
  .labs--post {
    width: calc(100% - 1rem);
  }

  .labs,
  .labs--hub {
    width: 100%;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
  }

  .home {
    padding-top: 3.1rem;
    gap: 1.25rem;
  }

  .home-hero h1 {
    font-size: 1.45rem;
  }

  .home-sub {
    font-size: 0.86rem;
    max-width: 34ch;
  }

  .labs {
    padding: 1.25rem 0.5rem 2.5rem;
  }

  .labs-hero h1 {
    font-size: clamp(1.7rem, 9vw, 2.2rem);
  }

  .labs-sub {
    font-size: 0.86rem;
    padding-inline: 0.35rem;
  }

  .labs--hub .labs-grid--hub,
  .labs-grid--hub,
  .home-tariffs-grid.labs-grid--hub {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    width: 100%;
    max-width: 100%;
  }

  .labs-grid--hub .labs-card-media,
  .labs--hub .labs-card-media,
  .home-tariffs-grid .labs-card-media {
    border-radius: 10px;
  }

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

  .cmp--lg {
    padding: 0.7rem 0.65rem 0.55rem;
    border-radius: 16px;
  }

  .cmp-input {
    /* keep ≥16px — smaller rem triggered iOS input zoom */
    font-size: 16px;
  }

  .cmp-file-btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .cmp-mode span:not(.chev) {
    display: none;
  }

  .cmp-mode {
    padding: 0 0.5rem;
  }

  .cmp-select {
    max-width: 7.5rem;
  }

  .ide-title h1 {
    font-size: 0.88rem;
  }

  .ide-agent span:not(.ico) {
    max-width: 9ch;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .page-head h1,
  .editor-head h1 {
    font-size: 1.2rem;
  }

  .tool-hero {
    gap: 0.75rem;
  }

  .tool-hero-ico {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .char-photo-col {
    width: 100%;
  }

  .char-form-photo,
  .char-form-photo img {
    width: 96px;
    height: 128px;
  }

  .char-photo-upload-btn {
    min-width: 96px;
  }

  .suno-billing-title {
    font-size: 1.55rem;
  }

  .suno-pack {
    padding: 1rem 0.9rem 1.1rem;
  }

  .suno-pack-price {
    font-size: clamp(1.25rem, 6vw, 1.55rem);
  }

  .tariff-card-price b {
    font-size: clamp(0.95rem, 5vw, 1.25rem);
  }

  .producer-choices {
    max-width: none;
  }

  .msg-actions a,
  .msg-actions button {
    font-size: 0.74rem;
    padding: 0.3rem 0.6rem;
  }

  .prev-chats-panel {
    margin-inline: 0;
  }
}

@media (max-width: 380px) {
  .works-strip {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }

  .home-hero h1 {
    font-size: 1.32rem;
  }

  .cmp-file-btn span {
    display: none;
  }
}

/* ------------------------------------------------------------------ living mascot buddy */
.at-buddy {
  position: fixed;
  top: 28%;
  right: max(0.35rem, env(safe-area-inset-right));
  bottom: auto;
  z-index: 60;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  pointer-events: none;
  transform: translate(110%, -50%);
  opacity: 0;
  transition:
    transform 1.15s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.7s ease;
}

.at-buddy.is-here {
  transform: translate(0, -50%);
  opacity: 1;
}

.at-buddy.is-away {
  transform: translate(110%, -50%);
  opacity: 0;
  pointer-events: none;
}

.at-buddy.is-hidden {
  opacity: 0 !important;
  visibility: hidden;
  pointer-events: none;
  transform: translate(120%, -50%);
}

/* Свободная позиция после перетаскивания */
.at-buddy.is-placed {
  right: auto;
  bottom: auto;
  transform: none;
  transition:
    opacity 0.55s ease,
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.at-buddy.is-placed.is-here {
  transform: none;
  opacity: 1;
}

.at-buddy.is-placed.is-away {
  transform: translateX(28px);
  opacity: 0;
  pointer-events: none;
}

.at-buddy.is-placed.is-hidden {
  transform: none;
}

.at-buddy.is-dragging {
  transition: none !important;
  z-index: 80;
  opacity: 1 !important;
  pointer-events: auto;
}

.at-buddy.is-dragging .at-buddy-btn {
  animation: none;
  cursor: grabbing;
  transform: scale(1.04);
}

.at-buddy-bubble {
  position: relative;
  max-width: 200px;
  margin: 0 -1.1rem 0 0;
  padding: 0.65rem 0.8rem;
  border-radius: 16px;
  background: color-mix(in srgb, var(--at-surface, #141820) 96%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--at-accent, #c8ff4a) 38%, transparent);
  backdrop-filter: blur(12px);
  color: var(--at-text, #f2f4f8);
  font-size: 0.78rem;
  line-height: 1.35;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateX(6px) scale(0.96);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  flex-shrink: 0;
  z-index: 1;
}

/* Хвостик облака речи — к маскоту справа */
.at-buddy-bubble::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  background: color-mix(in srgb, var(--at-surface, #141820) 96%, transparent);
  border-right: 1.5px solid color-mix(in srgb, var(--at-accent, #c8ff4a) 38%, transparent);
  border-bottom: 1.5px solid color-mix(in srgb, var(--at-accent, #c8ff4a) 38%, transparent);
  transform: rotate(-45deg);
}

.at-buddy-bubble.is-on {
  opacity: 1;
  transform: none;
}

.at-buddy-x {
  pointer-events: auto;
  position: absolute;
  top: 22px;
  right: 14px;
  z-index: 3;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--at-accent, #c8ff4a) 70%, #fff);
  border-radius: 50%;
  background: #111;
  color: #fff;
  font: 700 16px/1 inherit;
  cursor: pointer;
}

.at-buddy-btn {
  position: relative;
  pointer-events: auto;
  width: 160px;
  height: 168px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: grab;
  overflow: visible;
  animation: at-buddy-bob 4.2s ease-in-out infinite;
  transition: transform 0.3s ease, opacity 0.2s ease;
  flex-shrink: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.at-buddy-btn.is-swap {
  opacity: 0.4;
  transform: scale(0.94);
}

.at-buddy-btn:hover {
  transform: translateY(-4px) scale(1.03);
}

.at-buddy-btn:focus-visible {
  outline: 2px solid var(--at-accent, #c8ff4a);
  outline-offset: 4px;
  border-radius: 12px;
}

.at-mascot-svg {
  width: 160px;
  height: 168px;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.3));
}

.at-mascot-arm {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.at-mascot-arm.is-on {
  opacity: 1;
  visibility: visible;
}

.at-mascot-eye {
  transform-origin: center;
  animation: at-mascot-blink 4.8s ease-in-out infinite;
}

@keyframes at-buddy-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.at-buddy-btn.is-sneeze .at-mascot-svg {
  animation: at-buddy-sneeze 0.42s ease-out;
  transform-origin: 50% 70%;
}

@keyframes at-buddy-sneeze {
  0% { transform: translateY(0) scale(1); }
  20% { transform: translateY(3px) scale(0.96, 1.05); }
  38% { transform: translateY(-8px) scale(1.06, 0.92) rotate(-3deg); }
  62% { transform: translateY(2px) scale(0.98, 1.02); }
  100% { transform: none; }
}

@keyframes at-mascot-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  94%, 96% { transform: scaleY(0.12); }
}

@media (max-width: 720px) {
  .at-buddy {
    right: 2px;
    gap: 0;
  }
  .at-buddy-btn {
    width: 128px;
    height: 134px;
  }
  .at-buddy-x {
    top: 16px;
    right: 8px;
    width: 24px;
    height: 24px;
  }
  .at-mascot-svg {
    width: 128px;
    height: 134px;
  }
  .at-buddy-bubble {
    max-width: 140px;
    font-size: 0.68rem;
    padding: 0.5rem 0.6rem;
    margin-right: -0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .at-buddy,
  .at-buddy-btn,
  .at-buddy-bubble,
  .at-mascot-eye {
    transition: none !important;
    animation: none !important;
  }
  .at-buddy.is-here {
    transform: translate(0, -50%);
    opacity: 1;
  }
  .at-buddy.is-placed.is-here {
    transform: none;
  }
}

.taste-pair {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.65rem;
}
.taste-meta {
  margin: 0;
  color: var(--at-muted, #9aa);
  font-size: 0.78rem;
}
.taste-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.taste-clip {
  margin: 0;
  display: grid;
  gap: 0.35rem;
}
.taste-clip video {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 420px;
  object-fit: contain;
  background: #000;
  border-radius: 12px;
}
.taste-pick,
.taste-skip {
  border: 1px solid var(--at-border);
  background: var(--at-surface);
  color: inherit;
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  font: inherit;
}
.taste-pick {
  width: 100%;
}
.taste-skip {
  justify-self: start;
}
.taste-pair[data-locked] .taste-pick,
.taste-pair[data-locked] .taste-skip,
.taste-pair.is-picked .taste-pick,
.taste-pair.is-picked .taste-skip {
  display: none;
}
.taste-picked {
  margin: 0;
  font-size: 0.85rem;
}
@media (max-width: 720px) {
  .taste-clip video {
    max-height: 280px;
  }
}

/* Phone rail stays in the layout. Earlier drawer rules must not slide it off-screen. */
@media (max-width: 860px) {
  .layout {
    padding-left: 0;
  }

  .sb,
  .sb.is-open,
  .sb.is-collapsed {
    position: relative;
    top: auto;
    left: auto;
    bottom: auto;
    z-index: 2;
    width: 64px;
    min-width: 64px;
    max-width: 64px;
    transform: none;
    transition: none;
    box-shadow: none;
    overflow-x: hidden;
    overflow-y: auto;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }

  .sb .sb-label,
  .sb .sb-label-text,
  .sb .brand-text,
  .sb .sb-badge,
  .sb .credits-bar,
  .sb .credits-value,
  .sb .credits-note,
  .sb .profile-text,
  .sb .chev,
  .sb-toggle,
  .drawer-btn,
  .drawer-scrim {
    display: none !important;
  }

  .sb .sb-item,
  .sb .credits,
  .sb .profile-btn {
    justify-content: center;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }

  .main {
    width: auto;
    flex: 1;
    min-width: 0;
  }

  .home,
  .page,
  .ide-thread {
    padding-top: 1.1rem;
  }

  .ide-top {
    padding-left: 0.6rem;
  }
}

/* Scenarist duration stays readable in the native popup and keyboard navigation. */
select[name="durationRange"].cmp-chip{color-scheme:dark;background:#25233d;color:#fff;border:1px solid #655d91;min-height:34px;padding:6px 10px;cursor:pointer}
select[name="durationRange"].cmp-chip option{background:#242238;color:#fff}
select[name="durationRange"].cmp-chip:focus-visible{outline:2px solid #8b7cff;outline-offset:2px}
/* Saved scenarist prompts: independent reading and copying. */
.scenarist-prompt-cards{display:grid;gap:12px;min-width:0;white-space:normal}
.scenarist-prompt-cards>p{margin:0 0 4px}
.scenarist-prompt-card{border:1px solid #32374d;border-radius:16px;background:linear-gradient(125deg,#151b2b,#1c1422);overflow:hidden}
.scenarist-prompt-card header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px}
.scenarist-prompt-card header>div{display:grid;gap:4px}
.scenarist-prompt-card strong{font-size:15px;color:#f3f5ff}
.scenarist-prompt-card small{font-size:12px;color:#aab1c6}
.scenarist-prompt-card button{border:1px solid #4d658d;background:#213350;color:#ecf3ff;border-radius:10px;padding:9px 13px;cursor:pointer;font:inherit;font-size:13px}
.scenarist-prompt-card button:hover{background:#2c4670}
.scenarist-prompt-card button:focus-visible,.scenarist-prompt-card summary:focus-visible{outline:2px solid #7ca8ff;outline-offset:-2px}
.scenarist-prompt-card summary{padding:0 16px 14px;cursor:pointer;color:#b9caff;font-size:13px}
.scenarist-prompt-card .prompt-collapse{display:none}
.scenarist-prompt-card details[open] .prompt-expand{display:none}
.scenarist-prompt-card details[open] .prompt-collapse{display:inline}
.scenarist-prompt-card pre{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;font-size:13px;line-height:1.65;padding:16px;margin:0;border-top:1px solid #34394d;background:#10131d;user-select:text}
.scenarist-prompt-warning{margin:0;padding:0 16px 12px;color:#f2cd8d;font-size:13px}
