/* Traceforge: local assets, progressive disclosure, one primary workflow. */
*,
*::before,
*::after {
  box-sizing: border-box;
}
:root {
  --bg: #101113;
  --surface: #17181c;
  --raised: #202127;
  --line: #2c2e36;
  --text: #ededf1;
  --muted: #a4a5b0;
  --faint: #767984;
  --accent: #c1b1f8;
  --accent-strong: #a38be6;
  --danger: #f29898;
  --warn: #dfba80;
  --ok: #a9c5b2;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 var(--font);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.025em;
}
h1 {
  font-size: 28px;
}
h2 {
  font-size: 20px;
}
h3 {
  font-size: 14px;
}
p + p {
  margin-top: 10px;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--text);
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
details,
section,
article,
main,
aside,
form {
  min-width: 0;
}
summary {
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker {
  display: none;
}
code,
pre,
.mono {
  font-family: var(--mono);
}
code {
  font-size: 0.85em;
}
pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.muted,
.help,
.quiet-count {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.help {
  font-size: 11px;
  line-height: 1.55;
}
.block {
  display: block;
}
.hidden {
  display: none !important;
}
.js-only {
  display: none;
}
.js .js-only {
  display: inline-flex;
}
.eyebrow {
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.actions,
.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.quiet-count {
  font-size: 11px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.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;
}
.skip-link {
  position: absolute;
  top: -80px;
  left: 16px;
  padding: 8px 12px;
  z-index: 100;
  background: var(--raised);
  border: 1px solid var(--accent);
  border-radius: 6px;
}
.skip-link:focus {
  top: 10px;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-offset: 1px;
}
/* Shared chrome */
.topbar {
  height: 62px;
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1440px;
  height: 100%;
  padding: 0 32px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 19px;
  letter-spacing: -0.05em;
  font-weight: 650;
  text-decoration: none;
}
.brand-mark {
  width: 27px;
  height: 27px;
  border: 1px solid #71618f;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 21px;
  font-weight: 600;
  line-height: 1;
}
.topnav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 12px;
}
.topnav > a {
  color: var(--muted);
  text-decoration: none;
}
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  border: 0;
  background: none;
  padding: 0;
  text-decoration: none;
  cursor: pointer;
}
.text-button:hover {
  color: var(--text);
}
.account-menu {
  position: relative;
}
.account-menu > summary {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.account-menu > summary::after {
  content: "⌄";
  color: var(--faint);
}
.who {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-menu form {
  position: absolute;
  right: 0;
  top: 30px;
  min-width: 140px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  z-index: 60;
  box-shadow: 0 8px 24px #0005;
}
.account-menu button {
  background: none;
  border: 0;
  border-radius: 4px;
  padding: 8px 12px;
  color: var(--text);
  width: 100%;
  text-align: left;
}
.account-menu button:hover {
  background: var(--line);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--raised);
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 550;
  text-decoration: none;
  color: var(--text);
  line-height: 1.5;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--faint);
  color: var(--text);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #211b32;
}
.btn.primary:hover {
  background: #d3c6fc;
}
.btn.ghost {
  background: transparent;
}
.btn.small-btn {
  padding: 6px 11px;
  font-size: 11px;
}
.btn.danger {
  background: #48282c;
  color: #ffc5c5;
  border-color: #6c393e;
}
.icon-button {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 23px;
  padding: 0 3px;
  line-height: 1.2;
}
.breadcrumb {
  font-size: 11px;
  color: var(--faint);
  text-decoration: none;
}
.breadcrumb:hover {
  color: var(--text);
}
/* Fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label,
.file-picker > label {
  font-size: 12px;
  color: var(--muted);
}
input[type="text"],
input[type="search"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  padding: 9px 11px;
  font-size: 13px;
}
input::placeholder,
textarea::placeholder {
  color: var(--faint);
}
select {
  color-scheme: dark;
}
textarea {
  resize: vertical;
}
input:disabled,
textarea:disabled {
  opacity: 0.65;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.file-picker {
  padding: 16px;
  border: 1px dashed #41424b;
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: var(--bg);
}
input[type="file"] {
  width: 100%;
  color: var(--muted);
  font-size: 12px;
}
input[type="file"]::file-selector-button {
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 7px 10px;
  border-radius: 5px;
  margin-right: 10px;
  cursor: pointer;
}
/* Case index */
.case-index {
  max-width: 1040px;
  margin: auto;
  padding: 62px 32px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.page-heading h1 {
  font-size: 34px;
  margin-bottom: 8px;
}
.page-heading > div > p.muted {
  font-size: 13px;
}
.new-case {
  margin-bottom: 30px;
}
.new-case > summary {
  width: max-content;
}
.new-case[open] > summary {
  margin-bottom: 16px;
}
.new-case-form {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  max-width: 650px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.new-case-form .field {
  flex: 1;
}
.case-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}
.case-list > li {
  border-bottom: 1px solid var(--line);
}
.case-link {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 23px 8px;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
}
.case-link:hover {
  background: var(--surface);
}
.case-symbol {
  width: 38px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 18px;
}
.case-card-title {
  flex: 1;
  min-width: 0;
}
.case-card-title h2 {
  font-size: 15px;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}
.case-arrow {
  margin-left: 14px;
  color: var(--faint);
}
.index-empty {
  padding: 62px 0;
  text-align: center;
}
.empty-symbol {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--accent);
  font-size: 22px;
  margin-bottom: 20px;
}
.index-empty h2,
.chat-welcome h2 {
  font-size: 22px;
  margin-bottom: 10px;
}
.index-empty > p {
  font-size: 13px;
  margin-bottom: 18px;
}
/* Investigation */
.workspace {
  max-width: 1440px;
  margin: auto;
  padding: 24px 32px 32px;
}
.case-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}
.case-heading-name {
  min-width: 0;
}
.case-heading h1 {
  font-size: 23px;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.case-heading .actions {
  flex-shrink: 0;
}
.investigation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 28px;
  height: calc(100dvh - 206px);
  min-height: 540px;
}
.chat-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  overflow: hidden;
}
.conversation {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 30px;
  scroll-padding: 20px;
}
.conversation,
.rail-content {
  scrollbar-width: thin;
  scrollbar-color: #393a43 transparent;
}
.notices:empty {
  display: none;
}
.notices .alert,
.notices .status-line {
  margin: 12px 16px 0;
}
.notices .hidden {
  margin: 0;
}
.alert {
  padding: 10px 13px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--raised);
  overflow-wrap: anywhere;
}
.alert.error {
  border-color: #6b4043;
  color: #f2bcbc;
}
.alert.warn {
  border-color: #655039;
  color: #e2c7a4;
}
.alert.info {
  color: #d5c9f6;
  border-color: #494054;
}
.alert.success {
  color: #c3d9ca;
  border-color: #405649;
}
.status-line {
  font-size: 11px;
  color: var(--muted);
}
.upload-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* Without JS the upload form is a normal section below the case; with JS it is a centred panel. */
.upload-section {
  margin-top: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  max-width: 620px;
}
.upload-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.upload-head h2 {
  font-size: 18px;
}
.upload-section > p.muted {
  margin-bottom: 18px;
}
.js .upload-section {
  display: none;
}
.js .upload-section.is-open {
  display: block;
  position: fixed;
  z-index: 80;
  inset: 0;
  margin: auto;
  width: min(560px, calc(100vw - 32px));
  height: fit-content;
  max-height: calc(100dvh - 48px);
  overflow: auto;
  background: var(--surface);
  border-color: #45414e;
  box-shadow: 0 24px 90px #0008;
}
.upload-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: #090a0dbb;
  backdrop-filter: blur(3px);
}
.time-settings > summary,
.filter-details > summary {
  font-size: 11px;
  color: var(--muted);
}
.time-settings[open] > summary,
.filter-details[open] > summary {
  margin-bottom: 14px;
}
.time-settings > summary > span {
  margin-left: 5px;
}
.time-settings > summary::after,
.filter-details > summary::after,
.answer-details > summary::after,
.record-details > summary::after,
.case-settings > summary::after {
  content: "+";
  float: right;
  color: var(--faint);
}
.time-settings[open] > summary::after,
.filter-details[open] > summary::after,
.answer-details[open] > summary::after,
.record-details[open] > summary::after,
.case-settings[open] > summary::after {
  content: "−";
}
.chat-welcome {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 8px;
}
.chat-welcome > p {
  font-size: 13px;
}
.starter-prompts {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}
.starter-prompts a {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 12px;
}
.starter-prompts a:hover {
  color: var(--text);
  border-color: var(--faint);
}
.chat-history {
  max-width: 780px;
  margin: auto;
}
.chat-turn {
  margin: 0 0 26px;
}
.turn-question {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-left: 45px;
  border: 1px solid var(--line);
  background: var(--raised);
  padding: 12px 15px;
  border-radius: 10px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.turn-question > span:nth-child(2) {
  flex: 1;
}
.question-marker {
  color: var(--faint);
}
.turn-question .badge-ready {
  display: none;
}
.turn-question:hover {
  border-color: #494953;
}
.answer {
  padding: 23px 2px 0;
}
.result-title {
  font-size: 19px;
  font-weight: 550;
  line-height: 1.45;
  margin: 0 0 14px;
}
.claims {
  list-style: none;
  margin: 0;
  padding: 0;
}
.claims > li {
  padding: 10px 0;
  line-height: 1.8;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.claim-cites {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 6px;
  line-height: 1.4;
}
.citation {
  display: inline-flex;
  max-width: 100%;
  font-size: 10px;
  color: var(--accent);
  text-decoration: none;
  padding: 2px 0;
  border-bottom: 1px solid #665879;
}
.citation:hover {
  border-color: var(--accent);
}
.citation-file {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 15ch;
}
.citation-unresolved {
  color: var(--warn);
  font-size: 11px;
}
.more-cites {
  display: inline;
  font-size: 10px;
}
.more-cites > summary {
  display: inline-block;
  color: var(--muted);
  padding: 2px 5px;
}
.more-cites[open] {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.answer-details {
  border-top: 1px solid var(--line);
  margin-top: 15px;
  padding-top: 11px;
}
.answer-details > summary {
  font-size: 12px;
  color: var(--muted);
}
.answer-details > summary > .quiet-count {
  margin-left: 7px;
  color: var(--faint);
}
.answer-details[open] > summary {
  margin-bottom: 12px;
}
.unknown {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
}
.unknown li + li {
  margin-top: 9px;
}
.coverage {
  border-top: 0;
  padding-top: 2px;
}
.coverage > summary {
  font-size: 10px;
  color: var(--faint);
}
.working-reply {
  font-size: 13px;
  color: var(--muted);
  padding: 10px 0;
}
.working-dots {
  color: var(--accent);
}
.composer {
  margin: 8px 16px 16px;
  padding: 12px 14px;
  border: 1px solid #41424c;
  border-radius: 10px;
  background: var(--raised);
}
.composer:focus-within {
  border-color: #8d7ba8;
}
.composer textarea {
  display: block;
  border: 0;
  border-radius: 0;
  background: transparent;
  resize: vertical;
  min-height: 48px;
  max-height: 160px;
  padding: 0;
  font-size: 13px;
}
.composer textarea:focus-visible {
  outline: 0;
}
.composer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}
.composer-bottom .help {
  font-size: 10px;
}
.send-button {
  padding: 6px 12px;
  min-width: 76px;
}
.badge {
  display: inline-flex;
  font-size: 10px;
  line-height: 1.4;
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}
.badge-processing,
.badge-queued {
  color: var(--accent);
}
.badge-failed,
.badge-error {
  color: var(--danger);
}
.badge-warn {
  color: var(--warn);
}
/* Evidence rail and secondary tools */
.evidence-rail {
  align-self: start;
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
}
.rail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 550;
  padding: 3px 0 14px;
  border-bottom: 1px solid var(--line);
}
.rail-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}
.section-heading h2 {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0;
  font-weight: 400;
}
.source-card {
  padding: 10px 0;
}
.source-card > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.source-card > summary::before {
  content: "›";
  font-size: 15px;
  color: var(--faint);
}
.source-card[open] > summary::before {
  content: "⌄";
}
.source-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.source-body {
  padding: 12px 0 0 15px;
}
.source-body > p {
  margin-bottom: 8px;
}
.source-facts {
  margin: 12px 0;
  font-size: 10px;
}
.source-facts > div {
  margin-top: 8px;
}
.source-facts dt {
  color: var(--faint);
}
.source-facts dd {
  margin: 2px 0 0;
  color: var(--muted);
}
.hash {
  overflow-wrap: anywhere;
  font-size: 10px;
}
.warning-details {
  font-size: 11px;
  color: var(--warn);
  margin-top: 10px;
}
.warning-details > p,
.warning-details > ul {
  margin-top: 9px;
}
.warning-details ul {
  padding-left: 16px;
  font-size: 11px;
  color: var(--muted);
}
.warning-details li + li {
  margin-top: 7px;
}
.browse-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}
.case-settings > summary {
  font-size: 12px;
  color: var(--muted);
}
.settings-content {
  padding-top: 17px;
}
.settings-content h3 {
  font-size: 11px;
  font-weight: 400;
  color: var(--faint);
}
.members {
  list-style: none;
  padding: 0;
  margin: 10px 0 20px;
}
.members li {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  font-size: 12px;
  padding: 7px 0;
  overflow-wrap: anywhere;
}
.settings-content .stack {
  gap: 10px;
}
.settings-content .field label {
  font-size: 11px;
}
.settings-content .btn {
  font-size: 11px;
  padding: 7px 10px;
}
.danger-zone {
  margin-top: 22px;
  font-size: 11px;
  color: var(--danger);
}
.danger-zone > p {
  margin: 12px 0;
}
.evidence-browser {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.evidence-browser > summary {
  padding: 13px 17px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 16px;
  justify-content: space-between;
}
.browser-content {
  padding: 8px 20px 20px;
}
.search-form {
  margin-bottom: 18px;
}
.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.search-row .field {
  flex: 1;
}
.filter-details {
  margin-top: 13px;
}
.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.browser-content > p {
  margin-bottom: 12px;
}
.table-wrap {
  overflow-x: auto;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
table.data th,
table.data td {
  text-align: left;
  vertical-align: top;
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
}
table.data th {
  font-size: 10px;
  font-weight: 400;
  color: var(--faint);
}
table.data th:first-child {
  width: 185px;
}
.entry-text {
  overflow-wrap: anywhere;
}
.entry-text + .small {
  margin-top: 6px;
  font-size: 10px;
}
.evidence-link {
  font-size: 11px;
  overflow-wrap: anywhere;
}
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}
/* Sign-in and original evidence */
.auth {
  max-width: 460px;
  margin: 13vh auto 0;
  padding: 20px;
}
.auth-card {
  padding: 28px 8px;
}
.auth-card h1 {
  font-size: 34px;
  line-height: 1.25;
  max-width: 330px;
  margin-bottom: 15px;
}
.auth-card > p.muted {
  font-size: 14px;
  margin-bottom: 30px;
}
.auth-card > .alert {
  margin: 18px 0;
}
.auth-submit {
  width: 100%;
  justify-content: space-between;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.auth-card .actions {
  margin-top: 20px;
}
.evidence-page {
  max-width: 1100px;
  padding: 38px 32px;
  margin: auto;
}
.evidence-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
}
.evidence-heading h1 {
  font-size: 23px;
  margin-top: 9px;
  overflow-wrap: anywhere;
}
.evidence-page > .alert {
  margin-bottom: 15px;
}
.evidence-page > p {
  margin-bottom: 14px;
}
.evidence-lines {
  list-style: none;
  margin: 0;
  padding: 12px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  font: 12px/1.8 var(--mono);
  overflow: hidden;
}
.evidence-lines li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 18px;
  padding: 8px 20px;
}
.evidence-lines li.highlight {
  background: #c1b1f80c;
  box-shadow: inset 2px 0 var(--accent);
}
.line-no {
  color: var(--faint);
  text-align: right;
  user-select: none;
}
.line-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.record-details {
  margin-top: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.record-details > summary {
  font-size: 12px;
  color: var(--muted);
}
.details-content {
  padding-top: 20px;
}
.details-content h2 {
  font-size: 14px;
  margin: 22px 0 12px;
}
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 32px;
  margin: 0;
}
.facts > div {
  min-width: 0;
}
.facts dt {
  font-size: 11px;
  color: var(--faint);
  margin-bottom: 3px;
}
.facts dd {
  margin: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.raw {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: 12px;
}
/* Citation modal and live tour */
.dialog {
  width: min(900px, calc(100vw - 32px));
  max-height: 85dvh;
  border: 1px solid #45414e;
  border-radius: 12px;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 24px 90px #0008;
}
.dialog::backdrop {
  background: #090a0dbb;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 {
  font-size: 14px;
  letter-spacing: 0;
}
.dialog-body {
  padding: 22px;
  max-height: 70dvh;
  overflow: auto;
}
.dialog-body > .small {
  margin-bottom: 16px;
}
.dialog-body .actions {
  margin-top: 18px;
}
.walkthrough {
  position: fixed;
  z-index: 90;
  bottom: 24px;
  right: 24px;
  width: 320px;
  max-height: calc(100dvh - 48px);
  overflow: auto;
  background: #26242d;
  border: 1px solid #8a75ac;
  border-radius: 13px;
  padding: 18px 20px;
  box-shadow: 0 16px 48px #0008;
}
.tour-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.tour-top .eyebrow {
  margin: 0;
  color: var(--accent);
}
.walkthrough h2 {
  font-size: 18px;
  margin-bottom: 9px;
}
.walkthrough > p {
  font-size: 12px;
  color: #c5bfce;
  line-height: 1.7;
}
.tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  gap: 10px;
}
.walkthrough > .text-button {
  color: var(--accent);
  margin-top: 12px;
}
.tour-target {
  outline: 2px solid var(--accent) !important;
  outline-offset: 5px;
  scroll-margin: 30px;
}
.tour-target:focus {
  outline-offset: 5px;
}
.walkthrough:focus-visible {
  outline-color: var(--text);
}
@media (min-width: 1100px) {
  .conversation {
    padding-left: max(30px, calc((100% - 780px) / 2));
    padding-right: max(30px, calc((100% - 780px) / 2));
  }
}
@media (max-width: 1000px) {
  .investigation {
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 22px;
  }
  .workspace {
    padding: 20px 24px;
  }
  .conversation {
    padding: 20px;
  }
  .topbar-inner {
    padding: 0 24px;
  }
}
@media (max-width: 760px) {
  .topbar {
    height: 58px;
  }
  .topbar-inner {
    padding: 0 16px;
    gap: 10px;
  }
  .brand {
    font-size: 17px;
    gap: 8px;
  }
  .brand-mark {
    width: 25px;
    height: 25px;
    font-size: 19px;
  }
  .topnav {
    gap: 14px;
    font-size: 11px;
  }
  .topnav .text-button {
    font-size: 11px;
  }
  .who {
    max-width: 80px;
  }
  .workspace {
    padding: 18px 16px 24px;
  }
  .case-heading {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }
  .case-heading h1 {
    font-size: 20px;
  }
  .case-heading .actions {
    gap: 12px;
  }
  .case-heading .actions > a:first-child {
    display: none;
  }
  .investigation {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    gap: 18px;
  }
  .chat-panel {
    height: calc(100dvh - 185px);
    min-height: 510px;
    flex: none;
  }
  .conversation {
    padding: 20px 17px;
  }
  .evidence-rail {
    max-height: none;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 9px;
    overflow: visible;
  }
  .rail-heading {
    padding: 13px 16px;
    border: 0;
  }
  .evidence-rail[open] > .rail-heading {
    border-bottom: 1px solid var(--line);
  }
  .rail-heading::after {
    content: "⌄";
    color: var(--faint);
  }
  .rail-content {
    padding: 0 16px;
  }
  .rail-section:last-child {
    border: 0;
  }
  .turn-question {
    margin-left: 16px;
    font-size: 12px;
    padding: 11px 12px;
  }
  .answer {
    padding-top: 18px;
  }
  .result-title {
    font-size: 17px;
  }
  .claims > li {
    font-size: 13px;
  }
  .citation {
    font-size: 10px;
  }
  .citation-file {
    max-width: 12ch;
  }
  .composer {
    margin: 5px 10px 10px;
    padding: 11px;
  }
  .composer-bottom .help {
    font-size: 9px;
  }
  .composer textarea {
    font-size: 13px;
  }
  .case-index {
    padding: 36px 20px;
  }
  .page-heading h1 {
    font-size: 29px;
  }
  .page-heading {
    gap: 16px;
  }
  .page-heading .quiet-count {
    display: none;
  }
  .new-case-form {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }
  .case-link {
    gap: 14px;
    padding: 20px 2px;
  }
  .case-link > time {
    display: none;
  }
  .case-arrow {
    margin: 0;
  }
  .case-card-title h2 {
    font-size: 14px;
  }
  .case-card-title p {
    font-size: 11px;
  }
  .case-symbol {
    width: 32px;
    height: 36px;
    flex-shrink: 0;
  }
  .auth {
    margin-top: 9vh;
    padding: 20px;
  }
  .auth-card h1 {
    font-size: 31px;
  }
  .form-grid {
    gap: 12px;
  }
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .browser-content {
    padding: 4px 12px 15px;
  }
  table.data thead {
    display: none;
  }
  table.data,
  table.data tbody,
  table.data tr,
  table.data td {
    display: block;
    width: 100%;
  }
  table.data tr {
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
  }
  table.data td {
    padding: 4px 0;
    border: 0;
  }
  table.data td:first-child {
    color: var(--faint);
  }
  .evidence-page {
    padding: 26px 16px;
  }
  .evidence-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .evidence-heading h1 {
    font-size: 20px;
  }
  .evidence-lines {
    font-size: 11px;
  }
  .evidence-lines li {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 12px;
    padding: 8px 12px;
  }
  .facts {
    grid-template-columns: 1fr;
  }
  .dialog-body {
    padding: 16px;
  }
  .dialog-head {
    padding: 13px 16px;
  }
  .walkthrough {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
    max-height: 45dvh;
  }
}
@media (max-width: 380px) {
  .topnav {
    gap: 10px;
  }
  .who {
    max-width: 52px;
  }
  .composer-bottom .help {
    max-width: 150px;
  }
  .form-grid,
  .filters {
    grid-template-columns: 1fr;
  }
  .case-heading .actions .btn.ghost {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
.walkthrough.tour-top-position {
  top: 74px;
  bottom: auto;
}
.walkthrough.tour-compact #tour-description,
.walkthrough.tour-compact [data-tour-citation] {
  display: none;
}
.walkthrough.tour-compact h2 {
  font-size: 15px;
  margin-bottom: 0;
}
.walkthrough.tour-compact .tour-actions {
  margin-top: 12px;
}
@media (max-width: 760px) {
  .walkthrough.tour-top-position {
    top: 66px;
  }
}
.case-index .new-case {
  margin-bottom: 16px;
}
.example-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 32px;
}
.example-entry .text-button {
  color: var(--accent);
}
.chat-turn {
  margin: 0 0 34px;
}
.chat-turn .turn-question {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  margin-left: auto;
  width: fit-content;
  max-width: min(560px, 88%);
  cursor: default;
}
.chat-turn .turn-question > span:first-child {
  white-space: pre-wrap;
}
.plain-summary {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  margin: 0 0 18px;
  padding: 14px 16px;
  border-left: 2px solid var(--accent);
  background: #c1b1f80a;
  border-radius: 0 8px 8px 0;
}
.answer > .result-title {
  font-size: 13px;
  font-weight: 550;
  color: var(--muted);
  text-transform: none;
  margin: 0 0 6px;
}
.live-steps {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  font-size: 11px;
  color: var(--muted);
}
.live-steps li {
  padding: 3px 0 3px 18px;
  position: relative;
  overflow-wrap: anywhere;
}
.live-steps li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--ok);
}
.live-draft {
  border: 1px dashed #4b4459;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.live-draft .plain-summary {
  padding: 0;
  border: 0;
  background: none;
  margin-bottom: 10px;
}
.live-draft .result-title {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 6px;
}
.draft-claim {
  font-size: 13px;
  color: #cfcfd8;
  margin: 0 0 8px;
  white-space: pre-wrap;
}
.follow-ups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.follow-ups a {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid #4b4459;
  border-radius: 999px;
  padding: 6px 12px;
}
.follow-ups a:hover {
  border-color: var(--accent);
  color: var(--text);
}
/* Source viewer */
.source-page {
  max-width: 1280px;
  margin: auto;
  padding: 32px;
}
.source-page .evidence-heading p.muted {
  margin-top: 6px;
}
.view-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: 4px 0 18px;
}
.view-tabs a {
  padding: 9px 14px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.view-tabs a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.source-search {
  max-width: 520px;
  margin-bottom: 10px;
}
.source-page > p.muted.small {
  margin-bottom: 12px;
}
.table-title {
  font-size: 13px;
  margin: 22px 0 10px;
}
table.records td {
  white-space: nowrap;
}
table.records td.wrap {
  white-space: normal;
  min-width: 220px;
  overflow-wrap: anywhere;
}
table.records td:first-child a {
  font-family: var(--mono);
  font-size: 11px;
}
tr.tone-bad td:first-child,
.raw-view li.tone-bad {
  box-shadow: inset 2px 0 var(--danger);
}
tr.tone-good td:first-child,
.raw-view li.tone-good {
  box-shadow: inset 2px 0 #5f7d69;
}
.raw-view li {
  grid-template-columns: 44px minmax(0, 1fr) 18px;
  scroll-margin-top: 90px;
}
.raw-view .line-no {
  text-decoration: none;
}
.raw-view .line-no:hover {
  color: var(--text);
}
.raw-view li.highlight {
  background: #c1b1f81a;
}
.line-open {
  color: var(--faint);
  text-decoration: none;
  font-size: 11px;
}
.line-open:hover {
  color: var(--accent);
}
.message-view {
  max-width: 860px;
}
.message-headers {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 22px;
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.message-headers > div {
  display: contents;
}
.message-headers dt {
  font-size: 11px;
  color: var(--faint);
}
.message-headers dd {
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.route {
  margin: 14px 0 0;
  padding-left: 20px;
}
.route li + li {
  margin-top: 8px;
}
.message-body {
  margin: 22px 0;
}
.message-body pre {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font: 13px/1.7 var(--font);
  max-height: 70vh;
  overflow: auto;
}
.attachments {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}
.attachments li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
/* Timeline visualizer */
.timeline-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.timeline-panel > summary {
  padding: 13px 17px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.tv {
  padding: 0 16px 16px;
}
.tv-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.tv-toolbar .actions {
  gap: 6px;
}
.tv-canvas {
  width: 100%;
  min-height: 80px;
  touch-action: pan-y;
}
.tv-svg {
  display: block;
  user-select: none;
  cursor: crosshair;
}
.tv-band {
  fill: transparent;
}
.tv-band.alt {
  fill: #ffffff05;
}
.tv-label {
  fill: var(--muted);
  font-size: 11px;
}
.tv-grid {
  stroke: var(--line);
  stroke-width: 1;
}
.tv-tick {
  fill: var(--faint);
  font-size: 10px;
  text-anchor: middle;
}
.tv-point {
  fill: var(--faint);
  cursor: pointer;
}
.tv-point.tone-bad {
  fill: var(--danger);
}
.tv-point.tone-good {
  fill: #7f9f89;
}
.tv-point:hover {
  stroke: var(--text);
  stroke-width: 1.5;
}
.tv-cited {
  stroke: var(--accent);
  stroke-width: 2;
}
.tv-cited:focus-visible {
  outline: none;
  stroke: var(--text);
  stroke-width: 3;
}
.tv-brush {
  fill: #c1b1f822;
  stroke: var(--accent);
}
.tv-key {
  color: var(--faint);
}
.tv-key.tone-bad {
  color: var(--danger);
}
.tv-key.tone-good {
  color: #7f9f89;
}
.tv-key.tone-cited {
  color: var(--accent);
}
@media (max-width: 760px) {
  .source-page {
    padding: 24px 16px;
  }
  .message-headers {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .message-headers dd {
    margin-bottom: 8px;
  }
  .raw-view li {
    grid-template-columns: 30px minmax(0, 1fr) 14px;
  }
  .tv {
    padding: 0 10px 12px;
  }
}
