:root {
  --apx-agent-accent: #00d7e7;
  --apx-agent-accent-2: #7367ff;
  --apx-agent-panel: rgba(7, 15, 29, 0.96);
  --apx-agent-surface: rgba(255, 255, 255, 0.07);
  --apx-agent-border: rgba(132, 224, 238, 0.2);
  --apx-agent-text: #f5fbff;
  --apx-agent-muted: #9aabbd;
}

.apx-agent-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(137, 241, 255, 0.45);
  border-radius: 50%;
  color: #fff;
  background: #0a1b2f;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35), 0 0 24px rgba(0, 215, 231, 0.2);
  cursor: pointer;
  display: grid;
  place-items: center;
  font: 800 15px/1 system-ui, sans-serif;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.apx-agent-launcher:hover,
.apx-agent-launcher:focus-visible {
  transform: translateY(-3px);
  border-color: var(--apx-agent-accent);
  background: #0d2940;
}

.apx-agent-launcher::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #83909d;
  box-shadow: 0 0 0 3px #0a1b2f;
}

.apx-agent-launcher.is-online::after { background: #39d98a; }
.apx-agent-launcher.is-busy::after { background: #ffbf69; animation: apx-agent-pulse 1s infinite; }

.apx-agent-panel {
  position: fixed;
  right: 22px;
  bottom: 84px;
  z-index: 2147482999;
  width: min(390px, calc(100vw - 28px));
  height: min(650px, calc(100vh - 112px));
  border: 1px solid var(--apx-agent-border);
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  color: var(--apx-agent-text);
  background: var(--apx-agent-panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(22px) saturate(130%);
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transform-origin: right bottom;
  pointer-events: none;
  transition: opacity 170ms ease, transform 170ms ease;
  font-family: Inter, "Microsoft YaHei", system-ui, sans-serif;
}

.apx-agent-panel.is-open { opacity: 1; transform: none; pointer-events: auto; }

.apx-agent-head {
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--apx-agent-border);
}

.apx-agent-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.apx-agent-mark { width: 36px; height: 36px; display: grid; place-items: center; }
.apx-agent-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.apx-agent-identity strong { display: block; font-size: 15px; letter-spacing: 0; }
.apx-agent-identity small { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--apx-agent-muted); font-size: 11px; }
.apx-agent-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #7b8794; }
.apx-agent-status-dot.is-online { background: #39d98a; box-shadow: 0 0 9px rgba(57, 217, 138, 0.6); }
.apx-agent-head-actions { margin-left: auto; display: flex; gap: 4px; }
.apx-agent-icon-button { width: 34px; height: 34px; border: 0; border-radius: 6px; background: transparent; color: #dce9f1; cursor: pointer; font-size: 18px; }
.apx-agent-icon-button:hover { background: var(--apx-agent-surface); }

.apx-agent-body { overflow: auto; padding: 14px; scrollbar-width: thin; }
.apx-agent-message { display: flex; gap: 9px; margin-bottom: 14px; }
.apx-agent-message.is-user { justify-content: flex-end; }
.apx-agent-avatar { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; background: rgba(0, 215, 231, 0.12); color: var(--apx-agent-accent); font-size: 11px; font-weight: 800; }
.apx-agent-bubble { max-width: 84%; padding: 10px 11px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 7px; background: var(--apx-agent-surface); color: #eaf2f7; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.apx-agent-message.is-user .apx-agent-bubble { color: #06121e; border-color: transparent; background: #b7f4f4; }
.apx-agent-message.is-pending .apx-agent-bubble { color: var(--apx-agent-muted); }
.apx-agent-thinking { display: inline-flex; align-items: center; gap: 4px; }
.apx-agent-thinking i { width: 4px; height: 4px; border-radius: 50%; background: var(--apx-agent-accent); animation: apx-agent-thinking 1.1s ease-in-out infinite; }
.apx-agent-thinking i:nth-child(2) { animation-delay: 0.14s; }
.apx-agent-thinking i:nth-child(3) { animation-delay: 0.28s; }
@keyframes apx-agent-thinking { 0%, 70%, 100% { opacity: 0.25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-2px); } }
.apx-agent-bubble p { margin: 0 0 8px; }
.apx-agent-bubble p:last-child { margin-bottom: 0; }
.apx-agent-bubble strong { color: #fff; }
.apx-agent-message.is-user strong { color: #06121e; }
.apx-agent-bubble ul { margin: 7px 0; padding-left: 18px; }
.apx-agent-bubble code { padding: 2px 5px; border-radius: 4px; background: rgba(0, 0, 0, 0.28); font-size: 12px; }
.apx-agent-bubble a { color: #58e7f1; }

.apx-agent-artifact { margin-top: 9px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 6px; overflow: hidden; background: rgba(0, 0, 0, 0.22); }
.apx-agent-artifact img { display: block; width: 100%; max-height: 260px; object-fit: contain; background: #10141c; }
.apx-agent-artifact.is-video { width: min(380px,100%); background: #080d12; }.apx-agent-artifact video { display: block; width: 100%; max-height: 520px; object-fit: contain; background: #000; }.apx-agent-artifact div a { color: #58e7f1; font-weight: 700; text-decoration: none; }.apx-agent-artifact div a:hover { text-decoration: underline; }
.apx-agent-artifact.is-audio { width: min(430px,100%); }.apx-agent-artifact audio { display: block; width: 100%; min-width: 260px; }
.apx-agent-artifact div { padding: 8px 9px; display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--apx-agent-muted); }
.apx-agent-artifact.is-task { border-color: rgba(0, 215, 231, 0.26); }
.apx-agent-artifact .apx-agent-task-state { display: grid; grid-template-columns: 1fr; gap: 3px; padding: 12px; background: rgba(0, 215, 231, 0.06); }
.apx-agent-task-state strong { color: #dffbff; font-size: 12px; }
.apx-agent-task-state small { overflow-wrap: anywhere; color: #7f9cab; }

.apx-agent-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 15px 35px; }
.apx-agent-quick button { border: 1px solid rgba(0, 215, 231, 0.22); border-radius: 5px; padding: 7px 9px; color: #cceaf0; background: rgba(0, 215, 231, 0.06); cursor: pointer; font-size: 11px; }
.apx-agent-quick button:hover { border-color: rgba(0, 215, 231, 0.55); background: rgba(0, 215, 231, 0.12); }

.apx-agent-compose { padding: 10px; border-top: 1px solid var(--apx-agent-border); background: rgba(2, 8, 17, 0.7); }
.apx-agent-compose-box { min-height: 74px; border: 1px solid rgba(255, 255, 255, 0.13); border-radius: 7px; background: rgba(255, 255, 255, 0.055); padding: 9px; }
.apx-agent-pasted-assets { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; margin: 0 0 9px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.apx-agent-pasted-assets[hidden] { display: none; }
.apx-agent-pasted-item { position: relative; flex: 0 0 70px; height: 70px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 8px; background: rgba(0, 0, 0, 0.18); }
.apx-agent-pasted-open { width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.apx-agent-pasted-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.apx-agent-pasted-item small { position: absolute; left: 4px; bottom: 4px; padding: 1px 4px; border-radius: 4px; color: #fff; background: rgba(5, 14, 24, 0.72); font-size: 9px; }
.apx-agent-pasted-item > button:last-child { position: absolute; top: 3px; right: 3px; width: 19px; height: 19px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #fff; background: rgba(5, 14, 24, 0.78); cursor: pointer; font-size: 14px; line-height: 1; }
.apx-agent-pasted-note { flex: 0 0 auto; color: #8495a3; font-size: 10px; white-space: nowrap; }
.apx-agent-sent-images { width: min(420px, 100%); margin: 0 0 9px; display: flex; flex-wrap: wrap; gap: 7px; }
.apx-agent-sent-images button { width: 74px; height: 74px; padding: 0; overflow: hidden; border: 1px solid rgba(111, 151, 174, .28); border-radius: 8px; background: #eef3f6; cursor: zoom-in; }
.apx-agent-sent-images img { width: 100%; height: 100%; display: block; object-fit: cover; }
.apx-agent-sent-images > span { flex: 0 0 100%; color: #6e8290; font-size: 10px; }
.apx-agent-image-lightbox { position: fixed; inset: 0; z-index: 10000; display: grid; grid-template-columns: minmax(44px, 1fr) minmax(0, auto) minmax(44px, 1fr); align-items: center; gap: 18px; padding: 58px 28px 30px; background: rgba(5, 12, 20, 0.88); backdrop-filter: blur(10px); }
.apx-agent-image-lightbox figure { min-width: 0; max-width: min(82vw, 1240px); max-height: 84vh; margin: 0; display: grid; justify-items: center; gap: 10px; }
.apx-agent-image-lightbox figure img { display: block; max-width: 100%; max-height: 78vh; border-radius: 10px; object-fit: contain; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42); }
.apx-agent-image-lightbox figcaption { color: #e8f0f4; font-size: 13px; text-align: center; }
.apx-agent-image-lightbox > button { width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 50%; color: #fff; background: rgba(18, 29, 40, 0.82); cursor: pointer; font-size: 30px; line-height: 1; }
.apx-agent-image-lightbox > button:hover { background: rgba(31, 48, 63, 0.96); }
.apx-agent-image-lightbox .apx-agent-lightbox-prev { justify-self: end; }
.apx-agent-image-lightbox .apx-agent-lightbox-next { justify-self: start; }
.apx-agent-image-lightbox .apx-agent-lightbox-close { position: absolute; top: 18px; right: 22px; font-size: 24px; }
.apx-agent-compose textarea { display: block; width: 100%; min-height: 38px; max-height: 120px; padding: 0; resize: none; border: 0; outline: 0; color: #f5fbff; background: transparent; font: 13px/1.55 inherit; }
.apx-agent-compose textarea::placeholder { color: #7f8d9b; }
.apx-agent-compose-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 7px; }
.apx-agent-model-label { color: #8294a7; font-size: 10px; }
.apx-agent-send { width: 34px; height: 34px; border: 0; border-radius: 50%; color: #06121e; background: #eafcff; cursor: pointer; font-size: 18px; font-weight: 800; }
.apx-agent-send:disabled { opacity: 0.45; cursor: wait; }

.apx-agent-settings { position: absolute; inset: 68px 0 0; z-index: 3; display: none; grid-template-rows: auto 1fr; background: rgba(5, 12, 24, 0.985); }
.apx-agent-settings.is-open { display: grid; }
.apx-agent-settings-head { padding: 15px; display: flex; align-items: center; border-bottom: 1px solid var(--apx-agent-border); }
.apx-agent-settings-head strong { font-size: 15px; }
.apx-agent-settings-head button { margin-left: auto; }
.apx-agent-settings-body { padding: 14px; overflow: auto; }
.apx-agent-provider { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.apx-agent-provider strong { font-size: 13px; }
.apx-agent-provider small { color: var(--apx-agent-muted); font-size: 11px; }
.apx-agent-provider em { grid-row: 1 / 3; grid-column: 2; align-self: center; padding: 4px 7px; border-radius: 4px; color: #bbc5cf; background: rgba(255, 255, 255, 0.08); font-size: 10px; font-style: normal; }
.apx-agent-provider em.is-online { color: #59e59b; background: rgba(57, 217, 138, 0.1); }
.apx-agent-access { margin-top: 18px; }
.apx-agent-access label { display: block; margin-bottom: 7px; color: #d9e5ed; font-size: 12px; }
.apx-agent-access div { display: flex; gap: 7px; }
.apx-agent-access input { min-width: 0; flex: 1; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 5px; padding: 9px; color: #fff; background: rgba(255, 255, 255, 0.06); outline: 0; }
.apx-agent-access button, .apx-agent-refresh { border: 1px solid rgba(0, 215, 231, 0.28); border-radius: 5px; color: #dffbff; background: rgba(0, 215, 231, 0.08); padding: 8px 10px; cursor: pointer; }
.apx-agent-settings-note { margin: 14px 0; color: #8495a6; font-size: 11px; line-height: 1.6; }


/* The commerce workbench hosts the Agent as its primary creation surface. */
.apx-agent-inline-panel {
  position: relative;
  inset: auto;
  z-index: 1;
  width: 100%;
  height: 560px;
  border: 0;
  border-radius: 10px;
  color: #17202b;
  background:
    radial-gradient(circle at 8% 12%, rgba(123, 225, 231, 0.17), transparent 24%),
    radial-gradient(circle at 91% 20%, rgba(135, 124, 255, 0.11), transparent 22%),
    linear-gradient(145deg, #f7fbfc, #ffffff 58%, #f7f8fb);
  box-shadow: inset 0 0 0 1px #dfe7eb, 0 18px 42px rgba(35, 58, 72, 0.08);
  opacity: 1;
  transform: none;
  pointer-events: auto;
  backdrop-filter: none;
  overflow: hidden;
  grid-template-rows: minmax(0, 1fr) auto;
}
.apx-agent-inline-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background-image: radial-gradient(circle, rgba(86, 113, 128, 0.13) 0.8px, transparent 0.9px);
  background-size: 12px 12px;
  mask-image: linear-gradient(110deg, #000, transparent 42%, transparent 70%, #000);
}
.apx-agent-inline-panel > * { position: relative; z-index: 1; }
.apx-agent-inline-panel .apx-agent-head {
  min-height: 64px;
  padding: 11px 16px;
  border-bottom-color: rgba(113, 133, 145, 0.16);
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(12px);
}
.apx-agent-inline-panel .apx-agent-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #111a24, #344051);
  box-shadow: 0 8px 18px rgba(23, 32, 43, 0.18);
}
.apx-agent-inline-panel .apx-agent-mark b { font-size: 17px; }
.apx-agent-inline-panel .apx-agent-identity strong { color: #17202b; }
.apx-agent-inline-panel .apx-agent-identity small { color: #71808b; }
.apx-agent-inline-panel .apx-agent-head-actions { align-items: center; }
.apx-agent-scope {
  padding: 6px 9px;
  border: 1px solid rgba(116, 135, 147, 0.16);
  border-radius: 999px;
  color: #7a8791;
  background: rgba(255, 255, 255, 0.7);
  font-size: 9px;
}
.apx-agent-inline-panel .apx-agent-icon-button { color: #697985; }
.apx-agent-inline-panel .apx-agent-icon-button:hover { background: rgba(23, 32, 43, 0.06); }
.apx-agent-inline-panel .apx-agent-body { padding: 22px 20px 10px; }
.apx-agent-inline-panel .apx-agent-message { margin-bottom: 13px; }
.apx-agent-inline-panel .apx-agent-avatar {
  color: #0a8b96;
  background: #e4f7f8;
}
.apx-agent-inline-panel .apx-agent-bubble {
  max-width: min(78%, 660px);
  border-color: #e3e9ed;
  color: #34424e;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 7px 20px rgba(45, 64, 77, 0.05);
}
.apx-agent-inline-panel .apx-agent-bubble strong { color: #17202b; }
.apx-agent-inline-panel .apx-agent-message.is-user .apx-agent-bubble {
  color: #f8fbfd;
  background: #17222e;
  box-shadow: 0 9px 22px rgba(23, 34, 46, 0.14);
}
.apx-agent-inline-panel .apx-agent-quick { margin: 5px 0 10px; }
.apx-agent-inline-panel .apx-agent-quick button {
  padding: 7px 10px;
  border-color: #d8e4e8;
  border-radius: 999px;
  color: #536571;
  background: rgba(255, 255, 255, 0.76);
}
.apx-agent-inline-panel .apx-agent-quick button:hover { border-color: #86d2d8; color: #087f8b; background: #effafb; }
.apx-agent-inline-panel .apx-agent-compose {
  padding: 12px 16px 16px;
  border-top: 0;
  background: transparent;
}
.apx-agent-inline-panel .apx-agent-compose-box {
  min-height: 94px;
  padding: 13px 14px 10px;
  border-color: #dce4e8;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 13px 34px rgba(39, 59, 72, 0.11);
}
.apx-agent-inline-panel .apx-agent-pasted-item { border-color: #d7e2e7; background: #eef3f5; }
@media (max-width: 720px) {
  .apx-agent-image-lightbox { grid-template-columns: 42px minmax(0, 1fr) 42px; gap: 6px; padding-inline: 8px; }
  .apx-agent-image-lightbox > button { width: 38px; height: 38px; }
}
.apx-agent-inline-panel .apx-agent-compose-box:focus-within { border-color: #75cad1; box-shadow: 0 13px 34px rgba(39, 59, 72, 0.11), 0 0 0 3px rgba(18, 184, 199, 0.09); }
.apx-agent-inline-panel .apx-agent-compose textarea { min-height: 42px; max-height: 90px; color: #17202b; font-size: 14px; }
.apx-agent-inline-panel .apx-agent-compose textarea::placeholder { color: #9aa5ad; }
.apx-agent-compose-tools { min-width: 0; display: flex; align-items: center; gap: 9px; }
.apx-agent-compose-tools > button {
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #52616c;
  background: #f1f4f6;
  cursor: pointer;
  font-size: 20px;
}
.apx-agent-compose-tools > .apx-agent-skill-trigger {
  width: auto;
  min-width: 78px;
  height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  color: #40515d;
  font-size: 11px;
  font-weight: 700;
}
.apx-agent-skill-trigger b { max-width: 105px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #75848f; font-size: 10px; font-weight: 600; }
.apx-agent-skill-trigger.has-skill { color: #087f8b; background: #e5f7f8; box-shadow: inset 0 0 0 1px #a9dfe3; }
.apx-agent-skill-trigger.has-skill b { color: #087f8b; }
.apx-agent-skills {
  position: absolute;
  left: 16px;
  bottom: 78px;
  z-index: 8;
  display: none;
  width: min(390px, calc(100% - 32px));
  max-height: min(560px, calc(100% - 96px));
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #d8e3e8;
  border-radius: 12px;
  color: #17202b;
  background: rgba(255, 255, 255, 0.985);
  box-shadow: 0 16px 42px rgba(25, 47, 62, 0.22);
}
.apx-agent-skills.is-open { display: grid; }
.apx-agent-skills > header { display: flex; align-items: center; gap: 10px; padding: 12px 13px; border-bottom: 1px solid #e3eaee; }
.apx-agent-skills > header div { min-width: 0; }
.apx-agent-skills > header strong { display: block; font-size: 14px; }
.apx-agent-skills > header small { display: block; margin-top: 2px; color: #70808b; font-size: 10px; }
.apx-agent-skills > header button { width: 28px; height: 28px; margin-left: auto; border: 0; border-radius: 50%; color: #52616c; background: #eef3f5; cursor: pointer; font-size: 17px; }
.apx-agent-skill-list { min-height: 0; overflow: auto; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.apx-agent-skill-card { min-width: 0; padding: 9px 10px; display: block; border: 0; border-radius: 9px; color: #24323d; background: transparent; cursor: pointer; text-align: left; transition: background 120ms ease; }
.apx-agent-skill-card:hover { background: #f0f7f8; }
.apx-agent-skill-card.is-selected { color: #075f68; background: #e7f7f8; box-shadow: inset 0 0 0 1px #a9dfe3; }
.apx-agent-skill-summary { min-width: 0; display: flex; align-items: center; gap: 10px; }
.apx-agent-skill-summary > i { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; color: #087f8b; background: #dff5f7; font-size: 13px; font-style: normal; font-weight: 800; }
.apx-agent-skill-summary > span { min-width: 0; flex: 1; }
.apx-agent-skill-summary strong, .apx-agent-skill-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apx-agent-skill-summary strong { font-size: 12px; }
.apx-agent-skill-summary small { margin-top: 2px; color: #7b8993; font-size: 9px; }
.apx-agent-skill-summary > em { flex: 0 0 auto; color: #87949d; font-size: 9px; font-style: normal; font-weight: 700; }
.apx-agent-skill-card.is-selected .apx-agent-skill-summary > em { color: #087f8b; }
.apx-agent-skill-description { display: block; margin: 7px 0 0 40px; color: #687983; font-size: 9px; line-height: 1.45; }
.apx-agent-skill-detail { display: grid; gap: 7px; margin: 10px 0 1px 40px; padding-top: 10px; border-top: 1px solid rgba(8, 127, 139, 0.16); color: #4b616a; font-size: 9px; line-height: 1.55; }
.apx-agent-skill-detail > span { display: block; }
.apx-agent-skill-detail b { display: block; margin-bottom: 1px; color: #087f8b; font-size: 9px; }
.apx-agent-skills > footer { padding: 6px; border-top: 1px solid #e3eaee; }
.apx-agent-skills > footer button { width: 100%; border: 0; border-radius: 7px; padding: 8px 10px; color: #687781; background: transparent; cursor: pointer; font-size: 10px; }
.apx-agent-skills > footer button:hover { background: #f0f4f6; }
.apx-agent-artifact.is-skill-workflow { padding: 12px; border-color: #a9dfe3; background: linear-gradient(145deg, #f4fbfc, #f8fafb); }
.apx-agent-skill-task-state { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
.apx-agent-skill-task-state strong { color: #087f8b; font-size: 11px; }
.apx-agent-skill-task-state small { grid-column: 1 / -1; color: #6f808a; font-size: 9px; line-height: 1.45; }
.apx-agent-skill-task-state > span { height: 6px; min-width: 150px; overflow: hidden; border-radius: 999px; background: #dce9ed; }
.apx-agent-skill-task-state > span i { display: block; width: var(--skill-progress, 2%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, #14b8c4, #087f8b); transition: width 300ms ease; }
.apx-agent-skill-task-state > em { color: #087f8b; font-size: 9px; font-style: normal; font-weight: 800; }
.apx-agent-storyboard-prompt { margin-top: 10px; border-top: 1px solid #d9e7ea; padding-top: 8px; }
.apx-agent-storyboard-prompt summary { color: #087f8b; cursor: pointer; font-size: 10px; font-weight: 700; }
.apx-agent-storyboard-prompt pre { max-height: 240px; margin: 8px 0 0; overflow: auto; white-space: pre-wrap; color: #40515d; font: 9px/1.55 inherit; }
.apx-agent-skill-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.apx-agent-skill-results .apx-agent-artifact { margin: 0; }
.apx-agent-skill-results .apx-agent-artifact img { max-height: 170px; object-fit: contain; background: #eef3f5; }
.apx-agent-model-picker { display: flex; align-items: center; gap: 5px; color: #86939c; font-size: 10px; }
.apx-agent-model-picker select { max-width: 150px; height: 28px; padding: 0 23px 0 8px; border: 0; border-radius: 7px; outline: 0; color: #53616c; background: #f1f4f6; cursor: pointer; font-size: 10px; }
.apx-agent-model-picker select:focus { box-shadow: 0 0 0 2px rgba(18, 184, 199, 0.14); }
.apx-agent-image-selector { position: relative; flex: 0 0 auto; }
.apx-agent-image-trigger { width: 158px; height: 34px; padding: 3px 8px 3px 4px; display: flex; align-items: center; gap: 7px; border: 0; border-radius: 9px; color: #354550; background: #f1f4f6; cursor: pointer; text-align: left; }
.apx-agent-image-trigger > img { width: 27px; height: 27px; flex: 0 0 auto; border-radius: 7px; object-fit: cover; box-shadow: 0 2px 7px rgba(24, 43, 56, 0.16); }
.apx-agent-image-trigger > span { min-width: 0; flex: 1; }
.apx-agent-image-trigger small, .apx-agent-image-trigger strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apx-agent-image-trigger small { color: #83919a; font-size: 8px; font-weight: 500; }
.apx-agent-image-trigger strong { margin-top: 1px; color: #40515d; font-size: 10px; font-weight: 650; }
.apx-agent-image-trigger > i { color: #778792; font-size: 13px; font-style: normal; transition: transform 120ms ease; }
.apx-agent-image-selector.is-open .apx-agent-image-trigger { background: #e8f6f7; box-shadow: inset 0 0 0 1px #9fd7dc; }
.apx-agent-image-selector.is-open .apx-agent-image-trigger > i { transform: rotate(180deg); }
.apx-agent-image-menu { position: absolute; left: 0; bottom: 40px; z-index: 12; display: none; width: 310px; max-height: 330px; overflow-y: auto; padding: 6px; border: 1px solid #d9e3e8; border-radius: 12px; background: rgba(255, 255, 255, 0.99); box-shadow: 0 16px 42px rgba(25, 47, 62, 0.23); }
.apx-agent-image-selector.is-open .apx-agent-image-menu { display: block; }
.apx-agent-image-menu > button { width: 100%; min-width: 0; padding: 7px; display: flex; align-items: center; gap: 9px; border: 0; border-radius: 9px; color: #24323d; background: transparent; cursor: pointer; text-align: left; }
.apx-agent-image-menu > button:hover { background: #f1f6f8; }
.apx-agent-image-menu > button.is-selected { background: #edf8f9; }
.apx-agent-image-menu img { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 9px; object-fit: cover; box-shadow: 0 3px 9px rgba(24, 43, 56, 0.16); }
.apx-agent-image-menu span { min-width: 0; flex: 1; }
.apx-agent-image-menu strong, .apx-agent-image-menu small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apx-agent-image-menu strong { font-size: 12px; }
.apx-agent-image-menu strong b { display: inline-block; margin-left: 5px; padding: 1px 4px; border-radius: 4px; color: #087f8b; background: #dff4f6; font-size: 7px; font-weight: 800; vertical-align: 1px; }
.apx-agent-image-menu small { margin-top: 3px; color: #7c8992; font-size: 9px; }
.apx-agent-image-menu em { width: 42px; flex: 0 0 auto; color: #087f8b; font-size: 9px; font-style: normal; font-weight: 800; text-align: center; }
.apx-agent-image-menu > button.is-unavailable { cursor: default; opacity: 0.68; }
.apx-agent-image-menu > button.is-unavailable:hover { background: transparent; }
.apx-agent-image-menu > button.is-unavailable em { color: #8b98a1; font-weight: 600; }
.apx-agent-image-menu > p { margin: 0; padding: 16px; color: #7d8b95; font-size: 11px; text-align: center; }
.apx-agent-compose-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.apx-agent-llm-picker { padding-left: 9px; border-left: 1px solid #e2e8eb; }
.apx-agent-llm-picker select { max-width: 132px; }
.apx-agent-inline-panel .apx-agent-model-label { color: #74828d; }
.apx-agent-inline-panel .apx-agent-send { color: #fff; background: #17222e; }
.apx-agent-inline-panel .apx-agent-send:hover { background: #087f8b; }
.apx-agent-inline-panel .apx-agent-settings { inset: 64px 0 0; color: #f5fbff; }
body.dark .apx-agent-inline-panel { color: #eef4f7; background: radial-gradient(circle at 8% 12%, rgba(26, 150, 160, 0.2), transparent 24%), linear-gradient(145deg, #111a22, #17212a); box-shadow: inset 0 0 0 1px #2a3742, 0 18px 42px rgba(0, 0, 0, 0.18); }
body.dark .apx-agent-inline-panel .apx-agent-head { background: rgba(15, 24, 32, 0.65); }
body.dark .apx-agent-inline-panel .apx-agent-identity strong { color: #eef4f7; }
body.dark .apx-agent-inline-panel .apx-agent-bubble { border-color: #2b3944; color: #d8e2e7; background: rgba(28, 40, 50, 0.92); }
body.dark .apx-agent-inline-panel .apx-agent-bubble strong { color: #fff; }
body.dark .apx-agent-inline-panel .apx-agent-compose-box { border-color: #34434f; background: rgba(20, 30, 39, 0.96); }
body.dark .apx-agent-inline-panel .apx-agent-compose textarea { color: #eef4f7; }
body.dark .apx-agent-model-picker select { color: #dbe5ea; background: #283640; }
body.dark .apx-agent-image-trigger { color: #dbe5ea; background: #283640; }
body.dark .apx-agent-image-trigger strong { color: #dbe5ea; }
body.dark .apx-agent-image-menu { border-color: #34434f; background: rgba(17, 26, 34, 0.99); }
body.dark .apx-agent-image-menu > button { color: #eef4f7; }
body.dark .apx-agent-image-menu > button:hover, body.dark .apx-agent-image-menu > button.is-selected { background: #1c343d; }
body.dark .apx-agent-inline-panel .apx-agent-quick button { border-color: #34434f; color: #bdcad1; background: rgba(255, 255, 255, 0.04); }
body.dark .apx-agent-skills { border-color: #34434f; color: #eef4f7; background: rgba(17, 26, 34, 0.99); }
body.dark .apx-agent-skills > header, body.dark .apx-agent-skills > footer { border-color: #34434f; }
body.dark .apx-agent-skills > header small, body.dark .apx-agent-skills > footer { color: #9caab3; }
body.dark .apx-agent-skill-card { border-color: #34434f; color: #eef4f7; background: #17232d; }
body.dark .apx-agent-skill-card:hover, body.dark .apx-agent-skill-card.is-selected { border-color: #3eb9c3; background: #163039; }

@media (max-width: 1320px) {
  .apx-agent-inline-panel { height: 480px; }
}

@keyframes apx-agent-pulse { 50% { opacity: 0.4; transform: scale(0.78); } }

@media (max-width: 680px) {
  .apx-agent-launcher { right: 14px; bottom: 14px; }
  .apx-agent-panel { right: 14px; bottom: 76px; height: min(680px, calc(100vh - 98px)); }
  .apx-agent-inline-panel { height: 440px; }
  .apx-agent-inline-panel .apx-agent-scope { display: none; }
  .apx-agent-inline-panel .apx-agent-body { padding-inline: 12px; }
  .apx-agent-inline-panel .apx-agent-bubble { max-width: 88%; }
  .apx-agent-skills { left: 10px; bottom: 74px; width: calc(100% - 20px); }
  .apx-agent-model-picker span { display: none; }
  .apx-agent-model-picker select { max-width: 94px; }
  .apx-agent-image-trigger { width: 116px; }
  .apx-agent-image-trigger small { display: none; }
  .apx-agent-image-menu { width: min(310px, calc(100vw - 42px)); }
  .apx-agent-compose-tools { gap: 5px; }
  .apx-agent-compose-actions { gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .apx-agent-launcher, .apx-agent-panel { transition: none; }
  .apx-agent-launcher.is-busy::after { animation: none; }
}

/* Doubao-inspired conversation surface with the production controls docked as skills. */
#creationWorkspace .task-composer { padding: 0; overflow: visible; }
#creationWorkspace .workbench-agent-host { min-height: 680px; margin: 0; }
#creationWorkspace .composer-footer[hidden] { display: none; }
.apx-agent-inline-panel {
  height: 680px;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  grid-template-rows: minmax(0, 1fr) auto;
}
.apx-agent-inline-panel::before { display: none; }
.apx-agent-inline-panel .apx-agent-body { padding: 30px 34px 12px; background: #fff; }
.apx-agent-inline-panel .apx-agent-message { width: min(780px, 100%); margin: 0 auto 18px; }
.apx-agent-inline-panel .apx-agent-bubble {
  max-width: 100%;
  padding: 8px 2px;
  border: 0;
  border-radius: 0;
  color: #222b33;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  line-height: 1.8;
}
.apx-agent-inline-panel .apx-agent-message.is-user .apx-agent-bubble {
  max-width: 72%;
  padding: 11px 15px;
  border-radius: 15px;
  color: #202932;
  background: #f2f3f4;
  box-shadow: none;
}
.apx-agent-inline-panel .apx-agent-quick { width: min(780px, 100%); margin: -4px auto 18px; padding-left: 0; }
.apx-agent-inline-panel .apx-agent-quick button { padding: 9px 13px; border: 0; border-radius: 10px; color: #36434d; background: #f4f5f6; font-size: 12px; }
.apx-agent-inline-panel .apx-agent-quick button:hover { border: 0; color: #087f8b; background: #eaf8f9; }
.apx-agent-inline-panel .apx-agent-compose { padding: 12px 24px 20px; background: linear-gradient(180deg, rgba(255,255,255,0), #fff 22%); }
.apx-agent-inline-panel .apx-agent-compose-box {
  width: min(840px, 100%);
  min-height: 116px;
  margin-inline: auto;
  padding: 14px 16px 12px;
  border: 1px solid #bdd4ff;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(57, 88, 126, 0.1);
}
.apx-agent-inline-panel .apx-agent-compose-box:focus-within { border-color: #7faefc; box-shadow: 0 12px 34px rgba(57, 88, 126, 0.13), 0 0 0 2px rgba(90, 145, 255, 0.08); }
.apx-agent-inline-panel .apx-agent-compose textarea { min-height: 52px; max-height: 120px; font-size: 15px; line-height: 1.65; }
.apx-agent-inline-panel .apx-agent-compose-footer { margin-top: 8px; }
.apx-agent-inline-panel .apx-agent-send { background: #17222e; }
.apx-agent-inline-panel .apx-agent-send:hover { background: #087f8b; }
.apx-agent-workflow-dock { min-width: 0; margin-top: 10px; padding-top: 9px; display: flex; align-items: center; gap: 8px; border-top: 1px solid #edf0f2; }
.apx-agent-workflow-dock .production-console { min-width: 0; flex: 1 1 auto; margin: 0; }
.apx-agent-workflow-dock .production-toolbar { min-height: 36px; gap: 6px; }
.apx-agent-workflow-dock .asset-section { min-width: 0; flex: 1 1 330px; }
.apx-agent-workflow-dock .asset-grid { grid-template-columns: repeat(3, minmax(90px, 1fr)); gap: 5px; overflow: visible; }
.apx-agent-workflow-dock .asset-slot { min-height: 36px; padding: 5px 7px; grid-template-columns: 16px minmax(0, 1fr) 10px; border-color: #e3e7ea; border-radius: 9px; background: #f7f8f9; }
.apx-agent-workflow-dock .asset-slot:hover, .apx-agent-workflow-dock .asset-slot.has-file { border-color: #8bcfd5; background: #eefafa; }
.apx-agent-workflow-dock .asset-slot > svg { width: 14px; }
.apx-agent-workflow-dock .asset-slot strong { font-size: 9px; }
.apx-agent-workflow-dock .generation-settings-trigger { max-width: 170px; height: 36px; padding-inline: 9px; border-color: #e3e7ea; border-radius: 9px; background: #f7f8f9; }
.apx-agent-workflow-dock .generation-confirm { height: 36px; padding-inline: 8px; border-color: #e3e7ea; border-radius: 9px; background: #fff; }
.apx-agent-workflow-dock > .generate-button { flex: 0 0 auto; min-width: 138px; width: auto; height: 38px; margin: 0; padding-inline: 13px; border-radius: 10px; box-shadow: none; }
.apx-agent-workflow-dock > .generate-button small { padding-left: 8px; }
.apx-agent-workflow-dock .generation-settings-popover { right: 0; bottom: calc(100% + 12px); }
.apx-agent-inline-panel .apx-agent-skills { bottom: 172px; }

body.dark .apx-agent-inline-panel, body.dark .apx-agent-inline-panel .apx-agent-body { background: #111820; }
body.dark .apx-agent-inline-panel .apx-agent-bubble { border: 0; color: #dce5ea; background: transparent; }
body.dark .apx-agent-inline-panel .apx-agent-message.is-user .apx-agent-bubble { color: #edf4f7; background: #26313a; }
body.dark .apx-agent-inline-panel .apx-agent-compose { background: linear-gradient(180deg, rgba(17,24,32,0), #111820 22%); }
body.dark .apx-agent-inline-panel .apx-agent-compose-box { border-color: #405570; background: #18222b; }
body.dark .apx-agent-workflow-dock { border-top-color: #2b3740; }
body.dark .apx-agent-workflow-dock .asset-slot, body.dark .apx-agent-workflow-dock .generation-settings-trigger { border-color: #35424c; background: #222d36; }

@media (max-width: 1320px) {
  #creationWorkspace .workbench-agent-host { min-height: 640px; }
  .apx-agent-inline-panel { height: 640px; }
}

@media (max-width: 860px) {
  .apx-agent-inline-panel .apx-agent-body { padding-inline: 18px; }
  .apx-agent-inline-panel .apx-agent-compose { padding-inline: 14px; }
  .apx-agent-workflow-dock { align-items: stretch; flex-direction: column; }
  .apx-agent-workflow-dock .production-toolbar { flex-wrap: wrap; }
  .apx-agent-workflow-dock > .generate-button { width: 100%; }
  .apx-agent-inline-panel .apx-agent-skills { bottom: 250px; }
}

/* Refined conversation atmosphere: quiet canvas, readable dialogue and a floating composer. */
#creationWorkspace .task-composer {
  border-color: rgba(213, 223, 230, 0.72);
  background: transparent;
  box-shadow: 0 22px 65px rgba(37, 58, 73, 0.075);
}
.apx-agent-inline-panel {
  background:
    radial-gradient(circle at 12% 5%, rgba(224, 246, 249, 0.88), transparent 31%),
    radial-gradient(circle at 91% 8%, rgba(239, 235, 253, 0.72), transparent 28%),
    linear-gradient(180deg, #fcfdfd 0%, #f8fafb 58%, #f5f8fa 100%);
}
.apx-agent-inline-panel::before {
  display: block;
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.3;
  background-image: radial-gradient(circle, rgba(71, 96, 111, 0.11) 0.7px, transparent 0.8px);
  background-size: 16px 16px;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.3) 38%, transparent 72%);
}
.apx-agent-inline-panel .apx-agent-body {
  padding: 34px 40px 18px;
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: rgba(126, 141, 151, 0.5) transparent;
  scroll-padding-block: 24px;
}
.apx-agent-inline-panel .apx-agent-body::-webkit-scrollbar { width: 7px; }
.apx-agent-inline-panel .apx-agent-body::-webkit-scrollbar-track { background: transparent; }
.apx-agent-inline-panel .apx-agent-body::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: rgba(126, 141, 151, 0.5); background-clip: padding-box; }
.apx-agent-inline-panel .apx-agent-message { width: min(820px, 100%); margin-bottom: 24px; }
.apx-agent-inline-panel .apx-agent-bubble {
  padding: 9px 4px;
  color: #2d3741;
  font-size: 15px;
  line-height: 1.86;
  letter-spacing: 0.005em;
}
.apx-agent-inline-panel .apx-agent-bubble p { margin-bottom: 11px; }
.apx-agent-inline-panel .apx-agent-bubble ul { margin-block: 9px; }
.apx-agent-inline-panel .apx-agent-message.is-user .apx-agent-bubble {
  max-width: min(72%, 620px);
  padding: 12px 16px;
  border: 1px solid rgba(200, 222, 242, 0.72);
  border-radius: 16px;
  color: #25333f;
  background: linear-gradient(145deg, rgba(242, 249, 255, 0.98), rgba(235, 245, 255, 0.92));
  box-shadow: 0 7px 20px rgba(66, 105, 139, 0.07);
  font-size: 14px;
  line-height: 1.72;
}
.apx-agent-inline-panel .apx-agent-quick { width: min(820px, 100%); gap: 8px; margin-top: -9px; margin-bottom: 24px; }
.apx-agent-inline-panel .apx-agent-quick button {
  padding: 9px 14px;
  border: 1px solid rgba(218, 227, 232, 0.86);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 5px 15px rgba(43, 65, 79, 0.035);
}
.apx-agent-inline-panel .apx-agent-compose {
  padding: 20px 28px 24px;
  background: linear-gradient(180deg, rgba(247,250,251,0), rgba(247,250,251,.94) 25%, #f7fafb 55%);
}
.apx-agent-inline-panel .apx-agent-compose-box {
  width: min(900px, 100%);
  border-color: rgba(170, 201, 239, 0.9);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 48px rgba(44, 73, 100, 0.13), 0 2px 8px rgba(44, 73, 100, 0.05);
  backdrop-filter: blur(18px);
}
.apx-agent-inline-panel .apx-agent-compose-box:focus-within {
  border-color: #76a9f7;
  box-shadow: 0 18px 52px rgba(44, 73, 100, 0.15), 0 0 0 3px rgba(97, 151, 244, 0.08);
}
.apx-agent-inline-panel .apx-agent-compose textarea::placeholder { color: #93a1ad; }
.apx-agent-workflow-dock { border-top-color: rgba(225, 231, 235, 0.88); }
.apx-agent-workflow-dock .asset-slot,
.apx-agent-workflow-dock .generation-settings-trigger {
  border-color: rgba(222, 228, 232, 0.92);
  background: rgba(247, 249, 250, 0.92);
}
.apx-agent-workflow-dock .generation-confirm { border-color: rgba(222, 228, 232, 0.92); background: rgba(255,255,255,.86); }
.apx-agent-workflow-dock > .generate-button { flex: 0 0 150px; width: 150px; min-width: 150px; padding-inline: 9px; gap: 5px; }
.apx-agent-workflow-dock > .generate-button > svg:last-child { display: none; }
.apx-agent-workflow-dock > .generate-button > span,
.apx-agent-workflow-dock > .generate-button small { white-space: nowrap; }
.apx-agent-workflow-dock > .generate-button small { margin-left: 1px; padding-left: 6px; }

body.dark .apx-agent-inline-panel {
  background:
    radial-gradient(circle at 12% 5%, rgba(22, 93, 102, 0.23), transparent 31%),
    radial-gradient(circle at 91% 8%, rgba(70, 55, 112, 0.2), transparent 28%),
    linear-gradient(180deg, #121a22 0%, #10171e 100%);
}
body.dark .apx-agent-inline-panel .apx-agent-body { background: transparent; }
body.dark .apx-agent-inline-panel .apx-agent-message.is-user .apx-agent-bubble { border-color: #344e64; color: #edf4f8; background: linear-gradient(145deg, #223849, #1d303f); }
body.dark .apx-agent-inline-panel .apx-agent-compose { background: linear-gradient(180deg, rgba(16,23,30,0), rgba(16,23,30,.95) 28%, #10171e 58%); }

@media (max-width: 680px) {
  .apx-agent-inline-panel .apx-agent-body { padding-inline: 16px; }
  .apx-agent-inline-panel .apx-agent-message.is-user .apx-agent-bubble { max-width: 86%; }
  .apx-agent-inline-panel .apx-agent-compose { padding: 14px 10px 18px; }
}

/* Full-height commerce workspace: only the conversation scrolls; the composer stays docked. */
body[data-current-view="commerce-video"] {
  height: 100vh;
  overflow: hidden;
  background: #f7fafb;
  background-image: none;
}
body[data-current-view="commerce-video"] .workbench-main { height: 100vh; min-height: 0; overflow: hidden; }
body[data-current-view="commerce-video"] .workspace-content {
  width: 100%;
  max-width: none;
  height: calc(100vh - 62px);
  margin: 0;
  padding: 0;
  overflow: hidden;
}
@media (min-width: 821px) {
  body[data-current-view="commerce-video"] .workbench-main { height: 125vh; }
  body[data-current-view="commerce-video"] .workspace-content { height: calc(125vh - 62px); }
}
body[data-current-view="commerce-video"] #creationWorkspace,
body[data-current-view="commerce-video"] #creationWorkspace .workspace-grid,
body[data-current-view="commerce-video"] #creationWorkspace .task-composer,
body[data-current-view="commerce-video"] #creationWorkspace .workbench-agent-host {
  min-height: 0;
  height: 100%;
}
body[data-current-view="commerce-video"] #creationWorkspace .workspace-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  gap: 0;
  align-items: stretch;
  justify-content: stretch;
  transform: none;
}
body[data-current-view="commerce-video"] #creationWorkspace .workspace-grid::before { display: none; }
body[data-current-view="commerce-video"] #creationWorkspace .task-composer {
  grid-column: auto;
  grid-row: auto;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 10% 4%, rgba(224, 246, 249, 0.88), transparent 31%),
    radial-gradient(circle at 92% 7%, rgba(239, 235, 253, 0.7), transparent 29%),
    linear-gradient(180deg, #fcfdfd 0%, #f7fafb 100%);
  box-shadow: none;
}
body[data-current-view="commerce-video"] #creationWorkspace .workbench-agent-host { width: 100%; margin: 0; }
body[data-current-view="commerce-video"] .apx-agent-inline-panel {
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body[data-current-view="commerce-video"] .apx-agent-inline-panel::before { display: none; }
body[data-current-view="commerce-video"] .apx-agent-inline-panel .apx-agent-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
body[data-current-view="commerce-video"] .apx-agent-inline-panel .apx-agent-compose {
  position: relative;
  bottom: auto;
  flex: 0 0 auto;
  padding-bottom: 20px;
}
body[data-current-view="commerce-video"] #creationWorkspace .video-result-panel {
  grid-column: auto;
  grid-row: auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 18px;
  overflow-y: auto;
  position: relative;
  top: auto;
  border-width: 0 0 0 1px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
}
body[data-current-view="commerce-video"].right-sidebar-collapsed #creationWorkspace .workspace-grid { grid-template-columns: minmax(0, 1fr); }
body[data-current-view="commerce-video"].right-sidebar-collapsed #creationWorkspace .task-composer { width: 100%; max-width: none; }
body.dark[data-current-view="commerce-video"] { background: #10171e; }
body.dark[data-current-view="commerce-video"] #creationWorkspace .task-composer { background: radial-gradient(circle at 10% 4%, rgba(22,93,102,.2), transparent 31%), linear-gradient(180deg,#121a22,#10171e); }
body.dark[data-current-view="commerce-video"] #creationWorkspace .video-result-panel { border-left-color: #2a3742; background: rgba(17, 25, 33, 0.94); }

@media (max-width: 1320px) {
  body[data-current-view="commerce-video"] #creationWorkspace .workspace-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, 360px); }
}

@media (max-width: 980px) {
  body[data-current-view="commerce-video"] #creationWorkspace .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  body[data-current-view="commerce-video"] #creationWorkspace .video-result-panel { display: none; }
}

/* Unified attachment menu and compact generation controls. */
.apx-agent-asset-selector { position: relative; flex: 0 0 auto; }
.apx-agent-asset-trigger {
  width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #52616c;
  background: #f1f4f6;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: color 120ms ease, background 120ms ease, transform 120ms ease;
}
.apx-agent-asset-trigger:hover,
.apx-agent-asset-selector.is-open .apx-agent-asset-trigger { color: #087f8b; background: #e5f7f8; }
.apx-agent-asset-selector.is-open .apx-agent-asset-trigger { transform: rotate(45deg); }
.apx-agent-asset-menu {
  position: absolute;
  left: 0;
  bottom: 40px;
  z-index: 16;
  display: none;
  width: 300px;
  overflow: hidden;
  border: 1px solid #d8e3e8;
  border-radius: 14px;
  color: #1f2c36;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 18px 48px rgba(25, 47, 62, 0.23);
}
.apx-agent-asset-selector.is-open .apx-agent-asset-menu { display: block; }
.apx-agent-asset-menu > header { padding: 13px 14px 10px; border-bottom: 1px solid #e8edef; }
.apx-agent-asset-menu > header strong,
.apx-agent-asset-menu > header small { display: block; }
.apx-agent-asset-menu > header strong { font-size: 13px; }
.apx-agent-asset-menu > header small { margin-top: 2px; color: #7d8b95; font-size: 10px; }
.apx-agent-asset-menu > button {
  width: calc(100% - 12px);
  min-width: 0;
  margin: 3px 6px;
  padding: 9px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 9px;
  color: #273640;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.apx-agent-asset-menu > button:hover { background: #edf8f9; }
.apx-agent-asset-menu > button > i {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #087f8b;
  background: #e1f5f6;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}
.apx-agent-asset-menu > button > span { min-width: 0; flex: 1; }
.apx-agent-asset-menu > button strong,
.apx-agent-asset-menu > button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apx-agent-asset-menu > button strong { font-size: 12px; }
.apx-agent-asset-menu > button small { margin-top: 2px; color: #7e8c96; font-size: 9px; }
.apx-agent-asset-menu > button > em { color: #8c99a1; font-size: 18px; font-style: normal; }
.apx-agent-asset-menu > footer { padding: 8px 13px; border-top: 1px solid #e8edef; color: #8a969e; background: #fafcfc; font-size: 9px; }

.apx-agent-workflow-dock .asset-section[hidden] { display: none !important; }
.apx-agent-workflow-dock .production-toolbar { justify-content: flex-end; }
.apx-agent-workflow-dock .apx-agent-llm-picker {
  height: 36px;
  padding: 0 7px 0 10px;
  border: 1px solid rgba(222, 228, 232, 0.92);
  border-radius: 9px;
  background: rgba(247, 249, 250, 0.94);
}
.apx-agent-workflow-dock .apx-agent-llm-picker select { max-width: 132px; background: transparent; }
.apx-agent-compose-actions > .apx-agent-send:only-child { margin-left: 0; }

body.dark .apx-agent-asset-menu { border-color: #35424c; color: #e5edf2; background: rgba(28, 39, 48, 0.99); }
body.dark .apx-agent-asset-menu > header,
body.dark .apx-agent-asset-menu > footer { border-color: #35424c; background: #19232c; }
body.dark .apx-agent-asset-menu > button { color: #e2eaf0; }
body.dark .apx-agent-asset-menu > button:hover { background: #243640; }
body.dark .apx-agent-workflow-dock .apx-agent-llm-picker { border-color: #35424c; background: #222d36; }

@media (max-width: 680px) {
  .apx-agent-asset-menu { width: min(300px, calc(100vw - 32px)); }
  .apx-agent-workflow-dock .apx-agent-llm-picker { flex: 1 1 auto; justify-content: space-between; }
}

/* One continuous composer toolbar: attachments, models and generation stay on one line. */
.apx-agent-inline-panel .apx-agent-compose-footer {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
}
.apx-agent-inline-panel .apx-agent-compose-tools { flex: 0 0 auto; gap: 5px; }
.apx-agent-inline-panel .apx-agent-skill-trigger { min-width: 72px; padding-inline: 8px; }
.apx-agent-inline-panel .apx-agent-image-trigger { width: 148px; }
.apx-agent-inline-panel .apx-agent-compose-footer > .production-console {
  min-width: 0;
  flex: 1 1 270px;
  margin: 0;
}
.apx-agent-inline-panel .apx-agent-compose-footer .production-toolbar {
  min-width: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap !important;
  justify-content: flex-end;
  gap: 5px;
}
.apx-agent-inline-panel .apx-agent-compose-footer .generation-settings-trigger {
  width: 145px;
  min-width: 0;
  max-width: 145px;
  height: 34px;
  flex: 1 1 130px;
  padding-inline: 8px;
  border-radius: 8px;
}
.apx-agent-inline-panel .apx-agent-compose-footer .apx-agent-llm-picker {
  min-width: 124px;
  max-width: 148px;
  height: 34px;
  flex: 1 1 136px;
  padding: 0 5px 0 8px;
  border: 1px solid rgba(222, 228, 232, 0.92);
  border-radius: 8px;
  background: rgba(247, 249, 250, 0.94);
}
.apx-agent-inline-panel .apx-agent-compose-footer .apx-agent-llm-picker select { min-width: 0; max-width: 105px; padding-inline: 5px 18px; background: transparent; }
.apx-agent-inline-panel .apx-agent-compose-footer > .generate-button {
  width: 140px;
  min-width: 140px;
  height: 36px;
  flex: 0 0 140px;
  margin: 0;
  padding-inline: 9px;
  gap: 5px;
  border-radius: 9px;
  box-shadow: none;
}
.apx-agent-inline-panel .apx-agent-compose-footer > .generate-button > svg:last-child { display: none; }
.apx-agent-inline-panel .apx-agent-compose-footer > .generate-button > span { white-space: nowrap; }
.apx-agent-inline-panel .apx-agent-compose-footer > .generate-button small { margin-left: 0; padding-left: 5px; white-space: nowrap; }
.apx-agent-inline-panel .apx-agent-compose-actions { flex: 0 0 auto; gap: 0; }
.apx-agent-inline-panel .apx-agent-workflow-dock[hidden] { display: none !important; }

body.dark .apx-agent-inline-panel .apx-agent-compose-footer .apx-agent-llm-picker { border-color: #35424c; background: #222d36; }

@media (max-width: 1180px) {
  .apx-agent-inline-panel .apx-agent-compose-box { width: min(960px, 100%); }
  .apx-agent-inline-panel .apx-agent-compose-footer .generation-settings-trigger { max-width: 128px; }
  .apx-agent-inline-panel .apx-agent-compose-footer .apx-agent-llm-picker { min-width: 112px; max-width: 128px; }
  .apx-agent-inline-panel .apx-agent-compose-footer > .generate-button { width: 128px; min-width: 128px; flex-basis: 128px; }
}
