/* AIMS Copilot — cinematic AI layer (ASIARIGHT navy / electric / gold) */
.ai-studio {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(46, 139, 255, 0.28), transparent 50%),
    radial-gradient(800px 360px at 100% 0%, rgba(201, 168, 76, 0.18), transparent 46%),
    linear-gradient(165deg, #010822 0%, #001f5f 48%, #071232 100%);
  color: #e8f0f8;
  padding: 28px 28px 24px;
  margin-bottom: 8px;
  min-height: 560px;
  box-shadow: 0 20px 50px -24px rgba(0, 31, 95, 0.55);
}
.ai-studio::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 40% 20%, #000 20%, transparent 75%);
  pointer-events: none;
}
.ai-orb {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0.55;
  animation: orb-float 8s ease-in-out infinite;
  pointer-events: none;
}
.ai-orb.a { background: #2e8bff; top: -40px; right: 12%; }
.ai-orb.b { background: #c9a84c; width: 120px; height: 120px; bottom: 10%; left: 6%; animation-delay: -3s; }
@keyframes orb-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(16px) scale(1.06); }
}

.ai-hero { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.ai-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9ec8ff;
  font-weight: 600;
}
.ai-kicker .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: #4db4ff;
  box-shadow: 0 0 0 0 rgba(77, 180, 255, 0.7);
  animation: pulse-dot 1.6s infinite;
}
.ai-hero h2 {
  margin: 8px 0 6px;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: #fff;
}
.ai-hero p { margin: 0; max-width: 560px; color: #b8c9de; font-size: 14px; line-height: 1.55; }
.ai-conf {
  text-align: right;
  min-width: 120px;
}
.ai-conf b { display: block; font-size: 28px; color: #e8d39a; font-weight: 500; }
.ai-conf span { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #8aa0bd; }

.ai-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  margin-top: 22px;
}
.ai-insight {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(10px);
  animation: rise 0.7s ease backwards;
}
.ai-insight:nth-child(2) { animation-delay: 0.08s; }
.ai-insight:nth-child(3) { animation-delay: 0.16s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.ai-insight .kind {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e8d39a;
  font-weight: 700;
}
.ai-insight .md-card-icon {
  background: rgba(232, 211, 154, 0.14);
  color: #e8d39a;
}
.ai-insight h4 { margin: 6px 0 8px; font-size: 16px; font-weight: 500; color: #fff; }
.ai-insight p { margin: 0; color: #c5d3e4; font-size: 13px; line-height: 1.5; }
.ai-meter {
  margin-top: 12px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.ai-meter i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0e70a7, #e8d39a);
  border-radius: 99px;
  animation: fillbar 1.2s 0.3s ease forwards;
}
@keyframes fillbar { to { width: var(--w); } }

.ai-chat {
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}
.ai-msg { margin-bottom: 10px; font-size: 13px; line-height: 1.45; }
.ai-msg.bot { color: #d7e6f5; }
.ai-msg.user { color: #e8d39a; text-align: right; }
.ai-type::after {
  content: "▍";
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.ai-compose {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.ai-compose input {
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  padding: 10px 14px;
  font: inherit;
}
.ai-compose button {
  border: 0;
  border-radius: 999px;
  background: #0e70a7;
  color: #031428;
  font-weight: 600;
  padding: 0 16px;
  cursor: pointer;
}

/* Predictive spark + popover */
.ai-spark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 6px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #0e70a7, #c9a84c);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  vertical-align: middle;
  position: relative;
  box-shadow: 0 0 0 0 rgba(14, 112, 167, 0.45);
  animation: spark-glow 2s ease-in-out infinite;
}
.ai-spark .ms { font-size: 13px; color: #fff; }
@keyframes spark-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(14, 112, 167, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(14, 112, 167, 0); }
}
.ai-pop {
  position: absolute;
  z-index: 30;
  width: 280px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #001f5f;
  color: #e8f0f8;
  box-shadow: 0 16px 40px rgba(1, 8, 34, 0.35);
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.ai-pop.show { opacity: 1; transform: none; }
.ai-pop b { display: block; color: #e8d39a; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 4px; }
.ai-pop .conf { color: #9ec8ff; font-weight: 600; margin-top: 6px; }

.ai-master-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--ctrl-h, 40px);
  padding: 0 8px 0 10px;
  border: 1px solid var(--line, #d5dae3);
  border-radius: 999px;
  background: var(--md-sys-color-surface-container-lowest, #fff);
  color: var(--md-sys-color-on-surface, #121826);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.ai-master-toggle .ms { font-size: 18px; color: #6d7788; }
.ai-master-text { letter-spacing: 0.01em; }
.ai-switch {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #c5ced8;
  position: relative;
  flex: 0 0 34px;
  transition: background 0.22s ease;
}
.ai-switch i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.ai-master-toggle.is-on {
  border-color: transparent;
  background: linear-gradient(135deg, #0e70a7, #0a2a6e);
  color: #fff;
  box-shadow: 0 6px 16px rgba(14, 112, 167, 0.28);
}
.ai-master-toggle.is-on .ms { color: #e8d39a; }
.ai-master-toggle.is-on .ai-switch { background: #9ec8ff; }
.ai-master-toggle.is-on .ai-switch i { transform: translateX(14px); }

body.ai-off .ai-spark,
body.ai-off .ai-fab,
body.ai-off .ai-drawer,
body.ai-off .ai-backdrop,
body.ai-off .ai-decide { display: none !important; }
body.ai-off .wf-two-col:has(.ai-decide) { grid-template-columns: 1fr; }

body.ai-revealing .ai-spark { animation: spark-in 0.55s 1.65s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
body.ai-revealing .wf-table .ai-spark { animation-delay: 1.85s; }
body.ai-revealing .chart-card-head .ai-spark { animation-delay: 2s; }
body.ai-revealing .ai-decide { animation: decide-in 0.7s 0.35s cubic-bezier(0.22, 1, 0.36, 1) both; }
body.ai-revealing .ai-decide-row { animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
body.ai-revealing .ai-decide-row:nth-child(1) { animation-delay: 0.55s; }
body.ai-revealing .ai-decide-row:nth-child(2) { animation-delay: 0.68s; }
body.ai-revealing .ai-decide-row:nth-child(3) { animation-delay: 0.81s; }
@keyframes decide-in {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes spark-in {
  from { opacity: 0; transform: scale(0.35); }
  to { opacity: 1; transform: scale(1); }
}

/* ===== AI · Human Approve decision card ===== */
body.proto .ai-decide.wf-ai-box,
.ai-decide {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  margin: 0 0 16px;
  padding: 22px 22px 18px;
  border-radius: 20px;
  border: 1px solid rgba(158, 200, 255, 0.18);
  background:
    radial-gradient(900px 280px at 8% -20%, rgba(14, 112, 167, 0.42), transparent 55%),
    radial-gradient(640px 240px at 100% 0%, rgba(201, 168, 76, 0.16), transparent 48%),
    linear-gradient(165deg, #010822 0%, #001f5f 52%, #071232 100%);
  color: #e8f0f8;
  box-shadow:
    0 20px 50px -24px rgba(1, 8, 34, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  line-height: 1.45;
}
.ai-decide::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at 18% 0%, #000 10%, transparent 68%);
  pointer-events: none;
}
.ai-decide::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(158, 200, 255, 0.55), transparent 42%, rgba(245, 230, 179, 0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}
.ai-decide-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
  animation: orb-float 8s ease-in-out infinite;
}
.ai-decide-glow.a { width: 140px; height: 140px; background: #2e8bff; top: -48px; right: 12%; }
.ai-decide-glow.b { width: 90px; height: 90px; background: #c9a84c; bottom: -20px; left: 8%; animation-delay: -3s; }
.ai-decide-scan {
  position: absolute;
  left: 0; right: 0;
  height: 38%;
  top: -40%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(158, 200, 255, 0.1), transparent);
  animation: decide-scan 5.5s ease-in-out 1.2s infinite;
}
@keyframes decide-scan {
  0% { top: -40%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 0.4; }
  100% { top: 110%; opacity: 0; }
}
.ai-decide-head,
.ai-decide h3,
.ai-decide-blurb,
.ai-decide-signals,
.ai-decide-foot {
  position: relative;
  z-index: 1;
}
.ai-decide-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.ai-decide-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-decide-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #0e70a7, #0a2a6e);
  box-shadow: 0 0 0 1px rgba(158, 200, 255, 0.25), 0 8px 18px rgba(14, 112, 167, 0.35);
}
.ai-decide-mark .ms {
  font-size: 20px;
  color: #e8d39a;
  animation: spark-glow 2.4s ease-in-out infinite;
}
.ai-decide-kicker {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #9ec8ff;
  font-weight: 700;
}
.ai-decide-mode {
  font-size: 11px;
  color: #8aa0bd;
  margin-top: 1px;
}
.ai-decide-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ai-decide-pills span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ai-decide-pills .live {
  background: rgba(77, 180, 255, 0.12);
  color: #9ec8ff;
  border: 1px solid rgba(158, 200, 255, 0.28);
}
.ai-decide-pills .live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4db4ff;
  box-shadow: 0 0 0 0 rgba(77, 180, 255, 0.7);
  animation: pulse-dot 1.6s infinite;
}
.ai-decide-pills .guard {
  background: rgba(245, 230, 179, 0.1);
  color: #e8d39a;
  border: 1px solid rgba(245, 230, 179, 0.28);
}
.ai-decide h3 {
  margin: 14px 0 6px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: #fff;
}
.ai-decide-blurb {
  margin: 0 0 14px;
  max-width: 640px;
  color: #b8c9de;
  font-size: 13px;
  line-height: 1.55;
}
.ai-decide-signals {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-decide-row {
  display: grid;
  grid-template-columns: 28px auto 1fr auto 18px;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.ai-decide-row:hover {
  background: rgba(158, 200, 255, 0.1);
  border-color: rgba(158, 200, 255, 0.28);
  transform: translateX(2px);
}
.ai-decide-row .n {
  font-family: "Roboto", sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #9ec8ff;
}
.ai-decide-row .kind {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(245, 230, 179, 0.12);
  color: #e8d39a;
  white-space: nowrap;
}
.ai-decide-row .kind.k-risk { background: rgba(255, 107, 107, 0.14); color: #ffb4ab; }
.ai-decide-row .kind.k-cash { background: rgba(158, 200, 255, 0.14); color: #9ec8ff; }
.ai-decide-row .kind.k-action { background: rgba(158, 200, 255, 0.16); color: #9ec8ff; }
.ai-decide-row .kind.k-predict { background: rgba(201, 168, 76, 0.18); color: #e8d39a; }
.ai-decide-row .kind.k-capacity { background: rgba(180, 160, 255, 0.16); color: #d4c8ff; }
.ai-decide-row .txt {
  font-size: 13px;
  color: #e8f0f8;
  min-width: 0;
}
.ai-decide-row .score {
  text-align: right;
  white-space: nowrap;
}
.ai-decide-row .score b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #e8d39a;
  font-variant-numeric: tabular-nums;
}
.ai-decide-row .score i {
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8aa0bd;
}
.ai-decide-row .go { font-size: 16px; color: #9ec8ff; opacity: 0.7; }
.ai-decide-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.ai-decide-conf { min-width: 200px; flex: 1; }
.ai-decide-conf .meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8aa0bd;
  margin-bottom: 6px;
}
.ai-decide-conf .meta b { color: #e8d39a; font-weight: 600; }
.ai-decide-conf .ai-meter { margin-top: 0; background: rgba(255, 255, 255, 0.08); }
.ai-decide-cta { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-decide .wf-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
}
.ai-decide .wf-btn.primary {
  background: linear-gradient(135deg, #0e70a7, #0b5f8c);
  color: #031428;
  border: 0;
  box-shadow: 0 8px 18px rgba(14, 112, 167, 0.28);
}
.ai-decide .wf-btn.ghost {
  background: transparent;
  color: #e8f0f8;
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.ai-decide .wf-btn.ghost:hover { background: rgba(255, 255, 255, 0.08); }

.wf-table-wrap + .ai-decide { margin-top: 0; }
.wf-two-col .ai-decide { margin-bottom: 0; height: 100%; }
.wf-two-col .ai-decide h3 { font-size: 18px; }
.wf-two-col .ai-decide-row {
  grid-template-columns: 24px 1fr auto;
}
.wf-two-col .ai-decide-row .kind,
.wf-two-col .ai-decide-row .go { display: none; }
.wf-two-col .ai-decide-foot { flex-direction: column; align-items: stretch; }
.wf-two-col .ai-decide-cta .wf-btn { flex: 1; justify-content: center; }

@media (max-width: 720px) {
  .ai-decide-row {
    grid-template-columns: 24px 1fr auto;
  }
  .ai-decide-row .kind,
  .ai-decide-row .go { display: none; }
  .ai-decide h3 { font-size: 18px; }
}

/* Boot / enter AI-powered mode
   Child animations ONLY run under .is-playing. Default ring/copy/scan
   stay invisible so a reused node cannot leave leftover circular outlines. */
.ai-boot {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.ai-boot.is-playing {
  visibility: visible;
  pointer-events: auto;
  animation: boot-veil 2.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes boot-veil {
  0% { opacity: 0; }
  8% { opacity: 1; }
  78% { opacity: 1; }
  100% { opacity: 0; }
}
.ai-boot-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 420px at 50% 42%, rgba(14, 112, 167, 0.45), transparent 58%),
    radial-gradient(700px 380px at 70% 20%, rgba(201, 168, 76, 0.18), transparent 50%),
    rgba(1, 8, 34, 0.62);
  backdrop-filter: blur(10px);
}
.ai-boot-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: -28%;
  height: 28%;
  opacity: 0;
  background: linear-gradient(180deg, transparent, rgba(158, 200, 255, 0.18), transparent);
  animation: none;
}
.ai-boot.is-playing .ai-boot-scan {
  animation: boot-scan 2.15s ease-in-out 0.12s both;
}
@keyframes boot-scan {
  0% { top: -28%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { top: 92%; opacity: 0; }
}
.ai-boot-ring {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(158, 200, 255, 0.4);
  opacity: 0;
  animation: none;
}
.ai-boot-ring.r2 {
  width: 320px;
  height: 320px;
}
.ai-boot.is-playing .ai-boot-ring.r1 {
  animation: boot-ring 2.15s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}
.ai-boot.is-playing .ai-boot-ring.r2 {
  animation: boot-ring 2.25s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both;
}
@keyframes boot-ring {
  0% { transform: scale(0.38); opacity: 0; }
  22% { opacity: 1; }
  100% { transform: scale(1.42); opacity: 0; }
}
.ai-boot-copy {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #eaf0f8;
  opacity: 0;
  animation: none;
}
.ai-boot.is-playing .ai-boot-copy {
  animation: boot-copy 2.55s ease 0.08s both;
}
@keyframes boot-copy {
  0% { opacity: 0; transform: translateY(14px); }
  10% { opacity: 1; transform: none; }
  80% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-8px); }
}
.ai-boot-copy .k {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #9ec8ff;
  font-weight: 700;
}
.ai-boot-copy h3 {
  margin: 8px 0 6px;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: #fff;
}
.ai-boot-copy p {
  margin: 0;
  color: #b8c9de;
  font-size: 14px;
}
.ai-boot-steps {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: #9eb4cc;
  letter-spacing: 0.04em;
}
.ai-boot-steps span {
  opacity: 0;
  animation: none;
}
.ai-boot.is-playing .ai-boot-steps span:nth-child(1) {
  animation: boot-step 0.4s ease 0.42s forwards;
}
.ai-boot.is-playing .ai-boot-steps span:nth-child(2) {
  animation: boot-step 0.4s ease 0.95s forwards;
}
.ai-boot.is-playing .ai-boot-steps span:nth-child(3) {
  animation: boot-step 0.4s ease 1.48s forwards;
}
@keyframes boot-step {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.ai-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 38;
  height: 52px;
  padding: 0 18px 0 14px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #0e70a7, #0a2a6e);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(14, 112, 167, 0.35);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.ai-fab .ms { font-size: 22px; }
body.copilot-open .ai-fab {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.92);
}

.ai-backdrop {
  position: fixed;
  inset: 0;
  z-index: 36;
  background: rgba(1, 8, 34, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.ai-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.ai-drawer {
  position: fixed;
  top: 80px;
  right: 20px;
  bottom: 20px;
  width: min(420px, calc(100vw - 32px));
  z-index: 37;
  border-radius: 20px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(28px, 8px, 0) scale(0.97);
  transform-origin: 100% 80%;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
  box-shadow: 0 24px 64px rgba(1, 8, 34, 0.35);
}
.ai-drawer.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
}
.ai-drawer .ai-studio {
  margin: 0;
  min-height: 100%;
  height: 100%;
  overflow: auto;
  border-radius: 20px;
}
.ai-studio.is-panel {
  padding: 20px 18px 18px;
  min-height: 100%;
}
.ai-studio.is-panel .ai-hero {
  flex-direction: column;
  gap: 10px;
}
.ai-studio.is-panel .ai-hero h2 {
  font-size: 22px;
  line-height: 1.25;
}
.ai-studio.is-panel .ai-hero p { font-size: 13px; }
.ai-studio.is-panel .ai-conf {
  text-align: left;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.ai-studio.is-panel .ai-conf b { font-size: 20px; }
.ai-studio.is-panel .ai-grid {
  grid-template-columns: 1fr;
  margin-top: 16px;
  gap: 10px;
}
.ai-studio.is-panel .ai-insight { padding: 12px 14px; }
.ai-studio.is-panel .ai-insight h4 { font-size: 14px; margin: 4px 0 6px; }
.ai-studio.is-panel .ai-chat { min-height: 200px; }
.ai-studio.is-panel .ai-orb.a { width: 120px; height: 120px; }
.ai-studio.is-panel .ai-orb.b { width: 80px; height: 80px; }
.ai-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ai-close .ms { font-size: 20px; }

body.proto .wf-card-box .label { display: inline-flex; align-items: center; }

@media (max-width: 900px) {
  .ai-grid { grid-template-columns: 1fr; }
  .ai-hero { flex-direction: column; }
}