:root {
  --ink: #252c27;
  --muted: #616960;
  --line: #d8dbd1;
  --paper: #f4f5ee;
  --card: #fffef9;
  --green: #285746;
  --pale: #e8ede2;
  --amber: #825d13;
  --rust: #984734;
  --sans: "IBM Plex Sans", sans-serif;
  --serif: Fraunces, Georgia, serif;
  --mono: "IBM Plex Mono", monospace;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
button,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
select {
  cursor: pointer;
}
button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.55rem 0.85rem;
  background: var(--card);
  min-height: 42px;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover:not(:disabled) {
  background: var(--pale);
  border-color: #a6b4a3;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
button.primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
button.primary:hover:not(:disabled) {
  background: #1b4334;
}
button.quiet {
  background: transparent;
}
button.small {
  font-size: 0.8rem;
  min-height: 36px;
  padding: 0.3rem 0.6rem;
}
a {
  color: var(--green);
  text-underline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
header {
  height: 76px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: 0 1.75rem;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.wordmark {
  font: 640 2rem/1 var(--serif);
  letter-spacing: -0.08em;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
}
.identity { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; }
.relation-choice { display: block; max-width: 100%; text-align: left; margin: 0.5rem 0; overflow-wrap: anywhere; }
#identity-label { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1000px) {
  header { height: auto; min-height: 76px; flex-wrap: wrap; padding-top: 0.6rem; padding-bottom: 0.6rem; gap: 0.65rem; }
  .identity { margin-left: auto; }
}
.wordmark > span:first-child {
  color: var(--green);
}
.brand-mark {
  font: 28px var(--sans);
  color: var(--green);
  margin-left: 12px;
}
.workspace-label {
  border-left: 1px solid var(--line);
  padding-left: 1.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
}
.dot.ok {
  background: var(--green);
}
.dot.bad {
  background: var(--rust);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  flex: 1;
  min-height: 0;
}
.workspace.inspector-hidden {
  grid-template-columns: 1fr;
}
.workspace.inspector-hidden #inspector {
  display: none;
}
main {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.conversation-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.6rem 0.7rem;
  flex-shrink: 0;
}
.eyebrow {
  font: 500 0.65rem/1.5 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
#thread {
  overflow: auto;
  overscroll-behavior: contain;
  flex: 1;
  min-height: 0;
  padding: 1rem clamp(1.2rem, 4vw, 4.5rem) 2rem;
  scroll-behavior: smooth;
}
.empty {
  max-width: 660px;
  margin: clamp(1rem, 6vh, 5rem) auto 1rem;
}
.empty h1 {
  font: 560 clamp(2.5rem, 4.1vw, 4rem)/1.08 var(--serif);
  letter-spacing: -0.045em;
  margin: 1rem 0 1.3rem;
}
.empty > p {
  color: var(--muted);
  max-width: 430px;
}
.suggestions {
  display: grid;
  gap: 0.65rem;
  margin-top: 2rem;
}
.suggestions button {
  text-align: left;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 0.8rem 0;
  font-size: 0.93rem;
  position: relative;
  padding-right: 1.5rem;
}
.suggestions button > span:last-child {
  position: absolute;
  right: 0;
  top: 1.4rem;
  color: var(--green);
}
.example-label {
  display: block;
  font: 400 0.65rem var(--mono);
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.empty .empty-note {
  font-size: 0.76rem;
  margin-top: 1.8rem;
  max-width: none;
}
.turn {
  max-width: 850px;
  margin: 0 auto 2rem;
  animation: rise 0.2s ease-out;
}
.q {
  margin-left: 12%;
  padding: 0.8rem 1.15rem;
  border: 1px solid var(--line);
  background: var(--pale);
  border-radius: 12px 12px 3px 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.turn-context {
  border-left: 2px solid #9eae94;
  color: var(--muted);
  font: 400 0.72rem/1.6 var(--sans);
  padding-left: 0.7rem;
  margin: 0 0 0.7rem;
  overflow-wrap: anywhere;
}
.turn.off-context .turn-context { border-left-style: dashed; }
.a {
  padding: 1.3rem 0 0.2rem;
}
.stamp {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font: 500 0.65rem var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green);
  margin-bottom: 0.85rem;
}
.stamp:before {
  content: "✳";
  font: 22px var(--sans);
}
.kind-NeedsClarification .stamp,
.kind-PartialAnswer .stamp,
.kind-BudgetExhausted .stamp {
  color: var(--amber);
}
.kind-RequiredServiceFailure .stamp,
.kind-UnresolvedConflict .stamp,
.kind-PremiseDisputed .stamp,
.kind-InsufficientEvidence .stamp {
  color: var(--rust);
}
.answer-body {
  overflow-wrap: anywhere;
  font-size: 0.97rem;
}
.answer-body p {
  margin: 0.6rem 0;
  white-space: pre-wrap;
}
.answer-body ul,
.answer-body ol {
  padding-left: 1.4rem;
}
.answer-body li {
  margin: 0.3rem 0;
}
.answer-body h3 {
  font-size: 1rem;
  margin: 1rem 0 0.4rem;
}
.answer-body .citation-ref {
  border: 0;
  border-radius: 3px;
  min-height: 28px;
  min-width: 30px;
  padding: 0 0.25rem;
  vertical-align: baseline;
  font: 500 0.7rem var(--mono);
  color: var(--green);
  background: var(--pale);
}
.source-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 0.65rem;
}
.source-chips button {
  font-size: 0.74rem;
  text-align: left;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 34px;
  padding: 0.3rem 0.6rem;
}
.source-chips b {
  font: 500 0.68rem var(--mono);
  margin-right: 0.5rem;
  color: var(--green);
}
.resource-choices {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0;
}
.resource-choices p {
  margin: 0 0 0.2rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.resource-choices button {
  display: grid;
  gap: 0.25rem;
  min-height: 44px;
  padding: 0.65rem 0.8rem;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}
.resource-choices small {
  font: 0.7rem var(--mono);
  color: var(--muted);
}
.turn-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.55rem;
}
.turn-actions button {
  border-color: transparent;
  font-size: 0.73rem;
  min-height: 32px;
  padding: 0.25rem 0.45rem;
  background: transparent;
  color: var(--muted);
}
.turn-actions button[aria-pressed="true"] {
  background: var(--pale);
  color: var(--green);
}
.turn-actions .elapsed {
  margin-left: auto;
  font: 400 0.68rem var(--mono);
  color: var(--muted);
}
.request-interrupted .stamp { color: var(--amber); }
.request-details {
  margin-top: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: 4px;
  background: var(--card);
  overflow-wrap: anywhere;
}
.request-details summary {
  color: var(--ink);
  font-size: 0.78rem;
  cursor: pointer;
  min-height: 28px;
  align-content: center;
}
.request-details[open] summary { margin-bottom: 0.85rem; }
.request-details .kv { font-size: 0.75rem; }
.request-details .kv dd { min-width: 0; }
.request-details .trace-note { margin: 0.7rem 0; }
.request-details .usage-status { color: var(--amber); }
.request-metadata { margin-top: 0.85rem; padding-top: 0.55rem; border-top: 1px solid var(--line); }
.request-metadata > summary { font-size: 0.72rem; color: var(--muted); }
.request-metadata[open] > summary { margin-bottom: 0.65rem; }
.request-details button { margin-top: 0.25rem; }
.inspection-failure { margin-top: 1rem; }
.pending-copy {
  color: var(--muted);
  font-size: 0.87rem;
}
.pending .stamp:before {
  animation: pulse 1.5s infinite;
}
.scope-note {
  border-left: 2px solid #b4bfaa;
  padding-left: 0.85rem;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.8rem;
}
.service-limitation {
  color: var(--amber);
  border-color: var(--amber);
  background: #faf4e5;
  padding: 0.7rem 0.85rem;
  margin-bottom: 1rem;
}
#compose {
  padding: 0 1.6rem 1rem;
  flex-shrink: 0;
}
.retry-context {
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 8px;
  background: var(--pale);
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.65rem;
  font-size: 0.77rem;
  overflow-wrap: anywhere;
}
.retry-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.retry-heading button { font-size: 0.72rem; padding: 0.35rem 0.5rem; }
.retry-context p { margin: 0.45rem 0 0; color: var(--muted); }
.retry-context details { margin-top: 0.45rem; }
.retry-context summary { cursor: pointer; }
.retry-context ol { max-height: 7rem; overflow-y: auto; padding-left: 1.3rem; margin-bottom: 0; }
.retry-context li { margin-bottom: 0.35rem; }
.input-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
  padding: 0.6rem;
  background: var(--card);
  border: 1px solid #aebba8;
  border-radius: 12px;
  box-shadow: 0 4px 18px #20382408;
}
.input-row:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}
textarea {
  width: 100%;
  resize: none;
  min-height: 52px;
  max-height: 160px;
  padding: 0.4rem 0.5rem;
  border: 0;
  background: transparent;
  outline: none !important;
}
textarea::placeholder {
  color: #777e75;
}
.source-inspection label { display: block; margin: 12px 0 6px; }
.source-inspection select { width: 100%; max-width: 100%; }
.source-inspection textarea { border: 1px solid #aebba8; border-radius: 6px; background: #fffef9; resize: vertical; }
.source-inspection textarea:focus-visible { box-shadow: 0 0 0 2px var(--green); }
.source-inspection fieldset { border: 0; padding: 12px 0; margin: 0; min-width: 0; }
.source-inspection legend { font-size: 12px; color: #58685c; }
.source-inspection label.inspection-source { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; }
.inspection-source input { flex: none; accent-color: var(--green); }
.inspection-source span { overflow-wrap: anywhere; }
.inspection-result blockquote { white-space: pre-wrap; overflow-wrap: anywhere; }
.input-row > button {
  flex-shrink: 0;
  min-width: 70px;
}
.compose-bottom {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.68rem;
  padding: 0.5rem 0.2rem 0;
}
#activity {
  font-family: var(--mono);
}
#inspector {
  border-left: 1px solid var(--line);
  background: #eef0e8;
  min-height: 0;
  overflow: auto;
  scroll-padding-bottom: 0.5rem;
  overscroll-behavior: contain;
}
.inspector-return { display: none; }
#inspector-dialog {
  padding: 0;
  border: 0;
  color: var(--ink);
  background: #eef0e8;
}
.inspector-heading {
  padding: 1.45rem 1.3rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.inspector-heading h2 {
  font: 560 1.3rem var(--serif);
  letter-spacing: -0.025em;
  margin: 0.35rem 0 0;
}
.inspect-number {
  font: 400 0.75rem var(--mono);
  color: var(--muted);
}
.settings {
  margin: 0 1.3rem 0.9rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f6f7f0;
}
.settings summary {
  font-size: 0.75rem;
  cursor: pointer;
}
.settings summary span {
  float: right;
  font: 400 0.7rem var(--mono);
  color: var(--green);
}
.settings label {
  display: block;
  font-size: 0.73rem;
  margin: 0.8rem 0 0.3rem;
}
.settings select {
  padding: 0.4rem;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--card);
}
.settings p {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0.6rem 0;
}
.tabs {
  display: flex;
  padding: 0 1.3rem;
  border-bottom: 1px solid var(--line);
  gap: 0.3rem;
  position: sticky;
  top: 0;
  background: #eef0e8;
  z-index: 1;
}
.tabs button {
  flex: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.75rem 0.3rem;
  border-bottom: 2px solid transparent;
}
.tabs button[aria-pressed="true"] {
  border-bottom-color: var(--green);
  color: var(--green);
  font-weight: 600;
}
.usage-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.usage-toolbar h3 { margin: 0; font-size: 1rem; }
.usage-list { list-style: none; padding: 0; margin: 1rem 0; }
.usage-list li { margin: 0.6rem 0; }
.usage-list button { width: 100%; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.usage-list strong, .usage-list time, .usage-list span { display: block; }
.usage-list time, .usage-list span { font-size: 0.75rem; font-weight: 400; margin-top: 0.35rem; }
.usage-record-id { font-family: monospace; }
#inspection {
  padding: 1.1rem 1.3rem 2rem;
  overflow-wrap: anywhere;
}
.inspector-empty {
  margin: 2.5rem 0.3rem;
  text-align: center;
  color: var(--muted);
}
.empty-symbol {
  display: block;
  font: 30px var(--serif);
  color: #8a9984;
  margin-bottom: 1rem;
}
.inspector-empty h3 {
  font: 560 1.1rem var(--serif);
  color: var(--ink);
}
.inspector-empty p {
  font-size: 0.81rem;
  max-width: 260px;
  margin: auto;
}
.section-title {
  font: 500 0.65rem var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.2rem 0 0.6rem;
}
.section-title:first-child {
  margin-top: 0;
}
.meta {
  font: 400 0.68rem/1.65 var(--mono);
  color: var(--muted);
}
.kv {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.3rem 0.6rem;
  font-size: 0.76rem;
  margin: 0.7rem 0 1rem;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
}
.badge {
  display: inline-block;
  font: 500 0.62rem var(--mono);
  padding: 0.18rem 0.4rem;
  background: var(--pale);
  border-radius: 3px;
  color: var(--green);
  margin-right: 0.3rem;
}
.badge.Rejected,
.badge.Unsupported,
.badge.Contradicted,
.badge.FabricatedCitation {
  background: #f3e1d9;
  color: #823624;
}
.badge.Navigation,
.badge.Conflicting,
.badge.Uncited {
  background: #f1e8d2;
  color: #74510d;
}
details.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-bottom: 0.55rem;
  padding: 0.6rem 0.75rem;
}
details.card summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.5;
}
details.card summary .badge {
  margin-bottom: 0.2rem;
}
details.card p {
  font-size: 0.78rem;
  margin: 0.6rem 0;
}
.ranking-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.75rem;
  margin: 0.8rem 0;
}
.ranking-table caption {
  text-align: left;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.ranking-table th,
.ranking-table td {
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.ranking-table th:first-child {
  width: 43%;
  text-align: left;
}
.ranking-table tbody th { font-weight: 500; }
.ranking-table small {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 400;
}
.ranking-raw { margin-top: 0.75rem; }
blockquote {
  font-size: 0.79rem;
  line-height: 1.65;
  margin: 0.7rem 0;
  padding: 0.15rem 0 0.15rem 0.7rem;
  border-left: 2px solid #a7b699;
  white-space: pre-wrap;
}
details.card .meta {
  font-size: 0.64rem;
}
.trace-note {
  font-size: 0.77rem;
  color: var(--muted);
  margin: 0.3rem 0 1rem;
}
.decisions {
  padding-left: 1rem;
  font-size: 0.73rem;
  color: var(--muted);
}
.decisions li {
  padding-bottom: 0.45rem;
}
.scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  font-size: 0.68rem;
}
.scores span {
  display: flex;
  justify-content: space-between;
  gap: 0.3rem;
}
.scores b {
  font-family: var(--mono);
  font-weight: 400;
}
.metric {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.71rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}
.metric span:last-child {
  font-family: var(--mono);
  white-space: nowrap;
}
pre {
  font: 400 0.66rem/1.65 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 450px;
  overflow: auto;
}
.verifier-inputs {
  border-left: 2px solid var(--line);
}
.verifier-input-text {
  max-height: none;
  overflow: visible;
  margin: 0.5rem 0 1rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.error {
  color: var(--rust) !important;
}
.status-line {
  font-size: 0.8rem;
}
.inspector-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.75rem;
}
.notice {
  margin-bottom: 0.65rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 6px;
  background: var(--pale);
  color: var(--ink);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}
.skip {
  position: fixed;
  left: 1rem;
  top: -100px;
  background: var(--card);
  z-index: 10;
  padding: 0.5rem;
}
.skip:focus {
  top: 0.5rem;
}
.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 rise {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}
@media (min-width: 1500px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 450px;
  }
  #thread {
    padding-left: 6rem;
    padding-right: 6rem;
  }
}
@media (max-width: 1000px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
  .workspace-label {
    display: none;
  }
  header {
    gap: 1rem;
    padding: 0 1.2rem;
  }
  .status {
    font-size: 0.7rem;
  }
  #thread {
    padding: 1rem 1.4rem;
  }
  .empty h1 {
    font-size: 2.9rem;
  }
  .empty {
    margin-top: 2rem;
  }
  .conversation-bar {
    padding: 1rem;
  }
  .inspector-heading,
  #inspection {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .settings {
    margin-left: 1rem;
    margin-right: 1rem;
  }
  #compose {
    padding: 0 1rem 0.75rem;
  }
}
@media (max-width: 760px) {
  body {
    height: 100dvh;
    overflow: hidden;
  }
  header {
    height: 65px;
    gap: 0.75rem;
    flex-wrap: wrap;
  }
  .wordmark {
    font-size: 1.6rem;
  }
  .brand-mark {
    font-size: 22px;
  }
  .status {
    max-width: 135px;
    font-size: 0.64rem;
  }
  #new {
    font-size: 0.72rem;
    padding: 0.35rem 0.5rem;
  }
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .conversation-bar {
    padding: 0.65rem 1rem;
  }
  main {
    min-height: 0;
    flex: 1;
  }
  #thread {
    overflow: auto;
    flex: 1;
    padding: 1rem 1.1rem;
  }
  .empty {
    margin: 1rem auto 2rem;
    max-width: 520px;
  }
  .empty h1 {
    font-size: 2.8rem;
  }
  .empty > p {
    font-size: 0.9rem;
  }
  #compose {
    background: var(--paper);
    padding: 0.6rem 0.8rem max(0.65rem, env(safe-area-inset-bottom));
    z-index: 2;
    border-top: 1px solid var(--line);
  }
  .compose-bottom {
    font-size: 0.62rem;
  }
  .input-row {
    padding: 0.4rem;
  }
  textarea {
    font-size: 16px;
  }
  .q {
    margin-left: 5%;
  }
  #inspector {
    border-left: 0;
    height: 100%;
    overflow: auto;
    padding-bottom: env(safe-area-inset-bottom);
  }
  #inspector-dialog {
    inset: 0;
    margin: 0;
    width: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    overflow: hidden;
  }
  .inspector-return {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 3;
    padding: max(0.65rem, env(safe-area-inset-top)) 1rem 0.65rem;
    background: #eef0e8;
    border-bottom: 1px solid var(--line);
  }
  #inspector { scroll-padding-top: 5rem; }
  .inspector-return button {
    min-height: 44px;
    color: var(--green);
  }
  .tabs {
    position: static;
  }
  .inspector-empty {
    margin: 1rem;
  }
  .source-chips button {
    max-width: 280px;
  }
  .turn-actions {
    flex-wrap: wrap;
  }
  .workspace.inspector-hidden #inspector {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Compact viewports keep the header in normal flow when controls wrap. */
@media (max-width: 760px) {
  header {
    height: auto;
    min-height: 65px;
    padding: 0.7rem 1rem;
    row-gap: 0.5rem;
  }
  .brand-mark {
    margin-left: 9px;
  }
  .conversation-bar .eyebrow {
    font-size: 0.6rem;
  }
}
@media (max-height: 760px) and (min-width: 761px) {
  .empty {
    margin-top: 0.5rem;
  }
  .empty h1 {
    font-size: 2.7rem;
    margin: 0.7rem 0;
  }
  .suggestions {
    margin-top: 1rem;
  }
  .suggestions button {
    padding: 0.5rem 1.5rem 0.5rem 0;
  }
  .empty .empty-note {
    margin-top: 0.8rem;
  }
}

/* Requested-fact cells (ADR 0162): one block per (document, fact); the quote wraps at any width. */
.fact-cells { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.fact-cell { border-bottom: 1px solid var(--line); padding: 0.4rem 0; }
.fact-cell p { margin: 0; overflow-wrap: anywhere; }
.fact-cell blockquote { margin: 0.3rem 0 0.2rem; padding-left: 0.6rem; border-left: 2px solid var(--line); font-size: 0.8rem; white-space: pre-wrap; overflow-wrap: anywhere; }
/* Run controls follow the inspector's restrained, editorial typography. */
.settings .experiment-toggle { display: flex; align-items: center; gap: .6rem; font-size: .8rem; }
.settings .experiment-toggle input { width: auto; margin: 0; }
.answer-usage { color: var(--muted, #656c63); font-size: .8rem; margin-top: .8rem; overflow-wrap: anywhere; }

/* Source previews (answers that return passages instead of a written answer) */
.answer-body .preview-lead {
  border-left: 3px solid var(--amber);
  background: #f7f1e1;
  color: var(--amber);
  padding: 0.55rem 0.75rem;
  border-radius: 0 4px 4px 0;
  font-size: 0.9rem;
}
.answer-body .preview-label {
  margin: 1.1rem 0 0.2rem;
  font: 500 0.68rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.source-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 0.6rem 0;
  padding: 0.65rem 0.85rem 0.7rem;
}
.source-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.6rem;
  font-weight: 600;
  line-height: 1.35;
}
.source-card-title a {
  color: var(--green);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.source-card blockquote {
  margin: 0.45rem 0 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink);
}
.source-card blockquote.is-clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  white-space: normal;
}
.source-card-crumb {
  margin-top: 0.1rem;
  font-size: 0.74rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.source-card .passage-toggle {
  margin-top: 0.2rem;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--green);
  font: 500 0.78rem var(--sans);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.applied-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 12px; color: var(--muted, #6b7280); }
.filter-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 4px 1px 8px; border: 1px solid var(--border, #d1d5db); border-radius: 999px; background: transparent; }
.filter-chip.relaxed { padding-right: 8px; opacity: 0.7; text-decoration: line-through; }
.filter-chip.inferred { border-style: dashed; }
.filter-chip.explicit { border-color: var(--text, #374151); }
.filter-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 4px; border-radius: 999px; }
.filter-chip button:hover, .filter-chip button:focus-visible { background: rgba(127,127,127,.2); }

/* The deployment switch (ADR 0212) sits beside the corpus status; hidden unless several deployments are listed. */
.deployment { max-width: 14rem; font-size: 0.78rem; padding: 0.3rem 0.5rem; }
.deployment[hidden] { display: none; }
.suggestions[hidden] { display: none; }

/* Clerk's sign-in form while signed out (ADR 0224). */
.clerk-sign-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem;
}
