:root {
  --ink: #0e0e0c;
  --paper: #f5f2eb;
  --vellum: #faf8f3;
  --canvas: #eee8dd;
  --marginalia: #6b6760;
  --muted: #6b6760;
  --line: rgba(14, 14, 12, 0.16);
  --line-strong: rgba(14, 14, 12, 0.24);
  --surface: #faf8f3;
  --surface-quiet: #f8f5ee;
  --soft: #f0ece2;
  --blue: #a8501e;
  --blue-strong: #7b3716;
  --teal: #1f6f67;
  --green: #167047;
  --amber: #a8501e;
  --red: #8a1c1c;
  --black: #0e0e0c;
  --display-font: "Plus Jakarta Sans", Inter, Aptos, "Segoe UI", sans-serif;
  --mono-font: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --shadow: 0 18px 42px rgba(14, 14, 12, 0.08);
  --shadow-soft: 0 8px 24px rgba(14, 14, 12, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--canvas);
  color: var(--ink);
  display: grid;
  font-family: Roboto, Inter, Aptos, "Segoe UI", Helvetica, Arial, sans-serif;
  grid-template-columns: 276px minmax(0, 1fr);
  margin: 0;
  min-height: 100vh;
}

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

button,
.link-button {
  align-items: center;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 5px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 750;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  text-decoration: none;
}

button:hover {
  background: var(--blue-strong);
}

button.ghost,
.link-button.secondary {
  background: var(--vellum);
  border-color: var(--line);
  color: var(--ink);
}

button.danger {
  border-color: #d8aaa0;
  color: var(--red);
}

input,
select,
textarea {
  background: var(--vellum);
  border: 1px solid rgba(14, 14, 12, 0.22);
  border-radius: 5px;
  color: var(--ink);
  min-height: 40px;
  padding: 10px 11px;
  width: 100%;
}

textarea {
  line-height: 1.45;
  resize: vertical;
}

input[type="color"] {
  min-height: 44px;
  padding: 4px;
}

label {
  color: #403d36;
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  padding: 11px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 12px;
}

pre {
  background: var(--ink);
  border-radius: 5px;
  color: #f5f2eb;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.sidebar {
  background: var(--ink);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100vh;
  padding: 22px 16px;
  position: sticky;
  top: 0;
}

body.operator-mode .sidebar {
  background: #101010;
}

.brand {
  align-items: center;
  border-bottom: 1px solid rgba(245, 242, 235, 0.16);
  display: flex;
  gap: 12px;
  padding: 8px 8px 20px;
}

.brand-mark {
  align-items: center;
  background: var(--amber);
  background-position: center;
  background-size: cover;
  border-radius: 5px;
  color: #fff;
  display: flex;
  font-size: 20px;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.brand-mark.brand-image {
  border: 1px solid rgba(255, 255, 255, 0.38);
}

.brand-mark.docint-mark {
  background-image: url("/static/assets/docint-icon.svg");
}

body.operator-mode .brand-mark:not(.brand-image) {
  background: #161616;
  border: 1px solid var(--red);
  color: #ff3038;
  font-size: 16px;
}

.brand strong {
  display: block;
  font-size: 17px;
}

.brand span,
.session-card span {
  color: #b8afa2;
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.nav-list {
  display: grid;
  gap: 5px;
}

.nav-section {
  color: rgba(245, 242, 235, 0.48);
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 12px 10px 4px;
  text-transform: uppercase;
}

.nav-link {
  border: 1px solid transparent;
  border-radius: 6px;
  color: #d9d2c7;
  font-size: 14px;
  font-weight: 650;
  padding: 11px 12px;
  text-decoration: none;
}

.nav-link:hover {
  background: rgba(245, 242, 235, 0.08);
  color: #ffffff;
}

.nav-link.active {
  background: var(--paper);
  border-color: rgba(245, 242, 235, 0.34);
  color: var(--ink);
}

body.operator-mode .nav-link.active {
  background: var(--red);
  color: #fff;
}

.session-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(245, 242, 235, 0.16);
  border-radius: 5px;
  margin-top: auto;
  padding: 14px;
}

.sidebar-history,
.role-tools {
  display: grid;
  gap: 8px;
}

.sidebar-history-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.sidebar-icon-button {
  background: transparent;
  border: 1px solid rgba(245, 242, 235, 0.18);
  color: #d9d2c7;
  font-size: 11px;
  min-height: 28px;
  padding: 5px 8px;
}

.sidebar-search {
  background: rgba(245, 242, 235, 0.08);
  border-color: rgba(245, 242, 235, 0.16);
  color: var(--paper);
  min-height: 34px;
}

.sidebar-search::placeholder {
  color: rgba(245, 242, 235, 0.52);
}

.sidebar-history-list {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
}

.sidebar-history-controls {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.history-session,
.role-tool {
  background: rgba(245, 242, 235, 0.07);
  border: 1px solid rgba(245, 242, 235, 0.13);
  border-radius: 6px;
  color: #f5f2eb;
  display: grid;
  gap: 3px;
  justify-content: start;
  min-height: 0;
  padding: 9px 10px;
  text-align: left;
}

.history-session strong {
  color: #ffffff;
  display: -webkit-box;
  font-size: 12px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-session span,
.sidebar-empty {
  color: rgba(245, 242, 235, 0.58);
  font-size: 11px;
}

.role-tool {
  font-size: 13px;
  font-weight: 750;
}

.session-card strong {
  display: block;
  margin: 4px 0;
}

.session-card label {
  color: #b8afa2;
  display: grid;
  font-size: 11px;
  gap: 5px;
  margin-top: 12px;
}

.session-card select {
  background: rgba(245, 242, 235, 0.1);
  border-color: rgba(245, 242, 235, 0.2);
  color: var(--paper);
  min-height: 32px;
}

.workspace {
  display: grid;
  gap: 16px;
  grid-template-rows: auto auto 1fr;
  min-width: 0;
}

body.access-pending .workspace {
  grid-template-rows: auto 1fr;
}

body.access-pending {
  grid-template-columns: 1fr;
}

body.access-pending .sidebar {
  align-items: center;
  flex-direction: row;
  min-height: auto;
  padding: 14px 24px;
  position: static;
}

body.access-pending .brand {
  border-bottom: 0;
  padding: 0;
}

body.access-pending .dashboard,
body.access-pending .view,
body.access-pending .sidebar-history,
body.access-pending .role-tools,
body.access-pending .nav-list,
body.access-pending .session-card,
body.access-pending .topbar {
  display: none !important;
}

.topbar {
  align-items: center;
  background: rgba(245, 242, 235, 0.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 22px 32px;
}

.topbar-actions,
.toolbar,
.actions,
.split,
.section-head {
  align-items: center;
  display: flex;
  gap: 12px;
}

.section-head,
.topbar {
  justify-content: space-between;
}

.topbar h1,
.panel h2,
.login-copy h2 {
  font-family: var(--display-font);
  font-weight: 600;
  letter-spacing: 0;
  margin: 0;
}

.topbar h1 {
  font-size: clamp(26px, 3vw, 36px);
  margin-top: 3px;
}

.topbar p {
  max-width: 760px;
}

.topbar p,
.panel p,
.login-copy p,
.muted {
  color: var(--muted);
}

.eyebrow {
  color: var(--blue-strong);
  display: inline-block;
  font-family: var(--mono-font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 6px;
}

body.operator-mode .eyebrow {
  color: var(--red);
}

.login-shell {
  background: #ebe4d8;
  border-bottom: 1px solid rgba(14, 14, 12, 0.16);
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: calc(100vh - 132px);
  padding: 30px 32px 40px;
}

.login-copy {
  grid-column: 1 / -1;
  max-width: 820px;
  padding: 8px 0 2px;
}

.login-copy p {
  font-size: 15px;
  line-height: 1.65;
  max-width: 680px;
}

.login-card,
.panel,
.metric,
.data-card,
.citation,
.setup-step,
.row-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.login-card,
.panel,
.metric {
  box-shadow: var(--shadow);
}

.login-card,
.panel {
  padding: 18px;
}

.login-card {
  align-self: start;
}

.segmented {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
}

.segment {
  background: transparent;
  border: 0;
  color: var(--muted);
}

.segment.active {
  background: var(--paper);
  box-shadow: 0 1px 5px rgba(14, 14, 12, 0.12);
  color: var(--ink);
}

.auth-pane {
  display: none;
  gap: 12px;
  margin-top: 14px;
}

.auth-pane.active {
  display: grid;
}

.workspace-confirmation {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  display: flex;
  gap: 12px;
  margin-top: 4px;
  padding: 12px;
}

.workspace-confirmation img {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  height: 38px;
  object-fit: contain;
  padding: 4px;
  width: 38px;
}

.workspace-confirmation strong,
.workspace-confirmation span {
  display: block;
}

.workspace-confirmation span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.identity-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.dashboard {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  padding: 18px 32px 0;
}

.metric {
  box-shadow: var(--shadow-soft);
  padding: 14px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 13px;
}

.metric strong {
  display: block;
  font-family: var(--display-font);
  font-size: 24px;
  margin-top: 6px;
}

.view {
  display: none;
  gap: 18px;
  padding: 6px 32px 34px;
}

.view.active {
  display: grid;
}

#admin.view.active,
#control-plane.view.active {
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.7fr);
}

.full-width,
#ask.view.active,
#documents.view.active,
#facts.view.active,
#annotations.view.active,
#operations.view.active {
  grid-template-columns: minmax(0, 1fr);
}

.section-head {
  margin-bottom: 14px;
}

.askbox {
  min-height: 112px;
}

.toolbar {
  flex-wrap: wrap;
}

.toolbar > * {
  flex: 1;
  min-width: 150px;
}

.compact-toolbar > * {
  flex: 0 1 auto;
  min-width: 120px;
}

.vertical {
  align-items: stretch;
  flex-direction: column;
}

.split > * {
  flex: 1;
}

.wrap {
  flex-wrap: wrap;
}

.answer-card,
.status-line,
.cards {
  margin-top: 14px;
}

.source-first-ritual {
  grid-column: 1 / -1;
}

.source-first-ritual[data-user-ritual="source-first"] {
  align-self: stretch;
}

.source-first-card {
  align-items: center;
  background: var(--surface-quiet);
  border: 1px solid rgba(14, 14, 12, 0.2);
  border-radius: 5px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 14px 18px;
  grid-template-columns: minmax(260px, 0.9fr) minmax(220px, 0.7fr) auto;
  padding: 14px 16px;
  position: relative;
}

.source-first-card h2 {
  font-family: var(--display-font);
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}

.source-standard-copy p {
  margin: 8px 0 0;
}

.source-rule-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  display: grid;
  gap: 5px;
  padding: 12px;
}

.source-rule-card span {
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 17px;
}

.stamp-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.stamp-button {
  background: transparent;
  border: 2px solid var(--blue-strong);
  color: var(--blue-strong);
  font-family: var(--mono-font);
  font-size: 13px;
  letter-spacing: 0.08em;
  min-height: 58px;
  min-width: 150px;
  transform: rotate(-1deg);
}

.stamp-button:active {
  transform: rotate(-1deg) scale(0.96);
}

.source-first-ritual.complete .source-first-card {
  border-color: rgba(22, 112, 71, 0.42);
}

.source-first-ritual.complete .stamp-button {
  background: rgba(22, 112, 71, 0.12);
  border-color: var(--green);
  color: var(--green);
  transform: rotate(-4deg);
}

.admin-launch-ritual {
  margin: 16px 0;
}

.launch-boundary-card {
  background: linear-gradient(135deg, rgba(13, 27, 42, 0.96), rgba(20, 50, 71, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  box-shadow: var(--shadow);
  color: #f7fbff;
  display: grid;
  gap: 16px;
  padding: 18px;
}

.launch-boundary-card h3 {
  color: #ffffff;
  font-family: var(--display-font);
  font-size: 23px;
  font-weight: 600;
  margin: 4px 0 6px;
}

.launch-boundary-card p,
.launch-boundary-card .muted {
  color: rgba(247, 251, 255, 0.78);
}

.boundary-map {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.boundary-node {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  color: #ffffff;
  font-family: var(--mono-font);
  font-size: 12px;
  padding: 12px;
  text-align: center;
}

.launch-key-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.launch-key-button {
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: var(--blue);
  min-height: 48px;
}

.launch-key-button:active {
  transform: scale(0.98);
}

.admin-launch-ritual.complete .launch-boundary-card {
  border-color: rgba(44, 196, 139, 0.72);
}

.admin-launch-ritual.complete .launch-key-button {
  background: var(--green);
  color: #ffffff;
}

.admin-launch-ritual:not(.complete) + .setup-steps {
  opacity: 0.82;
}

.answer-card,
.status-line {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 14px;
}

.answer-card {
  min-height: 150px;
}

.answer-text {
  font-family: var(--display-font);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.pill {
  background: rgba(168, 80, 30, 0.11);
  border: 1px solid rgba(168, 80, 30, 0.28);
  border-radius: 999px;
  color: var(--blue-strong);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
}

.pill.warning {
  background: #f7ead8;
  border-color: #e1bf91;
  color: var(--amber);
}

.pill.success {
  background: #e8f2e6;
  border-color: #bdd7b6;
  color: var(--green);
}

.pill.danger {
  background: #f4ded8;
  border-color: #d8aaa0;
  color: var(--red);
}

.citation-list,
.cards,
.setup-steps {
  display: grid;
  gap: 10px;
}

.citation,
.data-card,
.row-card {
  padding: 12px;
}

.ask-workbench {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
}

.ask-panel {
  min-height: 540px;
}

.ask-panel textarea {
  background: #fffdf8;
  font-size: 16px;
}

.source-rail {
  position: sticky;
  top: 18px;
}

.source-rail .section-head h2 {
  font-size: 20px;
}

.source-rail-list,
.review-snapshot {
  display: grid;
  gap: 10px;
}

.source-mini {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.source-mini strong {
  display: block;
  font-size: 14px;
  line-height: 1.3;
}

.source-mini span {
  color: var(--muted);
  font-size: 12px;
}

.source-mini .pill-row {
  margin: 0;
}

.source-review-strip {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}

.review-snapshot {
  background: var(--paper);
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  padding: 12px;
}

.note-composer,
.upload-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.note-composer {
  border-style: dashed;
  margin-top: 16px;
}

.citation-actions,
.source-preview {
  margin-top: 10px;
}

.citation-inspector {
  border-style: solid;
}

.meta-grid {
  display: grid;
  gap: 8px 12px;
  grid-template-columns: minmax(80px, 0.32fr) 1fr;
}

.meta-grid span {
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.meta-grid strong,
.breakable {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.source-chunk.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(168, 80, 30, 0.14);
}

.identity-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.compact-cards {
  max-height: 360px;
  overflow: auto;
}

.source-preview {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding-top: 14px;
}

.source-preview-panel {
  background: var(--paper);
  border: 1px dashed rgba(14, 14, 12, 0.26);
  border-radius: 5px;
  display: grid;
  gap: 10px;
  margin-top: 14px;
  min-height: 74px;
  padding: 14px;
}

.source-preview-panel .source-preview {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.source-chunk p {
  margin-bottom: 0;
  white-space: pre-wrap;
}

.compact-head {
  align-items: start;
}

.row-card {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.setup-steps {
  margin-bottom: 16px;
}

.setup-step {
  display: grid;
  gap: 6px;
  grid-template-columns: 34px 1fr auto;
  padding: 14px;
}

.setup-step.complete {
  background: #e8f2e6;
  border-color: #bdd7b6;
}

.setup-section {
  background: var(--vellum);
  border: 1px solid var(--line);
  border-radius: 5px;
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 16px;
}

.setup-section h3 {
  font-size: 18px;
  margin: 0;
}

.setup-section p {
  margin: -4px 0 2px;
}

.step-label {
  color: var(--blue-strong);
  font-family: var(--mono-font);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.step-number {
  align-items: center;
  background: rgba(168, 80, 30, 0.12);
  border-radius: 5px;
  color: var(--blue);
  display: inline-flex;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.document-actions,
.api-entitlement {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
}

.advanced-settings {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  display: grid;
  gap: 12px;
  padding: 12px;
}

.advanced-settings summary {
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.advanced-settings[open] summary {
  margin-bottom: 10px;
}

.answer-service-settings {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding-top: 20px;
}

.answer-service-settings h3 {
  font-family: var(--display-font);
  font-size: 18px;
  font-weight: 650;
  margin: 0;
}

.answer-service-settings p {
  line-height: 1.5;
  margin: 6px 0 0;
  max-width: 680px;
}

.answer-profile-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.answer-profile-fieldset legend {
  color: #403d36;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 7px;
}

.answer-profile-choices {
  display: grid;
  gap: 8px;
}

.answer-profile-choice {
  align-items: start;
  background: var(--surface-quiet);
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 12px;
}

.answer-profile-choice:has(input:checked) {
  background: var(--paper);
  border-color: var(--blue);
}

.answer-profile-choice input {
  accent-color: var(--blue);
  margin-top: 3px;
  min-height: auto;
  padding: 0;
  width: auto;
}

.answer-profile-choice strong,
.answer-profile-choice small {
  display: block;
}

.answer-profile-choice strong {
  color: var(--ink);
  font-size: 14px;
}

.answer-profile-choice small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  margin-top: 3px;
}

.recommended-note {
  color: var(--blue-strong);
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
}

.service-health {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding-top: 14px;
}

.service-health-head,
.service-health-list > div {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.service-health-head span,
.service-health-list span {
  color: var(--muted);
  font-size: 13px;
}

.service-health-list {
  display: grid;
  gap: 7px;
}

.service-health-list strong {
  font-size: 13px;
}

.service-health-list strong.ready {
  color: var(--green);
}

.service-health-list strong.attention {
  color: var(--amber);
}

.answer-settings-advanced p {
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 12px;
  line-height: 1.5;
}

.status-line {
  color: var(--muted);
  min-height: 42px;
  white-space: pre-wrap;
}

.status-chip-row {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  padding: 11px 12px;
}

.status-chip-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-chip-row strong {
  color: var(--ink);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

.toggle-row {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  display: flex;
  gap: 10px;
  margin: 10px 0;
  padding: 12px;
}

.toggle-row input {
  width: auto;
}

.operator-footer {
  align-items: center;
  background: rgba(14, 14, 12, 0.96);
  border-top: 1px solid rgba(245, 242, 235, 0.16);
  bottom: 0;
  color: #fff;
  display: flex;
  gap: 9px;
  grid-column: 1 / -1;
  justify-content: center;
  left: 0;
  min-height: 42px;
  padding: 8px 16px;
  position: fixed;
  right: 0;
  z-index: 4;
}

.operator-footer[hidden],
[hidden] {
  display: none !important;
}

.operator-footer img {
  border-radius: 6px;
  height: 24px;
  object-fit: cover;
  width: 24px;
}

body.has-operator-footer {
  padding-bottom: 42px;
}

body.has-operator-footer .toast {
  bottom: 64px;
}

.toast {
  background: var(--ink);
  border-radius: 5px;
  bottom: 22px;
  color: #fff;
  display: none;
  max-width: 420px;
  padding: 13px 15px;
  position: fixed;
  right: 22px;
  z-index: 5;
}

.toast.show {
  display: block;
}

.empty,
.empty-state {
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.empty-state {
  background: var(--paper);
  border: 1px dashed rgba(14, 14, 12, 0.26);
  border-radius: 5px;
  line-height: 1.5;
}

@media (max-width: 1080px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: static;
  }

  .login-shell,
  .ask-workbench,
  .source-first-card,
  #ask.view.active,
  #admin.view.active,
  #control-plane.view.active {
    grid-template-columns: 1fr;
  }

  .login-copy {
    grid-column: auto;
  }

  .source-rail {
    position: static;
  }
}

@media (max-width: 760px) {
  .topbar,
  .section-head,
  .split,
  .identity-grid,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .identity-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }

  .segmented {
    grid-template-columns: 1fr;
  }

  .view,
  .dashboard,
  .topbar,
  .login-shell {
    max-width: 100%;
    min-width: 0;
    padding-left: 16px;
    padding-right: 16px;
  }

  .sidebar {
    gap: 14px;
    padding: 16px;
  }

  .nav-list {
    grid-template-columns: 1fr 1fr;
  }

  .nav-section {
    grid-column: 1 / -1;
  }

  .toolbar > *,
  .compact-toolbar > *,
  .split > * {
    min-width: 0;
  }

  input[type="file"] {
    max-width: 100%;
  }
}
