:root {
  color-scheme: light;
  /* Sticky layout contract: keep these values in sync with docs/mvp/MVP_RESPONSIVE_CHAT_LAYOUT_BLUEPRINT_v0.1.md. */
  --bp-compact: 720px;
  --bp-wide: 1100px;
  --topbar-h: clamp(52px, 7svh, 64px);
  --rail-w: clamp(220px, 18vw, 280px);
  --artifact-w: clamp(360px, 30vw, 480px);
  --drawer-w: min(88vw, 360px);
  --composer-max-h: min(22svh, 180px);
  --artifact-summary-max-h: min(8svh, 72px);
  --sheet-max-h: 88svh;
  --gap: clamp(8px, 1.2vw, 14px);
  --touch-target: 44px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f0f4f7;
  --line: #d7dde3;
  --text: #182027;
  --muted: #637083;
  --accent: #176a63;
  --accent-2: #e9f7f4;
  --warning: #a85c00;
  --warning-bg: #fff4df;
  --danger: #9f2626;
  --debug: #3356a5;
  --chat-column: 760px;
  --assistant-line: 70ch;
  --user-line: 56ch;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  min-height: var(--touch-target);
  padding: 8px 12px;
}

button:hover {
  border-color: var(--accent);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(23, 106, 99, 0.28);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.hidden {
  display: none !important;
}

.topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  height: var(--topbar-h);
  justify-content: space-between;
  min-height: var(--topbar-h);
  padding: 0 max(var(--gap), env(safe-area-inset-right, 0px)) 0 max(var(--gap), env(safe-area-inset-left, 0px));
  position: relative;
  z-index: 50;
}

.topbar-left,
.brand-lockup {
  align-items: center;
  display: flex;
  min-width: 0;
}

.topbar-left {
  gap: 8px;
}

.brand-lockup {
  gap: 8px;
}

.brand-lockup .muted {
  margin-left: 0;
}

.current-chat-title {
  border-left: 1px solid var(--line);
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  padding-left: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-menu-btn {
  display: none;
}

.muted {
  color: var(--muted);
  margin-left: 8px;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  position: relative;
}

.badge {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 4px 10px;
}

.icon-btn {
  align-items: center;
  display: inline-flex;
  font-size: 18px;
  height: var(--touch-target);
  justify-content: center;
  padding: 0;
  width: var(--touch-target);
}

.avatar-btn {
  align-items: center;
  background: var(--accent);
  border-color: var(--accent);
  border-radius: 999px;
  color: white;
  display: inline-flex;
  font-weight: 700;
  height: var(--touch-target);
  justify-content: center;
  padding: 0;
  text-transform: uppercase;
  width: var(--touch-target);
}

.artifact-top-btn {
  display: none;
  position: relative;
}

.artifact-dot {
  background: var(--warning);
  border: 2px solid var(--surface);
  border-radius: 999px;
  height: 10px;
  position: absolute;
  right: 7px;
  top: 7px;
  width: 10px;
}

.system-menu {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(24, 32, 39, 0.14);
  display: grid;
  gap: 6px;
  min-width: 176px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
}

.system-menu-role {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 4px 8px;
}

.system-menu-item {
  background: transparent;
  border-color: transparent;
  justify-content: flex-start;
  text-align: left;
  width: 100%;
}

.login-view {
  display: grid;
  height: calc(100vh - var(--topbar-h));
  height: calc(100svh - var(--topbar-h));
  overflow: auto;
  place-items: center;
  padding: 16px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 420px;
  padding: 20px;
  width: 100%;
}

.login-card h1 {
  font-size: 22px;
  margin: 0 0 16px;
}

.stack {
  display: grid;
  gap: 10px;
}

input,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  min-height: 48px;
  resize: vertical;
}

.secondary {
  margin-top: 10px;
  width: 100%;
}

.workspace {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--artifact-w);
  height: calc(100vh - var(--topbar-h));
  height: calc(100svh - var(--topbar-h));
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.workspace.admin-mode {
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
}

.sessions-panel,
.chat-panel,
.result-panel {
  min-height: 0;
}

.sessions-panel {
  background: var(--surface);
  border-right: 1px solid var(--line);
  min-width: 0;
  overflow: auto;
  padding: 12px;
  z-index: 10;
}

.surface-scrim {
  display: none;
}

.panel-title-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.panel-title {
  color: var(--muted);
  font-size: 13px;
}

.compact-icon {
  font-size: 16px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  width: 34px;
}

.session-row {
  align-items: stretch;
  border: 1px solid transparent;
  border-radius: 6px;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 6px;
}

.session-row.active,
.session-row:hover,
.session-row:focus-within {
  background: var(--accent-2);
  border-color: #b4dcd5;
}

.session-item {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 2px;
  padding: 8px;
  text-align: left;
  width: 100%;
  min-width: 0;
}

.session-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-item small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-actions {
  align-items: center;
  display: flex;
  gap: 2px;
  padding-right: 4px;
}

.session-edit-form {
  display: grid;
  gap: 4px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 4px;
}

.session-title-input {
  min-height: 30px;
  padding: 6px 8px;
}

.admin-nav-item {
  align-items: center;
  background: transparent;
  border-color: transparent;
  display: grid;
  gap: 8px;
  grid-template-columns: 28px minmax(0, 1fr);
  justify-items: start;
  margin-bottom: 6px;
  text-align: left;
  width: 100%;
}

.admin-nav-item.active,
.admin-nav-item:hover,
.admin-nav-item:focus-visible {
  background: var(--accent-2);
  border-color: #b4dcd5;
}

.admin-nav-icon {
  color: var(--debug);
  font-weight: 700;
  text-align: center;
  width: 28px;
}

.chat-panel {
  display: flex;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: var(--gap);
}

.workspace.admin-mode .chat-panel {
  display: block;
  overflow: auto;
  padding: var(--gap);
}

.chat-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  height: 100%;
  min-height: 0;
  width: min(100%, var(--chat-column));
}

.admin-workspace {
  margin: 0 auto;
  max-width: 1280px;
  width: 100%;
}

.admin-screen {
  display: grid;
  gap: 14px;
}

.admin-screen-header,
.admin-card-title,
.admin-preview-header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.admin-screen-header h1,
.admin-preview-header h2 {
  margin: 0 0 4px;
}

.admin-screen h1 {
  font-size: 24px;
}

.admin-screen h2,
.admin-card h2 {
  font-size: 17px;
  margin: 0 0 10px;
}

.admin-screen h3 {
  font-size: 14px;
  margin: 14px 0 6px;
}

.metrics-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.metric-card,
.admin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
}

.metric-title,
.metric-sub {
  color: var(--muted);
  font-size: 13px;
}

.metric-main {
  font-size: 22px;
  font-weight: 700;
  margin: 5px 0;
}

.metric-bar {
  background: var(--surface-2);
  border-radius: 999px;
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
}

.metric-bar span {
  background: var(--accent);
  display: block;
  height: 100%;
}

.admin-two-column {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
}

.admin-two-column.wide-left {
  grid-template-columns: minmax(420px, 0.9fr) minmax(0, 1.1fr);
}

.context-summary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

.activity-list {
  display: grid;
  gap: 6px;
}

.activity-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(150px, 1.4fr) minmax(140px, 1fr) 92px 90px minmax(100px, 0.9fr) 78px;
  min-height: 42px;
  text-align: left;
  width: 100%;
}

.activity-row.active,
.activity-row:hover {
  background: var(--accent-2);
}

.activity-title {
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-message-preview {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 360px;
  overflow: auto;
  padding: 10px;
}

.prompt-layer {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}

.prompt-layer summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 9px 10px;
}

.prompt-layer pre {
  border-radius: 0;
  margin: 0;
  max-height: 420px;
}

.layer-meta {
  color: var(--muted);
  display: grid;
  gap: 4px;
  padding: 8px 10px;
}

.quick-actions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.quick-actions button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.messages {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.empty-state {
  color: var(--muted);
}

.message {
  border-radius: 8px;
  line-height: 1.56;
  margin: 0 0 12px;
  max-width: min(86%, var(--assistant-line));
  overflow-wrap: anywhere;
  padding: 10px 12px;
  white-space: pre-wrap;
}

.message.user {
  background: var(--accent);
  color: white;
  margin-left: auto;
  max-width: min(78%, var(--user-line));
}

.message.assistant {
  background: var(--surface-2);
  margin-right: auto;
  max-width: min(100%, var(--assistant-line));
}

.message.markdown-body {
  white-space: normal;
}

.markdown-body > :first-child {
  margin-top: 0;
}

.markdown-body > :last-child {
  margin-bottom: 0;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body pre,
.markdown-body table {
  margin: 0 0 10px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  font-size: 1rem;
  line-height: 1.3;
  margin: 12px 0 6px;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.25rem;
}

.markdown-body li + li {
  margin-top: 4px;
}

.markdown-body a {
  color: var(--accent);
  font-weight: 650;
  text-underline-offset: 2px;
}

.markdown-body code {
  background: rgba(24, 32, 39, 0.08);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  padding: 1px 4px;
}

.markdown-body pre {
  background: #182027;
  border-radius: 6px;
  color: #f7f8fa;
  max-width: 100%;
  overflow-x: auto;
  padding: 10px 12px;
  white-space: pre;
}

.markdown-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.markdown-body blockquote {
  border-left: 3px solid var(--line);
  color: var(--muted);
  padding-left: 10px;
}

.markdown-body table {
  border-collapse: collapse;
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.message.pending {
  opacity: 0.88;
}

.message.typing {
  align-items: center;
  display: inline-flex;
  min-height: 38px;
  width: auto;
}

.typing-dots {
  align-items: center;
  display: inline-flex;
  gap: 5px;
  height: 16px;
}

.typing-dots span {
  animation: typing-dot 1050ms ease-in-out infinite;
  background: var(--muted);
  border-radius: 999px;
  display: block;
  height: 6px;
  opacity: 0.42;
  width: 6px;
}

.typing-dots span:nth-child(2) {
  animation-delay: 150ms;
}

.typing-dots span:nth-child(3) {
  animation-delay: 300ms;
}

@keyframes typing-dot {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.message-form {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-bottom: max(var(--safe-bottom), 0px);
  padding-top: var(--gap);
}

.message-input-stack {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.message-input-stack textarea {
  max-height: var(--composer-max-h);
  overflow: auto;
}

.message-actions {
  display: flex;
  gap: 6px;
}

.send-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-size: 18px;
}

.voice-btn {
  isolation: isolate;
  overflow: visible;
  position: relative;
}

.voice-pulse,
.voice-icon,
.voice-icon::before,
.voice-icon::after {
  pointer-events: none;
}

.voice-pulse {
  border: 2px solid rgba(23, 106, 99, 0.32);
  border-radius: 999px;
  display: none;
  inset: 3px;
  position: absolute;
  z-index: 0;
}

.voice-icon {
  display: inline-block;
  height: 20px;
  position: relative;
  width: 20px;
  z-index: 1;
}

.voice-btn.voice-batch .voice-icon::before {
  background: var(--danger);
  border-radius: 999px;
  content: "";
  inset: 5px;
  position: absolute;
}

.voice-btn.voice-batch.recording {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.voice-btn.voice-batch.recording .voice-icon::before {
  background: currentColor;
  border-radius: 2px;
  inset: 4px;
}

.voice-btn.voice-live {
  background: var(--accent-2);
  border-color: #b4dcd5;
  color: var(--accent);
}

.voice-btn.voice-live.recording,
.voice-btn.voice-live.connecting {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.voice-btn.voice-live .voice-icon::before {
  border: 2px solid currentColor;
  border-radius: 999px;
  content: "";
  height: 13px;
  left: 5px;
  position: absolute;
  top: 1px;
  width: 10px;
}

.voice-btn.voice-live .voice-icon::after {
  border: 2px solid currentColor;
  border-radius: 0 0 9px 9px;
  border-top: 0;
  content: "";
  height: 7px;
  left: 4px;
  position: absolute;
  top: 11px;
  width: 12px;
}

.voice-btn.voice-live.streaming .voice-pulse {
  animation: voice-live-pulse 1200ms ease-out infinite;
  display: block;
}

.voice-btn.connecting .voice-icon,
.voice-btn.transcribing .voice-icon {
  animation: voice-icon-breath 900ms ease-in-out infinite;
}

.voice-btn:disabled .voice-pulse {
  display: none;
}

@keyframes voice-live-pulse {
  0% {
    opacity: 0.7;
    transform: scale(0.78);
  }
  100% {
    opacity: 0;
    transform: scale(1.55);
  }
}

@keyframes voice-icon-breath {
  0%,
  100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .typing-dots span,
  .voice-btn.voice-live.streaming .voice-pulse,
  .voice-btn.connecting .voice-icon,
  .voice-btn.transcribing .voice-icon {
    animation: none;
  }
}

.voice-status {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  padding: 6px 8px;
}

.voice-cancel-btn {
  border-color: #efc4c4;
  color: var(--danger);
}

.artifact-summary {
  align-items: center;
  background: var(--accent-2);
  border-color: #b4dcd5;
  color: var(--text);
  display: none;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: var(--gap);
  max-height: var(--artifact-summary-max-h);
  overflow: hidden;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}

.artifact-summary strong,
.artifact-summary small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-summary small {
  color: var(--muted);
}

.result-panel {
  background: var(--surface);
  border-left: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.artifact-panel-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
  padding: 10px 12px;
}

.artifact-panel-header > div {
  min-width: 0;
}

.artifact-panel-header strong,
.artifact-panel-header span {
  display: block;
  margin-left: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-panel-header .compact-icon {
  display: none;
}

.tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  overflow-x: auto;
}

.tab {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  min-width: 82px;
}

.tab.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.tab-content {
  min-height: 0;
  min-width: 0;
  overflow: auto;
  padding: 14px;
}

.draft-status {
  background: var(--warning-bg);
  border: 1px solid #f3c887;
  border-radius: 999px;
  color: var(--warning);
  display: inline-block;
  font-size: 13px;
  margin: 6px 0 12px;
  padding: 4px 10px;
}

.warning-list {
  background: var(--warning-bg);
  border: 1px solid #f3c887;
  border-radius: 8px;
  color: var(--warning);
  margin-bottom: 12px;
  padding: 10px;
}

.status-list {
  display: grid;
  gap: 8px;
}

.status-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}

pre {
  background: #111827;
  border-radius: 8px;
  color: #e5e7eb;
  max-width: 100%;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-row {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}

.hint-line {
  align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px;
}

.hint-icon {
  color: var(--debug);
  flex: 0 0 auto;
  font-weight: 700;
}

.user-create-form,
.user-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
}

.user-create-form {
  background: var(--accent-2);
}

.user-row {
  background: var(--surface);
}

.user-meta,
.user-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

label {
  color: var(--muted);
  display: grid;
  gap: 4px;
}

select {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  width: 100%;
}

.danger-btn {
  border-color: #efc4c4;
  color: var(--danger);
}

.inspector-layer {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 8px;
}

.inspector-layer summary {
  cursor: pointer;
  padding: 8px;
}

.inspector-layer pre {
  border-radius: 0 0 6px 6px;
  margin: 0;
}

.toast {
  background: var(--text);
  border-radius: 6px;
  bottom: 16px;
  color: white;
  left: 50%;
  padding: 10px 14px;
  position: fixed;
  transform: translateX(-50%);
}

/* Sticky breakpoint layer: native CSS media queries cannot read custom properties, so the two contract thresholds live only here. */
@media (max-width: 1099px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace.admin-mode {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar-menu-btn:not(.hidden) {
    display: inline-flex;
  }

  .artifact-top-btn:not(.hidden) {
    display: inline-flex;
  }

  .artifact-summary:not(.hidden) {
    display: grid;
  }

  .sessions-panel {
    border-right: 1px solid var(--line);
    bottom: 0;
    box-shadow: 12px 0 34px rgba(24, 32, 39, 0.14);
    left: 0;
    max-width: var(--drawer-w);
    position: fixed;
    top: var(--topbar-h);
    transform: translateX(-100%);
    transition: transform 160ms ease, visibility 160ms ease;
    visibility: hidden;
    width: var(--drawer-w);
    z-index: 30;
  }

  .sessions-panel.open {
    transform: translateX(0);
    visibility: visible;
  }

  .surface-scrim {
    background: rgba(24, 32, 39, 0.32);
    border: 0;
    border-radius: 0;
    bottom: 0;
    display: block;
    left: 0;
    min-height: 0;
    padding: 0;
    position: fixed;
    right: 0;
    top: var(--topbar-h);
  }

  .sessions-scrim {
    z-index: 25;
  }

  .result-panel {
    bottom: 0;
    box-shadow: -12px 0 34px rgba(24, 32, 39, 0.14);
    position: fixed;
    right: 0;
    top: var(--topbar-h);
    transform: translateX(100%);
    transition: transform 180ms ease, visibility 180ms ease;
    visibility: hidden;
    width: var(--artifact-w);
    z-index: 36;
  }

  .result-panel.open {
    transform: translateX(0);
    visibility: visible;
  }

  .artifact-panel-header .compact-icon {
    display: inline-flex;
  }

  .artifact-scrim {
    z-index: 34;
  }

  .metrics-grid,
  .admin-two-column,
  .admin-two-column.wide-left,
  .context-summary-grid {
    grid-template-columns: 1fr;
  }

  .activity-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 719px) {
  .topbar {
    gap: 8px;
  }

  .brand-lockup {
    display: grid;
    gap: 0;
  }

  .brand-lockup .muted {
    display: none;
  }

  .brand-lockup strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .current-chat-title {
    max-width: 38vw;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-column {
    width: 100%;
  }

  .result-panel {
    border-left: 0;
    border-radius: 12px 12px 0 0;
    border-top: 1px solid var(--line);
    bottom: 0;
    box-shadow: 0 -12px 34px rgba(24, 32, 39, 0.16);
    height: min(var(--sheet-max-h), calc(100svh - var(--topbar-h)));
    left: 0;
    position: fixed;
    right: 0;
    top: auto;
    transform: translateY(100%);
    transition: transform 180ms ease, visibility 180ms ease;
    visibility: hidden;
    width: auto;
    z-index: 36;
  }

  .result-panel.open {
    transform: translateY(0);
    visibility: visible;
  }

  .message-actions {
    gap: 4px;
  }

  .message-actions .icon-btn {
    height: 40px;
    width: 40px;
  }

  .compact-icon {
    height: 38px;
    min-height: 38px;
    width: 38px;
  }

  .message {
    max-width: 96%;
  }

  .message.user {
    max-width: 90%;
  }
}
