:root {
  color-scheme: light;
  --ax-white: #ffffff;
  --ax-ink: #15171b;
  --ax-ink-strong: #0f1112;
  --ax-muted: #5a657b;
  --ax-muted-soft: #8d96a6;
  --ax-selected: #eff1f2;
  --ax-border: #e7e8ea;
  --ax-section-border: #ededed;
  --ax-workspace: #f4f7fc;
  --ax-success: #5c9864;
  --ax-blue: #6f93c8;
  --ax-sidebar-width: 242px;
  --ax-inspector-width: 283px;
  --ax-toolbar-height: 43px;
  --ax-composer-width: 820px;
  --text: var(--ax-ink);
  --muted: var(--ax-muted);
  --muted-2: var(--ax-muted-soft);
  --line: var(--ax-border);
  --line-strong: #d5d9de;
  --panel: var(--ax-white);
  --panel-2: #f7f8fa;
  --panel-3: #eff1f3;
  --sidebar: var(--ax-white);
  --accent: var(--ax-success);
  --bg: var(--ax-workspace);
  --shadow: 0 16px 45px rgba(43, 54, 75, 0.09);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  background: var(--ax-workspace);
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--ax-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

svg {
  display: block;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--ax-sidebar-width) minmax(0, 1fr) var(--ax-inspector-width);
  width: 100%;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--ax-white);
}

.app-shell > * {
  min-width: 0;
  min-height: 0;
}

/* Left rail */
.sidebar {
  position: relative;
  z-index: 3;
  display: flex;
  height: 100%;
  min-width: 0;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  padding: 0 7px 43px;
  border-right: 1px solid var(--ax-border);
  background: var(--ax-white);
  color: var(--ax-ink);
}

.window-lights {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 31px;
  margin-left: -3px;
}

.window-lights i {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #ff5f57;
}

.window-lights i:nth-child(2) { background: #febc2e; }
.window-lights i:nth-child(3) { background: #28c840; }

.sidebar-brand {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) 8px 28px;
  align-items: center;
  gap: 9px;
  min-height: 35px;
  margin: 0 0 9px;
  padding: 0 1px;
}

.logo-mark.compact {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: #0a0d12;
  box-shadow: 0 1px 3px rgba(6, 10, 16, 0.18);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.brand-copy {
  display: block;
  min-width: 0;
}

.brand-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ax-ink-strong);
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -0.01em;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small {
  display: none;
}

.status-pin {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #4aa668;
  box-shadow: none;
}

.brand-search-button,
.topbar button,
.context-header button {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
}

.brand-search-button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #65728a;
}

.brand-search-button:hover {
  background: #f4f5f6;
  color: var(--ax-ink);
}

.brand-search-button svg,
.topbar svg,
.context-section h3 svg,
.pack-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.brand-search-button svg {
  width: 18px;
  height: 18px;
}

.new-chat-button {
  display: flex;
  width: 100%;
  min-height: 35px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  padding: 0 10px;
  border: 1px solid #080a0d;
  border-radius: 7px;
  background: #0b0d10;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.new-chat-button:hover,
.new-chat-button:focus-visible {
  border-color: #222832;
  background: #15191f;
}

.new-chat-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.new-chat-label svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.new-chat-button kbd {
  padding: 0;
  background: transparent;
  color: #aeb4bd;
  font-family: inherit;
  font-size: 9px;
  font-weight: 600;
}

.search-wrap[hidden],
.history[hidden] {
  display: none !important;
}

.primary-nav {
  display: grid;
  align-content: start;
  gap: 0;
}

.section-label {
  margin: 0 4px 5px;
  color: #8a94a5;
  font-size: 8px;
  font-weight: 760;
  letter-spacing: 0.035em;
  line-height: 1;
  text-transform: uppercase;
}

.nav-item,
.primary-nav a.nav-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 35px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #66738a;
  text-align: left;
  text-decoration: none;
}

.nav-item:hover {
  background: #f6f7f8;
  color: #303846;
}

.nav-item.active {
  position: relative;
  background: var(--ax-selected);
  box-shadow: none;
  color: var(--ax-ink);
}

.nav-item.active::before {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: -7px;
  width: 2px;
  border-radius: 2px;
  background: #111419;
  content: "";
}

.nav-item > span:last-child {
  display: block;
  min-width: 0;
}

.nav-item strong {
  display: block;
  overflow: hidden;
  color: currentColor;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item small,
.nav-dot {
  display: none;
}

.nav-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: currentColor;
}

.nav-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.project-list {
  display: grid;
  align-content: start;
  gap: 7px;
  margin-top: 31px;
  padding-bottom: 6px;
}

.agent-team-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 16px;
  padding: 0 5px;
}

.agent-team-heading .section-label {
  margin: 0;
}

.agent-team-heading > a {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 4px;
  color: #647187;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
}

.agent-team-heading > a:hover {
  background: #f1f2f4;
  color: var(--ax-ink);
}

.agent-pack-link {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 33px;
  padding: 0 8px;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  background: #fff;
  color: #59667b;
  font-size: 10px;
  font-weight: 650;
  text-decoration: none;
}

.agent-pack-link:hover {
  border-color: #cfd4da;
  color: var(--ax-ink);
}

.agent-pack-link b {
  color: #718096;
  font-size: 17px;
  font-weight: 400;
}

.pack-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
}

.pack-icon svg {
  width: 15px;
  height: 15px;
}

.sidebar-footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  height: 43px;
  padding: 0;
  border-top: 1px solid var(--ax-section-border);
  background: #fff;
}

.account-button {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 7px;
  width: 100%;
  height: 42px;
  min-height: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ax-ink);
  text-align: left;
}

.account-button:hover {
  background: #f7f8fa;
}

.account-avatar {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid #e3e6e9;
  border-radius: 999px;
  background: #f4f5f7;
  color: #5f6878;
  font-size: 8px;
  font-weight: 720;
}

.account-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.account-copy strong,
.account-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  color: #313944;
  font-size: 9px;
  font-weight: 650;
}

.account-copy small {
  color: #8791a1;
  font-size: 8px;
}

.account-chevron {
  color: #98a1ae;
  font-size: 11px;
  text-align: center;
}

/* Main workspace */
.chat-pane {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: var(--ax-toolbar-height) minmax(0, 1fr) auto;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  background: var(--ax-workspace);
}

.topbar {
  display: flex;
  height: var(--ax-toolbar-height);
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 0 8px;
  border-bottom: 1px solid var(--ax-border);
  background: rgba(255, 255, 255, 0.97);
  color: #526077;
}

.topbar-navigation,
.topbar-actions,
.thread-heading {
  display: flex;
  min-width: 0;
  align-items: center;
}

.mobile-navigation {
  position: relative;
  z-index: 30;
  display: none;
  flex: 0 0 auto;
}

.mobile-navigation summary {
  display: grid;
  width: 32px;
  height: 32px;
  cursor: pointer;
  list-style: none;
  place-items: center;
  border-radius: 7px;
  color: #66738a;
}

.mobile-navigation summary::-webkit-details-marker {
  display: none;
}

.mobile-navigation summary:hover,
.mobile-navigation summary:focus-visible,
.mobile-navigation[open] summary {
  outline: 0;
  background: #eff1f2;
  color: #27303d;
}

.mobile-navigation summary svg {
  width: 18px;
  height: 18px;
}

.mobile-navigation nav {
  position: absolute;
  z-index: 40;
  top: 40px;
  left: 0;
  display: grid;
  width: min(260px, calc(100vw - 20px));
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--ax-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 48px rgba(43, 54, 75, 0.16);
  backdrop-filter: blur(18px);
}

.mobile-navigation nav button {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 7px;
  color: #526077;
  text-align: left;
}

.mobile-navigation nav button:hover,
.mobile-navigation nav button:focus-visible,
.mobile-navigation nav button.active {
  outline: 0;
  background: var(--ax-selected);
  color: var(--ax-ink);
}

.topbar-navigation {
  flex: 0 0 auto;
  gap: 3px;
}

.topbar-navigation button,
.toolbar-icon-button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #7a879a;
}

.topbar-navigation button:hover,
.toolbar-icon-button:hover {
  background: #f2f4f6;
  color: #27303d;
}

.topbar-navigation svg,
.toolbar-icon-button svg {
  width: 16px;
  height: 16px;
}

.topbar-separator {
  display: block;
  width: 1px;
  height: 21px;
  margin: 0 3px;
  background: #e4e7eb;
}

.thread-heading {
  flex: 1 1 auto;
  gap: 6px;
  overflow: hidden;
}

.thread-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #66738a;
}

.thread-heading .live-dot {
  display: none;
}

.thread-heading strong {
  overflow: hidden;
  color: #20242a;
  font-size: 12px;
  font-weight: 680;
  letter-spacing: -0.005em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar-live {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  color: #7c8797;
  font-size: 8px;
  font-weight: 720;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.toolbar-live i,
.activity-live-label i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #58a06a;
}

.topbar-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 3px;
}

.toolbar-more {
  padding-bottom: 8px;
  font-size: 18px;
  line-height: 1;
}

.open-in-link {
  display: inline-flex;
  height: 28px;
  align-items: center;
  gap: 5px;
  padding: 0 6px;
  border-radius: 6px;
  color: #2f3742;
  font-size: 10px;
  font-weight: 580;
  text-decoration: none;
}

.open-in-link:hover {
  background: #f2f4f6;
}

.open-in-link svg {
  width: 14px;
  height: 14px;
}

.auth-separator {
  margin-left: 5px;
}

.auth-action {
  display: inline-flex;
  height: 29px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9dde2;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 10px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.login-action {
  background: #fff;
  color: #171a1f;
}

.signup-action {
  border-color: #111419;
  background: #111419;
  color: #fff;
}

.auth-action:hover {
  transform: translateY(-1px);
}

.legacy-topbar-control,
.account-settings-button {
  display: none !important;
}

.workspace-stage {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(rgba(216, 224, 237, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 224, 237, 0.13) 1px, transparent 1px),
    radial-gradient(circle at 12% 0%, #fff 0%, #f9fbfe 48%, #f4f7fc 100%);
  background-size: 76px 76px, 76px 76px, 100% 100%;
}

.message-queue {
  display: none !important;
}

.thread-scroll {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 0;
  background: transparent;
  scrollbar-color: #c9ced6 transparent;
  scrollbar-width: thin;
}

.conversation-shell {
  position: relative;
  width: 100%;
  min-height: 100%;
  margin: 0;
}

.welcome {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 0 22px;
  text-align: left;
}

.welcome[hidden] {
  display: none !important;
}

.ready-copy {
  width: min(var(--ax-composer-width), 100%);
  transform: translateY(-34px);
}

.ready-copy > span {
  display: block;
  margin: 0 0 15px 10px;
  color: var(--ax-success);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
}

.ready-copy h1 {
  margin: 0 0 10px 10px;
  color: #11151b;
  font-size: clamp(22px, 1.45vw, 26px);
  font-weight: 720;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.ready-copy p {
  margin: 0 0 0 10px;
  color: #67717f;
  font-size: 14px;
  line-height: 1.4;
}

.runtime-sink {
  display: none !important;
}

.message-list {
  display: grid;
  width: min(var(--ax-composer-width), calc(100% - 44px));
  gap: 18px;
  margin: 0 auto;
  padding: 34px 0 130px;
}

body.showing-welcome .message-list {
  display: none;
}

.message {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
}

.message.user {
  grid-template-columns: minmax(0, 1fr);
  justify-items: end;
}

.message::before {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  background: #fff;
  color: #171b21;
  content: "A";
  font-size: 9px;
  font-weight: 780;
}

.message.user::before,
.message-meta {
  display: none;
}

.message-text {
  color: #2c3440;
  font-size: 13px;
  line-height: 1.58;
}

.message.assistant .message-text,
.message.user .message-text {
  border: 1px solid #e0e4e9;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 20px rgba(54, 66, 86, 0.04);
}

.message.assistant .message-text {
  padding: 12px 14px;
}

.message.user .message-text {
  width: min(620px, 88%);
  padding: 10px 13px;
  background: #f6f7f9;
}

.message-text h3,
.message-text h4 {
  color: var(--ax-ink);
}

.artifact-chip {
  border-color: #dde2e7;
  background: #fff;
  color: #394454;
}

.surface-panel {
  position: absolute;
  top: 46px;
  right: 22px;
  left: 22px;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  width: min(var(--ax-composer-width), calc(100% - 44px));
  margin: 0 auto;
  padding: 18px;
  border: 1px solid #e1e5ea;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
}

.surface-panel[hidden] {
  display: none !important;
}

.surface-panel:not([hidden]) + .welcome {
  display: none;
}

.surface-panel:not([hidden]) ~ .message-list {
  padding-top: 165px;
}

.surface-panel span {
  color: var(--ax-success);
  font-size: 9px;
}

.surface-panel h2 {
  color: var(--ax-ink);
  font-size: 22px;
}

.surface-panel p {
  color: var(--ax-muted);
}

.surface-actions button {
  border-color: #dce1e6;
  background: #fff;
  color: #354052;
}

.composer {
  position: relative;
  z-index: 5;
  display: flex;
  min-height: 86px;
  align-items: flex-start;
  justify-content: center;
  padding: 0 22px 27px;
  background: linear-gradient(180deg, rgba(244, 247, 252, 0), rgba(244, 247, 252, 0.86) 26%, #f4f7fc 100%);
}

.composer::after {
  position: absolute;
  bottom: 7px;
  left: 50%;
  width: 38px;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #111318;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  content: "";
  display: none;
}

.composer-shell {
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr) auto;
  width: min(var(--ax-composer-width), 100%);
  min-height: 59px;
  height: auto;
  align-items: end;
  gap: 10px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #d5d9de;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 35px rgba(52, 67, 92, 0.07), 0 1px 2px rgba(28, 37, 52, 0.03);
  backdrop-filter: blur(16px);
}

.composer-plus,
.composer-mic,
.send-btn {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 7px;
}

.composer-plus,
.composer-mic {
  border: 1px solid #e0e4e8;
  background: #fff;
  color: #617086;
}

.composer-plus {
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.composer-plus:hover,
.composer-mic:hover {
  border-color: #cbd2d9;
  color: #26303d;
}

.composer textarea {
  width: 100%;
  min-height: 25px;
  max-height: 150px;
  overflow-y: auto;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #252b33;
  padding: 3px 2px 0;
  font-size: 14px;
  line-height: 1.45;
}

.composer textarea::placeholder {
  color: #8a94a4;
  opacity: 1;
}

.composer-actions {
  display: flex;
  align-self: end;
  align-items: center;
  gap: 8px;
}

.composer-mic svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.send-btn {
  border: 1px solid #0d1014;
  background: #0d1014;
  color: #fff;
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
}

.send-btn:hover:not(:disabled) {
  background: #20252c;
}

.send-btn:disabled {
  cursor: default;
  opacity: 0.42;
}

.composer-note,
.composer-footer {
  display: none !important;
}

/* Dedicated messaging route workspace */
body.messaging-surface .chat-pane {
  grid-template-rows: var(--ax-toolbar-height) minmax(0, 1fr);
}

body.messaging-surface .composer {
  display: none;
}

.messaging-workspace {
  width: 100%;
  height: 100%;
  overflow: auto;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.98), rgba(247, 250, 254, 0.82) 48%, rgba(244, 247, 252, 0.96)),
    #f4f7fc;
  scrollbar-color: #c9ced6 transparent;
  scrollbar-width: thin;
}

.messaging-route-shell {
  width: min(940px, calc(100% - 56px));
  margin: 0 auto;
  padding: 42px 0 48px;
}

.messaging-route-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.messaging-route-header h1 {
  margin: 0;
  color: #11151b;
  font-size: clamp(25px, 2.4vw, 34px);
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.messaging-route-header p {
  max-width: 620px;
  margin: 10px 0 0;
  color: #667284;
  font-size: 13px;
  line-height: 1.55;
}

.messaging-live-state {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  color: #697689;
  font-size: 10px;
  font-weight: 680;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.messaging-live-state i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #91a0b3;
  box-shadow: 0 0 0 3px rgba(145, 160, 179, 0.12);
}

.messaging-live-state[data-tone="success"] i { background: #4ba765; box-shadow: 0 0 0 3px rgba(75, 167, 101, 0.12); }
.messaging-live-state[data-tone="error"] i { background: #d65b5b; box-shadow: 0 0 0 3px rgba(214, 91, 91, 0.12); }

.messaging-route-loading,
.messaging-route-error {
  min-height: 340px;
  align-content: center;
  justify-items: center;
  padding: 44px;
  border: 1px solid #e1e6ed;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 56px rgba(54, 67, 90, 0.06);
  text-align: center;
}

.messaging-route-loading:not([hidden]) {
  display: grid;
}

.messaging-route-loading strong,
.messaging-route-error strong {
  margin-top: 18px;
  color: #1d232c;
  font-size: 15px;
  font-weight: 680;
}

.messaging-route-loading p,
.messaging-route-error p {
  margin: 7px 0 0;
  color: #7a8595;
  font-size: 12px;
  line-height: 1.5;
}

.messaging-spinner {
  display: block;
  width: 29px;
  height: 29px;
  border: 2px solid #dce3ec;
  border-top-color: #7188aa;
  border-radius: 999px;
  animation: messaging-spin 0.85s linear infinite;
}

@keyframes messaging-spin {
  to { transform: rotate(360deg); }
}

.messaging-route-error:not([hidden]) {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  justify-items: start;
  gap: 16px;
  min-height: 150px;
  text-align: left;
}

.messaging-route-error > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: #fff0f0;
  color: #c34e4e;
  font-size: 17px;
  font-weight: 730;
}

.messaging-route-error strong,
.messaging-route-error p {
  margin: 0;
}

.messaging-route-error button,
.messaging-rotate-button,
.messaging-rotate-confirm button,
.messaging-copy-button {
  border: 1px solid #dce2e9;
  background: #fff;
  color: #344052;
  font-weight: 650;
}

.messaging-route-error button {
  min-height: 35px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 11px;
}

.messaging-route-ready:not([hidden]) {
  display: block;
}

.messaging-route-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.88fr) minmax(350px, 1.12fr);
  align-items: stretch;
  gap: 22px;
}

.messaging-qr-panel,
.messaging-route-card,
.imessage-preview {
  border: 1px solid #e0e5eb;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 48px rgba(43, 57, 80, 0.055);
}

.messaging-qr-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 22px;
  border-radius: 17px;
}

.messaging-qr-heading {
  display: flex;
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.messaging-qr-heading h2,
.messaging-route-card h2,
.imessage-preview h2 {
  margin: 0;
  color: #171c23;
  font-size: 14px;
  font-weight: 690;
  letter-spacing: -0.012em;
}

.messaging-qr-heading p,
.messaging-card-heading p {
  margin: 5px 0 0;
  color: #8490a0;
  font-size: 10px;
  line-height: 1.45;
}

.messaging-qr-heading svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: currentColor;
  color: #65748b;
}

.messaging-qr-frame {
  display: grid;
  width: min(276px, 100%);
  aspect-ratio: 1;
  place-items: center;
  margin: 22px 0 17px;
  padding: 12px;
  border: 1px solid #edf0f3;
  border-radius: 13px;
  background: #fff;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.messaging-qr-frame:hover {
  border-color: #cbd4df;
  box-shadow: 0 10px 30px rgba(43, 57, 80, 0.09);
  transform: translateY(-1px);
}

.messaging-qr-frame:focus-visible {
  outline: 3px solid rgba(47, 111, 237, 0.28);
  outline-offset: 3px;
}

.messaging-qr-frame[aria-disabled="true"] {
  cursor: default;
  pointer-events: none;
}

.messaging-qr-frame canvas {
  display: block;
  max-width: 100%;
  height: auto !important;
  aspect-ratio: 1;
}

.messaging-qr-caption {
  max-width: 285px;
  margin: auto 0 0;
  color: #8b96a5;
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

.messaging-route-details {
  display: grid;
  min-width: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}

.messaging-route-card,
.imessage-preview {
  border-radius: 15px;
}

.messaging-route-card {
  padding: 20px;
}

.messaging-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.messaging-card-heading > span {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #dce8fa;
  border-radius: 999px;
  background: #f3f8ff;
  color: #2f70c7;
  font-size: 8px;
  font-weight: 720;
  white-space: nowrap;
}

.messaging-route-values {
  display: grid;
  gap: 0;
  margin: 17px 0 18px;
}

.messaging-route-values > div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  min-height: 47px;
  border-top: 1px solid #edf0f3;
}

.messaging-route-values > div:last-child {
  border-bottom: 1px solid #edf0f3;
}

.messaging-route-values dt,
.messaging-route-values dd {
  margin: 0;
}

.messaging-route-values dt {
  color: #7b8797;
  font-size: 9px;
  font-weight: 590;
}

.messaging-route-values dd {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  color: #27303c;
  text-align: right;
}

.messaging-route-values strong,
.messaging-route-values code {
  overflow: hidden;
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messaging-route-values code {
  padding: 4px 7px;
  border-radius: 6px;
  background: #f1f4f7;
  color: #34445a;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.06em;
}

.messaging-copy-button {
  min-height: 25px;
  flex: 0 0 auto;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 8px;
}

.messaging-copy-button:hover,
.messaging-route-error button:hover,
.messaging-rotate-button:hover,
.messaging-rotate-confirm button:hover {
  border-color: #c8d0da;
  background: #f7f9fb;
  color: #17202c;
}

.messaging-copy-button:disabled,
.messaging-rotate-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.messages-open-button {
  display: flex;
  width: 100%;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 10px;
  background: #0a84ff;
  box-shadow: 0 9px 22px rgba(10, 132, 255, 0.21);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.messages-open-button:hover {
  transform: translateY(-1px);
  background: #0075e8;
  box-shadow: 0 11px 25px rgba(10, 132, 255, 0.26);
}

.messages-open-button[aria-disabled="true"] {
  pointer-events: none;
  box-shadow: none;
  opacity: 0.46;
}

.messages-open-button svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.messaging-open-note {
  margin: 9px 0 0;
  color: #8a95a4;
  font-size: 8px;
  line-height: 1.45;
  text-align: center;
}

.imessage-preview {
  min-height: 178px;
  overflow: hidden;
}

.imessage-preview header {
  display: flex;
  min-height: 51px;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border-bottom: 1px solid #edf0f4;
  background: rgba(249, 250, 252, 0.94);
}

.imessage-contact-avatar {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: #dfe5ed;
  color: #536276;
  font-size: 9px;
  font-weight: 740;
}

.imessage-preview header div {
  min-width: 0;
  flex: 1;
}

.imessage-preview header h2 {
  font-size: 10px;
}

.imessage-preview header p {
  margin: 2px 0 0;
  color: #98a1ae;
  font-size: 8px;
}

.imessage-preview-status {
  color: #0a84ff;
  font-size: 8px;
  font-weight: 650;
}

.imessage-thread {
  display: flex;
  min-height: 128px;
  flex-direction: column;
  gap: 5px;
  padding: 13px;
  background: #fff;
}

.imessage-bubble {
  display: block;
  width: fit-content;
  max-width: 78%;
  padding: 7px 10px;
  border-radius: 14px;
  font-size: 8px;
  line-height: 1.35;
}

.imessage-bubble.outgoing {
  align-self: flex-end;
  border-bottom-right-radius: 5px;
  background: #0a84ff;
  color: #fff;
}

.imessage-bubble.incoming {
  align-self: flex-start;
  border-bottom-left-radius: 5px;
  background: #e9e9ee;
  color: #272a30;
}

.messaging-imessage-note {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  margin-top: 16px;
  padding: 13px 15px;
  border: 1px solid #dfe9f8;
  border-radius: 11px;
  background: rgba(244, 249, 255, 0.88);
}

.messaging-imessage-note svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: #2d7bd6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.messaging-imessage-note p {
  margin: 0;
  color: #607087;
  font-size: 9px;
  line-height: 1.55;
}

.messaging-imessage-note strong {
  color: #35465d;
  font-weight: 710;
}

.messaging-route-footer,
.messaging-rotate-confirm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 13px;
  padding: 14px 2px 0;
}

.messaging-route-footer strong,
.messaging-rotate-confirm strong {
  color: #313b49;
  font-size: 10px;
  font-weight: 680;
}

.messaging-route-footer p,
.messaging-rotate-confirm p {
  margin: 3px 0 0;
  color: #8993a2;
  font-size: 8px;
  line-height: 1.45;
}

.messaging-rotate-button {
  min-height: 32px;
  flex: 0 0 auto;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 9px;
}

.messaging-rotate-confirm:not([hidden]) {
  display: flex;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid #f0d6d6;
  border-radius: 10px;
  background: #fff8f8;
}

.messaging-rotate-confirm > div:last-child {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.messaging-rotate-confirm button {
  min-height: 31px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 9px;
}

#messagingRotateConfirmButton {
  border-color: #c94f4f;
  background: #c94f4f;
  color: #fff;
}

#messagingRotateConfirmButton:hover { background: #b84444; color: #fff; }
#messagingRotateConfirmButton:disabled { cursor: wait; opacity: 0.65; }

.messaging-route-status {
  min-height: 18px;
  margin: 13px 0 0;
  color: #6d7889;
  font-size: 9px;
  line-height: 1.45;
  text-align: center;
}

.messaging-route-status[data-tone="success"] { color: #4f865d; }
.messaging-route-status[data-tone="error"] { color: #b85050; }
.messaging-route-status[data-tone="working"] { color: #4e6f9f; }

/* Browser surface */
.browser-workspace {
  height: 100%;
  padding: 16px 18px 22px;
  background: rgba(249, 251, 254, 0.94);
}

.browser-toolbar h2 {
  color: var(--ax-ink);
}

.browser-toolbar span,
.browser-address label,
.browser-frame-top span {
  color: var(--ax-muted);
}

.browser-address,
.browser-frame-shell {
  border-color: #dfe3e8;
  background: #fff;
}

.browser-address input {
  color: var(--ax-ink);
}

.browser-address button {
  background: #111419;
  color: #fff;
}

.browser-frame-top {
  border-color: #e6e9ed;
}

/* Right Context inspector */
.inspector {
  position: relative;
  z-index: 2;
  display: block;
  height: 100%;
  min-width: 0;
  overflow: auto;
  padding: var(--ax-toolbar-height) 0 0;
  border-left: 1px solid var(--ax-border);
  background: #fff;
  color: var(--ax-ink);
  scrollbar-color: #d2d6dc transparent;
  scrollbar-width: thin;
}

.context-header {
  display: flex;
  height: 49px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--ax-section-border);
}

.context-header h2 {
  margin: 0;
  color: #1e242d;
  font-size: 12px;
  font-weight: 680;
}

.context-header button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: #536075;
  font-size: 19px;
  font-weight: 350;
}

.context-header button:hover {
  background: #f2f4f6;
}

.context-section {
  padding: 14px 14px 13px;
  border-bottom: 1px solid var(--ax-section-border);
}

.environment-section {
  min-height: 173px;
}

.sources-section {
  min-height: 193px;
}

.context-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: #303845;
  font-size: 11px;
  font-weight: 650;
}

.context-section h3 svg {
  width: 15px;
  height: 15px;
  color: #68768a;
}

.context-rows {
  display: grid;
  gap: 0;
  margin: 0;
}

.context-rows > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 29px;
}

.context-rows dt,
.context-rows dd {
  margin: 0;
  font-size: 9px;
}

.context-rows dt {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #7d899b;
}

.context-rows dd {
  color: #313947;
  font-weight: 620;
  text-align: right;
}

.context-row-icon {
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  color: #8a96a7;
  font-size: 11px;
}

.bubble-icon {
  width: 13px;
  height: 11px;
  border: 1px solid #94a0b0;
  border-radius: 999px;
}

.source-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.source-list li {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr) 7px;
  min-height: 29px;
  align-items: center;
  gap: 7px;
  color: #758196;
  font-size: 9px;
  font-weight: 520;
}

.source-list img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  filter: saturate(0.45);
  opacity: 0.8;
}

.source-list i {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #a8b0bd;
}

.source-list li[data-connector-status="connected"] i {
  background: #43a463;
}

.source-list li[data-connector-status="available"] i {
  background: #4a78b8;
}

.source-list li[data-connector-status="warning"] i,
.source-list li[data-connector-status="disconnected"] i {
  background: #c58b2b;
}

.source-file-icon {
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  color: #8793a4;
  font-size: 13px;
  line-height: 1;
}

.source-file-icon.grid {
  letter-spacing: -3px;
}

.view-connectors {
  min-height: 21px;
  margin: 1px 0 0 1px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #536176;
  font-size: 9px;
  font-weight: 650;
  text-align: left;
}

.view-connectors:hover {
  color: #11151b;
}

.inspector > .inspector-card:not(.activity-context) {
  display: none !important;
}

.activity-context {
  display: block;
  min-height: 182px;
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--ax-section-border);
  border-radius: 0;
  background: #fff;
}

.activity-context .inspector-card-head {
  display: flex;
  height: 45px;
  min-height: 0;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border: 0;
}

.activity-context .inspector-card-head h2 {
  color: #303845;
  font-size: 11px;
  font-weight: 650;
}

.activity-live-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8490a0;
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
}

.activity-list {
  display: grid;
  max-height: none;
  gap: 0;
  overflow: visible;
  padding: 0 14px 12px;
}

.activity-card {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  min-height: 31px;
  align-items: start;
  gap: 7px;
  padding: 3px 0;
  border-radius: 0;
  background: transparent;
  color: #4e5b6e;
}

.activity-card:hover {
  background: transparent;
}

.activity-icon {
  width: 5px;
  height: 5px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #55a36a;
  color: transparent;
  font-size: 0;
}

.activity-card[data-event-tone="blue"] .activity-icon { background: #5590de; }
.activity-card[data-event-tone="muted"] .activity-icon { background: #8b94a0; }

.activity-card h3 {
  margin: 0;
  overflow: hidden;
  color: #68758a;
  font-size: 9px;
  font-weight: 610;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-card p {
  margin: 2px 0 0;
  color: #9aa3b0;
  font-size: 8px;
  line-height: 1.2;
}

.activity-card a {
  display: none;
}

.activity-list .empty-state {
  padding: 2px 0 14px;
  color: #949eac;
  font-size: 9px;
}

.context-settings {
  display: flex;
  width: 100%;
  height: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border: 0;
  background: #fff;
  color: #718095;
  font-size: 9px;
  text-align: left;
}

.context-settings:hover {
  background: #f8f9fa;
}

.context-settings b {
  color: #6f7d91;
  font-size: 8px;
  font-weight: 650;
}

/* Voice status only appears while active; mic control lives in the composer. */
.voice-widget {
  position: fixed;
  top: auto;
  right: calc(var(--ax-inspector-width) + 22px);
  bottom: 103px;
  left: auto;
  z-index: 80;
  display: none;
  width: 270px;
  min-width: 0;
  grid-template-columns: 38px minmax(0, 1fr);
  transform: none;
  padding: 7px;
  border: 1px solid #dce1e7;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 15px 45px rgba(37, 48, 68, 0.16);
  color: var(--ax-ink);
  backdrop-filter: blur(14px);
}

.voice-widget[data-mode="listening"],
.voice-widget[data-mode="working"],
.voice-widget[data-mode="done"],
.voice-widget[data-mode="error"] {
  display: grid;
}

.voice-orb {
  width: 38px;
  height: 38px;
  border-color: #dfe3e8;
  background: #f7f8fa;
  color: #394455;
}

.voice-copy strong { color: var(--ax-ink); }
.voice-copy small { color: var(--ax-muted); }

/* Auth and account dialogs remain functional in the light system. */
.auth-gate,
.account-modal {
  background: rgba(237, 241, 246, 0.78);
  backdrop-filter: blur(16px);
}

.auth-panel,
.account-panel {
  border-color: #dce1e7;
  background: #fff;
  box-shadow: 0 24px 80px rgba(34, 45, 64, 0.18);
  color: var(--ax-ink);
}

.auth-panel h2,
.account-head h2,
.account-status strong,
.usage-panel strong,
.plan-card h3,
.account-delete-copy h3,
.account-delete-confirmation strong {
  color: var(--ax-ink);
}

.auth-panel p,
.auth-panel label,
.account-head p,
.usage-panel p,
.plan-card p,
.plan-card small,
.account-delete-copy p,
.account-delete-confirmation p,
.account-delete-status {
  color: var(--ax-muted);
}

.auth-panel input,
.auth-panel select,
.account-status div,
.plan-card,
.account-delete-confirmation,
.account-delete-status {
  border-color: #dfe3e8;
  background: #f8f9fb;
  color: var(--ax-ink);
}

.google-submit,
.auth-submit,
.plan-card button {
  background: #111419;
  color: #fff;
}

.auth-page-link {
  color: #4d5b6e;
}

.account-head-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.account-signout:not([hidden]) {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid #dce1e7;
  border-radius: 8px;
  background: #fff;
  color: #394455;
  font-size: 12px;
  font-weight: 650;
}

.account-signout:hover {
  background: #f5f7f9;
}

[hidden] {
  display: none !important;
}

@media (max-width: 950px) {
  .messaging-route-shell {
    width: min(620px, calc(100% - 42px));
  }

  .messaging-route-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .messaging-qr-panel {
    min-height: 405px;
  }
}

@media (max-width: 1500px) {
  .topbar-navigation button:nth-child(2),
  .topbar-navigation button:nth-child(3),
  .toolbar-more,
  .inspector-toggle,
  .open-in-link svg {
    display: none;
  }

  .topbar-navigation .topbar-separator {
    display: none;
  }

  .auth-action {
    padding: 0 9px;
  }
}

@media (max-width: 1279px) {
  .app-shell {
    grid-template-columns: var(--ax-sidebar-width) minmax(0, 1fr);
  }

  .inspector {
    display: none;
  }

  .voice-widget {
    right: 22px;
  }
}

@media (max-width: 899px) {
  .app-shell {
    display: block;
    height: 100vh;
    height: 100dvh;
  }

  .sidebar,
  .inspector {
    display: none;
  }

  .chat-pane {
    grid-template-rows: 51px minmax(0, 1fr) auto;
    min-height: 100vh;
    min-height: 100dvh;
  }

  body.messaging-surface .chat-pane {
    grid-template-rows: 51px minmax(0, 1fr);
  }

  .messaging-route-shell {
    padding-top: 32px;
  }

  .topbar {
    height: 51px;
    flex-direction: row;
    align-items: center;
    padding: 0 10px;
  }

  .topbar-navigation {
    display: none;
  }

  .mobile-navigation {
    display: block;
  }

  .thread-heading {
    flex: 1 1 auto;
  }

  .topbar-actions {
    width: auto;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    overflow: visible;
  }

  .topbar .toolbar-icon-button,
  .topbar .open-in-link,
  .topbar .auth-separator {
    display: none !important;
  }

  .login-action {
    display: inline-flex;
  }

  .ready-copy {
    transform: translateY(-25px);
  }

  .ready-copy > span,
  .ready-copy h1,
  .ready-copy p {
    margin-left: 0;
  }

  .ready-copy h1 {
    font-size: 24px;
  }

  .ready-copy p {
    font-size: 13px;
  }

  .surface-panel {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    width: calc(100% - 24px);
    margin: 24px 12px 0;
    padding: 16px;
    background: #fff;
  }

  .conversation-shell:has(> .surface-panel:not([hidden])) {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    align-content: start;
  }

  .surface-panel:not([hidden]) ~ .message-list {
    padding-top: 24px;
  }

  .surface-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .surface-actions button {
    flex: 1 1 120px;
  }

  .composer {
    min-height: 82px;
    padding: 0 16px 23px;
  }

  .composer-shell {
    min-height: 56px;
    height: auto;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 7px;
    padding: 8px;
  }

  .composer-plus,
  .composer-mic,
  .send-btn {
    width: 36px;
    height: 36px;
  }

  .composer textarea {
    font-size: 13px;
    max-height: 132px;
  }

  .composer::after {
    bottom: 5px;
    display: block;
  }

  .message-list {
    width: calc(100% - 32px);
  }

  .voice-widget {
    right: 16px;
    bottom: 91px;
    left: 16px;
    width: auto;
  }
}

@media (max-width: 560px) {
  .thread-heading .thread-icon,
  .toolbar-live {
    display: none;
  }

  .thread-heading strong {
    font-size: 13px;
  }

  .auth-action {
    height: 31px;
    padding: 0 12px;
    font-size: 11px;
  }

  .welcome {
    padding: 0 18px;
  }

  .messaging-route-shell {
    width: calc(100% - 24px);
    padding: 25px 0 34px;
  }

  .messaging-route-header {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
  }

  .messaging-route-header h1 {
    max-width: 330px;
    font-size: 25px;
  }

  .messaging-live-state {
    margin-top: 0;
  }

  .messaging-qr-panel,
  .messaging-route-card {
    padding: 17px;
  }

  .messaging-qr-panel {
    min-height: 375px;
  }

  .messaging-route-values > div {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px 0;
  }

  .messaging-route-values dd {
    justify-content: space-between;
    text-align: left;
  }

  .messaging-route-values strong,
  .messaging-route-values code {
    max-width: calc(100% - 62px);
  }

  .messaging-imessage-note {
    padding: 12px;
  }

  .messaging-route-footer,
  .messaging-rotate-confirm:not([hidden]),
  .messaging-route-error:not([hidden]) {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .messaging-route-error:not([hidden]) {
    display: grid;
    justify-items: stretch;
    text-align: left;
  }

  .messaging-route-error > span {
    display: none;
  }

  .messaging-route-error button,
  .messaging-rotate-button {
    width: 100%;
  }

  .messaging-rotate-confirm > div:last-child {
    width: 100%;
  }

  .messaging-rotate-confirm button {
    flex: 1;
  }

  .ready-copy h1 {
    max-width: 300px;
    font-size: 23px;
  }

  .ready-copy p {
    max-width: 270px;
  }

  .composer {
    padding-right: 10px;
    padding-left: 10px;
  }

  .composer-shell {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .composer-plus,
  .composer-mic,
  .send-btn {
    width: 34px;
    height: 34px;
  }

  .message.user .message-text {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .messaging-spinner { animation-duration: 1.8s; }
  .messages-open-button { transition: none; }
}
