/* =========================================================
   FormYar — AI studio, assistant chat, landing + dashboard
   ========================================================= */

/* ---------- floating launcher ---------- */
.fy-ai-launcher {
  position: fixed;
  z-index: 190;
  inset-inline-end: 24px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 8px 11px 8px 15px;
  border-radius: 999px;
  color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, 0.3), transparent 42%),
    linear-gradient(135deg, #047857 0%, #0f766e 55%, #0ea5e9 135%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 18px 44px rgba(4, 120, 87, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.26);
  transition: transform 0.24s var(--ease), box-shadow 0.24s, border-color 0.24s, opacity 0.2s;
}
.fy-ai-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(4, 120, 87, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.fy-ai-launcher.is-open {
  transform: scale(0.96);
  opacity: 0;
  pointer-events: none;
}
.fy-ai-launcher-orb {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
  flex: none;
}
.fy-ai-launcher-orb::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  animation: fyAiPulse 2.8s ease-out infinite;
  pointer-events: none;
}
.fy-ai-launcher-orb .icon {
  width: 18px;
  height: 18px;
}
.fy-ai-launcher-label {
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
}
.fy-ai-launcher-badge {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.22);
  line-height: 1.4;
}
@keyframes fyAiPulse {
  0% { transform: scale(0.9); opacity: 0.9; }
  70% { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* ---------- shell ---------- */
.fy-ai-layer {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: none;
  pointer-events: none;
}
.fy-ai-layer.open {
  display: block;
}
.fy-ai-backdrop {
  display: none;
}
.fy-ai-panel {
  position: absolute;
  inset-inline-end: 24px;
  bottom: 92px;
  width: min(442px, calc(100vw - 32px));
  height: min(684px, calc(100dvh - 116px));
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--line-2) 72%, transparent);
  border-radius: 26px;
  box-shadow: 0 34px 90px rgba(8, 11, 28, 0.28), 0 2px 0 rgba(255, 255, 255, 0.04) inset;
  overflow: hidden;
  pointer-events: auto;
  animation: fyAiPanelIn 0.36s var(--ease);
}
@keyframes fyAiPanelIn {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- header ---------- */
.fy-ai-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 13px 16px;
  color: #fff;
  background:
    radial-gradient(120% 170% at 100% -20%, rgba(56, 189, 248, 0.28), transparent 55%),
    radial-gradient(100% 120% at 0% 120%, rgba(16, 185, 129, 0.22), transparent 60%),
    linear-gradient(135deg, #061411 0%, #0d2a22 56%, #0b2e2a 100%);
  overflow: hidden;
  flex: none;
}
.fy-ai-head::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  inset-inline-end: -70px;
  top: -90px;
  pointer-events: none;
}
.fy-ai-head-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  z-index: 1;
}
.fy-ai-orb {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
  background:
    radial-gradient(90% 100% at 30% 10%, rgba(255, 255, 255, 0.42), transparent 50%),
    linear-gradient(135deg, #0d9488, #0d9488 55%, #0ea5e9);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow: 0 10px 24px rgba(14, 18, 48, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.fy-ai-orb .icon {
  width: 20px;
  height: 20px;
}
.fy-ai-head-brand b {
  display: block;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}
.fy-ai-head-brand small {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  color: #a7f3d0;
  line-height: 1.5;
  font-weight: 500;
}
.fy-ai-online {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
  display: inline-block;
}
.fy-ai-head-actions {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  z-index: 1;
}
.fy-ai-demo-badge {
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #d1fae5;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 3px 6px;
  border-radius: 5px;
}
.fy-ai-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #d1fae5;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  transition: 0.16s;
}
.fy-ai-icon-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
}
.fy-ai-icon-btn .icon {
  width: 16px;
  height: 16px;
}

/* ---------- mode tabs ---------- */
.fy-ai-tabs {
  display: flex;
  gap: 6px;
  padding: 9px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.fy-ai-tab {
  flex: 1;
  min-height: 36px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--muted);
  transition: 0.18s;
  border: 1px solid transparent;
}
.fy-ai-tab .icon {
  width: 15px;
  height: 15px;
}
.fy-ai-tab:hover {
  color: var(--ink);
  background: var(--bg-2);
}
.fy-ai-tab.active {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 16%, transparent);
}

/* ---------- builder context ---------- */
.fy-ai-context {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: color-mix(in srgb, var(--brand-soft) 72%, var(--card));
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 12%, var(--line));
  font-size: 10px;
  color: var(--muted);
  flex: none;
}
.fy-ai-context[hidden] {
  display: none;
}
.fy-ai-context-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 18%, transparent);
  flex: none;
}
.fy-ai-context-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fy-ai-context-text b {
  color: var(--ink-2);
  font-weight: 800;
}
.fy-ai-context-badge {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand);
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--line));
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 8.5px;
  font-weight: 800;
  flex: none;
}
.fy-ai-context-badge .icon {
  width: 11px;
  height: 11px;
}

/* ---------- main / transcripts ---------- */
.fy-ai-main {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background:
    radial-gradient(ellipse 60% 40% at 100% 0%, color-mix(in srgb, var(--brand) 5%, transparent), transparent 70%),
    var(--card);
}
.fy-ai-transcripts {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 14px 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.fy-ai-transcripts::-webkit-scrollbar {
  width: 6px;
}
.fy-ai-transcripts::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 8px;
}
.fy-ai-messages {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.fy-ai-messages[hidden] {
  display: none;
}

/* ---------- messages ---------- */
.fy-ai-msg {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  max-width: 100%;
  animation: fyAiMsgIn 0.26s var(--ease);
}
@keyframes fyAiMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.fy-ai-msg.assistant {
  justify-content: flex-start;
}
.fy-ai-msg.user {
  margin-inline-start: auto;
  width: fit-content;
  max-width: 88%;
  justify-content: flex-end;
}
.fy-ai-msg-avatar,
.fy-ai-user-avatar {
  width: 27px;
  height: 27px;
  border-radius: 9px;
  flex: none;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}
.fy-ai-msg-avatar.ai {
  color: #fff;
  background: linear-gradient(135deg, #047857, #0d9488 62%, #0ea5e9);
  border-color: transparent;
}
.fy-ai-msg-avatar.ai .icon {
  width: 14px;
  height: 14px;
}
.fy-ai-msg-avatar.support img,
.fy-ai-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fy-ai-bubble {
  max-width: calc(100% - 34px);
  padding: 9px 11px;
  border-radius: 15px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.9;
  word-break: break-word;
}
.fy-ai-msg.assistant .fy-ai-bubble {
  border-start-start-radius: 5px;
}
.fy-ai-msg.user .fy-ai-bubble {
  color: #fff;
  background:
    radial-gradient(110% 140% at 100% 0%, rgba(255, 255, 255, 0.16), transparent 50%),
    linear-gradient(135deg, var(--brand), #0f766e);
  border-color: transparent;
  border-start-end-radius: 5px;
  box-shadow: 0 8px 20px rgba(4, 120, 87, 0.18);
}
.fy-ai-msg.is-wide .fy-ai-bubble {
  width: 100%;
  max-width: calc(100% - 34px);
}
.fy-ai-bubble b {
  font-size: 12.5px;
  color: var(--ink);
}
.fy-ai-msg.user .fy-ai-bubble,
.fy-ai-msg.user .fy-ai-bubble b {
  color: #fff;
}
.fy-ai-bubble p {
  margin: 4px 0 0;
}
.fy-ai-bubble p:first-child {
  margin-top: 0;
}
.fy-ai-bubble p + p {
  margin-top: 6px;
}
.fy-ai-capabilities {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}
.fy-ai-capabilities span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
}
.fy-ai-capabilities .icon {
  width: 13px;
  height: 13px;
  color: var(--brand);
}
.fy-ai-soft-note {
  margin-top: 8px !important;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 9.5px;
  color: var(--muted-2);
  line-height: 1.7;
}
.fy-ai-soft-note .icon {
  width: 12px;
  height: 12px;
  flex: none;
  margin-top: 2px;
}
.fy-ai-agent-sign {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 8.5px;
  color: var(--muted-2);
}
.fy-ai-agent-sign .icon {
  width: 11px;
  height: 11px;
  color: var(--mint);
}

/* ---------- typing ---------- */
.fy-ai-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 150px;
  padding: 2px 0;
}
.fy-ai-typing > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  animation: fyAiTyping 1.1s infinite ease-in-out;
}
.fy-ai-typing > span:nth-child(2) { animation-delay: 0.16s; }
.fy-ai-typing > span:nth-child(3) { animation-delay: 0.32s; }
.fy-ai-typing small {
  font-size: 9px;
  color: var(--muted-2);
  margin-inline-start: 5px;
}
@keyframes fyAiTyping {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* ---------- proposal card ---------- */
.fy-ai-proposal-wrap {
  margin-top: 9px;
}
.fy-ai-proposal {
  border: 1px solid var(--line);
  border-radius: 17px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--ai-accent, var(--brand)) 12%, transparent), transparent 55%),
    var(--card);
  box-shadow: 0 10px 28px rgba(14, 19, 48, 0.07);
}
[data-theme="dark"] .fy-ai-proposal {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}
.fy-ai-proposal-top {
  display: flex;
  gap: 10px;
  padding: 12px 12px 9px;
}
.fy-ai-proposal-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--ai-accent, var(--brand)), color-mix(in srgb, var(--ai-accent, var(--brand)) 55%, #0d9488));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--ai-accent, var(--brand)) 25%, transparent);
  flex: none;
}
.fy-ai-proposal-icon .icon {
  width: 18px;
  height: 18px;
}
.fy-ai-proposal-title-wrap {
  min-width: 0;
}
.fy-ai-proposal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 8.5px;
  font-weight: 800;
  color: var(--ai-accent, var(--brand));
  margin-bottom: 2px;
}
.fy-ai-proposal-kicker .icon {
  width: 11px;
  height: 11px;
}
.fy-ai-proposal h4 {
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  color: var(--ink);
}
.fy-ai-proposal-top p {
  margin: 3px 0 0;
  font-size: 10.5px;
  line-height: 1.8;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fy-ai-proposal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  padding: 7px 12px;
  border-block: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 54%, transparent);
  font-size: 9px;
  color: var(--muted);
}
.fy-ai-proposal-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.fy-ai-proposal-meta .icon {
  width: 11px;
  height: 11px;
  color: var(--ai-accent, var(--brand));
}
.fy-ai-proposal-fields {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fy-ai-field-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  font-size: 10.5px;
  color: var(--ink-2);
  border-bottom: 1px dashed color-mix(in srgb, var(--line) 65%, transparent);
}
.fy-ai-field-row:last-child {
  border-bottom: 0;
}
.fy-ai-field-icon {
  width: 19px;
  height: 19px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--bg-2);
  color: var(--muted);
  flex: none;
}
.fy-ai-field-icon .icon {
  width: 11px;
  height: 11px;
}
.fy-ai-field-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fy-ai-req {
  margin-inline-start: auto;
  font-size: 7.5px;
  font-style: normal;
  font-weight: 800;
  color: var(--coral);
  background: var(--coral-soft);
  padding: 1px 5px;
  border-radius: 4px;
  flex: none;
}
.fy-ai-more {
  font-size: 9px;
  color: var(--brand);
  font-weight: 700;
  padding: 4px 1px 2px;
}
.fy-ai-proposal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 60%, var(--bg-2));
}
.fy-ai-proposal-actions .btn {
  min-height: 31px;
  padding: 5px 10px;
  font-size: 10.5px;
  border-radius: 9px;
  gap: 4px;
}
.fy-ai-proposal-actions .btn .icon {
  width: 13px;
  height: 13px;
}
.fy-ai-proposal-actions .btn-outline {
  background: var(--card);
}
.fy-ai-proposal-foot {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px 9px;
  font-size: 8px;
  color: var(--muted-2);
}
.fy-ai-proposal-foot .icon {
  width: 10px;
  height: 10px;
  color: var(--mint);
}

/* ---------- suggestions ---------- */
.fy-ai-suggest {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  border-top: 1px solid var(--line);
  background: var(--card);
  flex: none;
}
.fy-ai-suggest::-webkit-scrollbar {
  display: none;
}
.fy-ai-suggest-chip {
  flex: none;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 650;
  transition: 0.16s;
}
.fy-ai-suggest-chip:hover {
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  background: var(--brand-soft);
}
.fy-ai-suggest-chip:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ---------- composer ---------- */
.fy-ai-composer {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 6px 12px 8px;
  background: var(--card);
  flex: none;
}
.fy-ai-input-wrap {
  flex: 1;
  min-width: 0;
  padding: 6px 10px 5px;
  border: 1px solid var(--line-2);
  border-radius: 15px;
  background: var(--bg-2);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  cursor: text;
}
.fy-ai-input-wrap:focus-within {
  border-color: color-mix(in srgb, var(--brand) 52%, var(--line-2));
  background: var(--card);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent);
}
.fy-ai-input-wrap textarea {
  display: block;
  width: 100%;
  min-height: 24px;
  max-height: 112px;
  padding: 1px 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.8;
  scrollbar-width: thin;
}
.fy-ai-input-wrap textarea::placeholder {
  color: var(--muted-2);
}
.fy-ai-input-hint {
  display: block;
  font-size: 8px;
  line-height: 1.4;
  color: var(--muted-2);
  padding-top: 2px;
  user-select: none;
}
.fy-ai-send {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    radial-gradient(100% 100% at 100% 0%, rgba(255, 255, 255, 0.2), transparent 55%),
    linear-gradient(135deg, var(--brand), #0f766e);
  box-shadow: 0 9px 22px rgba(4, 120, 87, 0.3);
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
  flex: none;
}
.fy-ai-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(4, 120, 87, 0.38);
}
.fy-ai-send:disabled {
  opacity: 0.52;
  transform: none;
  cursor: wait;
}
.fy-ai-send .icon {
  width: 18px;
  height: 18px;
}
.fy-ai-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 12px 9px;
  font-size: 8px;
  color: var(--muted-2);
  background: var(--card);
  flex: none;
}
.fy-ai-foot .icon {
  width: 10px;
  height: 10px;
}

/* ---------- preview sheet ---------- */
.fy-ai-preview {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  background: var(--card);
}
.fy-ai-preview[hidden] {
  display: none;
}
.fy-ai-prev-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.fy-ai-prev-head .fy-ai-icon-btn {
  color: var(--muted);
  background: var(--bg-2);
  border-color: var(--line);
}
.fy-ai-prev-head .fy-ai-icon-btn:hover {
  color: var(--ink);
  background: var(--card);
}
.fy-ai-prev-head div {
  min-width: 0;
  flex: 1;
}
.fy-ai-prev-head b {
  display: block;
  font-size: 11.5px;
}
.fy-ai-prev-head small {
  display: block;
  font-size: 9px;
  color: var(--muted-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fy-ai-prev-head .btn {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 10px;
  border-radius: 8px;
  flex: none;
}
.fy-ai-prev-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--line-2) 55%, transparent) 1px, transparent 0),
    var(--bg);
  background-size: 18px 18px;
}
.fy-ai-prev-form {
  max-width: 370px;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(14, 19, 48, 0.12);
}
.fy-ai-prev-hero {
  position: relative;
  padding: 18px 16px 15px;
  color: #fff;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255, 255, 255, 0.24), transparent 48%),
    linear-gradient(135deg, var(--ai-accent), color-mix(in srgb, var(--ai-accent) 60%, #0d9488) 75%, #10b981 160%);
}
.fy-ai-prev-hero::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  inset-inline-end: -30px;
  bottom: -55px;
}
.fy-ai-prev-brand {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 8.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 8px;
}
.fy-ai-prev-brand .icon {
  width: 12px;
  height: 12px;
}
.fy-ai-prev-hero h3 {
  font-size: 16px;
  line-height: 1.55;
  margin: 0 0 5px;
  color: #fff;
}
.fy-ai-prev-hero p {
  margin: 0;
  font-size: 9.5px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.84);
}
.fy-ai-prev-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 9px;
  margin-top: 10px;
  font-size: 7.5px;
  color: rgba(255, 255, 255, 0.78);
}
.fy-ai-prev-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 2px 6px;
  border-radius: 999px;
}
.fy-ai-prev-hero-meta .icon {
  width: 9px;
  height: 9px;
}
.fy-ai-prev-body {
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.fy-ai-prev-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fy-ai-prev-label {
  display: flex;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-2);
  line-height: 1.6;
}
.fy-ai-prev-req {
  color: var(--coral);
  font-weight: 800;
}
.fy-ai-prev-desc {
  font-size: 8px;
  color: var(--muted-2);
  margin: 0;
}
.fy-ai-prev-input {
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card-2);
}
.fy-ai-prev-area {
  height: 58px;
}
.fy-ai-prev-select {
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card-2);
  padding: 0 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 8.5px;
  color: var(--muted-2);
}
.fy-ai-prev-select .icon {
  width: 11px;
  height: 11px;
}
.fy-ai-prev-options {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.fy-ai-prev-options span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 8.5px;
  color: var(--muted);
  background: var(--card-2);
}
.fy-ai-prev-options i {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--line-2);
  display: inline-block;
  flex: none;
}
.fy-ai-prev-options i.dot {
  border-radius: 50%;
}
.fy-ai-prev-options i.box {
  border-radius: 3px;
}
.fy-ai-prev-stars {
  display: flex;
  gap: 4px;
  color: var(--amber);
}
.fy-ai-prev-stars .icon {
  width: 20px;
  height: 20px;
}
.fy-ai-prev-nps {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.fy-ai-prev-nps span {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--card-2);
  display: grid;
  place-items: center;
  font-size: 7.5px;
  color: var(--muted);
}
.fy-ai-prev-scale {
  display: flex;
  gap: 3px;
}
.fy-ai-prev-scale span {
  flex: 1;
  padding: 5px 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card-2);
  text-align: center;
  font-size: 6.5px;
  color: var(--muted);
}
.fy-ai-prev-scale b {
  display: block;
  color: var(--ink-2);
  font-size: 8px;
}
.fy-ai-prev-upload {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  background: var(--card-2);
  color: var(--muted);
}
.fy-ai-prev-upload .icon {
  width: 16px;
  height: 16px;
  color: var(--brand);
}
.fy-ai-prev-upload b {
  font-size: 8.5px;
}
.fy-ai-prev-upload small {
  font-size: 7px;
  color: var(--muted-2);
}
.fy-ai-prev-sign {
  height: 46px;
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  background: var(--card-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted-2);
  font-size: 8px;
}
.fy-ai-prev-sign .icon {
  width: 14px;
  height: 14px;
}
.fy-ai-prev-payment {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px;
  background: var(--card-2);
}
.fy-ai-prev-payment > div {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 8.5px;
  color: var(--ink-2);
}
.fy-ai-prev-payment > div > span {
  width: 23px;
  height: 23px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
}
.fy-ai-prev-payment .icon {
  width: 12px;
  height: 12px;
}
.fy-ai-prev-payment button {
  width: 100%;
  margin-top: 7px;
  min-height: 27px;
  border-radius: 7px;
  background: var(--ai-accent, var(--brand));
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
}
.fy-ai-prev-heading {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  padding-top: 2px;
}
.fy-ai-prev-heading p {
  margin: 2px 0 0;
  font-size: 8px;
  color: var(--muted-2);
}
.fy-ai-prev-paragraph {
  margin: 0;
  font-size: 8.5px;
  line-height: 1.8;
  color: var(--muted);
}
.fy-ai-prev-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}
.fy-ai-prev-image img {
  border-radius: 8px;
}
.fy-ai-prev-section {
  font-size: 9px;
  font-weight: 800;
  color: var(--brand);
  padding: 3px 0;
  border-bottom: 1px solid var(--line);
}
.fy-ai-prev-help {
  margin: 0;
  font-size: 7px;
  color: var(--muted-2);
}
.fy-ai-prev-submit {
  min-height: 34px;
  border-radius: 9px;
  background: var(--ai-accent, var(--brand));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  pointer-events: none;
}
.fy-ai-prev-submit .icon {
  width: 13px;
  height: 13px;
}
.fy-ai-prev-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--card);
  font-size: 8px;
  color: var(--muted-2);
  flex: none;
}
.fy-ai-prev-note .icon {
  width: 10px;
  height: 10px;
}

/* ---------- dashboard AI banner ---------- */
.ai-dash-banner {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  margin-bottom: 22px;
  border-radius: var(--r-lg);
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
  background:
    radial-gradient(70% 130% at 100% 0%, color-mix(in srgb, var(--violet) 13%, transparent), transparent 60%),
    radial-gradient(60% 130% at 0% 100%, color-mix(in srgb, var(--mint) 12%, transparent), transparent 60%),
    linear-gradient(120deg, color-mix(in srgb, var(--brand) 8%, var(--card)), var(--card) 55%);
  overflow: hidden;
}
.ai-dash-banner::after {
  content: "AI";
  position: absolute;
  inset-inline-start: 30px;
  top: -22px;
  font-size: 96px;
  font-weight: 900;
  letter-spacing: -0.08em;
  color: color-mix(in srgb, var(--brand) 5%, transparent);
  pointer-events: none;
  line-height: 1;
}
.ai-dash-orb {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    radial-gradient(100% 100% at 30% 10%, rgba(255, 255, 255, 0.36), transparent 50%),
    linear-gradient(135deg, #047857, #0d9488 55%, #0ea5e9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 28px rgba(4, 120, 87, 0.3);
  flex: none;
  position: relative;
  z-index: 1;
}
.ai-dash-orb .icon {
  width: 24px;
  height: 24px;
}
.ai-dash-copy {
  min-width: 0;
  position: relative;
  z-index: 1;
}
.ai-dash-kicker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.02em;
  color: var(--brand);
  margin-bottom: 2px;
}
.ai-dash-kicker .icon {
  width: 11px;
  height: 11px;
}
.ai-dash-copy h3 {
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 2px;
}
.ai-dash-copy p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--muted);
}
.ai-dash-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  position: relative;
  z-index: 1;
}
.ai-dash-prompts {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.ai-dash-prompt {
  max-width: 210px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 76%, transparent);
  padding: 4px 9px;
  border-radius: 999px;
  transition: 0.16s;
}
.ai-dash-prompt:hover {
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  background: var(--brand-soft);
}
.ai-dash-side .btn {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 11px;
  border-radius: 10px;
}
.ai-dash-side .btn .icon {
  width: 14px;
  height: 14px;
}

/* ---------- landing AI section ---------- */
.ai-landing-section {
  padding-top: 0;
}
.ai-landing-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  align-items: center;
  gap: clamp(24px, 4vw, 52px);
  padding: clamp(24px, 4.4vw, 52px);
  border-radius: 32px;
  overflow: hidden;
  color: #fff;
  isolation: isolate;
  background:
    radial-gradient(100% 120% at 100% 0%, rgba(56, 189, 248, 0.26), transparent 55%),
    radial-gradient(90% 130% at 0% 100%, rgba(16, 185, 129, 0.19), transparent 60%),
    linear-gradient(135deg, #061411 0%, #0d2a22 52%, #0b2e2a 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: var(--shadow-lg);
}
.ai-landing-card::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  inset-inline-end: -160px;
  top: -180px;
  z-index: -1;
}
.ai-landing-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 0);
  background-size: 24px 24px;
  opacity: 0.22;
  mask-image: linear-gradient(100deg, #000, transparent 60%);
  z-index: -1;
  pointer-events: none;
}
.ai-landing-copy {
  position: relative;
  z-index: 1;
}
.ai-landing-copy .eyebrow {
  color: #d1fae5;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
}
.ai-landing-copy h2 {
  font-size: clamp(25px, 3.4vw, 40px);
  line-height: 1.4;
  margin: 14px 0 12px;
  color: #fff;
}
.ai-landing-copy h2 span {
  color: #8ee9ca;
}
.ai-landing-copy > p {
  color: #c4c8e8;
  font-size: clamp(13px, 1.4vw, 14.5px);
  line-height: 2;
  max-width: 520px;
  margin: 0;
}
.ai-landing-features {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 18px 0 22px;
}
.ai-landing-features span {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 11.5px;
  color: #dfe1f9;
  line-height: 1.8;
}
.ai-landing-features .icon {
  width: 15px;
  height: 15px;
  color: #6ee7b7;
  flex: none;
  margin-top: 2px;
}
.ai-landing-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.ai-landing-actions .btn-primary {
  box-shadow: 0 16px 38px rgba(4, 120, 87, 0.36);
}
.ai-landing-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: #cdd0f7;
}
.ai-landing-link .icon {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}
.ai-landing-link:hover {
  color: #fff;
}
.ai-landing-link:hover .icon {
  transform: translateX(-3px);
}
.ai-landing-note {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 15px;
  font-size: 9.5px;
  color: #9ca2c8;
}
.ai-landing-note .icon {
  width: 12px;
  height: 12px;
  color: #fbbf24;
}

/* landing chat mock */
.ai-demo-chat {
  width: 100%;
  max-width: 420px;
  justify-self: center;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 24px;
  padding: 11px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 1;
}
.ai-demo-chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 3px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.ai-demo-chat-orb {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0d9488, #0d9488 55%, #0ea5e9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  flex: none;
}
.ai-demo-chat-orb .icon {
  width: 16px;
  height: 16px;
}
.ai-demo-chat-head b {
  display: block;
  font-size: 11.5px;
  line-height: 1.4;
}
.ai-demo-chat-head small {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  color: #b9bedf;
}
.ai-demo-chat-head small i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #34d399;
}
.ai-demo-chat-head .ai-demo-badge {
  margin-inline-start: auto;
}
.ai-demo-thread {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 2px;
}
.ai-demo-msg {
  max-width: 88%;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 10px;
  line-height: 1.8;
}
.ai-demo-msg.user {
  align-self: flex-start;
  color: #ecfdf5;
  background: rgba(13, 148, 136, 0.35);
  border: 1px solid rgba(139, 124, 255, 0.26);
  border-start-start-radius: 4px;
}
.ai-demo-msg.bot {
  align-self: flex-end;
  color: #d1fae5;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-start-end-radius: 4px;
}
.ai-demo-mini-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
}
.ai-demo-mini-fields span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 8.5px;
  color: #c9cdea;
}
.ai-demo-mini-fields .icon {
  width: 10px;
  height: 10px;
  color: #8ee9ca;
}
.ai-demo-mini-fields em {
  margin-inline-start: auto;
  font-size: 7px;
  font-style: normal;
  color: #8ee9ca;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.18);
  padding: 1px 5px;
  border-radius: 4px;
}
.ai-demo-input {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 5px 6px 5px 11px;
  border-radius: 12px;
  background: rgba(8, 11, 28, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #8f96bc;
  font-size: 9.5px;
}
.ai-demo-input span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-demo-input .ai-demo-send {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #0d9488, #0d9488);
  flex: none;
}
.ai-demo-input .icon {
  width: 13px;
  height: 13px;
}
.ai-demo-typing {
  display: inline-flex;
  gap: 3px;
  padding: 6px 9px;
  align-self: flex-end;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.ai-demo-typing i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #9ca2c8;
  animation: fyAiTyping 1.1s infinite ease-in-out;
}
.ai-demo-typing i:nth-child(2) { animation-delay: 0.15s; }
.ai-demo-typing i:nth-child(3) { animation-delay: 0.3s; }

/* ---------- builder AI entry ---------- */
.bt-ai-btn {
  min-height: 34px;
  padding: 5px 11px;
  font-size: 11.5px;
  border-radius: 9px;
  gap: 5px;
}
.bt-ai-btn .icon {
  width: 15px;
  height: 15px;
}

/* ---------- toast spacing on small screens ---------- */
@media (max-width: 700px) {
  body.has-fy-ai .toast-wrap {
    bottom: 150px;
  }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .ai-landing-card {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .ai-demo-chat {
    max-width: 470px;
  }
}

@media (max-width: 900px) {
  .ai-dash-banner {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .ai-dash-side {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .ai-dash-prompts {
    justify-content: flex-start;
    flex: 1;
  }
  body.fy-ai-has-tabbar .fy-ai-launcher,
  .builder-body .fy-ai-launcher {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 700px) {
  body.fy-ai-open {
    overflow: hidden;
  }
  .fy-ai-layer {
    pointer-events: none;
  }
  .fy-ai-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(8, 11, 28, 0.48);
    backdrop-filter: blur(4px);
    pointer-events: auto;
    animation: fadeIn 0.2s;
  }
  .fy-ai-panel {
    inset: auto 0 0 0;
    width: 100%;
    height: min(93dvh, 790px);
    max-height: calc(100dvh - 8px);
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    box-shadow: 0 -20px 60px rgba(8, 11, 28, 0.3);
    animation: fyAiSheetIn 0.34s var(--ease);
  }
  @keyframes fyAiSheetIn {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .fy-ai-head {
    min-height: 60px;
    padding: 10px 13px;
  }
  .fy-ai-orb {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }
  .fy-ai-orb .icon {
    width: 18px;
    height: 18px;
  }
  .fy-ai-head-brand b {
    font-size: 13px;
  }
  .fy-ai-head-brand small {
    font-size: 8.5px;
  }
  .fy-ai-demo-badge {
    display: none;
  }
  .fy-ai-transcripts {
    padding: 12px 12px 4px;
  }
  .fy-ai-bubble {
    font-size: 12px;
    line-height: 1.85;
  }
  .fy-ai-proposal-actions .btn {
    flex: 1;
    min-width: 112px;
  }
  .fy-ai-proposal-actions .btn-primary {
    flex: 1.2;
  }
  .fy-ai-launcher {
    inset-inline-end: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    min-height: 46px;
    padding: 6px 9px 6px 11px;
    gap: 6px;
  }
  .fy-ai-launcher-orb {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .fy-ai-launcher-orb .icon {
    width: 17px;
    height: 17px;
  }
  .fy-ai-launcher-label {
    display: none;
  }
  .fy-ai-launcher-badge {
    font-size: 7px;
    padding: 1px 4px;
  }
  body.fy-ai-has-tabbar .fy-ai-launcher,
  .builder-body .fy-ai-launcher {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
  .ai-landing-card {
    border-radius: 24px;
    padding: 22px 18px;
  }
  .ai-landing-features {
    margin: 15px 0 18px;
  }
  .ai-demo-chat {
    padding: 9px;
    border-radius: 19px;
  }
  .ai-demo-thread {
    padding: 10px 1px;
  }
  .ai-dash-banner {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }
  .ai-dash-orb {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }
  .ai-dash-orb .icon {
    width: 21px;
    height: 21px;
  }
  .ai-dash-banner::after {
    inset-inline-start: 18px;
    font-size: 76px;
    top: -16px;
  }
  .ai-dash-side {
    align-items: flex-start;
  }
  .ai-dash-prompts {
    width: 100%;
  }
  .ai-dash-prompt {
    max-width: 100%;
  }
  .ai-dash-side .btn {
    width: 100%;
    justify-content: center;
  }
  .welcome-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .welcome-actions .btn {
    justify-content: center;
  }
  .welcome-actions .btn-primary {
    grid-column: 1 / -1;
  }
  .bt-ai-btn {
    min-height: 32px;
    padding: 4px 8px;
  }
  .bt-ai-btn .btn-label {
    display: none;
  }
}

@media (max-width: 430px) {
  .fy-ai-panel {
    height: 94dvh;
  }
  .fy-ai-tab {
    font-size: 10.5px;
    min-height: 34px;
  }
  .fy-ai-tab .icon {
    width: 14px;
    height: 14px;
  }
  .fy-ai-msg-avatar,
  .fy-ai-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 8px;
  }
  .fy-ai-bubble {
    max-width: calc(100% - 30px);
    padding: 8px 10px;
  }
  .fy-ai-msg.is-wide .fy-ai-bubble {
    max-width: calc(100% - 30px);
  }
  .fy-ai-proposal-top {
    padding: 10px;
  }
  .fy-ai-proposal h4 {
    font-size: 12px;
  }
  .fy-ai-proposal-actions {
    padding: 8px 10px;
  }
  .fy-ai-proposal-actions .btn {
    min-width: 100px;
    font-size: 9.5px;
  }
  .fy-ai-prev-scroll {
    padding: 10px;
  }
  .ai-landing-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .ai-landing-actions .btn {
    justify-content: center;
  }
  .ai-landing-link {
    justify-content: center;
  }
}

/* ---------- dark fine-tuning ---------- */
[data-theme="dark"] .fy-ai-proposal-actions {
  background: color-mix(in srgb, var(--bg-2) 66%, var(--card));
}
[data-theme="dark"] .ai-dash-banner {
  background:
    radial-gradient(70% 130% at 100% 0%, rgba(13, 148, 136, 0.2), transparent 60%),
    radial-gradient(60% 130% at 0% 100%, rgba(16, 185, 129, 0.12), transparent 60%),
    linear-gradient(120deg, #0a1a16, var(--card) 60%);
}
[data-theme="dark"] .fy-ai-input-wrap {
  background: var(--bg-2);
}
[data-theme="dark"] .fy-ai-prev-form {
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.4);
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .fy-ai-launcher,
  .fy-ai-launcher-orb::after,
  .fy-ai-typing > span,
  .ai-demo-typing i {
    animation: none !important;
  }
  .fy-ai-panel,
  .fy-ai-msg,
  .fy-ai-backdrop {
    animation: none !important;
  }
}

/* keep the floating assistant clear of the publishing save bar */
body.publish-page .fy-ai-launcher {
  bottom: 92px;
}
@media (max-width: 760px) {
  body.publish-page .fy-ai-launcher {
    bottom: calc(146px + env(safe-area-inset-bottom));
  }
}
