/**
 * FCC Phase 11–12 — Global Command AI Upload Review Pipeline
 * Scoped to .command-ai-upload-*, .command-ai-entry-*, .command-ai-voice-* — mobile-first sheet, desktop modal.
 */

.command-ai-upload-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(20, 14, 16, 0.28);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  opacity: 0;
  transition: opacity 220ms ease, backdrop-filter 220ms ease, -webkit-backdrop-filter 220ms ease;
}

.command-ai-upload-backdrop.is-open {
  opacity: 1;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.command-ai-upload-backdrop.is-closing {
  opacity: 0;
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
}

.command-ai-upload-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(92vh, 720px);
  z-index: 10051;
  background:
    radial-gradient(circle at 14% 0%, rgba(224, 239, 255, 0.9), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(181, 131, 255, 0.2), transparent 36%),
    rgba(255, 250, 247, 0.86);
  -webkit-backdrop-filter: blur(24px) saturate(1.18);
  backdrop-filter: blur(24px) saturate(1.18);
  color: var(--fcc-text-primary, #2d2a29);
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -18px 54px rgba(23, 31, 54, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.command-ai-upload-panel.is-open {
  opacity: 1;
  transform: translateY(0);
}

.command-ai-upload-panel.is-closing {
  opacity: 0;
  transform: translateY(20px);
}

.command-ai-upload-panel-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(92vh, 720px);
  overflow: hidden;
}

.command-ai-upload-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 16px 0;
  -webkit-overflow-scrolling: touch;
}

.command-ai-upload-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 16px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.command-ai-upload-title-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.command-ai-upload-title {
  margin: 0;
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.command-ai-upload-subtitle {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(45, 42, 41, 0.58);
}

.command-ai-upload-close {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  transition: transform 170ms ease, box-shadow 170ms ease, background 170ms ease;
}

.command-ai-upload-close:hover {
  background: rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 22px rgba(45, 42, 41, 0.12);
  transform: translateY(-1px);
}

.command-ai-upload-close:active {
  transform: scale(0.97);
}

.command-ai-upload-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.command-ai-upload-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 80px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.command-ai-upload-textarea:focus {
  border-color: rgba(181, 131, 141, 0.62);
  box-shadow: 0 0 0 4px rgba(181, 131, 141, 0.14);
  outline: none;
}

.command-ai-upload-upload-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(181, 131, 141, 0.24);
  background: linear-gradient(135deg, rgba(255, 250, 247, 0.9), rgba(181, 131, 141, 0.12));
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 8px 20px rgba(181, 131, 141, 0.08);
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

.command-ai-upload-upload-btn:hover {
  border-color: rgba(181, 131, 141, 0.48);
  box-shadow: 0 14px 30px rgba(181, 131, 141, 0.16);
  transform: translateY(-1px);
}

.command-ai-upload-upload-btn:active {
  transform: scale(0.97);
}

.command-ai-upload-upload-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.command-ai-upload-dropzone {
  margin-top: 12px;
  padding: 20px 16px;
  border-radius: 18px;
  border: 1px solid rgba(181, 131, 141, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(255, 232, 214, 0.5)),
    radial-gradient(circle at 20% 15%, rgba(181, 131, 141, 0.16), transparent 36%);
  text-align: center;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74), 0 10px 28px rgba(45, 42, 41, 0.06);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.command-ai-upload-dropzone:hover {
  border-color: rgba(181, 131, 141, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 16px 38px rgba(181, 131, 141, 0.16);
  transform: translateY(-1px);
}

.command-ai-upload-dropzone:active {
  transform: scale(0.97);
}

.command-ai-upload-dropzone.is-drag {
  border-color: #b5838d;
  background:
    linear-gradient(135deg, rgba(255, 250, 247, 0.92), rgba(181, 131, 141, 0.18)),
    radial-gradient(circle at 50% 20%, rgba(181, 131, 141, 0.24), transparent 42%);
  box-shadow: 0 18px 42px rgba(181, 131, 141, 0.2);
}

.command-ai-upload-dropzone.has-file {
  border-color: rgba(88, 133, 106, 0.45);
  background:
    linear-gradient(135deg, rgba(247, 255, 248, 0.9), rgba(210, 236, 218, 0.72)),
    radial-gradient(circle at 18% 16%, rgba(88, 133, 106, 0.2), transparent 36%);
  box-shadow: 0 16px 38px rgba(88, 133, 106, 0.14);
}

.command-ai-upload-file-meta {
  font-size: 13px;
  margin-top: 8px;
  word-break: break-word;
  color: rgba(45, 42, 41, 0.62);
}

.command-ai-upload-preview-img {
  max-width: 100%;
  max-height: 220px;
  margin-top: 12px;
  border-radius: 12px;
  object-fit: contain;
}

.command-ai-upload-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.command-ai-upload-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid rgba(181, 131, 141, 0.18);
  background: rgba(255, 255, 255, 0.58);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(45, 42, 41, 0.04);
  animation: command-ai-chip-in 260ms ease both;
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease, background 170ms ease;
}

.command-ai-upload-chip:nth-child(2) {
  animation-delay: 35ms;
}

.command-ai-upload-chip:nth-child(3) {
  animation-delay: 70ms;
}

.command-ai-upload-chip:nth-child(4) {
  animation-delay: 105ms;
}

.command-ai-upload-chip:nth-child(5) {
  animation-delay: 140ms;
}

.command-ai-upload-chip:hover {
  border-color: rgba(181, 131, 141, 0.42);
  box-shadow: 0 14px 28px rgba(181, 131, 141, 0.14);
  transform: translateY(-2px);
}

.command-ai-upload-chip:active {
  transform: scale(0.97);
}

.command-ai-upload-chip-icon {
  line-height: 1;
}

.command-ai-upload-chip.is-active {
  border-color: rgba(181, 131, 141, 0.66);
  background: linear-gradient(135deg, #b5838d, #e2b6a2);
  color: #fff;
  box-shadow: 0 14px 30px rgba(181, 131, 141, 0.24);
  font-weight: 600;
}

.command-ai-upload-route-preview {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(181, 131, 141, 0.08);
  font-size: 14px;
}

.command-ai-upload-safety-note {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(45, 42, 41, 0.62);
}

.command-ai-upload-mismatch-note {
  margin-top: 0;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 193, 7, 0.12);
  border: 1px solid rgba(255, 152, 0, 0.35);
  font-size: 14px;
}

.command-ai-upload-warning-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.command-ai-upload-warning-chip,
.command-ai-upload-review-badge,
.command-ai-upload-recurrence-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.command-ai-upload-warning-chip {
  padding: 0 10px;
  color: #7a4a00;
  background: rgba(255, 193, 7, 0.16);
  border: 1px solid rgba(255, 152, 0, 0.32);
}

.command-ai-upload-review-badge {
  margin-left: 6px;
  padding: 0 8px;
  color: #7a4a00;
  background: rgba(255, 193, 7, 0.18);
  border: 1px solid rgba(255, 152, 0, 0.34);
  vertical-align: middle;
}

.command-ai-upload-recurrence-pill {
  width: fit-content;
  padding: 0 11px;
  color: #24563a;
  background: rgba(88, 133, 106, 0.13);
  border: 1px solid rgba(88, 133, 106, 0.28);
}

.command-ai-upload-error-msg {
  margin-top: 10px;
  color: #b00020;
  font-size: 14px;
}

.command-ai-upload-footer-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.command-ai-upload-footer-buttons .btn-primary,
.command-ai-upload-footer-buttons .btn-secondary {
  flex: 1;
  min-width: 120px;
  min-height: 46px;
  border-radius: 14px;
  transition: transform 170ms ease, box-shadow 170ms ease, filter 170ms ease;
}

.command-ai-upload-footer-buttons .btn-primary:hover,
.command-ai-upload-footer-buttons .btn-secondary:hover {
  box-shadow: 0 14px 28px rgba(45, 42, 41, 0.12);
  transform: translateY(-1px);
}

.command-ai-upload-footer-buttons .btn-primary:active,
.command-ai-upload-footer-buttons .btn-secondary:active {
  transform: scale(0.97);
}

.command-ai-upload-chooser-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
}

.command-ai-upload-chooser-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.command-ai-upload-chooser-card {
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: transparent;
  text-align: left;
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease, background 170ms ease;
}

.command-ai-upload-chooser-card:hover {
  border-color: rgba(181, 131, 141, 0.38);
  box-shadow: 0 12px 26px rgba(181, 131, 141, 0.14);
  transform: translateY(-1px);
}

.command-ai-upload-chooser-card:active {
  transform: scale(0.97);
}

.command-ai-upload-chooser-card.is-active {
  border-color: rgba(181, 131, 141, 0.64);
  background: linear-gradient(135deg, rgba(181, 131, 141, 0.18), rgba(255, 232, 214, 0.56));
  font-weight: 600;
}

.command-ai-upload-field {
  margin-bottom: 12px;
}

.command-ai-upload-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: rgba(45, 42, 41, 0.76);
}

.command-ai-upload-field input,
.command-ai-upload-field select,
.command-ai-upload-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  font-family: inherit;
  font-size: 16px;
}

.command-ai-upload-review-grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 768px) {
  .command-ai-upload-panel {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, calc(-50% + 20px));
    width: min(700px, 92vw);
    max-height: 88vh;
    border-radius: 30px;
    box-shadow: 0 28px 70px rgba(23, 31, 54, 0.22);
  }

  .command-ai-upload-panel.is-open {
    transform: translate(-50%, -50%);
  }

  .command-ai-upload-panel.is-closing {
    transform: translate(-50%, calc(-50% + 20px));
  }

  .command-ai-upload-review-grid.two-col-at-tablet {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .command-ai-upload-panel {
    width: min(720px, 94vw);
  }

  .command-ai-upload-review-grid.two-col-at-desktop {
    grid-template-columns: 1fr 1fr;
  }
}

body.command-ai-upload-open {
  overflow: hidden;
}

.command-ai-upload-orb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #fff8f2 0 18%, #f2c7b2 38%, #b5838d 72%);
  box-shadow:
    0 0 0 4px rgba(181, 131, 141, 0.12),
    0 0 24px rgba(181, 131, 141, 0.38);
  flex-shrink: 0;
  opacity: 0.86;
  animation: command-ai-orb-breathe 2.8s ease-in-out infinite;
}

.command-ai-upload-header-orb {
  width: 34px;
  height: 34px;
  margin-top: 1px;
  box-shadow:
    0 0 0 7px rgba(181, 131, 141, 0.1),
    0 0 34px rgba(181, 131, 141, 0.4);
}

.command-ai-upload-panel.is-listening .command-ai-upload-orb,
.command-ai-entry-wrap.is-listening .command-ai-upload-orb,
body.command-ai-voice-listening .command-ai-upload-orb {
  animation-duration: 1s;
  opacity: 1;
}

.command-ai-upload-section-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.command-ai-chat-shell {
  display: flex;
  flex-direction: column;
  height: min(82vh, 760px);
  max-height: min(82vh, 760px);
}

.command-ai-chat-messages {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 6px;
  scroll-behavior: smooth;
}

.command-ai-chat-bubble {
  max-width: min(92%, 560px);
  padding: 14px 16px;
  border-radius: 22px;
  line-height: 1.42;
  font-size: 15px;
}

.command-ai-chat-bubble--assistant {
  align-self: flex-start;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(238, 244, 255, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 34px rgba(62, 75, 112, 0.1);
}

.command-ai-chat-bubble--user {
  align-self: flex-end;
  background: linear-gradient(135deg, #4f7cff, #735cff);
  border: 1px solid rgba(255, 255, 255, 0.62);
  color: #fff;
  box-shadow: 0 14px 34px rgba(79, 124, 255, 0.18);
}

.command-ai-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 2px;
}

.command-ai-chat-chip {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(104, 120, 190, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: rgba(38, 45, 68, 0.94);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(70, 88, 140, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.command-ai-chat-chip:hover {
  border-color: rgba(104, 120, 190, 0.36);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(235, 240, 255, 0.78));
  box-shadow: 0 16px 34px rgba(70, 88, 140, 0.14);
  transform: translateY(-2px);
}

.command-ai-chat-chip:active {
  transform: scale(0.97);
}

.command-ai-composer-wrap {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin: 0 -16px;
  padding: 8px 12px 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.96),
    rgba(255, 255, 255, 0.82)
  );
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.command-ai-actions,
.ask-fcc-confirm-row {
  margin-bottom: 6px;
}

.command-ai-composer-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid rgba(104, 120, 190, 0.18);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 42px rgba(62, 75, 112, 0.14);
}

.command-ai-composer-input {
  flex: 1 1 auto;
  min-width: 0;
  max-height: 120px;
  min-height: 38px;
  padding: 9px 4px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 16px;
  line-height: 1.3;
  resize: none;
  outline: none;
}

.command-ai-composer-tool,
.command-ai-composer-send {
  flex: 0 0 auto;
  min-width: 38px;
  min-height: 38px;
  border: 0;
  border-radius: 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 170ms ease, box-shadow 170ms ease, opacity 170ms ease;
}

.command-ai-composer-tool {
  background: rgba(104, 120, 190, 0.12);
  color: #46558f;
  font-size: 22px;
  line-height: 1;
}

.command-ai-composer-send {
  padding: 0 14px;
  background: linear-gradient(135deg, #4f7cff, #9b7bff);
  color: #fff;
  box-shadow: 0 10px 24px rgba(79, 124, 255, 0.24);
}

.command-ai-composer-send:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.command-ai-composer-tool:hover,
.command-ai-composer-send:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(79, 124, 255, 0.18);
}

.command-ai-composer-tool:active,
.command-ai-composer-send:not(:disabled):active {
  transform: scale(0.97);
}

.command-ai-composer-mic {
  width: 38px;
  height: 38px;
  border-radius: 16px;
}

.command-ai-chat-helper {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(45, 42, 41, 0.52);
  text-align: center;
}

.command-ai-chat-route-card {
  display: grid;
  gap: 10px;
  max-width: min(100%, 560px);
  padding: 16px;
  border: 1px solid rgba(104, 120, 190, 0.18);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(235, 240, 255, 0.7));
  box-shadow: 0 18px 42px rgba(62, 75, 112, 0.12);
}

.command-ai-chat-route-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.command-ai-chat-route-card span,
.command-ai-chat-route-card p,
.command-ai-chat-nudge {
  margin: 0;
  font-size: 13px;
  color: rgba(45, 42, 41, 0.62);
}

.command-ai-chat-route-card strong {
  text-align: right;
}

.command-ai-chat-nudge {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(79, 124, 255, 0.08);
  color: #46558f;
  font-weight: 700;
}

.command-ai-chat-route-actions {
  margin-top: auto;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0));
}

/* Phase 12 — scoped only: .command-ai-upload-*, .command-ai-entry-*, .command-ai-voice-* */

.command-ai-intel-card {
  width: min(100%, 440px);
  padding: 12px;
  border: 1px solid rgba(86, 109, 160, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(52, 64, 94, 0.1);
}

.command-ai-intel-card strong,
.command-ai-intel-card span {
  display: block;
}

.command-ai-intel-card strong {
  color: #2d2a29;
  font-size: 14px;
}

.command-ai-intel-card span,
.command-ai-intel-card li {
  color: rgba(45, 42, 41, 0.68);
  font-size: 13px;
  line-height: 1.35;
}

.command-ai-intel-card ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.command-ai-intel-choice {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(88, 111, 168, 0.2);
  border-radius: 8px;
  background: rgba(79, 124, 255, 0.08);
  color: #34406f;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.command-ai-intel-choice:hover {
  background: rgba(79, 124, 255, 0.14);
}

.command-ai-intel-actions {
  gap: 10px;
  flex-wrap: wrap;
}

.command-ai-intel-action {
  min-width: 0;
}

.command-ai-upload-extract-status {
  min-height: 1.25em;
  margin-bottom: 8px;
}

.command-ai-upload-voice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.command-ai-upload-voice-hint {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: rgba(45, 42, 41, 0.58);
  transition: color 180ms ease, opacity 180ms ease;
}

.command-ai-upload-voice-hint.is-listening {
  color: #8d4f5a;
  font-weight: 700;
}

.command-ai-voice-mic {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(181, 131, 141, 0.12);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235c4a4d' stroke-width='2'%3E%3Cpath d='M12 14a3 3 0 0 0 3-3V7a3 3 0 1 0-6 0v4a3 3 0 0 0 3 3z'/%3E%3Cpath d='M19 11v1a7 7 0 0 1-14 0v-1'/%3E%3Cline x1='12' y1='17' x2='12' y2='22'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px 22px;
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease, background-color 170ms ease;
}

.command-ai-voice-mic:hover {
  border-color: rgba(181, 131, 141, 0.46);
  box-shadow: 0 12px 26px rgba(181, 131, 141, 0.16);
  transform: translateY(-1px);
}

.command-ai-voice-mic:active {
  transform: scale(0.97);
}

.command-ai-voice-mic.is-listening {
  border-color: rgba(181, 131, 141, 0.72);
  box-shadow: 0 0 0 3px rgba(181, 131, 141, 0.45), 0 16px 34px rgba(181, 131, 141, 0.22);
  animation: command-ai-voice-pulse 820ms ease-in-out infinite;
}

.command-ai-voice-mic.is-disabled,
.command-ai-voice-mic:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@keyframes command-ai-voice-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(181, 131, 141, 0.25);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(181, 131, 141, 0.12);
  }
}

@keyframes command-ai-orb-breathe {
  0%,
  100% {
    opacity: 0.78;
    transform: scale(0.92);
    box-shadow:
      0 0 0 4px rgba(181, 131, 141, 0.1),
      0 0 18px rgba(181, 131, 141, 0.28);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
    box-shadow:
      0 0 0 7px rgba(181, 131, 141, 0.16),
      0 0 34px rgba(181, 131, 141, 0.48);
  }
}

@keyframes command-ai-chip-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.command-ai-entry-host--header {
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
}

.command-ai-entry-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.command-ai-entry-host--header .command-ai-entry-wrap {
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.command-ai-entry-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  max-width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  white-space: nowrap;
  transition: transform 170ms ease, box-shadow 170ms ease, background 170ms ease, border-color 170ms ease;
}

.command-ai-entry-pill:hover {
  border-color: rgba(255, 255, 255, 0.58);
  box-shadow: 0 12px 28px rgba(45, 42, 41, 0.14);
  transform: translateY(-1px);
}

.command-ai-entry-pill:active {
  transform: scale(0.97);
}

.command-ai-entry-orb {
  width: 10px;
  height: 10px;
}

.command-ai-entry-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.command-ai-entry-examples {
  width: 100%;
  text-align: center;
  line-height: 1.35;
}

.command-ai-entry-host--header .command-ai-entry-examples,
.command-ai-entry-host--header .command-ai-entry-voice {
  display: none;
}

.command-ai-entry-voice {
  flex-shrink: 0;
}

.command-ai-entry-host--mobile .command-ai-entry-wrap {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: min(128px, 32vw);
}

#fccCommandAiMobileEntry.command-ai-entry-host--mobile .command-ai-entry-pill {
  padding: 6px 9px;
  min-height: 40px;
  max-width: 100%;
}

#fccCommandAiMobileEntry.command-ai-entry-host--mobile .command-ai-entry-label {
  max-width: 42px;
  font-size: 12px;
}

#fccCommandAiMobileEntry.command-ai-entry-host--mobile .command-ai-entry-examples {
  display: none;
}

#fccCommandAiMobileEntry.command-ai-entry-host--mobile .command-ai-entry-voice {
  display: none;
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  border-radius: 10px;
  background-size: 18px 18px;
}

.command-ai-entry-host--dashboard {
  margin: 0 0 12px;
}

.command-ai-entry-host--dashboard .command-ai-entry-wrap {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 250, 247, 0.95);
}

.command-ai-entry-host--dashboard .command-ai-entry-examples {
  width: auto;
  flex: 1 1 100%;
  text-align: left;
}

.command-ai-upload-field-badge-review {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #a65d57;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Voice help only — does not start SpeechRecognition (see #commandAiComposerMic). */
.ask-fcc-voice-btn {
  border: 0;
  border-radius: 999px;
  min-width: 36px;
  min-height: 36px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
  cursor: pointer;
}

.ask-fcc-voice-btn:active {
  transform: scale(0.97);
}

@media (max-width: 389px) {
  .ask-fcc-composer-bar .ask-fcc-voice-btn {
    display: none;
  }
}

@media (max-width: 380px) {
  #fccCommandAiMobileEntry.command-ai-entry-host--mobile .command-ai-entry-label {
    display: none;
  }

  .command-ai-composer-bar {
    gap: 6px;
    padding: 7px;
  }

  .command-ai-composer-send {
    padding: 0 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .command-ai-upload-backdrop,
  .command-ai-upload-panel,
  .command-ai-upload-close,
  .command-ai-upload-textarea,
  .command-ai-upload-upload-btn,
  .command-ai-upload-dropzone,
  .command-ai-upload-chip,
  .command-ai-upload-footer-buttons .btn-primary,
  .command-ai-upload-footer-buttons .btn-secondary,
  .command-ai-upload-chooser-card,
  .command-ai-voice-mic,
  .command-ai-entry-pill,
  .command-ai-chat-chip,
  .command-ai-composer-tool,
  .command-ai-composer-send {
    transition: none;
  }

  .command-ai-upload-orb,
  .command-ai-voice-mic.is-listening,
  .command-ai-upload-chip {
    animation: none;
  }
}

/* FCC UI polish v1 — brain-led Ask FCC surfaces */
.command-ai-brain {
  display: inline-block;
  flex: 0 0 auto;
  object-fit: contain;
  filter:
    drop-shadow(0 0 7px rgba(65, 116, 255, 0.58))
    drop-shadow(0 0 16px rgba(140, 92, 255, 0.44));
  animation: command-ai-brain-breathe 3.2s ease-in-out infinite;
}

.command-ai-brain--active,
.command-ai-upload-panel.is-open .command-ai-upload-header-brain {
  filter:
    drop-shadow(0 0 9px rgba(65, 116, 255, 0.68))
    drop-shadow(0 0 22px rgba(140, 92, 255, 0.54));
}

.command-ai-brain--listening,
.command-ai-upload-panel.is-listening .command-ai-brain,
.command-ai-entry-wrap.is-listening .command-ai-brain,
body.command-ai-voice-listening .command-ai-brain {
  animation: command-ai-brain-listening 900ms ease-in-out infinite;
  filter:
    drop-shadow(0 0 11px rgba(42, 135, 255, 0.86))
    drop-shadow(0 0 28px rgba(132, 92, 255, 0.7));
}

.command-ai-upload-header-brain {
  width: 48px;
  height: 48px;
  margin-top: -2px;
}

.command-ai-entry-brain {
  width: 38px;
  height: 38px;
  margin: -5px 2px -5px -6px;
}

.command-ai-entry-host--header {
  flex: 1 1 440px;
  max-width: 580px;
}

.command-ai-entry-host--header .command-ai-entry-wrap {
  width: 100%;
}

.command-ai-entry-host--header .command-ai-entry-pill {
  flex: 1 1 auto;
  justify-content: flex-start;
  min-width: min(440px, 42vw);
  padding: 10px 18px;
  border-color: rgba(119, 133, 255, 0.25);
  background: rgba(255, 255, 255, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 36px rgba(64, 96, 210, 0.16),
    0 0 0 5px rgba(116, 93, 255, 0.06);
  color: #071d55;
}

.command-ai-entry-host--header .command-ai-entry-label {
  max-width: none;
  font-size: 15px;
  font-weight: 800;
}

.command-ai-entry-host--header .command-ai-entry-voice {
  display: inline-flex;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.78);
  border-color: rgba(119, 133, 255, 0.18);
  box-shadow: 0 8px 24px rgba(64, 96, 210, 0.12);
}

.command-ai-upload-panel {
  background:
    radial-gradient(circle at 14% 0%, rgba(220, 236, 255, 0.92), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(164, 138, 255, 0.24), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 249, 255, 0.9));
  color: #0b1f55;
}

.command-ai-upload-header {
  align-items: center;
  padding: 20px 20px 14px;
  border-bottom-color: rgba(108, 122, 200, 0.12);
}

.command-ai-upload-title {
  color: #081f58;
  letter-spacing: 0;
}

.command-ai-upload-subtitle {
  color: rgba(8, 31, 88, 0.55);
}

.command-ai-upload-close {
  border-radius: 16px;
  background: rgba(239, 244, 255, 0.9);
  color: #081f58;
}

.command-ai-chat-bubble--assistant {
  position: relative;
  margin-left: 32px;
  color: #0b1f55;
}

.command-ai-chat-bubble--assistant::before {
  content: '';
  position: absolute;
  left: -34px;
  top: 12px;
  width: 26px;
  height: 26px;
  background: url('/Assets/Logo/fcc-ai-brain.png') center / contain no-repeat;
  filter:
    drop-shadow(0 0 6px rgba(65, 116, 255, 0.58))
    drop-shadow(0 0 14px rgba(140, 92, 255, 0.42));
}

.command-ai-chat-chip,
.command-ai-upload-chip {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(104, 120, 190, 0.16);
  color: #102764;
}

.command-ai-composer-wrap {
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.96),
    rgba(255, 255, 255, 0.82)
  );
}

.command-ai-composer-send {
  width: 38px;
  padding: 0;
  border-radius: 999px;
  font-size: 0;
  position: relative;
}

.command-ai-composer-send::before {
  content: '↑';
  font-size: 20px;
  line-height: 1;
}

.command-ai-upload-dropzone {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(239, 245, 255, 0.82)),
    radial-gradient(circle at 18% 16%, rgba(92, 135, 255, 0.14), transparent 34%);
  border-color: rgba(104, 120, 190, 0.18);
}

#fccCommandAiMobileEntry.command-ai-entry-host--mobile {
  flex: 1 0 100%;
  order: 4;
  max-width: none;
  width: 100%;
  padding: 4px 6px 0;
}

#fccCommandAiMobileEntry.command-ai-entry-host--mobile .command-ai-entry-wrap {
  width: min(100%, 430px);
  max-width: none;
  margin: 0 auto;
}

#fccCommandAiMobileEntry.command-ai-entry-host--mobile .command-ai-entry-pill {
  flex: 1 1 auto;
  justify-content: flex-start;
  min-height: 46px;
  padding: 8px 12px;
  border-color: rgba(119, 133, 255, 0.22);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 10px 28px rgba(64, 96, 210, 0.14);
}

#fccCommandAiMobileEntry.command-ai-entry-host--mobile .command-ai-entry-label {
  display: inline;
  max-width: none;
  font-size: 14px;
}

#fccCommandAiMobileEntry.command-ai-entry-host--mobile .command-ai-entry-voice {
  display: none !important;
}

#fccCommandAiMobileEntry.command-ai-entry-host--mobile .command-ai-entry-examples {
  display: none !important;
}

#fccCommandAiDashboardEntry,
.command-ai-entry-host--dashboard {
  display: none !important;
}

@media (max-width: 767px) {
  #fccCommandAiMobileEntry.command-ai-entry-host--mobile {
    flex: 1 0 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  #fccCommandAiMobileEntry.command-ai-entry-host--mobile .command-ai-entry-wrap,
  #fccCommandAiMobileEntry.command-ai-entry-host--mobile .command-ai-entry-pill {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}

@keyframes command-ai-brain-breathe {
  0%, 100% {
    transform: scale(0.98);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes command-ai-brain-listening {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

/* --- Ask FCC chat-first (scoped .ask-fcc-* under panel only) --- */
.command-ai-upload-panel-inner.fcc-ios-page {
  flex: 1 1 auto;
  min-height: 0;
}

.command-ai-upload-panel .ask-fcc-chat-shell,
.command-ai-upload-panel .ask-fcc-card,
.command-ai-upload-panel .fcc-ask-card,
.command-ai-upload-panel .ask-fcc-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.command-ai-upload-panel .ask-fcc-chat-thread,
.command-ai-upload-panel .ask-fcc-messages,
.command-ai-upload-panel .fcc-ask-messages,
.command-ai-upload-panel .ask-fcc-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px 12px;
}

.command-ai-upload-panel .ask-fcc-composer,
.command-ai-upload-panel .fcc-ask-composer,
.command-ai-upload-panel .ask-fcc-input-bar {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding: 10px 12px max(14px, env(safe-area-inset-bottom, 0px));
  padding-left: calc(12px + env(safe-area-inset-left, 0px));
  padding-right: calc(12px + env(safe-area-inset-right, 0px));
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.96));
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.command-ai-upload-panel .ask-fcc-composer-inner,
.command-ai-upload-panel .fcc-ask-composer-inner,
.command-ai-upload-panel .ask-fcc-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.command-ai-upload-panel .ask-fcc-composer-bar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.command-ai-upload-panel .ask-fcc-composer-input,
.command-ai-upload-panel .ask-fcc-composer textarea,
.command-ai-upload-panel .fcc-ask-input,
.command-ai-upload-panel .ask-fcc-input {
  width: 100%;
  min-width: 0;
  min-height: 64px;
  max-height: 140px;
  resize: none;
  overflow-y: auto;
  border-radius: 20px;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.4;
  box-sizing: border-box;
}

.command-ai-upload-panel .ask-fcc-composer-tool {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(119, 133, 255, 0.35);
  background: rgba(255, 255, 255, 0.85);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.command-ai-upload-panel .ask-fcc-composer-send {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 14px;
}

.command-ai-upload-panel .ask-fcc-message {
  margin-bottom: 14px;
}

.command-ai-upload-panel .ask-fcc-bubble {
  border-radius: 16px;
  padding: 12px 14px;
  max-width: 100%;
  word-break: break-word;
}

.command-ai-upload-panel .ask-fcc-bubble--user {
  margin-left: auto;
  max-width: min(92%, 420px);
  background: rgba(119, 133, 255, 0.14);
  border: 1px solid rgba(119, 133, 255, 0.22);
}

.command-ai-upload-panel .ask-fcc-bubble--assistant {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.command-ai-upload-panel .ask-fcc-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.command-ai-upload-panel .ask-fcc-route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.command-ai-upload-panel .ask-fcc-intel-actions {
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.command-ai-upload-panel .ask-fcc-preview-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.command-ai-upload-panel .ask-fcc-inline-card {
  border-radius: 14px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.65);
}

.command-ai-upload-panel .ask-fcc-preview-toolbar {
  margin-top: 14px;
}

.command-ai-upload-panel .ask-fcc-attachment-preview {
  display: flex;
  align-items: center;
  gap: 10px;
}

.command-ai-upload-panel .ask-fcc-attach-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
}

.command-ai-upload-panel .ask-fcc-hidden-inputs {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.command-ai-upload-panel .ask-fcc-attachment-backdrop {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(15, 12, 14, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 160ms ease;
}

.command-ai-upload-panel .ask-fcc-attachment-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.command-ai-upload-panel .ask-fcc-attachment-menu {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 252, 249, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 14px 40px rgba(23, 31, 54, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.command-ai-upload-panel .ask-fcc-attachment-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.command-ai-upload-panel .ask-fcc-att-item {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(119, 133, 255, 0.18);
  background: rgba(255, 255, 255, 0.88);
  text-align: left;
  font-size: 16px;
  cursor: pointer;
}

.command-ai-upload-panel .ask-fcc-att-item--quiet {
  font-size: 14px;
  opacity: 0.85;
}

.command-ai-upload-panel-inner {
  position: relative;
}

@media (max-width: 520px) {
  .command-ai-upload-panel .ask-fcc-chat-shell,
  .command-ai-upload-panel .ask-fcc-card,
  .command-ai-upload-panel .fcc-ask-card,
  .command-ai-upload-panel .ask-fcc-panel {
    min-height: calc(100dvh - 70px);
  }

  .command-ai-upload-panel .ask-fcc-composer-bar {
    grid-template-columns: 42px minmax(0, 1fr) auto auto;
  }
}

@media (min-width: 768px) {
  .command-ai-upload-panel .ask-fcc-chat-thread,
  .command-ai-upload-panel .ask-fcc-messages,
  .command-ai-upload-panel .fcc-ask-messages,
  .command-ai-upload-panel .ask-fcc-thread {
    padding: 16px 20px 12px;
  }

  .command-ai-upload-panel .ask-fcc-composer,
  .command-ai-upload-panel .fcc-ask-composer,
  .command-ai-upload-panel .ask-fcc-input-bar {
    padding-left: calc(20px + env(safe-area-inset-left, 0px));
    padding-right: calc(20px + env(safe-area-inset-right, 0px));
  }
}

/* --- Ask FCC Phase 20260505: chat shell, composer (form system), typing/thinking, chips, swipe --- */
.command-ai-upload-panel #askFccChatShell.command-ai-chat-shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: min(82vh, 760px);
  max-height: min(82vh, 760px);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.command-ai-upload-panel #askFccChatShell.command-ai-chat-shell.fcc-ask-dragging {
  transition: none;
}

.command-ai-upload-panel #askFccChatThread.command-ai-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 12px 14px 6px;
}

.command-ai-upload-panel #askFccComposer.ask-fcc-composer {
  flex: 0 0 auto;
  min-height: 0;
}

.command-ai-upload-panel .command-ai-composer-wrap {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 20;
  padding: 8px 12px 10px;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.96),
    rgba(255, 255, 255, 0.82)
  );
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.command-ai-upload-panel .command-ai-composer-wrap .ask-fcc-composer-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.command-ai-upload-panel .command-ai-composer-bar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px 44px;
  align-items: end;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid rgba(104, 120, 190, 0.18);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 42px rgba(62, 75, 112, 0.14);
}

.command-ai-upload-panel .ask-fcc-composer-input,
.command-ai-upload-panel .command-ai-input,
.command-ai-upload-panel .command-ai-composer-wrap textarea.command-ai-composer-input {
  width: 100%;
  min-width: 0;
  min-height: 64px;
  max-height: 140px;
  resize: none;
  overflow-y: auto;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.86);
  box-shadow:
    inset 0 1px 2px rgba(15, 23, 42, 0.06),
    0 8px 22px rgba(15, 23, 42, 0.06);
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.4;
  box-sizing: border-box;
  outline: none;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.14s ease;
}

.command-ai-upload-panel .ask-fcc-composer-input:focus,
.command-ai-upload-panel .command-ai-input:focus,
.command-ai-upload-panel .command-ai-composer-wrap textarea.command-ai-composer-input:focus {
  border-color: rgba(94, 114, 255, 0.42);
  box-shadow:
    inset 0 1px 2px rgba(15, 23, 42, 0.05),
    0 0 0 4px rgba(94, 114, 255, 0.12),
    0 10px 28px rgba(94, 114, 255, 0.1);
}

.command-ai-upload-panel .command-ai-composer-wrap button {
  min-width: 42px;
  min-height: 42px;
  border-radius: 16px;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.command-ai-upload-panel .command-ai-composer-wrap button:active {
  transform: scale(0.96);
}

.fcc-ask-typing-preview {
  flex: 0 0 auto;
  align-self: flex-end;
  max-width: 82%;
  margin: 6px 14px 8px auto;
  padding: 10px 13px;
  border-radius: 18px 18px 6px 18px;
  background: rgba(220, 226, 255, 0.92);
  color: #1f2a44;
  font-size: 14px;
  line-height: 1.35;
  box-shadow: 0 8px 22px rgba(57, 75, 160, 0.12);
  white-space: pre-wrap;
  word-break: break-word;
}

.fcc-ask-typing-preview[hidden] {
  display: none !important;
}

.fcc-ask-thinking-row {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 14px 6px;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.07);
  color: rgba(31, 42, 68, 0.72);
  font-size: 13px;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.fcc-ask-thinking-row[hidden] {
  display: none !important;
}

.fcc-ask-thinking-orb {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: radial-gradient(circle, #7c8cff, #b58cff);
  box-shadow: 0 0 0 rgba(124, 140, 255, 0.35);
  animation: fccAskThinkingPulse 1.15s ease-in-out infinite;
}

@keyframes fccAskThinkingPulse {
  0%,
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(124, 140, 255, 0.35);
  }
  50% {
    transform: scale(1.18);
    box-shadow: 0 0 0 7px rgba(124, 140, 255, 0);
  }
}

.fcc-ask-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.fcc-ask-choice-chip {
  border: 1px solid rgba(94, 114, 255, 0.22);
  background: rgba(244, 246, 255, 0.92);
  color: #26345f;
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.fcc-ask-choice-chip:active {
  transform: scale(0.97);
}

@media (max-width: 520px) {
  .command-ai-upload-panel #askFccChatShell.command-ai-chat-shell {
    height: calc(100dvh - 70px);
    max-height: calc(100dvh - 70px);
    min-height: 0;
  }

  .command-ai-upload-panel .command-ai-composer-wrap {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .command-ai-upload-panel .command-ai-composer-bar {
    grid-template-columns: 42px minmax(0, 1fr) 42px 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .command-ai-upload-panel #askFccChatShell.command-ai-chat-shell {
    transition: none;
  }

  .fcc-ask-thinking-orb {
    animation: none;
  }
}

/* --- Ask FCC Phase 20260505: chat shell, composer (form system), typing/thinking, chips, swipe --- */
.command-ai-upload-panel #askFccChatShell.command-ai-chat-shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: min(82vh, 760px);
  max-height: min(82vh, 760px);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.command-ai-upload-panel #askFccChatShell.command-ai-chat-shell.fcc-ask-dragging {
  transition: none;
}

.command-ai-upload-panel #askFccChatThread.command-ai-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 12px 14px 6px;
}

.command-ai-upload-panel #askFccComposer.ask-fcc-composer {
  flex: 0 0 auto;
  min-height: 0;
}

.command-ai-upload-panel .command-ai-composer-wrap {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 20;
  padding: 8px 12px 10px;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.96),
    rgba(255, 255, 255, 0.82)
  );
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.command-ai-upload-panel .command-ai-composer-wrap .ask-fcc-composer-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.command-ai-upload-panel .command-ai-composer-bar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px 44px;
  align-items: end;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid rgba(104, 120, 190, 0.18);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 42px rgba(62, 75, 112, 0.14);
}

.command-ai-upload-panel .command-ai-composer-wrap .ask-fcc-composer-voice-hint {
  grid-column: 1 / -1;
}

.command-ai-upload-panel .ask-fcc-composer-input,
.command-ai-upload-panel .command-ai-input,
.command-ai-upload-panel .command-ai-composer-wrap textarea.command-ai-composer-input {
  width: 100%;
  min-width: 0;
  min-height: 64px;
  max-height: 140px;
  resize: none;
  overflow-y: auto;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.86);
  box-shadow:
    inset 0 1px 2px rgba(15, 23, 42, 0.06),
    0 8px 22px rgba(15, 23, 42, 0.06);
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.4;
  box-sizing: border-box;
  outline: none;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.14s ease;
}

.command-ai-upload-panel .ask-fcc-composer-input:focus,
.command-ai-upload-panel .command-ai-input:focus,
.command-ai-upload-panel .command-ai-composer-wrap textarea.command-ai-composer-input:focus {
  border-color: rgba(94, 114, 255, 0.42);
  box-shadow:
    inset 0 1px 2px rgba(15, 23, 42, 0.05),
    0 0 0 4px rgba(94, 114, 255, 0.12),
    0 10px 28px rgba(94, 114, 255, 0.1);
}

.command-ai-upload-panel .command-ai-composer-wrap button {
  min-width: 42px;
  min-height: 42px;
  border-radius: 16px;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.command-ai-upload-panel .command-ai-composer-wrap button:active {
  transform: scale(0.96);
}

.fcc-ask-typing-preview {
  flex: 0 0 auto;
  align-self: flex-end;
  max-width: 82%;
  margin: 6px 14px 8px auto;
  padding: 10px 13px;
  border-radius: 18px 18px 6px 18px;
  background: rgba(220, 226, 255, 0.92);
  color: #1f2a44;
  font-size: 14px;
  line-height: 1.35;
  box-shadow: 0 8px 22px rgba(57, 75, 160, 0.12);
  white-space: pre-wrap;
  word-break: break-word;
}

.fcc-ask-typing-preview[hidden] {
  display: none !important;
}

.fcc-ask-thinking-row {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 14px 6px;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.07);
  color: rgba(31, 42, 68, 0.72);
  font-size: 13px;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.fcc-ask-thinking-row[hidden] {
  display: none !important;
}

.fcc-ask-thinking-orb {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: radial-gradient(circle, #7c8cff, #b58cff);
  box-shadow: 0 0 0 rgba(124, 140, 255, 0.35);
  animation: fccAskThinkingPulse 1.15s ease-in-out infinite;
}

@keyframes fccAskThinkingPulse {
  0%,
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(124, 140, 255, 0.35);
  }
  50% {
    transform: scale(1.18);
    box-shadow: 0 0 0 7px rgba(124, 140, 255, 0);
  }
}

.fcc-ask-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.fcc-ask-choice-chip {
  border: 1px solid rgba(94, 114, 255, 0.22);
  background: rgba(244, 246, 255, 0.92);
  color: #26345f;
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.fcc-ask-choice-chip:active {
  transform: scale(0.97);
}

@media (max-width: 520px) {
  .command-ai-upload-panel #askFccChatShell.command-ai-chat-shell {
    height: calc(100dvh - 70px);
    max-height: calc(100dvh - 70px);
    min-height: 0;
  }

  .command-ai-upload-panel .command-ai-composer-wrap {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .command-ai-upload-panel .command-ai-composer-bar {
    grid-template-columns: 42px minmax(0, 1fr) 42px 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .command-ai-upload-panel #askFccChatShell.command-ai-chat-shell {
    transition: none;
  }

  .fcc-ask-thinking-orb {
    animation: none;
  }
}

/* Ask FCC final cascade guard: keep mobile composer horizontal and single-mic. */
.command-ai-upload-panel .ask-fcc-composer .ask-fcc-composer-bar {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.command-ai-upload-panel .ask-fcc-composer .ask-fcc-composer-bar .ask-fcc-voice-btn {
  display: none !important;
}

.command-ai-upload-panel .ask-fcc-composer .ask-fcc-composer-bar #commandAiAttachBtn,
.command-ai-upload-panel .ask-fcc-composer .ask-fcc-composer-bar .ask-fcc-voice-mic,
.command-ai-upload-panel .ask-fcc-composer .ask-fcc-composer-bar #commandAiComposerSend {
  flex: 0 0 38px !important;
  width: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  align-items: center;
  justify-content: center;
}

.command-ai-upload-panel .ask-fcc-composer .ask-fcc-composer-bar #commandAiAttachBtn,
.command-ai-upload-panel .ask-fcc-composer .ask-fcc-composer-bar .ask-fcc-voice-mic {
  display: inline-flex;
}

.command-ai-upload-panel .ask-fcc-composer .ask-fcc-composer-bar #commandAiComposerSend {
  display: none;
  font-size: 0;
  border-radius: 999px;
}

.command-ai-upload-panel .ask-fcc-composer .ask-fcc-composer-bar #commandAiComposerSend::before {
  content: ">";
  font-size: 18px;
  line-height: 1;
}

.command-ai-upload-panel .ask-fcc-composer .ask-fcc-composer-bar.is-ready-to-send .ask-fcc-voice-mic {
  display: none;
}

.command-ai-upload-panel .ask-fcc-composer .ask-fcc-composer-bar.is-ready-to-send #commandAiComposerSend {
  display: inline-flex;
}

.command-ai-upload-panel .ask-fcc-composer .ask-fcc-composer-bar .ask-fcc-composer-input,
.command-ai-upload-panel .ask-fcc-composer .ask-fcc-composer-bar textarea.command-ai-composer-input {
  display: block;
  flex: 1 1 auto;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  resize: none;
  white-space: normal !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .command-ai-upload-panel .ask-fcc-composer .command-ai-composer-wrap {
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .command-ai-upload-panel .ask-fcc-composer .ask-fcc-composer-inner {
    gap: 6px;
  }

  .command-ai-upload-panel .ask-fcc-composer .ask-fcc-composer-bar {
    padding: 6px;
    border-radius: 22px;
  }

  .command-ai-upload-panel .ask-fcc-composer .ask-fcc-composer-bar .ask-fcc-composer-input,
  .command-ai-upload-panel .ask-fcc-composer .ask-fcc-composer-bar textarea.command-ai-composer-input {
    min-height: 38px !important;
    max-height: 118px !important;
    padding: 8px 10px !important;
    line-height: 1.35;
  }

  .command-ai-upload-panel .ask-fcc-composer .ask-fcc-composer-voice-hint {
    display: none;
  }
}
