.demo-mode-watermark {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9999;
  pointer-events: none;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #fff;
  background: rgba(180, 40, 40, 0.92);
  padding: 4px 10px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* App layer on hi-fi tokens (popover, toggles, gate timeout, thread scroll). */
#empty-state.col {
  align-self: stretch;
}
.prototype-disclaimer {
  font-size: 12px;
  line-height: 1.45;
  color: #9a9a9a;
  text-align: center;
  max-width: var(--column);
  margin: 0 auto;
}
.gate .prototype-disclaimer {
  width: 100%;
  max-width: 400px;
  margin-bottom: var(--s-4);
  padding: 0 var(--s-2);
}
.app-footer {
  flex-shrink: 0;
  width: 100%;
  max-width: var(--column);
  padding-left: var(--s-6);
  padding-right: var(--s-6);
}
.app-footer .prototype-disclaimer {
  text-align: center;
}
.dock {
  flex-shrink: 0;
  z-index: 2;
  background-color: var(--color-bg);
  background-image: linear-gradient(var(--color-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-grid) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.dock .app-footer {
  padding-top: var(--s-2);
  padding-bottom: var(--s-2);
}
.dock .prototype-disclaimer {
  font-size: 11px;
  line-height: 1.35;
}
@media (min-width: 640px) and (max-height: 860px) {
  .thread {
    padding-top: var(--s-4);
    padding-bottom: var(--s-4);
  }
  .hero {
    margin-top: var(--s-3);
  }
  .hero-leverup {
    font-size: 2.25rem;
    line-height: 1.05;
  }
  .hero-assistant {
    font-size: 1.65rem;
    line-height: 1.08;
  }
  .hero-sub {
    margin-top: var(--s-3);
    font-size: var(--fs-sm);
    line-height: 1.4;
  }
  .hero-actions {
    margin-top: var(--s-4);
    gap: var(--s-2);
  }
  .hero-actions .btn {
    min-height: 40px;
    min-width: 7.5rem;
    padding: 0 var(--s-4);
  }
  .chips {
    margin-top: var(--s-4);
    gap: var(--s-2);
  }
  .chip {
    min-height: 46px;
    padding: var(--s-2) var(--s-4);
    font-size: var(--fs-meta);
  }
  .chip small {
    font-size: 11px;
    line-height: 1.25;
  }
  .dock {
    padding-top: var(--s-2);
  }
  .source-toggle {
    margin-bottom: var(--s-1);
  }
}
body.m .app-footer {
  padding-left: var(--s-4);
  padding-right: var(--s-4);
}
body.m .gate .prototype-disclaimer {
  font-size: 11px;
  margin-bottom: var(--s-3);
}
.confidential-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #ff3b30;
  background: rgba(255, 59, 48, 0.12);
  color: #ff3b30;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.35;
}
.hero-title-row {
  align-items: flex-start;
}
.hero-titles {
  flex: 1 1 12rem;
  min-width: 0;
}
.gate-card-title {
  font-size: var(--fs-h2);
  line-height: 34px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.gate-card-title .brand-compact {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}
.top .brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  min-width: 0;
  flex: 1;
}
body.m .confidential-badge {
  font-size: 10px;
  padding: 2px 8px;
}
body.m .hero-title-row .confidential-badge {
  margin-top: var(--s-1);
}
.thread {
  overflow: visible;
  -webkit-mask-image: none;
  mask-image: none;
}
.bot-body .sources {
  max-height: min(280px, 42vh);
  overflow-y: auto;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
.bot-body .sources.sources--clip::after {
  content: "";
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  display: block;
  height: 28px;
  margin-top: -28px;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--color-surface) 85%);
}
#empty-state.is-dismissed {
  display: none !important;
}
.chips[hidden],
#starters[hidden] {
  display: none !important;
}
.src-highlight {
  background: var(--color-surface-3) !important;
}
.answer-details {
  margin-top: var(--s-3);
  padding-left: 1.15em;
  list-style: disc;
}
.answer-details li + li {
  margin-top: var(--s-2);
}
.answer-details li::marker {
  color: var(--color-muted);
}
.conflict-note {
  margin-top: var(--s-3);
  font-size: var(--fs-meta);
  line-height: 20px;
  color: var(--color-muted);
}
/* Build note #4: doc source label is injected in chat.js, not in gated hi-fi HTML */
.src .lbl {
  font-family: var(--font-sans);
  font-weight: 500;
}
.source-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  margin-bottom: var(--s-2);
  border: 0;
  font-size: var(--fs-meta);
  color: var(--color-muted);
  width: 100%;
  max-width: var(--column);
  padding: 0 var(--s-6);
}
.source-toggle label {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: var(--target);
  margin-top: 0;
  cursor: pointer;
}
body.m .source-toggle {
  padding: 0 var(--s-4);
}
.util-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  justify-content: center;
  margin-top: var(--s-2);
  width: 100%;
  max-width: var(--column);
  padding: 0 var(--s-6);
}
body.m .util-actions {
  padding: 0 var(--s-4);
}
.util-actions .btn-ghost {
  min-height: var(--target);
  padding: 0 var(--s-3);
  font-size: var(--fs-meta);
  color: var(--color-muted);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 500;
}
.util-actions .btn-ghost:hover {
  color: var(--color-fg);
}
#retry-btn[hidden],
#copy-btn[hidden] {
  display: none !important;
}
.stopped-label {
  color: var(--color-muted);
  font-size: var(--fs-meta);
}
.gate-timeout {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-top: var(--s-4);
  padding: var(--s-3);
  border: 1px solid var(--color-status-danger);
  background: var(--color-status-danger-bg);
  border-radius: var(--r-panel);
  font-size: var(--fs-meta);
}
.gate-timeout[hidden] {
  display: none !important;
}
.gate-timeout strong {
  color: var(--color-status-danger);
}
.field[readonly] {
  opacity: 0.85;
  cursor: wait;
}
.spin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spin {
    animation: none;
  }
  .dots i {
    animation: none !important;
  }
}
.cite-popover {
  position: fixed;
  z-index: 100;
  width: 280px;
  max-width: calc(100vw - 32px);
  padding: var(--s-3) var(--s-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--r-panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.cite-popover p {
  font-size: var(--fs-meta);
  line-height: 20px;
  color: var(--color-fg-2);
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cite-popover .pop-ttl {
  margin-top: var(--s-2);
  font-size: var(--fs-meta);
  font-weight: 600;
  color: var(--color-accent);
}
.eval-pre {
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  line-height: var(--lh-body);
  color: var(--color-fg-2);
}
