/* ═══════════════════════════════════════════════════════════════════════
   ASAS-AI Command Bar v2.0 — Static sticky top strip
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Bar container ───────────────────────────────────────────────────── */
#asas-command-bar {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  background: linear-gradient(180deg, rgba(20,28,48,.86), rgba(13,18,32,.92));
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgba(212,168,71,.15);
  z-index: 30;
  transition: all .2s ease;
}

/* ── Category tab strip wrapper ──────────────────────────────────────── */
.asas-cbt-wrap {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid rgba(255,255,255,.04);
  background: rgba(0,0,0,.2);
}

/* ── Category tab strip ──────────────────────────────────────────────── */
#asas-cbt {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  white-space: nowrap;
  scroll-behavior: smooth;
  border-bottom: none;
}
#asas-cbt::-webkit-scrollbar { display: none; }

/* ── Scroll arrow buttons ─────────────────────────────────────────────── */
.asas-cbt-arrow {
  flex-shrink: 0;
  width: 30px;
  height: 100%;
  min-height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--sb, rgba(10,15,30,.85));
  border: none;
  color: var(--t2, rgba(255,255,255,.45));
  cursor: pointer;
  transition: color .14s, background .14s;
  padding: 0;
}
.asas-cbt-arrow:hover { color: var(--ac, #D4A847); background: var(--s2, rgba(10,15,30,1)); }
.asas-cbt-arrow-l { border-right: 1px solid var(--b2, rgba(255,255,255,.04)); }
.asas-cbt-arrow-r { border-left:  1px solid var(--b2, rgba(255,255,255,.04)); }
.asas-cbt-arrow.hidden { display: none; }

.asas-cbtab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 13px 8px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,.4);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .03em;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
  font-family: inherit;
  white-space: nowrap;
  border-radius: 0;
}
.asas-cbtab:hover { color: rgba(255,255,255,.7); }
.asas-cbtab.active {
  color: #D4A847;
  border-bottom-color: #D4A847;
}
.asas-cbtab[data-cat="_favs"] { color: rgba(212,168,71,.5); }
.asas-cbtab[data-cat="_favs"].active { color: #D4A847; }
.asas-cbt-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  opacity: .6;
  flex-shrink: 0;
}
.asas-cbtab.active .asas-cbt-dot { opacity: 1; }
.asas-cbt-count {
  background: rgba(212,168,71,.2);
  color: #D4A847;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

/* ── Collapse button ─────────────────────────────────────────────────── */
#asas-cbt-toggle {
  position: static;
  flex: 0 0 auto;
  align-self: center;
  margin: 0 8px;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 28px; padding: 0 12px;
  background: var(--ad, rgba(212,168,71,.14));
  border: 1px solid var(--ac, rgba(212,168,71,.55));
  border-radius: 999px;
  color: var(--ac, #D4A847);
  font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
#asas-command-bar.collapsed #asas-cbt-toggle { background: var(--ac, #D4A847); color: var(--an, #0A0F1E); border-color: var(--ac, #D4A847); }
#asas-app[data-theme^="light-"] #asas-command-bar.collapsed #asas-cbt-toggle { color: #fff; }
@media (max-width: 600px) {
  #asas-cbt-toggle { margin: 0 6px; padding: 0 10px; }
  .asas-cbt-toggle-more { display: none; }
}
#asas-cbt-toggle:hover, #asas-cbt-toggle:focus-visible { background: rgba(212,168,71,.22); border-color: #D4A847; }
#asas-cbt-toggle:focus-visible { outline: 2px solid #D4A847; outline-offset: 2px; }

/* ── Card strip ──────────────────────────────────────────────────────── */
#asas-cbc-wrap {
  display: flex;
  align-items: stretch;
  gap: 7px;
  padding: 9px 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  min-height: 84px;
  transition: all .2s ease;
}
#asas-cbc-wrap::-webkit-scrollbar { display: none; }

/* ── Collapsed state ─────────────────────────────────────────────────── */
#asas-command-bar.collapsed #asas-cbc-wrap {
  display: none;
}
#asas-command-bar.collapsed {
  border-bottom-color: rgba(255,255,255,.06);
}
/* The toggle lives at the end of the tab row in both states, so it never jumps. */
#asas-command-bar .asas-cbtab { cursor: pointer; }

/* ── Empty state ─────────────────────────────────────────────────────── */
.asas-cbc-empty {
  display: flex;
  align-items: center;
  padding: 8px 6px;
  color: rgba(255,255,255,.28);
  font-size: 12px;
  font-style: italic;
  white-space: nowrap;
  min-height: 50px;
}

/* ── Individual command card ─────────────────────────────────────────── */
.asas-cbc {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 11px 8px;
  min-width: 144px;
  max-width: 176px;
  background: linear-gradient(150deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s, border-color .18s, transform .12s, box-shadow .15s;
  outline: none;
  text-align: left;
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset;
}
.asas-cbc:hover {
  background: rgba(212,168,71,.07);
  border-color: rgba(212,168,71,.28);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.asas-cbc:focus-visible {
  border-color: #D4A847;
  outline: 2px solid rgba(212,168,71,.3);
  outline-offset: 1px;
}
.asas-cbc.loaded {
  border-color: rgba(212,168,71,.6);
  background: rgba(212,168,71,.1);
}
.asas-cbc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 2px;
}
.asas-cbc-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.asas-cbc-fav {
  width: 18px; height: 18px;
  background: none;
  border: none;
  color: rgba(255,255,255,.2);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  border-radius: 3px;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  transition: color .12s, background .12s;
  flex-shrink: 0;
}
.asas-cbc-fav:hover, .asas-cbc-fav.on { color: #D4A847; }
.asas-cbc-name {
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(255,255,255,.88);
  line-height: 1.25;
  letter-spacing: .01em;
}
.asas-cbc-desc {
  font-size: 10px;
  color: rgba(255,255,255,.35);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── Toast ───────────────────────────────────────────────────────────── */
#asas-cbtst {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(212,168,71,.14);
  border: 1px solid rgba(212,168,71,.35);
  color: #D4A847;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 20px;
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 9999;
  white-space: nowrap;
}
#asas-cbtst.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Visual edit toolbar (kept from visual engine) ───────────────────── */
.asas-visual-edit-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  padding: 7px 12px;
  background: rgba(0,0,0,.15);
  border-top: 1px solid rgba(255,255,255,.06);
}
.asas-visual-edit-bar label {
  font-size: 10.5px;
  color: rgba(255,255,255,.4);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}
.asas-veb-select {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.8);
  font-size: 11.5px;
  padding: 3px 7px;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
}
.asas-veb-color {
  width: 26px; height: 26px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 5px;
  padding: 2px;
  cursor: pointer;
  background: rgba(255,255,255,.05);
}
.asas-veb-btn {
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(212,168,71,.35);
  background: transparent;
  color: #D4A847;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s, color .12s;
}
.asas-veb-btn:hover { background: #D4A847; color: #0a0f1e; }
.asas-veb-regen {
  margin-left: auto;
  display: flex; align-items: center; gap: 4px;
}
.asas-veb-separator { width: 1px; height: 16px; background: rgba(255,255,255,.1); margin: 0 1px; }
.asas-veb-regen-form {
  padding: 7px 12px;
  background: rgba(0,0,0,.2);
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex; gap: 7px; align-items: center; flex-wrap: wrap;
}
.asas-veb-regen-input {
  flex: 1; min-width: 160px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  color: #e0e0e0;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12.5px;
  font-family: inherit;
}
.asas-veb-regen-input:focus {
  outline: none;
  border-color: rgba(212,168,71,.4);
}

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE — Complete responsive overhaul
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Sidebar overlay on mobile ──────────────────────────────────────── */
@media(max-width:768px) {
  /* Sidebar: hidden drawer, slides from left */
  #asas-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    z-index: 200 !important;
    transform: translateX(-100%) !important;
    transition: transform .25s cubic-bezier(.4,0,.2,1) !important;
    box-shadow: 6px 0 32px rgba(0,0,0,.6) !important;
  }
  #asas-sidebar.open {
    transform: translateX(0) !important;
  }

  /* Backdrop overlay when sidebar open */
  #asas-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 199;
    backdrop-filter: blur(2px);
  }
  #asas-sidebar-overlay.active { display: block; }

  /* Topbar always visible on mobile */
  #asas-topbar {
    display: flex !important;
    height: 48px;
    padding: 0 12px !important;
    background: #0a0f1e !important;
    border-bottom: 1px solid rgba(212,168,71,.12) !important;
    z-index: 30;
    flex-shrink: 0;
  }

  /* Menu button larger touch target */
  #asas-menu-btn {
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    touch-action: manipulation;
  }

  /* Profile panel: full screen bottom sheet on mobile */
  #asas-panel-bg {
    align-items: flex-end !important;
  }
  #asas-panel {
    width: 100% !important;
    max-height: 88dvh !important;
    border-radius: 16px 16px 0 0 !important;
    overflow-y: auto !important;
  }
  /* Drag handle */
  #asas-panel::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    background: rgba(255,255,255,.15);
    border-radius: 2px;
    margin: 10px auto 4px;
    flex-shrink: 0;
  }

  /* Command bar: compact on mobile */
  .asas-cbtab { padding: 8px 10px; font-size: 11px; }
  .asas-cbc { min-width: 126px; max-width: 148px; padding: 8px 9px; }
  .asas-cbc-desc { display: none; }
  #asas-cbc-wrap { min-height: 66px; padding: 8px 10px; gap: 6px; }

  /* Input: prevent iOS zoom (must be ≥16px) */
  #asas-input { font-size: 16px !important; }

  /* Chat feed padding */
  #asas-feed { padding: 14px 12px 8px !important; }
  #asas-composer { padding: 6px 10px 10px !important; }

  /* Bubbles: full width on mobile */
  .asas-msg.ai .asas-bubble,
  .asas-msg.user .asas-bubble { max-width: 96% !important; }

  /* Stats: 2 col */
  .asas-stats { grid-template-columns: repeat(2,1fr) !important; }

  /* Visual iframes */
  .asas-visual-iframe,
  .asas-html-preview-frame { min-height: 260px !important; }

  /* Attach toolbar: show more buttons */
  #asas-attach-toolbar .asas-attach-btn { padding: 5px 8px !important; }
}

/* ── Very small phones ──────────────────────────────────────────────── */
@media(max-width:380px) {
  #asas-topbar { padding: 0 8px !important; }
  #asas-input { font-size: 16px !important; }
  .asas-cbc { min-width: 115px; }
}

/* ── Tablet (769–1024px) ─────────────────────────────────────────────── */
@media(min-width:769px) and (max-width:1024px) {
  #asas-sidebar { width: 220px !important; }
  .asas-cbc { min-width: 136px; max-width: 165px; }
}

/* Theme-proof: the regen input used a translucent background, so on a light
   parent its light text became unreadable. Pin an opaque dark field with
   light text so the pairing can never be split. */
.asas-veb-regen-input,
input.asas-veb-regen-input{
  background-color:#0f1729 !important;
  color:#f2f5fb !important; -webkit-text-fill-color:#f2f5fb !important;
  border:1px solid rgba(212,168,71,.28) !important; opacity:1 !important;
}
.asas-veb-regen-input::placeholder{
  color:#8fa0bd !important; -webkit-text-fill-color:#8fa0bd !important; opacity:1 !important;
}
.asas-veb-regen-input:focus{
  background-color:#111c33 !important; border-color:#D4A847 !important;
  color:#ffffff !important; -webkit-text-fill-color:#ffffff !important;
}

/* ─────────────────────────────────────────────────────────────────────
   FEATURED COMMAND TAB — "📸 Photo → 3D"
   The flagship tab sits first and is visually distinguished with an
   animated gradient border, a soft glow and a NEW badge. Colours are
   explicit (not theme variables) so a host theme cannot wash it out,
   and the animation is disabled under prefers-reduced-motion.
   ───────────────────────────────────────────────────────────────────── */
#asas-app .asas-cbtab.asas-cbtab-featured{
  position:relative;
  background:linear-gradient(135deg, rgba(255,107,53,.20), rgba(212,168,71,.16)) !important;
  border:1px solid rgba(255,107,53,.55) !important;
  color:#ffd9c7 !important;
  font-weight:700 !important;
  box-shadow:0 0 0 0 rgba(255,107,53,.45);
  animation:asas-feat-pulse 2.8s ease-in-out infinite;
  overflow:visible;
}
#asas-app .asas-cbtab.asas-cbtab-featured:hover{
  background:linear-gradient(135deg, rgba(255,107,53,.32), rgba(212,168,71,.24)) !important;
  border-color:#FF6B35 !important;
  color:#ffffff !important;
}
#asas-app .asas-cbtab.asas-cbtab-featured.active,
#asas-app .asas-cbtab.asas-cbtab-featured[aria-selected="true"]{
  background:linear-gradient(135deg,#FF6B35,#D4A847) !important;
  border-color:#FF6B35 !important;
  color:#1a1005 !important;
  animation:none;
  box-shadow:0 4px 16px -4px rgba(255,107,53,.6);
}
@keyframes asas-feat-pulse{
  0%,100%{ box-shadow:0 0 0 0 rgba(255,107,53,.40); }
  50%    { box-shadow:0 0 0 5px rgba(255,107,53,0); }
}
/* Shimmer sweep across the tab */
#asas-app .asas-cbtab.asas-cbtab-featured::after{
  content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background:linear-gradient(115deg,transparent 30%,rgba(255,255,255,.28) 50%,transparent 70%);
  background-size:220% 100%;
  animation:asas-feat-shimmer 3.4s linear infinite;
}
@keyframes asas-feat-shimmer{
  0%  { background-position:180% 0; }
  100%{ background-position:-80% 0; }
}
.asas-cbt-new{
  display:inline-block;margin-left:6px;padding:1px 5px;border-radius:999px;
  background:#c2410c;color:#ffffff;font-size:8.5px;font-weight:800;
  letter-spacing:.04em;line-height:1.5;vertical-align:middle;
  box-shadow:0 1px 4px rgba(255,107,53,.5);
}
#asas-app .asas-cbtab.asas-cbtab-featured.active .asas-cbt-new,
#asas-app .asas-cbtab.asas-cbtab-featured[aria-selected="true"] .asas-cbt-new{
  background:#1a1005;color:#FFD9A0;
}
/* Featured cards get a matching accent so the section feels cohesive. */
.asas-cbc[data-cat="photo3d"]{
  border-color:rgba(255,107,53,.42) !important;
  background:linear-gradient(160deg, rgba(255,107,53,.10), rgba(255,255,255,.02)) !important;
}
.asas-cbc[data-cat="photo3d"]:hover{
  border-color:#FF6B35 !important;
  box-shadow:0 6px 20px -8px rgba(255,107,53,.55) !important;
}
@media (prefers-reduced-motion: reduce){
  #asas-app .asas-cbtab.asas-cbtab-featured{ animation:none; }
  #asas-app .asas-cbtab.asas-cbtab-featured::after{ animation:none; background:none; }
}

/* ─────────────────────────────────────────────────────────────────────
   CONCEPT VISUALS — featured tab (purple) + concept image block
   The disclaimer styling is deliberately prominent: a concept image must
   never be mistaken for a measured render or a deliverable.
   ───────────────────────────────────────────────────────────────────── */
#asas-app .asas-cbtab.asas-cbtab-featured[data-cat="concept"]{
  background:linear-gradient(135deg, rgba(168,85,247,.20), rgba(212,168,71,.14)) !important;
  border:1px solid rgba(168,85,247,.55) !important;
  color:#e9d5ff !important;
  animation:asas-feat-pulse-purple 2.8s ease-in-out infinite;
}
#asas-app .asas-cbtab.asas-cbtab-featured[data-cat="concept"]:hover{
  background:linear-gradient(135deg, rgba(168,85,247,.32), rgba(212,168,71,.22)) !important;
  border-color:#A855F7 !important; color:#ffffff !important;
}
#asas-app .asas-cbtab.asas-cbtab-featured[data-cat="concept"].active,
#asas-app .asas-cbtab.asas-cbtab-featured[data-cat="concept"][aria-selected="true"]{
  background:linear-gradient(135deg,#A855F7,#D4A847) !important;
  border-color:#A855F7 !important; color:#1a0a2e !important; animation:none;
  box-shadow:0 4px 16px -4px rgba(168,85,247,.6);
}
#asas-app .asas-cbtab.asas-cbtab-featured[data-cat="concept"] .asas-cbt-new{ background:#7c3aed; }
@keyframes asas-feat-pulse-purple{
  0%,100%{ box-shadow:0 0 0 0 rgba(168,85,247,.40); }
  50%    { box-shadow:0 0 0 5px rgba(168,85,247,0); }
}
.asas-cbc[data-cat="concept"]{
  border-color:rgba(168,85,247,.42) !important;
  background:linear-gradient(160deg, rgba(168,85,247,.10), rgba(255,255,255,.02)) !important;
}
.asas-cbc[data-cat="concept"]:hover{
  border-color:#A855F7 !important;
  box-shadow:0 6px 20px -8px rgba(168,85,247,.55) !important;
}

/* ── Concept image block ─────────────────────────────────────────────── */
.asas-concept-wrap{
  margin:14px 0; padding:12px; border-radius:14px;
  background:#0f1729; border:1px solid rgba(168,85,247,.35);
}
.asas-concept-head{
  display:flex; align-items:center; gap:8px; margin-bottom:9px;
  font-size:13.5px; font-weight:700; color:#f2f5fb !important;
}
.asas-concept-badge{
  display:inline-block; padding:2px 8px; border-radius:999px;
  background:#7c3aed; color:#ffffff !important;
  font-size:9px; font-weight:800; letter-spacing:.06em;
}
.asas-concept-img{
  display:block; width:100%; height:auto; border-radius:10px;
  border:1px solid rgba(255,255,255,.1); background:#0a0f1e;
}
.asas-concept-note{
  margin-top:10px; padding:9px 11px; border-radius:9px;
  background:rgba(212,168,71,.10); border:1px solid rgba(212,168,71,.35);
  color:#f0d9a8 !important; font-size:11.5px; line-height:1.55;
}
.asas-concept-prompt{ margin-top:9px; }
.asas-concept-prompt summary{
  cursor:pointer; font-size:11.5px; color:#a9b8d1 !important; user-select:none;
}
.asas-concept-prompt pre{
  margin:7px 0 0; padding:9px; border-radius:8px; white-space:pre-wrap;
  background:#0a0f1e; border:1px solid rgba(255,255,255,.08);
  color:#c9d3e6 !important; font-size:11px; line-height:1.5;
}
.asas-concept-actions{ margin-top:10px; display:flex; gap:8px; flex-wrap:wrap; }
@media (prefers-reduced-motion: reduce){
  #asas-app .asas-cbtab.asas-cbtab-featured[data-cat="concept"]{ animation:none; }
}

/* ══════════════════════════════════════════════════════════════════════
   COMMAND LIBRARY v2 — cluster console
   The active cluster's accent (--cl-accent, set in JS) runs through the
   rail, the category underline and the card edges, so each cluster reads
   as its own space instead of one more tab in a 36-tab strip.
   ══════════════════════════════════════════════════════════════════════ */
#asas-command-bar { --cl-accent: #D4A847; }

.asas-cl-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

/* Cluster rail */
.asas-cl-rail {
  display: flex; gap: 6px; flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
  padding: 2px;
}
.asas-cl-rail::-webkit-scrollbar { display: none; }

.asas-cl-pill {
  --pill-accent: #D4A847;
  position: relative; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px 7px 9px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(150deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  color: #aab6cb; font: 600 12px/1 inherit; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  transition: color .18s, border-color .18s, background .18s, box-shadow .2s, transform .12s;
}
.asas-cl-pill:hover { color: #fff; border-color: rgba(255,255,255,.16); transform: translateY(-1px); }
.asas-cl-pill:focus-visible { outline: 2px solid var(--pill-accent); outline-offset: 2px; }
.asas-cl-ico {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 7px; font-size: 12px;
  background: color-mix(in srgb, var(--pill-accent) 18%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pill-accent) 35%, transparent);
}
.asas-cl-n {
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px;
  background: rgba(255,255,255,.07); color: #8fa0bb;
}
.asas-cl-pill.active {
  color: #fff;
  border-color: color-mix(in srgb, var(--pill-accent) 60%, transparent);
  background: linear-gradient(150deg,
      color-mix(in srgb, var(--pill-accent) 26%, transparent),
      color-mix(in srgb, var(--pill-accent) 8%, transparent));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--pill-accent) 25%, transparent),
              0 8px 22px -10px var(--pill-accent);
}
.asas-cl-pill.active .asas-cl-n {
  background: var(--pill-accent); color: #0a0f1e;
}
.asas-cl-pill.active::after {            /* live indicator under the active cluster */
  content: ''; position: absolute; left: 14px; right: 14px; bottom: -9px; height: 2px;
  border-radius: 2px; background: var(--pill-accent);
  box-shadow: 0 0 10px var(--pill-accent);
}

/* Global command search */
.asas-cb-search {
  flex-shrink: 0; display: flex; align-items: center; gap: 7px;
  width: 260px; padding: 6px 8px 6px 11px;
  border-radius: 10px; color: #8fa0bb;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(8,12,24,.55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: border-color .18s, box-shadow .18s, width .2s;
}
.asas-cb-search:focus-within {
  width: 320px;
  border-color: color-mix(in srgb, var(--cl-accent) 60%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cl-accent) 18%, transparent);
}
#asas-cb-search-input {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  color: #eef2f8 !important; -webkit-text-fill-color: #eef2f8 !important;
  font: 500 12.5px/1.2 inherit; font-family: inherit;
}
#asas-cb-search-input::placeholder { color: #6b7a93; -webkit-text-fill-color: #6b7a93; }
#asas-cb-search-input::-webkit-search-cancel-button { filter: invert(.6); }
#asas-cb-search-count { font-size: 10.5px; font-weight: 700; color: var(--cl-accent); white-space: nowrap; }
#asas-cb-search-count:empty { display: none; }
.asas-cb-kbd {
  font: 600 9.5px/1 ui-monospace, Consolas, monospace; color: #6b7a93;
  padding: 3px 5px; border-radius: 5px;
  border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04);
}
.asas-cb-search:focus-within .asas-cb-kbd { display: none; }

/* Category tabs inside the active cluster */
.asas-cbtab.asas-cl-hidden { display: none !important; }
#asas-command-bar .asas-cbtab.active {
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--cl-accent);
}
/* While searching, results cross categories — the category strip steps aside */
#asas-command-bar.asas-cb-searching .asas-cbt-wrap { display: none; }

/* Cards pick up the cluster accent on hover/focus */
#asas-command-bar .asas-cbc:hover,
#asas-command-bar .asas-cbc:focus-visible {
  border-color: color-mix(in srgb, var(--cl-accent) 55%, transparent);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset,
              0 10px 24px -14px color-mix(in srgb, var(--cl-accent) 80%, transparent);
}

/* Collapsed bar keeps only the console head */
#asas-command-bar.collapsed .asas-cl-head { border-bottom: none; }

/* Narrow screens: icon-only pills, full-width search */
@media (max-width: 900px) {
  .asas-cl-head { flex-wrap: wrap; }
  .asas-cb-search, .asas-cb-search:focus-within { width: 100%; order: -1; }
  .asas-cb-kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .asas-cl-pill, .asas-cb-search { transition: none; }
  .asas-cl-pill:hover { transform: none; }
}

/* Adaptive rail tiers (set by fitRail() in JS) */
.asas-cl-short { display: none; }
#asas-command-bar.cl-fit-1 .asas-cl-name  { display: none; }
#asas-command-bar.cl-fit-1 .asas-cl-short { display: inline; }
#asas-command-bar.cl-fit-1 .asas-cl-pill:not(.active) .asas-cl-n { display: none; }
#asas-command-bar.cl-fit-1 .asas-cl-pill { padding: 6px 10px 6px 7px; gap: 6px; }
#asas-command-bar.cl-fit-2 .asas-cl-pill:not(.active) .asas-cl-short { display: none; }
#asas-command-bar.cl-fit-2 .asas-cl-pill:not(.active) { padding: 6px; }

/* Reduced motion for the Concept tab — its pulse is set at higher
   specificity ([data-cat="concept"]) than the general reduced-motion rule
   above, so it kept animating for users who had asked for less motion. */
@media (prefers-reduced-motion: reduce) {
  #asas-app .asas-cbtab.asas-cbtab-featured[data-cat="concept"] { animation: none !important; }
  #asas-app .asas-cbtab.asas-cbtab-featured { animation: none !important; }
}


/* ── Card strip: side arrows, drag and edge fades ─────────────────────── */
.asas-cbc-shell { position: relative; }
#asas-command-bar.collapsed .asas-cbc-shell { display: none; }
#asas-cbc-wrap { cursor: grab; }
#asas-cbc-wrap.asas-dragging, #asas-cbt.asas-dragging { cursor: grabbing; scroll-behavior: auto !important; user-select: none; }
#asas-cbc-wrap.asas-dragging .asas-cbc { pointer-events: none; }
.asas-cbc-nav {
  position: absolute; top: 50%; z-index: 4; transform: translateY(-50%);
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: var(--sf, #131c2e); color: var(--ac, #D4A847);
  border: 1px solid var(--ac, #D4A847);
  box-shadow: 0 4px 14px rgba(0,0,0,.35), 0 0 0 4px color-mix(in srgb, var(--bg, #0a0f1e) 60%, transparent);
  transition: transform .15s, background .15s, opacity .15s;
}
.asas-cbc-nav:hover, .asas-cbc-nav:focus-visible { background: var(--ac, #D4A847); color: var(--an, #0a0f1e); outline: none; }
.asas-cbc-nav:active { transform: translateY(-50%) scale(.94); }
.asas-cbc-nav-l { left: 6px; }
.asas-cbc-nav-r { right: 6px; }
.asas-cbc-nav.hidden { opacity: 0; pointer-events: none; }
/* soft fade at an edge that has more cards behind it */
.asas-cbc-shell::before, .asas-cbc-shell::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 46px; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .2s;
}
.asas-cbc-shell::before { left: 0;  background: linear-gradient(90deg, var(--sb, #111827), transparent); }
.asas-cbc-shell::after  { right: 0; background: linear-gradient(270deg, var(--sb, #111827), transparent); }
.asas-cbc-shell.has-more-l::before, .asas-cbc-shell.has-more-r::after { opacity: .9; }
#asas-app[data-theme^="light-"] .asas-cbc-nav { box-shadow: 0 3px 10px rgba(20,30,50,.18), 0 0 0 4px color-mix(in srgb, var(--bg, #fff) 70%, transparent); }
#asas-app[data-theme^="light-"] .asas-cbc-nav:hover { color: #fff; }
@media (hover: none) { .asas-cbc-nav { width: 30px; height: 30px; } }

/* ── Phones: a compact command bar, so the conversation keeps the screen ── */
@media (max-width: 600px) {
  #asas-command-bar .asas-cb-head, #asas-command-bar .asas-cl-head { padding-top: 6px !important; padding-bottom: 4px !important; gap: 6px !important; }
  #asas-command-bar .asas-cb-search { height: 34px !important; min-height: 34px !important; font-size: 13px !important; }
  #asas-command-bar .asas-cb-search input { font-size: 16px !important; }   /* 16px stops iOS zoom-on-focus */
  #asas-command-bar .asas-cl-pill { min-height: 32px !important; height: 32px !important; padding: 0 8px !important; font-size: 12px !important; border-radius: 10px !important; }
  #asas-command-bar .asas-cl-ico, #asas-command-bar .asas-cl-pill svg { width: 22px !important; height: 22px !important; } #asas-command-bar .asas-cl-ico svg { width: 13px !important; height: 13px !important; }
  #asas-command-bar .asas-cbtab { padding: 6px 9px !important; font-size: 11px !important; min-height: 32px; }
  #asas-command-bar .asas-cbt-wrap { min-height: 34px; }
  #asas-command-bar .asas-cbt-arrow { width: 24px; min-height: 32px; }
  #asas-cbt-toggle { min-height: 26px; font-size: 11px; }
  #asas-cbc-wrap { min-height: 58px !important; padding: 6px 8px !important; gap: 6px !important; }
  #asas-command-bar .asas-cbc { min-width: 118px !important; max-width: 140px !important; padding: 7px 8px !important; border-radius: 10px !important; }
  #asas-command-bar .asas-cbc-name, #asas-command-bar .asas-cbc-title { font-size: 11.5px !important; line-height: 1.25 !important; }
  #asas-command-bar .asas-cbc-icon { width: 24px !important; height: 24px !important; }
  #asas-command-bar .asas-cbc-icon svg { width: 13px !important; height: 13px !important; }
  .asas-cbc-shell::before, .asas-cbc-shell::after { width: 28px; }
}
@media (max-width: 600px) {
  #asas-app #asas-token-quota-row { font-size: 11px !important; padding: 2px 4px 4px !important; line-height: 1.35 !important; }
  #asas-app #asas-input-wrap { padding: 6px 8px !important; border-radius: 16px !important; }
  #asas-app #asas-input { min-height: 38px !important; padding: 6px 4px !important; }
  #asas-app .asas-attach-btn { width: 30px !important; height: 30px !important; }
  #asas-app #asas-footer-note { font-size: 10px !important; margin-top: 4px !important; line-height: 1.3 !important; }
  #asas-app #asas-send { width: 40px !important; height: 40px !important; }
}
