/* Components · AI Video Studio  (depends on tokens.css)
   Naming: block, block__element, block--modifier, .is-state */

*, *::before, *::after { box-sizing: border-box; }

.icon { display: block; flex: none; max-width: none; user-select: none; -webkit-user-drag: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--color-teal-strong); outline-offset: 2px;
}

/* ───────── Button ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: var(--control-h-s); padding: 0 28px; border-radius: var(--radius-md);
  white-space: nowrap; transition: filter var(--dur-fast), background var(--dur-fast);
}
.btn--primary   { background: var(--color-primary); color: var(--color-on-primary); min-width: 128px; }
.btn--primary:hover   { filter: brightness(.94); }
.btn--secondary { background: var(--fill-1); color: var(--text-1); min-width: 100px; }
.btn--secondary:hover { background: rgba(0, 0, 0, .09); }
.btn--action    { height: 28px; padding: 0 12px; border-radius: var(--radius-sm); background: var(--color-teal-strong); color: #fff; }
.btn--action:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(.5px); }

/* round icon buttons (＋ and send) */
.round-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 21px; background: var(--fill-1); transition: background var(--dur-fast);
}
.round-btn--plus { padding: 6px; }
.round-btn--send { width: 28px; height: 28px; padding: 6px; }
.round-btn--send.is-active { background: #000; }
.round-btn--send:disabled { cursor: default; }
.round-btn--send.is-sending { opacity: .55; cursor: wait; }
.round-btn:not(.is-active):hover { background: rgba(0, 0, 0, .09); }

/* ───────── Avatar ───────── */
.avatar {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 20px; background: var(--color-avatar);
  color: #fff; font: 600 18px/1.3 var(--font); overflow: hidden;
}

/* ───────── Page header ───────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  width: 100%; height: var(--header-h); padding: 12px 20px 8px 16px; background: var(--surface);
}
.page-header__name { display: flex; align-items: center; gap: 12px; padding-top: 2px; }
.logo { position: relative; width: 92.3px; height: 24px; flex: none; }
.logo__note { position: absolute; left: 0; top: 0; width: 19.17px; height: 22px; }
.logo__word { position: absolute; left: 22.79px; top: 5.24px; width: 69.54px; height: 16.08px; }
.page-header__divider { width: 1px; height: 18px; background: var(--border-1); flex: none; }
.page-header__title { color: var(--text-1); white-space: nowrap; }
.page-header__cta { display: flex; align-items: center; gap: 20px; }

/* ───────── Sidebar ───────── */
.sidebar {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  width: var(--sidebar-w); height: 100%; padding: 4px 10px 0 8px; background: transparent; /* fills the height of its container */
}
.sidebar__item {
  display: flex; align-items: center; justify-content: center; width: 100%;
  padding: 7px; border-radius: var(--radius-md); transition: background var(--dur-fast);
}
.sidebar__item:hover { background: var(--fill-1); }

/* ───────── Panel ───────── */
.panel {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--surface); border-radius: var(--radius-xl); overflow: hidden;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between; flex: none;
  padding: 14px 12px; background: var(--surface); border-bottom: .5px solid var(--border-1); color: var(--text-1);
}
.panel-header--close { padding-right: 22px; }
.panel-header__close { display: flex; padding: 0; border-radius: var(--radius-sm); }

/* ───────── Chat atoms ───────── */
.time { text-align: center; color: var(--text-3); }
.user-input {
  display: inline-flex; max-width: 360px; padding: 10px; border-radius: var(--radius-lg);
  background: var(--color-teal-soft); color: var(--text-1); overflow-wrap: anywhere;
}
.agent-output { color: var(--text-1); white-space: pre-line; }

.agent-status { display: flex; flex-direction: column; gap: 6px; }
.agent-status__head {
  display: inline-flex; align-items: center; gap: 2px; color: var(--text-2);
  padding: 0; align-self: flex-start;
}
.agent-status__head .icon { transition: transform var(--dur-base) var(--ease); margin-top: 1px; }
.agent-status__steps { display: flex; flex-direction: column; gap: 4px; padding-left: 12px; margin: 0; list-style: none; color: var(--text-2); }
/* Long-form agent thinking (Figma 722:15525): 13px muted paragraphs, 6px apart */
.agent-status__thinking { display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }
.agent-status__thinking p { margin: 0; }
.agent-status--generating .agent-status__label {
  background: linear-gradient(90deg, var(--text-2) 0%, var(--text-1) 50%, var(--text-2) 100%) 0 0 / 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ───────── Capability ───────── */
.capability {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px 0 8px;
  border-radius: var(--radius-pill); background: var(--fill-1); color: var(--text-2);
  white-space: nowrap; transition: background var(--dur-fast);
}
.capability:hover, .capability.is-press { background: rgba(0, 0, 0, .09); }
.capability--chosen { color: var(--text-1); gap: 4px; }
.capability__remove { display: flex; margin-left: 4px; padding: 0; }

.capability-list {
  display: flex; flex-direction: column; width: 172px; padding: 4px;
  background: var(--surface); border-radius: var(--radius-2xl); box-shadow: var(--shadow-menu);
}
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 164px; height: 40px; padding: 14px;
  border-radius: var(--radius-xl); color: var(--text-1); text-align: left; transition: background var(--dur-fast);
}
.menu-item:hover { background: var(--fill-1); }

/* ───────── Input box ───────── */
.input-box {
  display: flex; flex-direction: column; gap: 14px; width: 100%;
  padding: 10px 8px 8px; background: var(--surface);
  border: 1.5px solid var(--border-1); border-radius: var(--radius-input);
}
.input-box__text {
  display: block; width: 100%; min-height: 18px; margin: 0; padding: 0; resize: none; border: 0; outline: 0;
  background: transparent; color: var(--text-1); overflow: hidden;
}
.input-box__text:focus, .input-box__text:focus-visible { outline: 0; }
.input-box__text::placeholder { color: var(--text-3); }
.input-box__text:disabled { color: var(--text-2); cursor: wait; }
.input-box__row { display: flex; align-items: center; justify-content: space-between; }
.input-box__left { display: flex; align-items: center; gap: 8px; }

.disclaimer { display: flex; align-items: flex-start; gap: 4px; color: var(--text-2); white-space: nowrap; }
.disclaimer__link {
  display: inline-flex; align-items: center; gap: 2px; height: 15px;
  border-bottom: .8px solid var(--text-2); color: inherit; text-decoration: none;
}

/* ───────── Cards (shared) ───────── */
.card {
  display: flex; flex-direction: column; gap: 10px; width: 100%; padding: 10px;
  border-radius: var(--radius-lg); overflow: hidden;
  background: linear-gradient(var(--fill-2), var(--fill-2)), #fff;
}
.card__head { display: flex; align-items: center; justify-content: space-between; padding-right: 3px; color: var(--text-1); }
.card__title { display: flex; align-items: center; gap: 4px; }

/* Pick viral boost */
.pick { gap: 8px; padding: 10px 12px; align-items: center; }
.pick__top { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.pick__more { display: inline-flex; align-items: center; gap: 2px; color: var(--text-2); }
.pick__body { display: flex; gap: 10px; padding: 10px; background: #fff; border-radius: var(--radius-md); }
.pick__item { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; text-align: left; border-radius: var(--radius-lg); }
.pick__thumb { position: relative; height: 188px; border-radius: var(--radius-sm); overflow: hidden; background: var(--frame-a); }
.pick__thumb > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pick__cap {
  color: var(--text-1); overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; /* Figma wraps captions to 2 lines */
}
.pick__item.is-selected .pick__thumb { outline: 2px solid var(--color-teal-strong); outline-offset: -2px; }
/* Hover 表现（Figma 672:13775）：底部渐变遮罩 + “Try it” 按钮 + 右上角静音图标（auto layout） */
.pick__hover {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 8px; opacity: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .16) 100%);
  transition: opacity var(--dur-fast);
}
.pick__item:hover .pick__hover { opacity: 1; }
.boost-card:hover .pick__hover { opacity: 1; }
.boost-card:hover .boost-card__mute { opacity: 1; }
.pick__try {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 28px; padding: 4px 12px 5px;
  border-radius: var(--radius-sm); background: #fff; color: var(--text-1); white-space: nowrap;
}
/* 静音图标：外层容器铺满缩略图，padding 8px + justify-end 把按钮钉在右上角，
   与上/右边框间距固定 8px；内层按钮 22×22（4px padding + 14px 图标）、圆角 5、底 rgba(0,0,0,.48) */
.pick__badge-wrap {
  position: absolute; left: 0; top: 0; width: 100%; z-index: 1;
  display: flex; align-items: flex-start; justify-content: flex-end;
  padding: 8px; opacity: 0; pointer-events: none;
  transition: opacity var(--dur-fast);
}
.pick__item:hover .pick__badge-wrap { opacity: 1; }
.pick__badge {
  display: flex; align-items: center; justify-content: center;
  padding: 4px; border-radius: 5px; background: rgba(0, 0, 0, .48);
}
.pick__note { width: 100%; padding: 0 0 0 0; color: var(--text-3); }

/* Preview video card */
.preview-card__inner {
  display: flex; align-items: center; gap: 20px; height: 103px; padding: 13px 20px 13px 16px;
  border: 2px solid #fff; border-radius: var(--radius-md);
  background: linear-gradient(2.5deg, #fff 62.5%, #f8fffc 71.4%, #dcffff 115%), #fff;
}
.preview-card--done .preview-card__inner { padding-right: 15px; }
.preview-card--before .preview-card__inner { gap: 12px; padding: 13px 15px; }
.preview-card__text { display: flex; flex: 1 1 0; flex-direction: column; min-width: 0; height: 100%; }
.preview-card--generating .preview-card__text { justify-content: space-between; padding-bottom: 10px; }
.preview-card--done .preview-card__text,
.preview-card--before .preview-card__text { justify-content: center; gap: 7px; }
.preview-card__title { color: var(--text-1); }
.preview-card__sub { color: var(--text-2); }
.preview-card__cta { display: flex; justify-content: flex-end; }

.progress { width: 100%; height: 4px; border-radius: 16px; background: var(--color-teal-track); overflow: hidden; }
/* Fill keeps Figma's cyan → blue stops. One wave is 320px wide and drifts slowly to the right;
   width is driven by `progress` (or UI.runProgress) with no CSS transition so it never lags behind. */
.progress__fill {
  height: 100%; border-radius: 17px;
  background: linear-gradient(90deg, #47edf3 0, #00c8ff 50%, #47edf3 100%) 0 0 / 320px 100% repeat-x;
  animation: progress-flow 3.4s linear infinite;
}
@keyframes progress-flow { to { background-position: 320px 0; } }
@media (prefers-reduced-motion: reduce) { .progress__fill { animation: none; } }
.progress--indeterminate .progress__fill { width: 40%; animation: slide 1.4s var(--ease) infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* fanned thumbnails (generating / done): a single Figma export (SVG). Layout box is 84.3×71.9; the 85×97 art bleeds above and below it. */
.fan { position: relative; flex: none; width: 84.3px; height: 71.92px; }
.fan img { position: absolute; left: 0; top: -13.4px; max-width: none; }
.fan__play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.thumb img.fill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb__dim { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }
.thumb { position: relative; flex: none; width: 46px; height: 77px; border-radius: var(--radius-md); overflow: hidden; background: var(--frame-a); }

/* ───────── Video player ───────── */
.video {
  position: relative; flex: none; width: 250px; height: 448px; border-radius: var(--radius-lg);
  overflow: hidden; background: var(--frame-a);
}
.video__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video__dim { position: absolute; inset: 0; background: rgba(0, 0, 0, .04); pointer-events: none; }
/* HUD (play button, time, progress bar) only appears on hover */
.video__hud {
  position: absolute; left: 10px; right: 10px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; color: #fff;
  opacity: 0; transition: opacity var(--dur-fast);
}
.video:hover .video__hud { opacity: 1; }
.video__row { display: flex; align-items: center; gap: 6px; }
.video__play { display: flex; padding: 0; }
.video__time { display: flex; gap: 3px; }
.video__bar { height: 3px; border-radius: 16px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.video__bar > i { display: block; height: 100%; background: var(--frame-a); }

/* ───────── Timeline ───────── */
.timeline {
  display: flex; flex-direction: column; gap: 20px; width: 764px; padding-bottom: 16px;
  background: var(--fill-2); border-radius: var(--radius-2xl); overflow: hidden;
}
.timeline__bar {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}
.timeline__group { display: flex; align-items: center; gap: 8px; }
.timeline__group--right { gap: 20px; }
.timeline__play { display: flex; align-items: center; gap: 4px; }
/* The timeline control is a fixed play glyph: a small white triangle in a black
   circle (same icon as the video player). No toggle. */
.pp {
  position: relative; display: block;
  width: 20px; height: 20px; padding: 0; border-radius: 20px; flex: none;
  background: #000; /* black circle */
}
/* small white play triangle in the middle */
.pp::before {
  content: ""; position: absolute; left: 8.2px; top: 6px;
  width: 0; height: 0;
  border-left: 5.5px solid #fff;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}
.timeline__time { display: flex; gap: 3px; }
.timeline__time b { font-weight: 500; color: var(--text-1); }
.timeline__time span { color: var(--text-2); }
.timeline__sep { width: 1px; height: 14px; background: var(--border-1); }
.timeline__shots { display: flex; align-items: flex-start; justify-content: center; gap: 4px; padding: 0; }

.shot-wrap { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
.shot { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; text-align: center; }
.shot__unit { width: 100%; padding: 2px 6px; background: #fff; border-radius: var(--radius-sm); transition: box-shadow var(--dur-fast); }
.shot:hover .shot__unit { box-shadow: 0 0 0 1px var(--border-1); }
.shot.is-selected .shot__unit { box-shadow: 0 0 0 1.5px #000; } /* selected stroke is black */
.shot__frames { position: relative; display: flex; align-items: center; }
.shot__frame { position: relative; flex: none; width: 32px; height: 54px; background-color: var(--frame-b); background-size: cover; background-position: center; }
.shot__frame:nth-child(odd) { background-color: var(--frame-a); }
.shot__frame.is-first { border-radius: 2px 0 0 2px; }
.shot__frame.is-last { border-radius: 0 2px 2px 0; }
.shot__badge {
  position: absolute; left: 3px; top: 3px; padding: 0 3px; border-radius: 3px;
  background: rgba(0, 0, 0, .48); color: #fff;
}
.shot__label { width: 100%; color: var(--text-1); }
.shot.is-selected .shot__label { visibility: hidden; } /* label is covered by the three dots */
/* three-dots menu trigger over the selected shot's label (Figma 748:39415) */
.shot__dots {
  position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 16px; padding: 0; /* ~2:1 pill */
  border-radius: 4px; background: #fff;
  box-shadow: 0 0 12.5px rgba(0, 0, 0, .1);
}
.shot__dots img { display: block; }
/* popover menu (Figma 748:39415): white card, big soft shadow */
.shot-menu {
  position: absolute; z-index: 15; width: 188px; padding: 4px;
  display: flex; flex-direction: column;
  background: #fff; border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .16);
}
.shot-menu__item {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 40px;
  padding: 0 14px; border-radius: 10px; color: var(--text-1); text-align: left;
  transition: background var(--dur-fast);
}
.shot-menu__item:hover { background: var(--fill-1); }
/* "Review videos" row: white by default, highlighted only on hover / active (Figma 754:40429) */
.shot-menu__item.is-highlighted { border-radius: 8px; background: #fff; }
.shot-menu__item.is-highlighted:hover, .shot-menu__item.is-highlighted:active { background: rgba(0, 0, 0, .05); }
/* disabled: Review videos is greyed out on shots other than shot 1 */
.shot-menu__item:disabled, .shot-menu__item[disabled] {
  color: rgba(0, 0, 0, .34); cursor: default; background: #fff;
}
.shot-menu__item:disabled .icon, .shot-menu__item[disabled] .icon { opacity: .4; }
.playhead { position: absolute; top: -15.5px; width: 11.59px; height: 104px; pointer-events: none; z-index: 2; }
.playhead img { display: block; width: 100%; height: 100%; }

/* ───────── Curated shots card (chat) ───────── */
.pick--trending { align-items: stretch; gap: 10px; background: linear-gradient(rgba(241, 250, 255, .4), rgba(241, 250, 255, .4)), linear-gradient(var(--fill-2), var(--fill-2)), #fff; }
.pick--trending .pick__more { gap: 2px; color: var(--text-2); }
.pick__row { display: flex; gap: 10px; }
.pick--trending .pick__thumb { border-radius: var(--radius-md); }
.pick--trending .pick__note { width: 100%; }

/* ───────── Variant preview (review state) ───────── */
.variant-video { position: relative; flex: none; width: 218px; height: 390px; border-radius: var(--radius-lg); overflow: hidden; background: var(--frame-a); }
.variant-video img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.variant-video--lg { width: 250px; height: 448px; }
.variant-video__dim { position: absolute; inset: 0; background: rgba(0, 0, 0, .04); }

.review { position: relative; display: flex; flex-direction: column; gap: 16px; width: 764px; padding-bottom: 16px; background: var(--fill-2); border-radius: var(--radius-2xl); }
.review__top { display: flex; flex-direction: column; gap: 4px; }
.review__head { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px 12px 12px; color: var(--text-1); }
.review__title { display: flex; align-items: center; justify-content: space-between; padding-right: 3px; }
.review__close { display: flex; padding: 0; border-radius: var(--radius-sm); }
.review__row { display: flex; align-items: center; justify-content: space-between; }
.review__chips { display: flex; align-items: center; gap: 16px; }
.review__variants { display: flex; gap: 12px; }
.review__vsep { display: block; flex: none; width: 1.5px; height: 17.5px; }
.vchip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px 4px 8px;
  background: var(--surface); border: 1px solid var(--border-1); border-radius: var(--radius-sm); color: var(--text-1);
  white-space: nowrap; transition: border-color var(--dur-fast);
}
.vchip:hover { border-color: rgba(0, 0, 0, .32); }
.vchip.is-selected, .vchip.is-selected:hover { border-color: #000; }
.vchip__thumb { position: relative; flex: none; width: 12px; height: 18px; border-radius: var(--radius-xs); overflow: hidden; background: var(--frame-a); }
.vchip__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.btn--choose { height: 24px; padding: 0 12px; border-radius: var(--radius-sm); background: #000; color: #fff; }
.btn--choose:hover { background: #262626; }
/* Choose is disabled while the original Default variant is selected */
.btn--choose:disabled, .btn--choose[disabled] {
  background: rgba(0, 0, 0, .12); color: #fff; cursor: default;
}
.review__rule { position: relative; height: 4.21px; transform: scaleY(-1); } /* flipped: the notch points down at the shot */
.review__rule svg { position: absolute; left: 0; top: 0; overflow: visible; }
.review__shots { display: flex; align-items: flex-start; gap: 4px; padding: 0 16px; }
.review__playhead { position: absolute; left: 16px; top: 94.2px; width: 11.59px; height: 104px; pointer-events: none; z-index: 2; }
.review__playhead img { display: block; width: 100%; height: 100%; }

/* ───────── Modal · Viral boost ───────── */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.scrim { position: absolute; inset: 0; z-index: 20; background: var(--scrim); }
.modal {
  position: absolute; z-index: 21; left: 220px; top: 34px; width: 1080px; height: 732px;
  display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-xl); overflow: hidden;
}
.modal__head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 14px 22px 14px 24px; color: var(--text-1); }
.modal__close { display: flex; padding: 0; border-radius: var(--radius-sm); }
.modal__body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 16px; padding: 8px 0 24px; scrollbar-width: none; } /* no visible scrollbar, as in Figma; wheel / trackpad still scroll */
.modal__body::-webkit-scrollbar { display: none; }

.boost-banner {
  flex: none; height: 132px; margin: 0 24px; border-radius: var(--radius-2xl);
  background: url("../assets/img/boost-banner.webp") center / 100% 100% no-repeat; /* Figma 637:49737, exported 4×, WebP for payload */
}

.boost-toolbar {
  position: sticky; top: -8px; z-index: 2; flex: none; display: flex; align-items: center; justify-content: space-between;
  height: 48px; padding: 0 24px 8px; background: var(--surface); /* 40px row + 8px breathing room below (matches Figma: card top at y=271) */
  transition: box-shadow var(--dur-fast);
} /* top: -8px cancels the body's top padding so it pins flush under the header */
.boost-toolbar::before { content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 2px; background: var(--surface); } /* seals the sub-pixel seam above the pinned bar */
.boost-toolbar.is-stuck { box-shadow: 0 1px 0 var(--border-1); }
.chips { display: flex; gap: 8px; }
.chip {
  display: inline-flex; flex: none; align-items: center; justify-content: center; height: 32px; min-width: 32px; padding: 0 12px;
  border-radius: var(--radius-capsule); color: var(--text-65); white-space: nowrap; transition: background var(--dur-fast), color var(--dur-fast);
}
.chip:hover { background: var(--fill-1); }
.chip.is-selected { background: var(--fill-1); color: var(--text-1); }

.search-field {
  display: flex; align-items: center; gap: 6px; width: 240px; padding: 10px 11px;
  border: 1px solid var(--border-1); border-radius: var(--radius-lg); background: var(--surface);
}
.search-field input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text-1); }
.search-field input::placeholder { color: var(--text-2); }

.boost-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; padding: 0 24px; }
.boost-grid__empty { grid-column: 1 / -1; padding: 48px 0; text-align: center; color: var(--text-2); }
.boost-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; text-align: left; border-radius: var(--radius-lg); }
.boost-card__thumb { position: relative; aspect-ratio: 220 / 367; border-radius: var(--radius-lg); overflow: hidden; background: var(--frame-a); }
.boost-card__thumb > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* 顶部行（Figma 673:14066）：标签靠左、静音按钮靠右，两端对齐；hover 时静音按钮与 Try it 一起浮现 */
.boost-card__top {
  position: absolute; left: 0.2px; top: 0; width: calc(100% - 0.4px);
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 10px 10px 0;
}
.boost-card__tag { padding: 4px; border-radius: 5px; background: rgba(0, 0, 0, .48); color: #fff; }
.boost-card__mute {
  display: flex; align-items: center; justify-content: center; padding: 4px; border-radius: 5px;
  background: rgba(0, 0, 0, .48); opacity: 0; pointer-events: none;
  transition: opacity var(--dur-fast);
}
/* BoostCard 的 Try it 按钮高 32px（Figma 673:14066），比 pick 卡的 28px 高；
   渐变层底部留白 10px、顶部 20px，按钮 32px 全宽 */
.boost-card .pick__hover { padding: 20px 10px 10px; }
.boost-card .pick__try { height: 32px; }
.boost-card__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-1); } /* always one line; long names truncate */
.boost-card__sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.boost-card:hover .boost-card__thumb { filter: brightness(.96); }
.boost-card.is-selected .boost-card__thumb { outline: 2px solid var(--color-teal-strong); outline-offset: -2px; }
.boost-row { display: contents; }

/* ───────── App shell ───────── */
.app {
  position: relative; display: flex; flex-direction: column; width: 1440px; height: 800px; background: var(--page-bg);
  font-family: var(--font); color: var(--text-1); overflow: hidden;
}
.app__main { display: flex; flex: 1; min-height: 0; gap: var(--panel-gap); padding: var(--panel-gap) var(--panel-gap) var(--panel-gap) 0; }
.app__main > .sidebar { height: auto; } /* stretches with the panels: 800 − 54 header − 2×8 = 730 */
.app__chat { width: var(--chat-w); flex: none; }
.app__preview { flex: 1; min-width: 0; }

/* Top toast (Figma 609:8375): floating notice, centred 8px below the header, above the app */
.toast {
  position: absolute; top: calc(var(--header-h) + 8px); left: 50%; z-index: 40;
  transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center;
  padding: 12px 16px; border-radius: 10px;
  font: 600 14px/1.3 var(--font); color: #f6f6f6; text-align: center; white-space: nowrap;
  background: linear-gradient(90deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .1)),
              linear-gradient(90deg, rgba(37, 37, 37, .7), rgba(37, 37, 37, .7));
  backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, .15);
  animation: toast-in var(--dur-base) var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }

.chat__scroll { flex: 1; min-height: 0; overflow: auto; padding: 8px 13px 12px; display: flex; flex-direction: column; gap: 24px; }
.chat__scroll > * { flex: none; } /* messages keep their height; the list scrolls instead of squeezing cards */
.chat__row { display: flex; flex-direction: column; }
.chat__row--right { align-items: flex-end; }
.chat__row--center { align-items: center; }
.chat__stack { display: flex; flex-direction: column; gap: 12px; }
.chat__foot { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 13px 8px; }

.preview__body { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 30px; padding: 16px 0 32px; }
.preview__body--review { gap: 40px; }
.preview__stage { display: flex; align-items: flex-start; justify-content: center; width: 100%; padding: 0 20px; }

.popover { position: absolute; z-index: 10; }
