:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --sidebar: #f0f0ed;
  --surface: #ffffff;
  --surface-muted: #f5f5f2;
  --surface-hover: #e9e9e5;
  --border: #deded8;
  --border-strong: #c8c9c1;
  --text: #20211f;
  --text-soft: #4f514d;
  --muted: #6e716b;
  --faint: #91948d;
  --accent: #46604b;
  --accent-hover: #354b3a;
  --accent-soft: #e3ebe3;
  --success: #376246;
  --warning: #8a5b19;
  --danger: #9f3d36;
  --danger-soft: #f8e9e7;
  --sans: "Avenir Next", Avenir, "Segoe UI", "Gill Sans", "Trebuchet MS", sans-serif;
  --report: Charter, Georgia, Cambria, "Times New Roman", serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sidebar-width: 260px;
  --sources-width: 338px;
  --content-width: 850px;
  --ease: cubic-bezier(0, 0, 0.2, 1);
  --shadow-composer: 0 12px 32px rgba(27, 31, 26, 0.1), 0 2px 8px rgba(27, 31, 26, 0.06);
}

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

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.drawer-open {
  overflow: hidden;
}

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

button,
select,
input[type="checkbox"] {
  touch-action: manipulation;
}

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

button {
  color: inherit;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.075em;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 3px solid #647f68;
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  z-index: 300;
  top: 0.75rem;
  left: 0.75rem;
  min-height: 44px;
  padding: 0.7rem 1rem;
  color: #fff;
  border-radius: 8px;
  background: var(--accent-hover);
  font-size: 0.88rem;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 150ms var(--ease);
}

.skip-link:focus {
  color: #fff;
  transform: translateY(0);
}

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

.run-rail {
  position: relative;
  z-index: 50;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: 0.75rem 0.55rem 0.6rem;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: var(--sidebar);
}

.run-rail__brand {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 0.66rem;
  padding: 0.28rem 0.48rem 0.65rem;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  color: #fff;
  border-radius: 9px;
  background: var(--text);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.run-rail__brand strong,
.run-rail__brand small {
  display: block;
}

.run-rail__brand strong {
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.run-rail__brand small {
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 550;
}

.new-run-button {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 0.62rem;
  padding: 0.58rem 0.72rem;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(28, 31, 27, 0.04);
  font-size: 0.79rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 150ms var(--ease),
    border-color 150ms var(--ease),
    transform 100ms var(--ease);
}

.new-run-button:hover {
  border-color: #b7b9b0;
  background: #fbfbfa;
}

.new-run-button:active {
  transform: scale(0.99);
}

.new-run-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.corpus-button {
  display: grid;
  width: 100%;
  min-height: 48px;
  align-items: center;
  gap: 0.62rem;
  margin-top: 0.45rem;
  padding: 0.48rem 0.72rem;
  color: var(--text);
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  grid-template-columns: 18px minmax(0, 1fr);
  transition: background-color 140ms var(--ease);
}

.corpus-button:hover {
  background: #e6e6e1;
}

.corpus-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.corpus-button strong,
.corpus-button small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corpus-button strong {
  font-size: 0.73rem;
  font-weight: 720;
}

.corpus-button small {
  margin-top: 0.06rem;
  color: var(--muted);
  font-size: 0.58rem;
}

.recents {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  margin-top: 1.15rem;
}

.recents__header {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.55rem 0.35rem;
}

.recents__header h2 {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.run-count {
  display: inline-grid;
  min-width: 1.55rem;
  min-height: 1.35rem;
  place-items: center;
  padding: 0.05rem 0.35rem;
  color: var(--muted);
  border-radius: 999px;
  background: #e1e2dc;
  font-size: 0.64rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.run-list {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 0.13rem;
  padding: 0 0.1rem 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}

.run-list__empty {
  margin: 0.35rem 0.55rem;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.48;
}

.run-list > .button {
  margin: 0.3rem 0.5rem;
}

.rail-loading {
  display: grid;
  gap: 0.38rem;
  padding: 0.2rem 0.35rem;
}

.rail-loading span {
  display: block;
  height: 48px;
  border-radius: 7px;
  background: linear-gradient(
      100deg,
      transparent 20%,
      rgba(255, 255, 255, 0.65) 40%,
      transparent 60%
    )
    #e5e5e0;
  background-size: 220% 100%;
  animation: skeleton-sweep 1.5s linear infinite;
}

@keyframes skeleton-sweep {
  to {
    background-position-x: -220%;
  }
}

.run-card {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 50px;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 0.45rem;
  padding: 0.5rem 0.55rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms var(--ease);
}

.run-card:hover {
  background: #e6e6e1;
}

.run-card[aria-current="true"] {
  background: #dedfd8;
}

.run-card__signal {
  width: 6px;
  height: 6px;
  margin-top: 0.39rem;
  border-radius: 50%;
  background: var(--faint);
}

.run-card[data-status="queued"] .run-card__signal,
.run-card[data-status="running"] .run-card__signal {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(70, 96, 75, 0.11);
}

.run-card[data-status="completed"] .run-card__signal {
  background: var(--success);
}

.run-card[data-status="failed"] .run-card__signal {
  background: var(--danger);
}

.run-card > span:last-child {
  min-width: 0;
}

.run-card__question {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 620;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.run-card[aria-current="true"] .run-card__question {
  color: var(--text);
  font-weight: 700;
}

.run-card__meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-top: 0.22rem;
  color: var(--muted);
  font-size: 0.6rem;
  line-height: 1.2;
}

.run-card__meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-rail__footer {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 0.48rem;
  padding: 0.55rem 0.62rem 0.2rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.65rem;
  font-weight: 600;
}

.local-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.workspace-shell {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: var(--surface);
}

.workspace-chrome {
  position: relative;
  z-index: 30;
  display: flex;
  min-height: 58px;
  flex: 0 0 58px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0.8rem 0.45rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.workspace-chrome__left,
.workspace-chrome__controls,
.workspace-label,
.account-state,
.chrome-select {
  display: flex;
  align-items: center;
}

.workspace-chrome__left {
  min-width: 0;
  gap: 0.35rem;
}

.workspace-label {
  min-width: 0;
  gap: 0.55rem;
}

.workspace-label__icon {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  color: var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
}

.workspace-label__icon svg,
.chrome-select > svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace-label strong,
.workspace-label small {
  display: block;
}

.workspace-label strong {
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-label small {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.61rem;
  line-height: 1.1;
}

.workspace-chrome__controls {
  min-width: 0;
  justify-content: flex-end;
  gap: 0.38rem;
}

.chrome-select {
  min-width: 0;
  min-height: 44px;
  gap: 0.25rem;
  padding-left: 0.55rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.chrome-select select {
  min-width: 0;
  max-width: 172px;
  min-height: 42px;
  padding: 0.35rem 1.8rem 0.35rem 0.2rem;
  color: var(--text-soft);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.69rem;
  font-weight: 650;
  text-overflow: ellipsis;
}

.chrome-select--effort {
  padding-left: 0.25rem;
}

.chrome-select--effort select {
  max-width: 106px;
  padding-left: 0.35rem;
}

.chrome-select:focus-within {
  border-color: #708474;
  box-shadow: 0 0 0 2px rgba(70, 96, 75, 0.13);
}

.chrome-select select:disabled {
  color: var(--faint);
}

.account-state {
  min-height: 44px;
  gap: 0.4rem;
  padding: 0.35rem 0.58rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.66rem;
  font-weight: 650;
  white-space: nowrap;
}

.account-state__dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--faint);
}

.account-state[data-state="connected"] .account-state__dot {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(55, 98, 70, 0.11);
}

.account-state[data-state="pending"] .account-state__dot {
  background: #bf7922;
  box-shadow: 0 0 0 3px rgba(191, 121, 34, 0.11);
}

.account-state[data-state="error"] .account-state__dot {
  background: var(--danger);
}

.button,
.icon-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    color 140ms var(--ease),
    background-color 140ms var(--ease),
    border-color 140ms var(--ease),
    transform 100ms var(--ease);
}

.button {
  gap: 0.45rem;
  padding: 0.52rem 0.72rem;
}

.icon-button {
  width: 44px;
  flex: 0 0 44px;
  padding: 0;
  color: var(--muted);
  background: transparent;
}

.button svg,
.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  background: var(--surface-hover);
}

.button:active:not(:disabled),
.icon-button:active:not(:disabled) {
  transform: scale(0.98);
}

.button:disabled,
.icon-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button--secondary {
  color: var(--text-soft);
  border-color: var(--border);
  background: var(--surface);
}

.button--secondary:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.button--danger {
  color: var(--danger);
  border-color: #ddb9b5;
  background: transparent;
}

.button--danger:hover:not(:disabled) {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
}

.auth-button {
  min-height: 44px;
  padding-block: 0.35rem;
}

.history-toggle {
  display: none;
}

.login-notice {
  position: relative;
  z-index: 25;
  display: flex;
  min-height: 54px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 1rem;
  border-bottom: 1px solid #d8c59f;
  background: #fbf5e8;
  font-size: 0.72rem;
}

.login-notice__copy {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.65rem;
}

.login-notice__copy strong,
.login-notice__copy span span {
  display: block;
}

.login-notice__copy span span {
  margin-top: 0.08rem;
  color: var(--muted);
}

.login-notice__pulse {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #a36d21;
  animation: live-pulse 1.6s ease-in-out infinite;
}

.workspace-body {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) var(--sources-width);
}

.workspace-body:has(.source-ledger[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}

.research-desk {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: var(--surface);
}

.conversation-scroll {
  min-width: 0;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}

.empty-desk {
  display: flex;
  width: min(100%, 680px);
  min-height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin: 0 auto;
  padding: clamp(2rem, 8vh, 5.5rem) 1.5rem 1.5rem;
  text-align: center;
}

.empty-desk__orb {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  margin-bottom: 1.25rem;
  color: var(--accent);
  border: 1px solid #cbd6cb;
  border-radius: 20px;
  background: var(--accent-soft);
}

.empty-desk__orb svg {
  width: 39px;
  height: 39px;
  fill: var(--surface);
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-desk h1 {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1.14;
  text-wrap: balance;
}

.empty-desk > p {
  max-width: 54ch;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.58;
}

.capability-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1.35rem;
}

.capability-row span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 0.38rem;
  padding: 0.35rem 0.55rem;
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 0.65rem;
  font-weight: 650;
}

.capability-row svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.run-workspace {
  width: min(100%, calc(var(--content-width) + 3rem));
  min-height: 100%;
  margin: 0 auto;
  padding: 1.6rem 1.5rem 3rem;
}

.user-turn {
  display: grid;
  min-width: 0;
  align-items: start;
  gap: 0.7rem;
  grid-template-columns: 32px minmax(0, 1fr) auto;
}

.turn-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 9px;
}

.turn-avatar--user {
  color: var(--text-soft);
  border: 1px solid var(--border);
  background: var(--surface-muted);
  font-size: 0.65rem;
  font-weight: 750;
}

.turn-avatar--assistant {
  color: #fff;
  background: var(--text);
}

.turn-avatar--assistant svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-turn__content {
  min-width: 0;
  justify-self: end;
}

.user-prompt {
  width: fit-content;
  max-width: min(680px, 100%);
  max-height: 7.1rem;
  margin: 0;
  padding: 0.68rem 0.85rem;
  overflow: auto;
  color: var(--text);
  border-radius: 14px 14px 3px 14px;
  background: #edede9;
  font-size: 0.85rem;
  font-weight: 530;
  line-height: 1.52;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}

.run-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.2rem 0.8rem;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.61rem;
}

.run-meta span + span::before {
  margin-right: 0.8rem;
  color: var(--border-strong);
  content: "·";
}

.user-turn__state {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.status-stamp {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0.22rem 0.5rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.59rem;
  font-weight: 750;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.status-stamp[data-status="queued"],
.status-stamp[data-status="running"] {
  color: var(--accent-hover);
  border-color: #bdcbbf;
  background: var(--accent-soft);
}

.status-stamp[data-status="completed"] {
  color: var(--success);
}

.status-stamp[data-status="failed"] {
  color: var(--danger);
  border-color: #e0bbb7;
  background: var(--danger-soft);
}

.assistant-turn {
  display: grid;
  min-width: 0;
  align-items: start;
  gap: 0.75rem;
  margin-top: 1.35rem;
  grid-template-columns: 32px minmax(0, 1fr);
}

.assistant-turn__content {
  min-width: 0;
}

.progress-journal {
  margin: 0 0 1rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-muted);
}

.progress-journal > summary {
  display: grid;
  min-height: 52px;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  list-style: none;
  grid-template-columns: 30px minmax(0, 1fr) auto 24px;
  transition: background-color 140ms var(--ease);
}

.progress-journal > summary::-webkit-details-marker {
  display: none;
}

.progress-journal > summary:hover {
  background: #eeeeea;
}

.activity-summary__icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
}

.activity-summary__icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.activity-summary__copy {
  min-width: 0;
}

.activity-summary__copy strong,
.progress-journal__summary {
  display: block;
}

.activity-summary__copy strong {
  font-size: 0.75rem;
  font-weight: 750;
  line-height: 1.25;
}

.progress-journal__summary {
  margin-top: 0.12rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-chevron {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 180ms var(--ease);
}

.progress-journal[open] .activity-chevron {
  transform: rotate(180deg);
}

.live-indicator {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.42rem;
  color: var(--muted);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.56rem;
  font-weight: 750;
  white-space: nowrap;
}

.live-indicator > span:first-child {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
}

.live-indicator[data-state="live"] {
  color: var(--accent-hover);
}

.live-indicator[data-state="live"] > span:first-child {
  background: var(--accent);
  animation: live-pulse 1.6s ease-in-out infinite;
}

.live-indicator[data-state="done"] {
  color: var(--success);
}

.live-indicator[data-state="done"] > span:first-child {
  background: var(--success);
}

.live-indicator[data-state="error"] {
  color: var(--danger);
}

.live-indicator[data-state="error"] > span:first-child {
  background: var(--danger);
}

@keyframes live-pulse {
  50% {
    box-shadow: 0 0 0 5px rgba(70, 96, 75, 0.12);
  }
}

.activity-body {
  padding: 0.25rem 0.8rem 0.2rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.episode-list {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0.65rem 0 0;
  list-style: none;
}

.episode-list::before {
  position: absolute;
  top: 1.25rem;
  bottom: 1.25rem;
  left: 0.35rem;
  width: 1px;
  background: var(--border);
  content: "";
}

.episode {
  position: relative;
  display: grid;
  gap: 0.55rem;
  padding: 0 0 0.8rem;
  grid-template-columns: 0.75rem minmax(0, 1fr);
}

.episode__marker {
  position: relative;
  z-index: 1;
  width: 8px;
  height: 8px;
  margin-top: 0.34rem;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 1px var(--faint);
}

.episode[data-state="current"] .episode__marker {
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px rgba(70, 96, 75, 0.1);
}

.episode[data-state="error"] .episode__marker {
  background: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}

.episode__label {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.69rem;
  font-weight: 720;
  line-height: 1.35;
}

.episode[data-state="current"] .episode__label {
  color: var(--accent-hover);
}

.episode__detail {
  margin: 0.16rem 0 0;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.42;
}

.episode__time {
  display: block;
  margin-top: 0.2rem;
  color: var(--faint);
  font-size: 0.54rem;
}

.episode__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.episode__tag {
  max-width: 100%;
  padding: 0.18rem 0.35rem;
  overflow: hidden;
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-muted);
  font-size: 0.55rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-message {
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.85rem;
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  border-radius: 8px;
  background: var(--surface-muted);
  font-size: 0.75rem;
}

.run-message strong {
  display: block;
  margin-bottom: 0.12rem;
  color: var(--text);
}

.run-message p {
  margin: 0;
}

.run-message[data-kind="error"] {
  border-color: #e5c5c1;
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.report-sheet {
  min-width: 0;
  padding: 0.2rem 0 1rem;
}

.report-sheet__header {
  display: flex;
  min-height: 54px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 0 0.85rem;
  border-bottom: 1px solid var(--border);
}

.report-kicker,
.report-sheet__date {
  display: block;
  color: var(--muted);
  font-size: 0.59rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.report-sheet__header h1 {
  margin: 0.18rem 0 0.12rem;
  font-size: 1.16rem;
  font-weight: 720;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.sources-toggle {
  flex: 0 0 auto;
}

.source-count {
  display: inline-grid;
  min-width: 1.35rem;
  min-height: 1.25rem;
  place-items: center;
  padding: 0.05rem 0.25rem;
  color: var(--text-soft);
  border-radius: 999px;
  background: var(--surface-hover);
  font-size: 0.58rem;
  font-variant-numeric: tabular-nums;
}

.report-loading {
  display: flex;
  min-height: 290px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2rem 1rem;
  text-align: center;
}

.research-loader {
  display: flex;
  height: 22px;
  align-items: center;
  gap: 4px;
  margin-bottom: 0.9rem;
}

.research-loader span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: loader-rise 1.2s ease-in-out infinite;
}

.research-loader span:nth-child(2) {
  animation-delay: 120ms;
}

.research-loader span:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes loader-rise {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.report-loading h2 {
  margin: 0;
  font-size: 0.92rem;
}

.report-loading p {
  max-width: 44ch;
  margin: 0.38rem 0 0;
  color: var(--muted);
  font-size: 0.73rem;
}

.report-content {
  max-width: 74ch;
  margin: 1.3rem auto 0;
  color: #292b28;
  font-family: var(--report);
  font-size: clamp(1rem, 1.3vw, 1.065rem);
  line-height: 1.76;
  overflow-wrap: anywhere;
}

.report-content > :first-child {
  margin-top: 0;
}

.report-content h4,
.report-content h5,
.report-content h6 {
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.28;
  text-wrap: balance;
}

.report-content h4 {
  margin: 2.1em 0 0.6em;
  padding-bottom: 0.38em;
  border-bottom: 1px solid var(--border);
  font-size: 1.42em;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.report-content h5 {
  margin: 1.75em 0 0.5em;
  font-size: 1.17em;
  font-weight: 720;
  letter-spacing: -0.015em;
}

.report-content h6 {
  margin: 1.5em 0 0.4em;
  color: var(--accent-hover);
  font-size: 0.77em;
  font-weight: 750;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.report-content p {
  margin: 0 0 1.05em;
}

.report-content ul,
.report-content ol {
  margin: 0 0 1.15em;
  padding-left: 1.45em;
}

.report-content li {
  margin: 0.3em 0;
  padding-left: 0.14em;
}

.report-content li::marker {
  color: var(--accent);
  font-family: var(--sans);
  font-weight: 700;
}

.report-content blockquote {
  margin: 1.35em 0;
  padding: 0.15em 0 0.15em 1em;
  color: var(--text-soft);
  border-left: 3px solid var(--accent);
  font-style: italic;
}

.report-content blockquote p:last-child {
  margin-bottom: 0;
}

.report-content hr {
  margin: 2em 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.report-content code {
  padding: 0.1em 0.3em;
  color: #314735;
  border-radius: 4px;
  background: var(--accent-soft);
  font-family: var(--mono);
  font-size: 0.82em;
}

.report-content pre {
  max-width: 100%;
  margin: 1.25em 0;
  overflow-x: auto;
  padding: 0.9rem;
  color: #f5f6f3;
  border-radius: 8px;
  background: #292c29;
  line-height: 1.55;
}

.report-content pre code {
  padding: 0;
  color: inherit;
  background: transparent;
}

.report-content .citation-link {
  display: inline-grid;
  min-width: 1.35em;
  min-height: 1.35em;
  place-items: center;
  margin: 0 0.05em;
  padding: 0 0.28em;
  color: var(--accent-hover);
  border: 1px solid #bdcbbf;
  border-radius: 999px;
  background: var(--accent-soft);
  font-family: var(--sans);
  font-size: 0.62em;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  vertical-align: 0.25em;
}

.report-content .citation-link:hover {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.report-content table {
  display: block;
  width: 100%;
  margin: 1.4em 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.75em;
}

.report-content th,
.report-content td {
  min-width: 8rem;
  padding: 0.56rem 0.65rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.report-content th {
  background: var(--surface-muted);
  font-weight: 750;
}

.query-station {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  padding: 0.65rem 1rem 0.7rem;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--surface) 18%, var(--surface));
}

.question-form {
  width: min(100%, var(--content-width));
  margin: 0 auto;
}

.composer-shell {
  position: relative;
  display: flex;
  min-height: 106px;
  flex-direction: column;
  padding: 0.55rem 3.7rem 2.55rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-composer);
  transition:
    border-color 150ms var(--ease),
    box-shadow 150ms var(--ease);
}

.composer-shell:focus-within {
  border-color: #879989;
  box-shadow: 0 0 0 3px rgba(70, 96, 75, 0.1), var(--shadow-composer);
}

.composer-shell textarea {
  width: 100%;
  min-height: 46px;
  max-height: 180px;
  resize: none;
  overflow-y: auto;
  color: var(--text);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.92rem;
  line-height: 1.52;
}

.composer-shell textarea::placeholder {
  color: #888b84;
  opacity: 1;
}

.composer-shell textarea[aria-invalid="true"] {
  color: var(--danger);
}

.submit-button {
  position: absolute;
  right: 0.62rem;
  bottom: 0.58rem;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  color: #fff;
  border: 0;
  border-radius: 10px;
  background: var(--accent-hover);
  cursor: pointer;
  transition:
    background-color 140ms var(--ease),
    transform 100ms var(--ease),
    opacity 140ms var(--ease);
}

.submit-button:hover:not(:disabled) {
  background: #263b2b;
}

.submit-button:active:not(:disabled) {
  transform: scale(0.96);
}

.submit-button:disabled {
  color: var(--faint);
  background: var(--surface-hover);
  cursor: not-allowed;
}

.submit-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.composer-toolbar {
  position: absolute;
  right: 3.7rem;
  bottom: 0.58rem;
  left: 0.68rem;
  display: flex;
  min-width: 0;
  min-height: 32px;
  align-items: center;
  gap: 0.45rem;
}

.mode-chip,
.clarification-control {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 0.38rem;
  border-radius: 7px;
  font-size: 0.62rem;
  font-weight: 680;
}

.mode-chip {
  padding: 0.32rem 0.48rem;
  color: var(--accent-hover);
  background: var(--accent-soft);
}

.mode-chip svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.clarification-control {
  padding: 0.26rem 0.4rem;
  color: var(--text-soft);
  cursor: pointer;
}

.clarification-control:hover {
  background: var(--surface-muted);
}

.clarification-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.checkmark {
  position: relative;
  display: grid;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
}

.clarification-control input:checked + .checkmark {
  border-color: var(--accent);
  background: var(--accent);
}

.clarification-control input:checked + .checkmark::after {
  width: 6px;
  height: 3px;
  margin-top: -1px;
  border-bottom: 1.7px solid #fff;
  border-left: 1.7px solid #fff;
  content: "";
  transform: rotate(-45deg);
}

.clarification-control input:focus-visible + .checkmark {
  outline: 3px solid #647f68;
  outline-offset: 2px;
}

.composer-shortcut {
  margin-left: auto;
  color: var(--faint);
  font-size: 0.57rem;
  font-weight: 600;
  white-space: nowrap;
}

.field-error {
  display: block;
  min-height: 0.95rem;
  padding: 0.15rem 0.25rem 0;
  color: var(--danger);
  font-size: 0.62rem;
  font-weight: 650;
}

.field-error:empty {
  min-height: 0;
  padding-top: 0;
}

.composer-disclaimer {
  margin: 0.3rem 0 0;
  color: var(--faint);
  font-size: 0.55rem;
  text-align: center;
}

.source-ledger {
  position: relative;
  z-index: 35;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--border);
  background: var(--surface);
}

.source-ledger__header {
  display: flex;
  min-height: 66px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.75rem 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
}

.source-ledger__header span {
  display: block;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.source-ledger__header h2 {
  margin: 0.12rem 0 0;
  font-size: 0.96rem;
  letter-spacing: -0.015em;
}

.sources-close {
  display: none;
}

.source-ledger__intro {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.75rem 1rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
  font-size: 0.65rem;
  line-height: 1.45;
}

.source-list {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 0;
  margin: 0;
  padding: 0 0.8rem 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}

.source-card {
  display: grid;
  min-width: 0;
  gap: 0.55rem;
  padding: 0.85rem 0.2rem;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 1rem;
  grid-template-columns: 24px minmax(0, 1fr);
}

.source-card:focus {
  border-radius: 6px;
  outline: 3px solid #647f68;
  outline-offset: -2px;
}

.source-card__number {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: var(--accent-hover);
  border: 1px solid #bdcbbf;
  border-radius: 6px;
  background: var(--accent-soft);
  font-size: 0.57rem;
  font-weight: 800;
}

.source-card__title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.source-card__title a {
  color: var(--text);
  text-decoration: none;
}

.source-card__title a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.source-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.5rem;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.54rem;
  font-weight: 650;
  text-transform: uppercase;
}

.source-card__excerpt {
  display: -webkit-box;
  margin: 0.35rem 0 0;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--report);
  font-size: 0.66rem;
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.drawer-backdrop {
  display: none;
}

.corpus-dialog {
  position: fixed;
  z-index: 210;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 3vw, 2.25rem);
}

.corpus-dialog__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(28, 30, 27, 0.52);
  cursor: default;
}

.corpus-workbench {
  position: relative;
  display: flex;
  width: min(1120px, 100%);
  height: min(760px, 100%);
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 32px 80px rgba(22, 25, 21, 0.28);
  animation: corpus-enter 180ms var(--ease) both;
}

@keyframes corpus-enter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
}

.corpus-workbench__header {
  display: flex;
  min-height: 82px;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.corpus-kicker {
  display: block;
  color: var(--accent);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.corpus-workbench__header h2 {
  margin: 0.12rem 0 0;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
}

.corpus-workbench__header p {
  margin: 0.18rem 0 0;
  color: var(--muted);
  font-size: 0.68rem;
}

.corpus-search {
  display: grid;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.72rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: #fafaf7;
  grid-template-columns: minmax(310px, 0.82fr) minmax(0, 1.18fr);
}

.corpus-search__form {
  display: grid;
  min-width: 0;
  gap: 0.36rem;
}

.corpus-search__form label span,
.corpus-search__form label small {
  display: block;
}

.corpus-search__form label span {
  color: var(--text);
  font-size: 0.66rem;
  font-weight: 780;
}

.corpus-search__form label small {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.55rem;
}

.corpus-search__field {
  display: grid;
  min-width: 0;
  gap: 0.4rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.corpus-search__field input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  outline: 0;
  background: var(--surface);
  font: inherit;
  font-size: 0.72rem;
}

.corpus-search__field input:focus {
  border-color: #647f68;
  box-shadow: 0 0 0 3px rgba(77, 105, 84, 0.13);
}

.corpus-search__field .button {
  min-width: 82px;
  color: #fff;
  background: var(--accent);
}

.corpus-search__field .button:hover:not(:disabled) {
  background: #36533d;
}

.corpus-retrieval-state {
  display: grid;
  min-width: 0;
  gap: 0.32rem;
}

.corpus-retrieval-state__summary {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  gap: 0.26rem;
}

.corpus-readiness-line {
  display: grid;
  min-width: 0;
  grid-template-columns: 7px minmax(0, 1fr);
  align-items: start;
  gap: 0.42rem;
}

.corpus-readiness-line__marker {
  width: 7px;
  height: 7px;
  margin-top: 0.2rem;
  border: 1px solid #8f9891;
  border-radius: 50%;
  background: #eef0ee;
}

.corpus-readiness-line[data-tone="ready"] .corpus-readiness-line__marker {
  border-color: #4e7157;
  background: #4e7157;
  box-shadow: 0 0 0 2px #dce9df;
}

.corpus-readiness-line[data-tone="blocked"] .corpus-readiness-line__marker,
.corpus-readiness-line[data-tone="waiting"] .corpus-readiness-line__marker {
  border-color: #a76a24;
  background: #d48a32;
  box-shadow: 0 0 0 2px #f4e4cf;
}

.corpus-readiness-line[data-tone="action"] .corpus-readiness-line__marker {
  border-radius: 2px;
  border-color: #596b70;
  background: #70858b;
}

.corpus-readiness-line__copy {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 0.38rem;
}

.corpus-readiness-line__copy strong {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 0.57rem;
  font-weight: 760;
}

.corpus-readiness-line[data-tone="blocked"] .corpus-readiness-line__copy strong,
.corpus-readiness-line[data-tone="waiting"] .corpus-readiness-line__copy strong {
  color: #845018;
}

.corpus-readiness-line[data-tone="action"] .corpus-readiness-line__copy strong {
  color: #40565c;
}

.corpus-readiness-line__copy small {
  min-width: 0;
  color: var(--muted);
  font-size: 0.5rem;
  line-height: 1.35;
  white-space: normal;
}

.corpus-retrieval-state__heading,
.corpus-index-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.corpus-retrieval-state__heading {
  align-items: flex-start;
  justify-content: space-between;
}

.corpus-index-actions {
  flex: 0 0 auto;
}

.corpus-index-actions .button {
  min-height: 28px;
  padding: 0.32rem 0.55rem;
  font-size: 0.53rem;
}

.corpus-index-job {
  display: grid;
  gap: 0.28rem;
  padding: 0.48rem 0.58rem;
  border: 1px solid #a9c1ae;
  border-radius: 7px;
  background: #edf4ee;
}

.corpus-index-job[hidden] {
  display: none;
}

.corpus-index-job__copy {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem;
}

.corpus-index-job__copy strong {
  color: var(--accent);
  font-size: 0.58rem;
}

.corpus-index-job__copy span,
.corpus-index-job small {
  color: var(--muted);
  font-size: 0.5rem;
}

.corpus-index-job progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 99px;
  accent-color: var(--accent);
}

.corpus-model-stack {
  display: flex;
  min-width: 0;
  gap: 0.32rem;
  overflow-x: auto;
  padding-bottom: 0.08rem;
  scrollbar-width: thin;
}

.corpus-model-chip {
  display: grid;
  min-width: min(190px, 68vw);
  max-width: 250px;
  flex: 0 0 auto;
  gap: 0.04rem;
  padding: 0.38rem 0.48rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}

.corpus-model-chip[data-profile="champion"] {
  border-color: #a9c1ae;
  background: #edf4ee;
}

.corpus-model-chip[data-profile="fallback"] {
  border-color: #d5c7a8;
  background: #f8f4e9;
}

.corpus-model-chip[data-profile="pending"] {
  border-color: #d5b37e;
  background: #fbf3e5;
}

.corpus-model-chip strong,
.corpus-model-chip span,
.corpus-model-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corpus-model-chip strong {
  color: var(--accent);
  font-size: 0.5rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.corpus-model-chip[data-profile="fallback"] strong {
  color: #8a651e;
}

.corpus-model-chip span {
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.53rem;
}

.corpus-model-chip small {
  color: var(--muted);
  font-size: 0.49rem;
}

.corpus-workbench__body {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(260px, 0.34fr) minmax(0, 0.66fr);
}

.corpus-library {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: 0.9rem;
  border-right: 1px solid var(--border);
  background: var(--surface-muted);
}

.document-drop {
  display: flex;
  min-height: 76px;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.72rem;
  padding: 0.75rem;
  color: var(--text);
  border: 1px dashed #aeb7ab;
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition:
    border-color 140ms var(--ease),
    background-color 140ms var(--ease);
}

.document-drop:hover,
.document-drop.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.document-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.document-drop:focus-within {
  outline: 3px solid #647f68;
  outline-offset: 2px;
}

.document-drop svg {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.document-drop strong,
.document-drop small {
  display: block;
}

.document-drop strong {
  font-size: 0.72rem;
}

.document-drop small {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.59rem;
}

.corpus-library__summary {
  display: flex;
  min-height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.5rem 0.25rem 0.35rem;
}

.corpus-library__summary strong {
  font-size: 0.64rem;
  letter-spacing: 0.02em;
}

.text-button {
  min-height: 36px;
  padding: 0.25rem 0.35rem;
  color: var(--accent);
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 0.6rem;
  font-weight: 750;
  cursor: pointer;
}

.text-button:hover {
  background: var(--accent-soft);
}

.corpus-list {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 0.25rem;
  overflow-y: auto;
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}

.corpus-list__empty {
  margin: 1.5rem 0.5rem;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.5;
  text-align: center;
}

.document-card {
  display: grid;
  width: 100%;
  min-height: 62px;
  align-items: start;
  gap: 0.45rem;
  padding: 0.62rem;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  grid-template-columns: 9px minmax(0, 1fr);
}

.document-card:hover {
  background: #e8e8e3;
}

.document-card[aria-current="true"] {
  border-color: #c8d2c7;
  background: var(--accent-soft);
}

.document-card__status {
  width: 7px;
  height: 7px;
  margin-top: 0.3rem;
  border-radius: 50%;
  background: var(--faint);
}

.document-card[data-status="ready"] .document-card__status {
  background: var(--success);
}

.document-card[data-status="queued"] .document-card__status,
.document-card[data-status="processing"] .document-card__status {
  background: #b17422;
  box-shadow: 0 0 0 3px rgba(177, 116, 34, 0.12);
}

.document-card[data-status="partial"] .document-card__status {
  background: var(--warning);
}

.document-card[data-status="failed"] .document-card__status {
  background: var(--danger);
}

.document-card strong,
.document-card small {
  display: block;
}

.document-card strong {
  overflow: hidden;
  font-size: 0.68rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-card small {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.54rem;
  text-transform: uppercase;
}

.document-card__progress {
  display: block;
  width: 100%;
  height: 3px;
  margin-top: 0.42rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #d6d7d1;
  appearance: none;
}

.document-card__progress::-webkit-progress-bar {
  border-radius: inherit;
  background: #d6d7d1;
}

.document-card__progress::-webkit-progress-value {
  border-radius: inherit;
  background: #a56b1e;
  transition: width 180ms var(--ease);
}

.document-card__progress::-moz-progress-bar {
  border-radius: inherit;
  background: #a56b1e;
}

.document-inspector {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  background: var(--surface);
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}

.document-inspector__empty {
  display: grid;
  width: min(420px, calc(100% - 2rem));
  min-height: 100%;
  margin: 0 auto;
  place-content: center;
  justify-items: center;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.document-inspector__empty svg {
  width: 52px;
  height: 52px;
  fill: none;
  stroke: #8a9c8d;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.document-inspector__empty h3 {
  margin: 1rem 0 0;
  color: var(--text);
  font-family: var(--report);
  font-size: 1.15rem;
}

.document-inspector__empty p {
  margin: 0.5rem 0 0;
  font-size: 0.7rem;
  line-height: 1.6;
}

.corpus-search-results {
  min-height: 100%;
}

.corpus-search-results__header {
  position: sticky;
  z-index: 2;
  top: 0;
  padding: 0.95rem 1.2rem 0.8rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.97);
}

.corpus-search-results__header span {
  color: var(--accent);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.corpus-search-results__header h3 {
  margin: 0.12rem 0 0;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.corpus-search-results__header p {
  margin: 0.24rem 0 0;
  color: var(--muted);
  font-size: 0.61rem;
}

.corpus-search-contract {
  display: grid;
  gap: 0.58rem;
  padding: 0.72rem 1.2rem 0.82rem;
  border-bottom: 1px solid var(--border);
  background: #fafaf7;
}

.corpus-search-contract__overview {
  display: grid;
  gap: 0.48rem;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.9fr) minmax(0, 1.02fr);
}

.corpus-contract-card {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 0.18rem;
  padding: 0.56rem 0.62rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}

.corpus-contract-card__kicker,
.corpus-sufficiency > div:first-child > span {
  color: var(--muted);
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.corpus-contract-card > strong {
  overflow: hidden;
  font-size: 0.66rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corpus-contract-card > small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.49rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corpus-contract-card > code {
  display: block;
  overflow: hidden;
  color: var(--accent-hover);
  font-family: var(--mono);
  font-size: 0.46rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corpus-contract-chips,
.corpus-contract-signals {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 0.18rem;
}

.corpus-contract-chip,
.corpus-contract-signals span,
.corpus-version-state {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  padding: 0.13rem 0.3rem;
  border-radius: 999px;
  font-size: 0.46rem;
  font-weight: 690;
  line-height: 1.25;
}

.corpus-contract-chip {
  color: var(--accent-hover);
  background: var(--accent-soft);
}

.corpus-contract-chip--quiet,
.corpus-contract-signals span {
  color: var(--muted);
  background: var(--surface-muted);
}

.corpus-contract-signals span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corpus-version-state {
  margin-top: 0.08rem;
  color: var(--success);
  border: 1px solid #b8cdbd;
  background: #edf4ee;
}

.corpus-version-state[data-state="unresolved"] {
  color: var(--warning);
  border-color: #dfc99e;
  background: #faf3e6;
}

.corpus-version-state[data-state="ambiguous"] {
  color: var(--danger);
  border-color: #e3b7b2;
  background: var(--danger-soft);
}

.corpus-contract-card__notes {
  display: -webkit-box;
  overflow: hidden;
  margin: 0.05rem 0 0;
  color: var(--muted);
  font-size: 0.48rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.corpus-candidate-accounting {
  display: grid;
  min-width: 0;
  gap: 0.34rem;
  padding: 0.5rem 0.62rem 0.54rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}

.corpus-candidate-accounting__heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}

.corpus-candidate-accounting__heading strong {
  flex: 0 0 auto;
  font-size: 0.57rem;
}

.corpus-candidate-accounting__heading small,
.corpus-candidate-accounting__navigation {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.46rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corpus-candidate-stages {
  display: grid;
  min-width: 0;
  padding: 0;
  margin: 0;
  list-style: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.corpus-candidate-stages li {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 0.02rem;
  padding: 0.28rem 0.55rem 0.26rem 0.48rem;
  border-left: 1px solid var(--border);
}

.corpus-candidate-stages li:first-child {
  padding-left: 0;
  border-left: 0;
}

.corpus-candidate-stages li:not(:last-child)::after {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: -0.25rem;
  width: 0.48rem;
  color: var(--faint);
  background: var(--surface);
  content: "→";
  font-size: 0.52rem;
  line-height: 1;
  text-align: center;
  transform: translateY(-50%);
}

.corpus-candidate-stages span,
.corpus-candidate-stages small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.44rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corpus-candidate-stages strong {
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.2;
}

.corpus-sufficiency {
  display: grid;
  align-items: center;
  gap: 0.8rem;
  padding: 0.58rem 0.68rem;
  color: var(--success);
  border: 1px solid #b8cdbd;
  border-left-width: 3px;
  border-radius: 7px;
  background: #edf4ee;
  grid-template-columns: minmax(0, 1fr) minmax(210px, auto);
}

.corpus-sufficiency[data-status="insufficient"] {
  color: var(--danger);
  border-color: #e3b7b2;
  background: var(--danger-soft);
}

.corpus-sufficiency > div:first-child,
.corpus-sufficiency__evidence {
  display: grid;
  min-width: 0;
  gap: 0.08rem;
}

.corpus-sufficiency > div:first-child > strong,
.corpus-sufficiency__evidence > strong {
  font-size: 0.61rem;
  line-height: 1.3;
}

.corpus-sufficiency p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.51rem;
  line-height: 1.4;
}

.corpus-sufficiency__evidence {
  text-align: right;
}

.corpus-sufficiency__evidence small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.45rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corpus-search-result-list {
  display: grid;
  padding: 0 1.2rem 1.4rem;
}

.corpus-search-result-list__message {
  margin: 0;
  padding: 1.5rem 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.55;
}

.corpus-search-result {
  display: grid;
  width: 100%;
  min-height: 90px;
  align-items: start;
  gap: 0.7rem;
  padding: 0.85rem 0;
  color: var(--text);
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
  cursor: pointer;
  grid-template-columns: 32px minmax(0, 1fr) auto;
}

.corpus-search-result:hover:not(:disabled),
.corpus-search-result:focus-visible {
  background: linear-gradient(90deg, transparent 0, var(--accent-soft) 7%, var(--accent-soft) 93%, transparent 100%);
}

.corpus-search-result:focus-visible {
  outline: 2px solid #647f68;
  outline-offset: 2px;
}

.corpus-search-result:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.corpus-search-result__rank {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 760;
}

.corpus-search-result__content {
  display: grid;
  min-width: 0;
  gap: 0.17rem;
}

.corpus-search-result__content strong {
  overflow: hidden;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corpus-search-result__content small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.55rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corpus-search-result__excerpt {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-soft);
  font-family: var(--report);
  font-size: 0.72rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.corpus-search-result__action {
  align-self: center;
  color: var(--accent);
  font-size: 0.56rem;
  font-weight: 750;
  white-space: nowrap;
}

.document-detail__header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.97);
}

.document-format {
  color: var(--accent);
  font-size: 0.57rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.document-detail__header h3 {
  margin: 0.12rem 0 0;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.document-detail__header p {
  margin: 0.24rem 0 0;
  color: var(--muted);
  font-size: 0.62rem;
}

.document-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.document-detail__message {
  margin: 1rem 1.2rem;
  padding: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  font-size: 0.68rem;
}

.evidence-browser {
  display: grid;
  gap: 0;
  padding: 0 1.2rem 1.5rem;
}

.evidence-browser__summary {
  margin: 0;
  padding: 0.9rem 0 0.65rem;
  color: var(--muted);
  font-size: 0.62rem;
}

.evidence-row {
  display: grid;
  gap: 0.65rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--border);
  grid-template-columns: minmax(95px, 0.23fr) minmax(0, 0.77fr);
}

.evidence-row__location {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.56rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.evidence-row__text {
  margin: 0;
  color: var(--text-soft);
  font-family: var(--report);
  font-size: 0.76rem;
  line-height: 1.55;
}

.opened-evidence {
  display: grid;
  gap: 0.75rem;
  padding: 1.2rem 0;
}

.opened-evidence__location {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
}

.opened-evidence__text {
  margin: 0;
  padding: 0.2rem 0 0.2rem 1rem;
  color: var(--text);
  border-left: 3px solid #9bb29f;
  font-family: var(--report);
  font-size: 0.86rem;
  line-height: 1.65;
}

.opened-evidence__reference {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.5rem;
}

.toast-region {
  position: fixed;
  z-index: 250;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  width: min(360px, calc(100vw - 2rem));
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: grid;
  align-items: center;
  padding: 0.72rem 0.75rem;
  color: #fff;
  border-radius: 10px;
  background: #292c29;
  box-shadow: 0 12px 30px rgba(24, 27, 23, 0.2);
  grid-template-columns: 4px minmax(0, 1fr) 44px;
  gap: 0.65rem;
  pointer-events: auto;
  animation: toast-in 240ms var(--ease) both;
}

.toast::before {
  width: 4px;
  height: 70%;
  min-height: 23px;
  border-radius: 99px;
  background: #8eb296;
  content: "";
}

.toast[data-kind="error"]::before {
  background: #e47e76;
}

.toast p {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 620;
}

.toast button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  color: #fff;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
}

.toast button:hover {
  background: rgba(255, 255, 255, 0.1);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1240px) {
  .workspace-body,
  .workspace-body:has(.source-ledger[hidden]) {
    grid-template-columns: minmax(0, 1fr);
  }

  .source-ledger {
    position: fixed;
    z-index: 120;
    inset: 0 0 0 auto;
    width: min(390px, 92vw);
    border-left: 1px solid var(--border-strong);
    box-shadow: -18px 0 42px rgba(27, 31, 26, 0.15);
    transform: translateX(105%);
    transition: transform 220ms var(--ease);
  }

  .source-ledger.is-open {
    transform: translateX(0);
  }

  .sources-close {
    display: inline-flex;
  }

  .sources-backdrop {
    position: fixed;
    z-index: 110;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(26, 29, 25, 0.42);
  }
}

@media (max-width: 1000px) {
  .workspace-label small,
  .account-state #account-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .account-state {
    width: 38px;
    justify-content: center;
    padding: 0;
  }

  .chrome-select select {
    max-width: 132px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .run-rail {
    position: fixed;
    z-index: 140;
    inset: 0 auto 0 0;
    width: min(var(--sidebar-width), 88vw);
    box-shadow: 18px 0 42px rgba(27, 31, 26, 0.15);
    transform: translateX(-105%);
    transition: transform 220ms var(--ease);
  }

  .run-rail.is-open {
    transform: translateX(0);
  }

  .rail-backdrop {
    position: fixed;
    z-index: 130;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(26, 29, 25, 0.42);
  }

  .workspace-shell {
    width: 100%;
    height: 100vh;
    height: 100dvh;
  }

  .history-toggle {
    display: inline-flex;
  }

  .workspace-chrome {
    padding-left: 0.55rem;
  }
}

@media (max-width: 720px) {
  .corpus-dialog {
    padding: 0;
  }

  .corpus-workbench {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
  }

  .corpus-workbench__header {
    min-height: 74px;
    padding: 0.8rem 0.75rem 0.65rem 0.9rem;
  }

  .corpus-workbench__header p {
    display: none;
  }

  .corpus-search {
    padding: 0.65rem 0.8rem;
    grid-template-columns: 1fr;
  }

  .corpus-search__form label small {
    display: none;
  }

  .corpus-retrieval-state__heading,
  .corpus-index-job__copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.32rem;
  }

  .corpus-readiness-line__copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.05rem;
  }

  .corpus-readiness-line__copy small {
    overflow: visible;
    white-space: normal;
  }

  .corpus-model-chip {
    min-width: min(175px, 72vw);
  }

  .corpus-workbench__body {
    display: block;
    overflow-y: auto;
  }

  .corpus-library {
    min-height: 280px;
    max-height: 48vh;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .document-inspector {
    min-height: 52vh;
    overflow: visible;
  }

  .document-inspector__empty {
    min-height: 330px;
  }

  .document-detail__header {
    position: static;
    flex-direction: column;
  }

  .evidence-row {
    grid-template-columns: 1fr;
  }

  .corpus-search-result-list {
    padding-inline: 0.9rem;
  }

  .corpus-search-contract {
    padding-inline: 0.9rem;
  }

  .corpus-search-contract__overview {
    grid-template-columns: 1fr;
  }

  .corpus-candidate-accounting__heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.12rem;
  }

  .corpus-candidate-stages {
    overflow-x: auto;
    padding-bottom: 0.18rem;
    grid-auto-columns: 88px;
    grid-auto-flow: column;
    grid-template-columns: none;
    overscroll-behavior-inline: contain;
  }

  .corpus-sufficiency {
    align-items: start;
    gap: 0.42rem;
    grid-template-columns: 1fr;
  }

  .corpus-sufficiency__evidence {
    text-align: left;
  }

  .corpus-search-result {
    gap: 0.45rem;
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .corpus-search-result__action {
    display: none;
  }

  .workspace-chrome {
    gap: 0.35rem;
    padding-right: 0.5rem;
  }

  .workspace-label__icon,
  .workspace-label > span:last-child {
    display: none;
  }

  .workspace-chrome__controls {
    flex: 1;
  }

  .chrome-select {
    flex: 1 1 auto;
  }

  .chrome-select select {
    width: 100%;
    max-width: none;
  }

  .chrome-select--effort {
    flex: 0 1 92px;
  }

  .auth-button {
    padding-inline: 0.55rem;
  }

  .login-notice {
    align-items: stretch;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.55rem 0.75rem;
  }

  .login-notice .button {
    width: 100%;
  }

  .run-workspace {
    padding: 1rem 0.8rem 2rem;
  }

  .user-turn {
    gap: 0.5rem;
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .turn-avatar {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    border-radius: 8px;
  }

  .user-turn__state {
    align-items: flex-end;
    grid-column: 2;
    justify-content: flex-end;
  }

  .user-prompt {
    max-height: 6.2rem;
    font-size: 0.81rem;
  }

  .assistant-turn {
    gap: 0.5rem;
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .progress-journal > summary {
    gap: 0.45rem;
    grid-template-columns: 28px minmax(0, 1fr) auto 18px;
  }

  .live-indicator {
    padding-inline: 0.32rem;
  }

  .live-indicator #live-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .report-content {
    font-size: 0.98rem;
  }

  .query-station {
    padding: 0.55rem 0.65rem 0.45rem;
  }

  .composer-shell {
    min-height: 102px;
  }

  .composer-disclaimer {
    display: none;
  }
}

@media (max-width: 540px) {
  .workspace-chrome {
    min-height: 54px;
    flex-basis: 54px;
  }

  .chrome-select > svg,
  .chrome-select--effort {
    display: none;
  }

  .chrome-select {
    min-height: 44px;
    padding-left: 0.25rem;
  }

  .account-state {
    display: none;
  }

  .auth-button {
    min-width: 44px;
    max-width: 84px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .empty-desk {
    justify-content: flex-start;
    padding: 10vh 1rem 1rem;
  }

  .empty-desk__orb {
    width: 56px;
    height: 56px;
    margin-bottom: 1rem;
  }

  .empty-desk h1 {
    font-size: 1.55rem;
  }

  .capability-row {
    align-items: center;
    flex-direction: column;
    margin-top: 1rem;
  }

  .capability-row span {
    min-height: 30px;
  }

  .run-workspace {
    padding-inline: 0.6rem;
  }

  .assistant-turn,
  .user-turn {
    display: block;
  }

  .turn-avatar {
    margin-bottom: 0.4rem;
  }

  .user-turn__content {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
  }

  .user-turn__state {
    display: flex;
    margin-top: 0.4rem;
  }

  .assistant-turn {
    margin-top: 1.1rem;
  }

  .report-sheet__header {
    gap: 0.5rem;
  }

  .sources-toggle {
    min-width: 44px;
    padding-inline: 0.5rem;
  }

  .sources-toggle > svg {
    display: none;
  }

  .activity-summary__copy .progress-journal__summary {
    display: none;
  }

  .composer-shell {
    padding-right: 3.35rem;
  }

  .composer-toolbar {
    right: 3.35rem;
    gap: 0.28rem;
  }

  .composer-shortcut {
    display: none;
  }

  .mode-chip,
  .clarification-control {
    font-size: 0.58rem;
  }
}

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

@media print {
  body,
  .app-shell,
  .workspace-shell,
  .workspace-body,
  .research-desk,
  .conversation-scroll {
    display: block;
    height: auto;
    overflow: visible;
    background: #fff;
  }

  .run-rail,
  .workspace-chrome,
  .login-notice,
  .query-station,
  .progress-journal,
  .source-ledger,
  .user-turn__state,
  .toast-region {
    display: none !important;
  }

  .run-workspace {
    width: 100%;
    padding: 0;
  }

  .report-content {
    max-width: none;
  }
}
body[data-instance-locked="true"] > :not(.instance-gate) {
  visibility: hidden;
}

.instance-gate {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 20% 10%, rgb(61 100 92 / 14%), transparent 38%),
    radial-gradient(circle at 85% 80%, rgb(193 144 78 / 12%), transparent 34%),
    #f5f5f2;
}

.instance-gate[hidden] {
  display: none;
}

.instance-gate__card {
  width: min(100%, 430px);
  padding: 2.5rem;
  border: 1px solid rgb(24 39 36 / 12%);
  border-radius: 24px;
  background: rgb(255 255 252 / 96%);
  box-shadow: 0 24px 80px rgb(23 42 37 / 13%);
}

.instance-gate__card .brand-mark {
  width: 48px;
  height: 48px;
}

.instance-gate__eyebrow {
  margin: 1.4rem 0 0.45rem;
  color: #5b766f;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.instance-gate__card h1 {
  margin: 0;
  color: #172824;
  font-size: clamp(1.75rem, 6vw, 2.35rem);
  letter-spacing: -0.045em;
}

.instance-gate__card > p:not(.instance-gate__eyebrow, .instance-gate__error) {
  margin: 0.8rem 0 1.6rem;
  color: #5e6b67;
  line-height: 1.55;
}

.instance-gate__card label {
  display: block;
  margin-bottom: 0.45rem;
  color: #263d37;
  font-size: 0.82rem;
  font-weight: 700;
}

.instance-gate__card input {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  border: 1px solid #bdc9c5;
  border-radius: 12px;
  background: #fff;
  color: #172824;
  font: inherit;
}

.instance-gate__card input:focus {
  border-color: #315e53;
  outline: 3px solid rgb(49 94 83 / 16%);
}

.instance-gate__error {
  min-height: 1.3em;
  margin: 0.55rem 0;
  color: #a53838;
  font-size: 0.8rem;
}

.instance-gate__card .button {
  width: 100%;
  min-height: 46px;
}
