.acx-stage {
  --acx-paper: #f8f9fc;
  --acx-surface: #fff;
  --acx-ink: #172044;
  --acx-copy: #455072;
  --acx-muted: #7882a0;
  --acx-line: #e4e8f1;
  --acx-violet: #5538d5;
  --acx-violet-soft: #eeeafe;
  --acx-blue: #1967d2;
  --acx-green: #138466;
  --acx-green-soft: #edf8f4;
  --acx-amber: #9a6510;
  --acx-amber-soft: #fff8e8;
  --acx-red: #b53d52;
  --acx-red-soft: #fff1f3;
  width: 100%;
  height: 100%;
  font-family: Inter, Arial, sans-serif;
  color: var(--acx-ink);
}

.acx-stage *,
.acx-stage *::before,
.acx-stage *::after { box-sizing: border-box; }

.acx-shell {
  position: relative;
  display: grid;
  grid-template-rows: 66px minmax(0, 1fr) 102px;
  width: 100%;
  height: 100%;
  overflow: clip;
  border-radius: 35px;
  background: var(--acx-paper);
}

.acx-header {
  position: relative;
  z-index: 3;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--acx-line);
  background: var(--acx-surface);
}

.acx-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.acx-brand-logo {
  width: 118px;
  height: auto;
  object-fit: contain;
}

.acx-header-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.acx-icon-button,
.acx-composer-button,
.acx-panel-close,
.acx-voice-cancel,
.acx-voice-confirm {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.acx-icon-button {
  position: relative;
  display: grid;
  width: 40px;
  min-height: 40px;
  place-items: center;
  border-radius: 10px;
  color: var(--acx-copy);
  background: transparent;
}

.acx-icon-button:hover { color: var(--acx-violet); background: var(--acx-violet-soft); }
.acx-action-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.acx-work-button { width: auto; grid-auto-flow: column; gap: 6px; padding-inline: 9px; }
.acx-work-button .acx-action-text { position: static; width: auto; height: auto; overflow: visible; clip-path: none; font-size: 0.66rem; font-weight: 700; white-space: nowrap; }
.acx-svg { display: inline-grid; width: 20px; height: 20px; place-items: center; flex: none; }
.acx-svg svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.acx-badge {
  position: absolute;
  top: 1px;
  right: 0;
  display: grid;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 10px;
  color: #fff;
  background: var(--acx-violet);
  font-size: 0.56rem;
  font-weight: 700;
}

.acx-badge[hidden] { display: none; }

.acx-feed {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 22px 12px;
  scrollbar-color: #c9cfdd transparent;
  scrollbar-width: thin;
}

.acx-event {
  margin: 0 0 16px;
  animation: acx-enter 240ms ease both;
}

.acx-user-message { display: flex; justify-content: flex-end; }
.acx-user-bubble {
  max-width: 88%;
  margin: 0;
  padding: 12px 16px;
  border-radius: 15px 15px 4px 15px;
  color: var(--acx-ink);
  background: var(--acx-violet-soft);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.5;
}

.acx-thinking {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 5px 0;
}

.acx-assistant-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #1b285a;
  font-size: 0.88rem;
  font-weight: 700;
}

.acx-thinking-copy strong { display: block; margin-bottom: 5px; font-size: 0.82rem; line-height: 1.45; }
.acx-thinking-copy span { display: block; color: var(--acx-muted); font-size: 0.7rem; line-height: 1.5; }
.acx-thinking-dots { display: flex; gap: 4px; padding-top: 8px; }
.acx-thinking-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--acx-violet); animation: acx-think 1.1s infinite; }
.acx-thinking-dots i:nth-child(2) { animation-delay: 140ms; }
.acx-thinking-dots i:nth-child(3) { animation-delay: 280ms; }

.acx-card {
  padding: 16px;
  border: 1px solid var(--acx-line);
  border-radius: 14px;
  background: var(--acx-surface);
}

.acx-label {
  margin: 0 0 8px;
  color: var(--acx-muted);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.acx-card h3 { margin: 0 0 7px; color: var(--acx-ink); font-size: 1rem; line-height: 1.35; letter-spacing: -0.015em; }
.acx-summary { margin: 0; color: var(--acx-copy); font-size: 0.78rem; line-height: 1.55; }

.acx-records { display: grid; gap: 8px; margin-top: 12px; }
.acx-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--acx-line);
}
.acx-record:first-child { border-top: 0; }
.acx-record-copy strong,
.acx-record-copy span { display: block; }
.acx-record-copy strong { font-size: 0.77rem; line-height: 1.4; }
.acx-record-copy span { margin-top: 2px; color: var(--acx-muted); font-size: 0.67rem; line-height: 1.45; }
.acx-record-value { color: var(--acx-ink); font-size: 0.76rem; }

.acx-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.acx-metric {
  min-width: 0;
  padding: 10px 7px;
  border: 1px solid var(--acx-line);
  border-radius: 10px;
  color: var(--acx-copy);
  background: #f7f8fa;
  text-align: left;
}

button.acx-metric { cursor: pointer; }
button.acx-metric:hover { border-color: var(--acx-red); }
.acx-metric-value { display: block; color: var(--acx-ink); font-size: 1.1rem; line-height: 1.2; }
.acx-metric-label { display: flex; min-width: 0; align-items: center; gap: 5px; margin-top: 4px; font-size: 0.62rem; line-height: 1.35; }
.acx-status-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: #8b93a8; }
.acx-tone-green { border-color: #cfe9df; background: var(--acx-green-soft); }
.acx-tone-green .acx-status-dot { background: var(--acx-green); }
.acx-tone-amber { border-color: #eedcaf; background: var(--acx-amber-soft); }
.acx-tone-amber .acx-status-dot { background: var(--acx-amber); }
.acx-tone-red { border-color: #efccd2; background: var(--acx-red-soft); }
.acx-tone-red .acx-status-dot { background: var(--acx-red); }
.acx-tone-blue { border-color: #cadef5; background: #f0f6fd; }
.acx-tone-blue .acx-status-dot { background: var(--acx-blue); }

.acx-confirmation {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 15px;
  border: 1px solid #baddcf;
  border-radius: 13px;
  color: #0d624c;
  background: var(--acx-green-soft);
}
.acx-confirmation .acx-svg { width: 20px; height: 20px; margin-top: 1px; }
.acx-confirmation p { margin: 0; color: inherit; font-size: 0.78rem; font-weight: 600; line-height: 1.5; }

.acx-task {
  padding: 13px;
  border: 1px solid var(--acx-line);
  border-radius: 12px;
  background: #fff;
}
.acx-task-top,
.acx-project-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.acx-task-id,
.acx-project-id { color: var(--acx-violet); font-size: 0.64rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
.acx-priority { padding: 3px 7px; border-radius: 999px; background: #f2f3f7; color: var(--acx-copy); font-size: 0.58rem; font-weight: 700; }
.acx-priority-critical { color: var(--acx-red); background: var(--acx-red-soft); }
.acx-priority-high { color: var(--acx-amber); background: var(--acx-amber-soft); }
.acx-task h4,
.acx-project h4 { margin: 8px 0; color: var(--acx-ink); font-size: 0.78rem; line-height: 1.4; }
.acx-detail-line { display: flex; gap: 7px; align-items: flex-start; color: var(--acx-muted); font-size: 0.65rem; line-height: 1.45; }
.acx-detail-line .acx-svg { width: 14px; height: 14px; margin-top: 1px; }
.acx-overdue { margin-top: 8px; color: var(--acx-red); }
.acx-impact { margin-top: 6px; color: var(--acx-copy); }
.acx-person { display: flex; gap: 8px; align-items: center; margin-top: 9px; color: var(--acx-copy); font-size: 0.66rem; line-height: 1.35; }
.acx-person-avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; object-fit: cover; }
.acx-person small,
.acx-person strong { display: block; }
.acx-person small { color: var(--acx-muted); font-size: 0.58rem; }

.acx-plan { display: grid; gap: 12px; margin: 14px 0 0; padding-left: 24px; }
.acx-plan li { padding-left: 3px; color: var(--acx-copy); font-size: 0.72rem; line-height: 1.5; }
.acx-plan strong,
.acx-plan span { display: block; }
.acx-plan strong { color: var(--acx-ink); font-size: 0.74rem; }
.acx-plan span { margin-top: 2px; }

.acx-governance {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--acx-line);
}

.acx-governance__title {
  color: var(--acx-ink);
  font-size: 0.72rem;
  line-height: 1.4;
}

.acx-governance__list {
  display: grid;
  gap: 5px;
  margin: 7px 0 0;
  padding-left: 18px;
  color: var(--acx-copy);
  font-size: 0.68rem;
  line-height: 1.45;
}

.acx-response-actions button.ac-work-ui__action {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.acx-response-actions button.ac-work-ui__action:focus-visible {
  outline: 3px solid rgba(81, 66, 230, 0.42);
  outline-offset: 3px;
}

.acx-response-actions button.ac-work-ui__action:disabled {
  cursor: default;
  opacity: 0.64;
}

.msme-conversation-experience {
  display: grid;
  place-items: center;
  margin: 38px 0;
  padding: clamp(22px, 5vw, 48px);
  overflow: hidden;
  border-radius: 28px;
  background:
    radial-gradient(circle at 13% 24%, rgba(54, 74, 202, 0.56), transparent 38%),
    radial-gradient(circle at 88% 78%, rgba(18, 137, 111, 0.48), transparent 38%),
    #101937;
}

.msme-conversation-device {
  width: min(420px, 100%);
  height: clamp(640px, 78vh, 820px);
  padding: 9px;
  overflow: hidden;
  border: 1px solid #303a59;
  border-radius: 46px;
  background: #101729;
  box-shadow: 0 28px 64px rgba(3, 9, 26, 0.28);
}

.msme-conversation-loading {
  display: grid;
  height: 100%;
  margin: 0;
  place-items: center;
  padding: 24px;
  border-radius: 36px;
  color: #56617e;
  background: #f8f9fc;
  font-size: 0.88rem;
  text-align: center;
}

.acx-composer-wrap {
  position: relative;
  z-index: 3;
  display: grid;
  align-items: center;
  padding: 15px 18px 18px;
  border-top: 1px solid var(--acx-line);
  background: var(--acx-paper);
}

.acx-composer {
  display: flex;
  min-width: 0;
  min-height: 62px;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid #dce1eb;
  border-radius: 19px;
  background: #fff;
}
.acx-composer-button { display: grid; width: 44px; min-height: 44px; flex: none; place-items: center; border-radius: 14px; }
.acx-mic { color: var(--acx-copy); background: transparent; }
.acx-send { color: #fff; background: var(--acx-violet); transition: transform 160ms ease; }
.acx-send:disabled { color: #98a0b3; background: #edf0f5; cursor: default; }
.acx-send.is-pressing { transform: scale(0.86); }
.acx-input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--acx-ink); background: transparent; font: 400 0.82rem/1.45 Inter, Arial, sans-serif; }
.acx-input::placeholder { color: var(--acx-muted); }

.acx-composer.is-voice { gap: 8px; padding: 8px 10px; }
.acx-voice { display: flex; min-width: 0; flex: 1; align-items: center; gap: 10px; }
.acx-voice-label { flex: none; color: var(--acx-violet); font-size: 0.7rem; font-weight: 650; }
.acx-voice.is-recognised .acx-voice-label { max-width: 25ch; overflow: hidden; color: var(--acx-ink); text-overflow: ellipsis; white-space: nowrap; }
.acx-waveform { display: flex; min-width: 80px; flex: 1; align-items: center; justify-content: center; gap: 3px; }
.acx-waveform i { width: 2px; height: 17px; border-radius: 2px; background: var(--acx-violet); animation: acx-wave 900ms ease-in-out infinite alternate; }
.acx-waveform i:nth-child(3n) { animation-delay: 180ms; height: 28px; }
.acx-waveform i:nth-child(2n) { animation-delay: 360ms; height: 10px; }
.acx-voice.is-recognised .acx-waveform { display: none; }
.acx-voice-actions { display: flex; flex: none; align-items: center; gap: 4px; }
.acx-voice-cancel { min-height: 42px; padding: 0 7px; border-radius: 10px; color: var(--acx-muted); background: transparent; font-size: 0.64rem; }
.acx-voice-confirm { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: #fff; background: var(--acx-violet); transition: transform 160ms ease; }
.acx-voice-confirm.is-pressing { transform: scale(0.84); }

.acx-panel {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: grid;
  grid-template-rows: 66px minmax(0, 1fr);
  overflow: hidden;
  border-left: 1px solid var(--acx-line);
  border-radius: inherit;
  background: var(--acx-paper);
  transform: translateX(103%);
  visibility: hidden;
  transition: transform 260ms ease, visibility 0s linear 260ms;
}
.acx-panel.is-open { transform: translateX(0); visibility: visible; transition-delay: 0s; }
.acx-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 18px; border-bottom: 1px solid var(--acx-line); background: #fff; }
.acx-panel-head h3 { margin: 0; font-size: 1rem; }
.acx-panel-close { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 10px; color: var(--acx-copy); background: transparent; }
.acx-panel-close:hover { color: var(--acx-violet); background: var(--acx-violet-soft); }
.acx-panel-body { display: grid; gap: 10px; align-content: start; overflow-y: auto; padding: 16px; }
.acx-project { padding: 14px; border: 1px solid var(--acx-line); border-radius: 13px; background: #fff; }
.acx-project-capacity { color: var(--acx-copy); font-size: 0.67rem; font-weight: 700; }
.acx-project-facts { display: grid; gap: 6px; margin: 10px 0 0; }
.acx-project-facts div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
.acx-project-facts dt { color: var(--acx-muted); font-size: 0.62rem; }
.acx-project-facts dd { margin: 0; color: var(--acx-copy); font-size: 0.66rem; font-weight: 550; }

.acx-metric.is-demo-tap { position: relative; transform: scale(0.96); }
.acx-metric.is-demo-tap::after { content: ""; position: absolute; inset: -5px; border: 2px solid var(--acx-red); border-radius: 14px; animation: acx-tap 520ms ease-out both; }

.acx-icon-button:focus-visible,
.acx-composer-button:focus-visible,
.acx-panel-close:focus-visible,
.acx-voice-cancel:focus-visible,
.acx-voice-confirm:focus-visible,
.acx-metric:focus-visible {
  outline: 3px solid #765ff0;
  outline-offset: 2px;
}

.acx-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes acx-enter { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes acx-think { 0%, 70%, 100% { opacity: 0.28; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }
@keyframes acx-wave { from { transform: scaleY(0.5); } to { transform: scaleY(1); } }
@keyframes acx-tap { from { opacity: 0.9; transform: scale(0.94); } to { opacity: 0; transform: scale(1.12); } }

@media (max-width: 520px) {
  .msme-conversation-experience { margin-inline: calc(clamp(18px, 5vw, 28px) * -1); padding: 14px 8px; border-radius: 22px; }
  .msme-conversation-device { height: 690px; padding: 6px; border-radius: 34px; }
  .acx-shell { grid-template-rows: 62px minmax(0, 1fr) 92px; border-radius: 27px; }
  .acx-header { padding-inline: 12px 8px; }
  .acx-brand-logo { width: 104px; }
  .acx-icon-button { width: 37px; min-height: 38px; }
  .acx-work-button { width: auto; }
  .acx-feed { padding: 18px 14px 10px; }
  .acx-card { padding: 14px; }
  .acx-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acx-composer-wrap { padding: 11px 12px 14px; }
  .acx-composer { min-height: 58px; }
  .acx-composer-button { width: 40px; min-height: 42px; }
  .acx-voice.is-recognised .acx-voice-label { max-width: 14ch; }
  .acx-waveform { min-width: 54px; gap: 2px; }
  .acx-waveform i:nth-child(n+14) { display: none; }
  .acx-project-facts div { grid-template-columns: 66px minmax(0, 1fr); }
}

@media (max-width: 390px) {
  .msme-conversation-device { height: 650px; }
}

@media (max-width: 360px) {
  .acx-work-button { width: 37px; padding-inline: 6px; }
  .acx-work-button .acx-action-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

@media (prefers-reduced-motion: reduce) {
  .acx-stage *,
  .acx-stage *::before,
  .acx-stage *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
