:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --panel-muted: #fbfbfd;
  --soft: #f5f5f7;
  --soft-2: #ececf0;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);
  --text: #1d1d1f;
  --muted: #616168;
  --muted-2: #6e6e76;
  --brand: #ff462d;
  --ao-blue: #052d98;
  --accent: #1d1d1f;
  --accent-strong: #000000;
  --success: #34c759;
  --danger: #c92e27;
  --focus-ring: rgba(255, 70, 45, 0.2);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 14px 42px rgba(0, 0, 0, 0.08);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.05), 0 8px 24px rgba(0, 0, 0, 0.05);
  --glass-fill: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(30, 32, 38, 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.95);
  --glass-shadow: 0 2px 4px rgba(28, 30, 36, 0.04), 0 8px 24px rgba(28, 30, 36, 0.08);
  --glass-filter: blur(24px) saturate(135%);
  --glass-ease: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
}

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

.login-screen { position: relative; isolation: isolate; width: 100%; min-height: 100dvh; overflow: hidden; background: #132d49; color: #fff; }
.login-photo { position: absolute; inset: 0; z-index: -2; background: url('/assets/ao-hq-winter.webp') center 48% / cover no-repeat; }
.login-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(7, 29, 62, .38) 0%, rgba(7, 29, 62, .1) 35%, rgba(7, 22, 43, .3) 54%, rgba(4, 14, 31, .78) 100%); }
.login-brand { position: absolute; top: 27px; left: 32px; display: grid; justify-items: center; gap: 2px; width: 70px; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.34); }
.login-brand img { display: block; width: 63px; height: auto; filter: brightness(0) invert(1); }
.login-brand span { font-size: 11px; font-weight: 750; letter-spacing: .03em; }
.login-clock { position: absolute; top: clamp(82px, 12vh, 145px); left: 0; right: 0; text-align: center; text-shadow: 0 2px 22px rgba(0,0,0,.36); }
#login-date { font-size: clamp(18px, 2.3vw, 25px); font-weight: 500; line-height: 1.3; }
#login-time { font-size: clamp(108px, 15.12vw, 187px); font-weight: 700; letter-spacing: -.075em; line-height: 1.02; }
.login-main { position: absolute; left: 0; right: 0; bottom: clamp(73px, 11vh, 130px); display: grid; justify-items: center; padding: 0 20px; }
.login-identity { position: relative; z-index: 2; display: grid; justify-items: center; gap: 3px; margin-bottom: 17px; text-align: center; text-shadow: 0 1px 8px rgba(0,0,0,.55); }
.login-avatar { display: grid; place-items: center; width: 70px; height: 70px; margin-bottom: 5px; border: 1px solid rgba(255,255,255,.52); border-radius: 50%; background: rgba(245,249,255,.27); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 7px 22px rgba(2,15,34,.26); backdrop-filter: blur(18px) saturate(125%); -webkit-backdrop-filter: blur(18px) saturate(125%); font-size: 27px; font-weight: 500; }
.login-identity > strong { font-size: 14px; font-weight: 650; line-height: 1.25; }
.login-identity > small { max-width: 260px; overflow: hidden; color: rgba(255,255,255,.88); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.login-switch-anchor { position: relative; display: inline-flex; justify-self: center; margin-top: 4px; }
.login-switch { display: inline-flex; align-items: center; gap: 4px; min-height: 27px; padding: 0 9px; border: 1px solid rgba(255,255,255,.42); border-radius: 999px; background: rgba(17,39,68,.22); color: #fff; font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); transition: background .2s ease, border-color .2s ease; }
.login-switch:hover, .login-switch[aria-expanded="true"] { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.7); }
.login-switch .side-tool-icon { width: 12px; height: 12px; transition: transform .2s ease; }
.login-switch[aria-expanded="true"] .side-tool-icon { transform: rotate(-90deg); }
.login-account-list { position: absolute; right: auto; bottom: -2px; left: calc(100% + 12px); z-index: 4; width: min(294px, 82vw); max-height: min(340px, 55dvh); overflow-y: auto; padding: 10px; border: 1px solid rgba(255,255,255,.82); border-radius: 18px; background: rgba(247,250,255,.96); box-shadow: 0 7px 20px rgba(0,15,42,.22), inset 0 1px 0 rgba(255,255,255,.76); color: #172945; text-align: left; text-shadow: none; transform-origin: left bottom; }
.login-account-list[hidden] { display: none; }
.login-account-option { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 8px 12px; border: 0; border-radius: 12px; background: transparent; color: #172945; font: inherit; text-align: left; cursor: pointer; transition: background .16s ease; }
.login-account-option[hidden] { display: none; }
.login-account-option:hover, .login-account-option:focus-visible { background: rgba(21,55,131,.09); }
.login-account-avatar { display: grid; flex: 0 0 36px; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(24,61,144,.13); border-radius: 50%; background: rgba(24,61,144,.09); color: #183d90; font-size: 15px; font-weight: 600; }
.login-account-label { display: grid; min-width: 0; gap: 3px; }
.login-account-label strong { font-size: 13px; font-weight: 650; line-height: 1.2; }
.login-account-label small { overflow: hidden; color: #66758c; font-size: 11px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.login-form { display: grid; justify-items: stretch; width: min(280px, 100%); }
.login-password-label, .login-username-label { margin-bottom: 6px; color: rgba(255,255,255,.93); font-size: 11px; font-weight: 600; text-align: center; text-shadow: 0 1px 6px rgba(0,0,0,.45); }
.login-username { width: 100%; height: 40px; margin-bottom: 10px; padding: 0 12px; border: 1px solid rgba(255,255,255,.55); border-radius: 10px; outline: none; background: rgba(255,255,255,.24); color: #fff; font: inherit; font-size: 13px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.login-password-row { display: flex; align-items: center; height: 42px; padding: 3px; border: 1px solid rgba(255,255,255,.57); border-radius: 11px; background: rgba(235,244,255,.22); box-shadow: 0 7px 26px rgba(0,13,31,.18); backdrop-filter: blur(20px) saturate(130%); -webkit-backdrop-filter: blur(20px) saturate(130%); transition: background .18s ease, border-color .18s ease; }
.login-password-row:focus-within { background: rgba(235,244,255,.3); }
.login-password-row input { min-width: 0; flex: 1; height: 100%; padding: 0 9px; border: 0; outline: none; background: transparent; color: #fff; font: inherit; font-size: 13px; }
.login-password-row input:focus-visible { outline: none; }
.login-password-row input::placeholder { color: rgba(255,255,255,.83); }
.login-password-row input:disabled::placeholder { color: rgba(255,255,255,.6); }
.login-submit { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border: 0; border-radius: 8px; background: rgba(255,255,255,.92); color: #092e69; cursor: pointer; transition: background .18s ease, transform .18s ease; }
.login-submit:hover:not(:disabled) { background: #fff; transform: translateX(1px); }
.login-submit:disabled { opacity: .46; cursor: default; }
.login-submit .side-tool-icon { width: 17px; height: 17px; }
.login-switch:focus-visible, .login-submit:focus-visible, .login-username:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.login-account-option:focus-visible { outline: 2px solid #183d90; outline-offset: -2px; }
.login-error { min-height: 16px; margin: 8px 0 0; color: #fff; font-size: 11px; font-weight: 600; text-align: center; text-shadow: 0 1px 6px #091525; }
.login-hint { position: absolute; right: 18px; bottom: 19px; left: 18px; margin: 0; color: rgba(255,255,255,.88); font-size: 11px; text-align: center; text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.login-hint strong { color: #fff; font-weight: 700; }
.login-connecting { margin: 0; color: #fff; font-size: 13px; font-weight: 600; text-shadow: 0 2px 12px rgba(0,0,0,.5); }

@media (max-width: 640px) {
  .login-brand { top: 18px; left: 18px; width: 56px; }
  .login-brand img { width: 50px; }
  .login-brand span { font-size: 9px; }
  .login-clock { top: clamp(75px, 12vh, 115px); }
  #login-time { font-size: clamp(89px, 22.8vw, 125px); }
  .login-main { bottom: 72px; padding: 0 10px; }
  .login-avatar { width: 54px; height: 54px; font-size: 22px; }
  .login-identity { margin-bottom: 12px; }
}

@media (max-width: 760px) {
  .login-account-list { position: fixed; top: max(210px, 30dvh); right: 12px; bottom: auto; left: 12px; width: auto; max-height: min(260px, 34dvh); transform-origin: center bottom; }
  .login-switch[aria-expanded="true"] .side-tool-icon { transform: rotate(180deg); }
}

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .login-avatar, .login-switch { background: rgba(17,39,68,.9); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .login-account-list { background: #f7faff; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .login-username, .login-password-row { background: rgba(17,39,68,.9); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

html {
  view-transition-name: none;
}

html.auth-transitioning * { view-transition-name: none !important; }
html.auth-transitioning .login-screen,
html.auth-transitioning .app-shell { view-transition-name: auth-screen !important; }
html.auth-entering::view-transition-old(auth-screen) { z-index: 1; animation: auth-photo-recede 560ms cubic-bezier(.22, 1, .36, 1) both; }
html.auth-entering::view-transition-new(auth-screen) { z-index: 2; animation: auth-workspace-appear 560ms cubic-bezier(.22, 1, .36, 1) both; }
html.auth-leaving::view-transition-old(auth-screen) { z-index: 2; animation: auth-workspace-recede 560ms cubic-bezier(.22, 1, .36, 1) both; }
html.auth-leaving::view-transition-new(auth-screen) { z-index: 1; animation: auth-photo-appear 560ms cubic-bezier(.22, 1, .36, 1) both; }

@keyframes auth-photo-recede {
  from { transform: scale(1); }
  to { transform: scale(1.035); }
}
@keyframes auth-workspace-appear {
  from { transform: translateY(100%); border-radius: 26px 26px 0 0; }
  to { transform: translateY(0); border-radius: 0; }
}
@keyframes auth-workspace-recede {
  from { transform: translateY(0); border-radius: 0; }
  to { transform: translateY(100%); border-radius: 26px 26px 0 0; }
}
@keyframes auth-photo-appear {
  from { transform: scale(1.035); }
  to { transform: scale(1); }
}

.bottom-bar {
  view-transition-name: tab-bottom-bar;
}

::view-transition {
  pointer-events: none;
}

::view-transition-group(tab-bottom-bar) {
  animation-duration: 420ms;
  animation-timing-function: var(--glass-ease);
  border-radius: 30px;
  overflow: hidden;
  background: var(--glass-fill);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
  backdrop-filter: var(--glass-filter);
  -webkit-backdrop-filter: var(--glass-filter);
}

::view-transition-old(tab-bottom-bar),
::view-transition-new(tab-bottom-bar) {
  height: 100%;
  width: 100%;
  object-fit: none;
  object-position: center bottom;
  mix-blend-mode: normal;
}

::view-transition-old(tab-bottom-bar) {
  animation: dock-content-out 120ms ease-out both;
}

::view-transition-new(tab-bottom-bar) {
  animation: dock-content-in 260ms 120ms var(--glass-ease) both;
}

::view-transition-group(knowledge-resource) {
  animation-duration: 420ms;
  animation-timing-function: var(--glass-ease);
  border-radius: 8px;
  overflow: hidden;
}

::view-transition-old(knowledge-resource),
::view-transition-new(knowledge-resource) {
  height: 100%;
  width: 100%;
  mix-blend-mode: normal;
}

::view-transition-group(graph-browse-sidebar) {
  animation-duration: 340ms;
  animation-timing-function: var(--glass-ease);
}

::view-transition-old(graph-browse-inspector),
::view-transition-new(graph-browse-inspector) {
  width: 100%;
  height: 100%;
  mix-blend-mode: normal;
}

html[data-graph-inspector-motion="open"]::view-transition-new(graph-browse-inspector) {
  animation: graph-inspector-rise 340ms var(--glass-ease) both;
}

html[data-graph-inspector-motion="close"]::view-transition-old(graph-browse-inspector) {
  animation: graph-inspector-fall 280ms cubic-bezier(0.55, 0, 1, 0.45) both;
}

html[data-graph-inspector-motion="morph"]::view-transition-old(graph-browse-inspector) {
  animation: graph-inspector-morph-out 150ms ease-in both;
}

html[data-graph-inspector-motion="morph"]::view-transition-new(graph-browse-inspector) {
  animation: graph-inspector-morph-in 250ms 75ms var(--glass-ease) both;
}

@keyframes graph-inspector-rise {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes graph-inspector-fall {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(100%); }
}

@keyframes graph-inspector-morph-out {
  to { opacity: 0; transform: translateY(-8px) scale(0.985); }
}

@keyframes graph-inspector-morph-in {
  from { opacity: 0; transform: translateY(8px) scale(1.015); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dock-content-out {
  to { opacity: 0; transform: translateY(2px); }
}

@keyframes dock-content-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

body {
  overflow: hidden;
  background: var(--bg);
}

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

button {
  color: inherit;
}

/* Glass belongs to the control layer, not the documents, answers, or graph. */
.glass-surface {
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
  backdrop-filter: var(--glass-filter);
  -webkit-backdrop-filter: var(--glass-filter);
}

.glass-interactive {
  position: relative;
  isolation: isolate;
}

.glass-interactive::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.04) 20%, rgba(255, 255, 255, 0.8) 48%, rgba(234, 241, 255, 0.12) 72%);
  background-size: 220% 100%;
  background-position: var(--glass-light-x, 50%) 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(255, 255, 255, 0.44), 0 0 12px rgba(231, 240, 255, 0.38);
  opacity: 0;
  transform: scale(0.94);
  pointer-events: none;
  transition: opacity 220ms ease, transform 340ms var(--glass-ease), background-position 180ms ease;
}

.glass-interactive > :not(.glass-selection) {
  position: relative;
  z-index: 3;
}

.glass-interactive:focus-visible::before,
.glass-interactive:active::before {
  opacity: 0.75;
  transform: scale(1);
}

@media (hover: hover) {
  .glass-interactive:hover::before {
    opacity: 0.65;
    transform: scale(1);
  }
}

.glass-interactive:disabled::before {
  opacity: 0;
}

.glass-selection {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(228, 232, 240, 0.48), 0 2px 7px rgba(28, 30, 36, 0.1), 0 0 0 1px rgba(30, 32, 38, 0.05);
  pointer-events: none;
}

.tabs .glass-selection {
  background: rgba(232, 234, 239, 0.8);
}

.has-glass-selection .tab.active,
.has-glass-selection .filter-tab.active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.has-glass-selection .tab:hover:not(.active),
.has-glass-selection .filter-tab:hover {
  background: transparent;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

::selection {
  background: rgba(255, 70, 45, 0.18);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.28);
  border: 3px solid transparent;
  background-clip: padding-box;
}

.setup-screen {
  min-height: 100%;
  height: 100%;
  display: grid;
  place-items: start center;
  overflow-y: auto;
  padding: 32px;
  background: var(--bg);
}

.setup-panel {
  width: min(720px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 30px;
}

.setup-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  min-width: 0;
  margin-bottom: 26px;
}

.kyndryl-mark {
  width: 178px;
  height: auto;
  flex: 0 0 auto;
}

.semantic-word {
  color: var(--brand);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.setup-form {
  display: grid;
  gap: 18px;
}

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

.setup-grid .field {
  min-width: 0;
}

#lightrag-demo {
  min-width: 0;
  text-overflow: ellipsis;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.field-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--panel-muted);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.field input:focus,
.search-input:focus,
.field select:focus {
  background: #fff;
  border-color: rgba(255, 70, 45, 0.58);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.logo-search-field,
.logo-results {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.logo-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.logo-upload {
  display: flex;
  align-items: center;
  gap: 14px;
}

.client-preview,
.client-logo {
  max-width: 120px;
  max-height: 34px;
  object-fit: contain;
}

.client-preview {
  min-width: 94px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  background: var(--panel-muted);
}

.logo-search-status {
  min-height: 40px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

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

.logo-choice {
  min-width: 0;
  display: grid;
  grid-template-rows: 48px auto auto;
  gap: 6px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-muted);
  padding: 10px;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.logo-choice:hover,
.logo-choice.selected {
  background: #fff;
  border-color: rgba(255, 70, 45, 0.5);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.logo-choice-image {
  min-width: 0;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.logo-choice-image img {
  max-width: 100%;
  max-height: 34px;
  object-fit: contain;
}

.logo-choice-title,
.logo-choice-source {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo-choice-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.logo-choice-source {
  color: var(--muted);
  font-size: 11px;
}

.logo-show-more {
  justify-self: center;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.logo-show-more:hover {
  border-color: rgba(255, 70, 45, 0.42);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.setup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}

.tunnel-manager {
  margin-top: 22px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  overflow: hidden;
}

.tunnel-manager-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.tunnel-manager h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
}

.tunnel-manager p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.tunnel-list {
  display: grid;
}

.tunnel-row {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.tunnel-row:last-child {
  border-bottom: 0;
}

.tunnel-info {
  min-width: 0;
}

.tunnel-port {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.tunnel-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.tunnel-empty {
  padding: 16px 14px;
  color: var(--muted);
  font-size: 13px;
  background: #fff;
}

.error-text {
  color: var(--danger);
}

.app-shell {
  height: 100%;
  display: grid;
  grid-template-rows: minmax(64px, auto) minmax(0, 1fr);
  background: var(--bg);
}

.topbar {
  position: relative;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  padding: 6px 24px;
  min-width: 0;
  background: var(--panel);
}

.brand-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 8px;
  min-width: 0;
}

.brand-identity {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 4px;
  flex: 0 0 auto;
}

.brand-line .kyndryl-mark {
  display: block;
  width: 104px;
}

.brand-line .semantic-word {
  font-size: 11px;
  font-weight: 400;
  line-height: 13px;
}

.brand-separator {
  width: 1px;
  height: 28px;
  flex: 0 0 auto;
  background: var(--border-strong);
}

.client-logo-slot {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
  max-width: 100%;
  height: 36px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 0 1 auto;
}

.client-logo-slot::-webkit-scrollbar {
  display: none;
}

.client-logo-frame {
  display: block;
  position: relative;
  height: 32px;
  overflow: hidden;
  flex: 0 0 auto;
}

.client-logo-slot .client-logo {
  display: block;
  width: auto;
  height: 32px;
  max-width: none;
  max-height: none;
}

.client-logo-placeholder {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 40px;
  padding: 4px;
  border-radius: 999px;
}

.tab {
  height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 15px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 220ms ease, color 220ms ease, box-shadow 220ms ease;
}

.tab.active {
  color: var(--text);
  background: rgba(232, 234, 239, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 3px rgba(28, 30, 36, 0.08);
}

.tab:hover:not(.active) {
  background: rgba(232, 234, 239, 0.48);
  color: var(--text);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
}

.account-logout { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--text); box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0,0,0,.05); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.account-logout .side-tool-icon { width: 15px; height: 15px; }
.account-logout:hover { background: #f3f6fd; border-color: rgba(5,45,152,.23); color: var(--ao-blue); }
.account-logout:focus-visible { outline: 2px solid var(--ao-blue); outline-offset: 2px; }

.icon-button,
.button,
.dark-button,
.ghost-button,
.toggle-button {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.icon-button {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
}

.button-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

#settings-button {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: 999px;
  font-size: 22px;
  line-height: 1;
}

#settings-button .side-tool-icon {
  width: 22px;
  height: 22px;
}

.knowledge-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
}

.knowledge-search:focus-within {
  border-color: #8b8b93;
  box-shadow: 0 0 0 1px #8b8b93;
}

.knowledge-search input,
.knowledge-search input:focus-visible {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  outline: none;
  box-shadow: none;
}

.knowledge-catalog-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.knowledge-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 18px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease;
}

.knowledge-option:last-child {
  border-bottom: 0;
}

.knowledge-option:hover,
.knowledge-option:focus-visible {
  background: var(--soft-2);
}

.knowledge-option:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: -3px;
}

.knowledge-option-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.knowledge-option-topic {
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
}

.knowledge-option-customer {
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
}

.knowledge-option-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  max-width: 112px;
  color: var(--muted);
}

.knowledge-current {
  font-size: 11px;
}

.knowledge-port {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.knowledge-option-meta .side-tool-icon {
  width: 14px;
  height: 14px;
}

.knowledge-empty {
  padding: 36px 18px;
  font-size: 13px;
  text-align: center;
  color: var(--muted);
}

.knowledge-catalog-view .knowledge-option-copy {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}

.knowledge-search-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(740px, 100%);
  min-height: 66px;
  padding: 12px 18px;
  border-radius: 30px;
}

.knowledge-search-bar .knowledge-search {
  flex: 1;
  min-width: 0;
}

#knowledge-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.knowledge-view {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 24px;
  height: 100%;
  min-height: 0;
  padding: 24px 24px 110px;
  background: var(--panel);
}

.knowledge-resource-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
}

.knowledge-resource-heading > div {
  min-width: 0;
}

.knowledge-resource-heading h1 {
  margin: 0;
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.knowledge-resource-heading h1:focus {
  outline: none;
}

.knowledge-resource-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
  overflow-wrap: anywhere;
}

#browse-knowledge {
  flex: 0 0 auto;
}

.knowledge-catalog-view .knowledge-resource-heading { align-items: center; }
#current-knowledge { flex: 0 0 auto; margin-left: auto; }

.knowledge-content {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-content: start;
  align-items: start;
  gap: 24px 32px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.knowledge-content h2 {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.knowledge-content h2 > span {
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.knowledge-parameters {
  padding-right: 24px;
  border-right: 1px solid var(--border);
}

.knowledge-parameters dl {
  margin: 0;
  font-size: 13px;
  line-height: 20px;
}

.knowledge-parameters dl > div {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.knowledge-parameters dt {
  color: var(--muted);
}

.knowledge-parameters dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.knowledge-prompt-list {
  counter-reset: prompt;
  list-style: none;
  padding: 0;
  margin: 0;
}

.knowledge-prompt-list li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 32px;
  align-items: start;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.knowledge-prompt-list li::before {
  counter-increment: prompt;
  content: counter(prompt);
  padding-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 24px;
  font-variant-numeric: tabular-nums;
}

.knowledge-prompt-list p {
  margin: 0;
  padding-top: 4px;
  font-size: 14px;
  line-height: 24px;
  overflow-wrap: anywhere;
}

.knowledge-prompt-copy {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.knowledge-no-prompts {
  padding: 16px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.knowledge-connection-error {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 20px;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--border);
}

.knowledge-connect-dock {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: max(20px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
}

.knowledge-connect-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(740px, 100%);
  min-height: 66px;
  padding: 12px 18px;
  border-radius: 30px;
}

.knowledge-connect-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.knowledge-connect-copy strong {
  color: var(--text);
  font-weight: 600;
}

#connect-knowledge {
  flex: 0 0 auto;
  min-width: 128px;
}

#connect-knowledge[aria-busy="true"] .side-tool-icon {
  animation: progress-turn 1000ms linear infinite;
}

.knowledge-connect-bar .dark-button::before,
#current-knowledge::before {
  background: linear-gradient(115deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.14) 48%, rgba(255, 255, 255, 0) 72%);
}

@media (hover: hover) {
  .icon-button:enabled:hover,
  .button:where(:not(.primary)):enabled:hover,
  .ghost-button:enabled:hover,
  .toggle-button:enabled:hover {
    background-color: var(--soft);
    border-color: var(--border-strong);
  }

  .dark-button:not(.destructive-button):enabled:hover,
  .button.primary:not(.destructive-button):enabled:hover {
    background-color: #1748b1;
    background-image: radial-gradient(ellipse 44px 32px at var(--button-light-x, 50%) var(--button-light-y, 50%), rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0) 100%), linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
    border-color: #1748b1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 2px 5px rgba(0, 0, 0, 0.18);
  }
}

.dark-button,
.button.primary {
  color: #fff;
  background-color: var(--ao-blue);
  background-image: linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  border-color: var(--ao-blue);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 2px 4px rgba(0, 0, 0, 0.12);
}

.button:disabled,
.dark-button:disabled,
.icon-button:disabled,
.ghost-button:disabled,
.toggle-button:disabled,
.entity-toggle-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.button:focus-visible,
.dark-button:focus-visible,
.icon-button:focus-visible,
.ghost-button:focus-visible,
.toggle-button:focus-visible,
.entity-toggle-button:focus-visible,
.tab:focus-visible,
.filter-tab:focus-visible,
.copy-inline:focus-visible,
.graph-side-tools button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(80, 86, 99, 0.12);
}

.status-dot {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c6cad2;
}

.status-dot.connected {
  background: var(--success);
}

.status-dot.error {
  background: #ff5a4d;
}

.main-panel {
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

.documents-view {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  padding: 22px 24px 12px;
  background: var(--panel);
}

.documents-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  min-width: 0;
}

.documents-heading,
.documents-actions,
.documents-action-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.documents-heading {
  gap: 12px;
}

.documents-count {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.documents-actions {
  flex-wrap: wrap;
  gap: 16px;
}

.documents-action-group {
  gap: 4px;
}

.documents-actions .button,
.documents-actions .icon-button {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  font-weight: 500;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.documents-actions .button:enabled:hover,
.documents-actions .icon-button:enabled:hover {
  background: rgba(243, 245, 249, 0.72);
  border-color: rgba(232, 236, 244, 0.66);
  box-shadow: inset 0 1px 0 #fff, 0 2px 8px rgba(28, 30, 36, 0.04);
}

.documents-actions .glass-interactive .side-tool-icon,
.documents-actions .glass-interactive .button-icon {
  transition: transform 280ms var(--glass-ease);
}

.documents-actions .glass-interactive:enabled:active .side-tool-icon,
.documents-actions .glass-interactive:enabled:active .button-icon {
  transform: scale(0.92);
}

.documents-actions .dark-button::before {
  background: linear-gradient(115deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.22) 48%, rgba(255, 255, 255, 0) 72%);
}

.documents-action-group + .documents-action-group {
  padding-left: 16px;
  border-left: 1px solid var(--border);
}

#toggle-doc-details {
  min-width: 132px;
}

.documents-toolbar .section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
}

.docs-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
}

.documents-filter-dock {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 3;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.documents-filter-dock::before {
  content: "";
  position: absolute;
  left: -24px;
  right: -24px;
  bottom: -20px;
  height: 110px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.88) 72%, #fff);
  pointer-events: none;
}

.filter-tabs {
  --glass-fill: rgba(248, 250, 253, 0.64);
  --glass-border: rgba(255, 255, 255, 0.88);
  --glass-filter: blur(28px) saturate(160%);
  --glass-shadow: 0 3px 8px rgba(28, 30, 36, 0.08), 0 12px 30px rgba(28, 30, 36, 0.14), 0 0 0 1px rgba(30, 32, 38, 0.08);
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 60px;
  padding: 7px;
  border-radius: 999px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
  max-width: 100%;
  pointer-events: auto;
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  padding: 0 15px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 220ms ease, color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.filter-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.4);
}

.filter-tab.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 0 #fff, 0 2px 7px rgba(28, 30, 36, 0.1), 0 0 0 1px rgba(30, 32, 38, 0.05);
}

.filter-tab:focus-visible {
  outline-offset: -3px;
  box-shadow: none;
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.05);
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.docs-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border-top: 1px solid var(--border);
  padding-bottom: 96px;
  scroll-padding-bottom: 96px;
}

.docs-table {
  width: 100%;
  min-width: 1200px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.docs-table th,
.docs-table td {
  text-align: left;
  padding: 14px 12px;
  vertical-align: middle;
}

.docs-table th {
  position: sticky;
  top: 0;
  background: var(--panel);
  color: var(--muted);
  z-index: 1;
  font-size: 12px;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  padding-top: 11px;
  padding-bottom: 11px;
}

.docs-table th:first-child {
  padding-left: 54px;
}

.docs-table td {
  background: #fff;
  height: 64px;
}

.docs-table tbody tr:nth-child(even) td {
  background: #f7f8fa;
}

.docs-table tbody tr:hover td {
  background: #eff1f5;
}

.docs-table .numeric-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.docs-table .checkbox-cell {
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}

.docs-sort-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.docs-sort-label .side-tool-icon {
  width: 13px;
  height: 13px;
}

.hide-doc-details .docs-table col:nth-child(2),
.hide-doc-details .docs-table th:nth-child(2),
.hide-doc-details .docs-table td:nth-child(2) {
  display: none;
}

.hide-doc-details .doc-id {
  display: none;
}

.file-name {
  display: flex;
  min-width: 0;
  line-height: 1.45;
  font-size: 14px;
  font-weight: 500;
}

.file-name-stem {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-name-extension {
  flex: 0 0 auto;
  max-width: 35%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-file {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.document-file-icon {
  display: inline-flex;
  flex: 0 0 32px;
  color: var(--muted);
}

.document-file-icon.icon-button {
  width: 32px;
  height: 36px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.document-file-icon.icon-button:enabled:hover {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

.document-preview-dialog {
  width: min(1120px, calc(100vw - 32px));
  height: min(760px, calc(100dvh - 48px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 250, 0.97) 52%, rgba(255, 255, 255, 0.98));
  backdrop-filter: var(--notification-refraction, blur(18px)) blur(12px) saturate(135%);
  -webkit-backdrop-filter: var(--notification-refraction, blur(18px)) blur(12px) saturate(135%);
  color: var(--text);
  box-shadow: inset 0 1px 1px #fff, inset 0 -1px 1px rgba(55, 60, 70, 0.16), 0 20px 60px rgba(25, 30, 40, 0.18), 0 2px 6px rgba(25, 30, 40, 0.08);
  overflow: hidden;
  isolation: isolate;
}

.document-preview-dialog[open] { display: flex; flex-direction: column; }
.document-preview-dialog [hidden] { display: none !important; }
.document-preview-dialog::backdrop { background: rgba(30, 32, 38, 0.14); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.document-preview-dialog::before,
.document-preview-dialog::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.document-preview-dialog::before {
  background: linear-gradient(115deg, transparent 22%, rgba(255, 255, 255, 0.6) 46%, rgba(255, 255, 255, 0.08) 65%, transparent 80%);
  background-size: 220% 150%;
  background-position: var(--glass-light-x, 35%) var(--notification-light-y, 20%);
  opacity: 0.7;
  transition: background-position 200ms ease;
}
.document-preview-dialog.preview-glass-entering::before {
  animation: preview-glass-reveal 480ms var(--glass-ease) both;
}
.document-preview-dialog::after {
  z-index: 4;
  padding: 1px;
  background: linear-gradient(130deg, #fff 8%, rgba(255, 255, 255, 0.12) 35%, rgba(70, 78, 92, 0.23) 66%, rgba(255, 255, 255, 0.96));
  background-size: 180% 140%;
  background-position: var(--glass-light-x, 35%) 50%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  transition: background-position 200ms ease;
}
.document-preview-dialog > * { position: relative; z-index: 1; }
@keyframes preview-glass-reveal {
  from { opacity: 0.15; background-position: 8% 0%; }
  to { opacity: 0.7; background-position: var(--glass-light-x, 35%) var(--notification-light-y, 20%); }
}
.document-preview-heading { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex: 0 0 auto; }
.document-preview-heading > div { flex: 1; min-width: 0; }
.document-preview-heading > .side-tool-icon { flex: 0 0 24px; width: 24px; height: 24px; color: var(--muted); }
.document-preview-heading h2 { margin: 0; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
#document-preview-title:focus { outline: none; }
.document-preview-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.document-preview-dialog .icon-button { flex: 0 0 36px; width: 36px; height: 36px; min-height: 36px; background: rgba(255, 255, 255, 0.55); border-color: rgba(255, 255, 255, 0.85); box-shadow: inset 0 1px 0 #fff, 0 1px 3px rgba(30, 35, 45, 0.1); }
.document-preview-dialog .icon-button:disabled { opacity: 0.32; box-shadow: none; }
.document-preview-toolbar { display: flex; flex: 0 0 auto; gap: 16px; align-items: center; justify-content: space-between; padding: 8px 16px 16px; }
.document-preview-modes { position: relative; isolation: isolate; display: flex; flex: 0 0 auto; height: 42px; padding: 4px; background: rgba(225, 229, 235, 0.42); border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 999px; box-shadow: inset 0 1px 3px rgba(30, 35, 45, 0.06), 0 1px 0 rgba(255, 255, 255, 0.7); }
.document-preview-modes .button { position: relative; z-index: 2; height: 32px; min-height: 32px; min-width: 64px; border: 0; box-shadow: none; background: transparent; color: var(--muted); border-radius: 999px; }
.document-preview-modes .button[aria-pressed="true"] { color: var(--text); }
.document-preview-modes .button:enabled:hover { background: transparent; box-shadow: none; color: var(--text); }
.document-preview-modes .glass-selection { background: rgba(255, 255, 255, 0.8); }
.document-preview-search { display: flex; align-items: center; gap: 8px; min-width: 0; width: min(340px, 50%); min-height: 42px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, 0.85); border-radius: 999px; background: rgba(255, 255, 255, 0.5); box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 1px 3px rgba(30, 35, 45, 0.06); transition: background 180ms ease, box-shadow 180ms ease; }
.document-preview-search:focus-within { background: rgba(255, 255, 255, 0.84); box-shadow: inset 0 1px 0 #fff, 0 0 0 2px rgba(80, 86, 99, 0.45); }
.document-preview-search .side-tool-icon { flex: 0 0 16px; width: 16px; height: 16px; color: var(--muted); }
.document-preview-search input.search-input { width: 100%; min-width: 0; height: 40px; padding: 0; border: 0; background: transparent; box-shadow: none; outline: none; border-radius: 0; }
.documents-search-status { padding: 2px 2px 16px; color: var(--muted); font-size: 13px; }
.documents-search-control { position: relative; flex: 0 1 280px; width: 280px; max-width: 100%; }
.documents-search-field {
  position: relative;
  width: 100%;
  height: 34px;
  min-height: 34px;
  padding-right: 44px;
  border-color: rgba(174, 190, 213, 0.75);
  background: #fff;
  box-shadow: none;
  backdrop-filter: blur(16px) saturate(125%);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 280ms ease;
}
.documents-search-field::before {
  content: '';
  position: absolute;
  inset: -1px;
  padding: 2px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg,
    rgba(255, 255, 255, 0.04) 20%,
    rgba(222, 231, 244, 0.8) 48%,
    rgba(234, 241, 255, 0.12) 72%) #aebfd6;
  background-size: 220% 100%;
  background-position: var(--glass-light-x, 50%) 50%;
  opacity: 0.65;
  transition: background-position 180ms ease, opacity 220ms ease;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.documents-search-field input.search-input { height: 32px; }
.documents-search-field:focus-within { background: #fff; box-shadow: 0 0 10px 1px rgba(176, 196, 229, 0.45), inset 0 0 0 1px rgba(234, 241, 255, 0.7); outline: none; }
.documents-search-field:focus-within::before { opacity: 0.85; }
.documents-search-control > .icon-button { position: absolute; top: 1px; right: 5px; width: 32px; height: 32px; }
.documents-search-control > [hidden], .documents-search-status[hidden] { display: none !important; }
.documents-search-field input::-webkit-search-cancel-button { display: none; }
.document-search-result { padding: 18px 0; border-bottom: 1px solid var(--border); }
.document-search-result-heading { display: flex; align-items: center; gap: 10px; min-width: 0; margin-bottom: 10px; }
.document-search-result-heading .document-file-icon { margin-left: 4px; margin-right: 0; }
.document-search-result-heading h2 { flex: 1; min-width: 0; margin: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.document-search-result-heading .button { flex: 0 0 auto; font-size: 12px; }
.document-search-excerpt { display: block; width: 100%; border: 0; border-radius: 6px; padding: 10px 12px; background: transparent; text-align: left; color: var(--text); font: inherit; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; cursor: pointer; }
.document-search-excerpt:hover { background: var(--soft); }
.document-search-excerpt:focus-visible { outline: 2px solid var(--muted); outline-offset: -2px; }
.document-search-excerpt mark { background: #d5eddd; color: #153e25; border-radius: 2px; }
.document-search-table-wrap { max-width: 100%; max-height: 400px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; scrollbar-gutter: stable; }
.document-search-table-wrap:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }
.document-search-table td { min-width: 140px; }
.document-search-row-open { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; width: 100%; padding: 0; border: 0; border-radius: 2px; background: transparent; color: inherit; font: inherit; text-align: left; white-space: inherit; cursor: pointer; }
.document-search-row-open:hover { text-decoration: underline; }
.document-search-row-open:focus-visible { outline: 2px solid var(--muted); outline-offset: 4px; }
.document-search-row-open .side-tool-icon { flex: 0 0 14px; width: 14px; height: 14px; margin-top: 3px; color: var(--muted); }
.document-search-row-count { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.document-search-warning { padding: 12px 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.document-search-warning summary { cursor: pointer; }
.document-search-warning ul { padding-left: 20px; }
.document-search-warning .button { margin: 8px 0; }
.document-search-pages { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 18px 0; font-size: 13px; }
@media (max-width: 600px) {
  .documents-search-control { flex: 1 1 100%; width: 100%; margin-right: 0; }
  .document-search-result-heading { flex-wrap: wrap; }
  .document-search-result-heading h2 { flex-basis: calc(100% - 46px); }
  .document-search-result-heading .button { margin-left: 46px; }
}
.document-preview-modes[hidden] + .document-preview-search { margin-left: auto; width: min(340px, 100%); }
.document-preview-content { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; background: white; border: 1px solid rgba(80, 88, 100, 0.1); border-radius: 8px; }
.document-preview-table { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 13px; text-align: left; }
.document-preview-table th { position: sticky; top: 0; z-index: 1; background: #f5f6f8; color: var(--muted); font-weight: 600; }
.document-preview-table th, .document-preview-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; min-width: 150px; max-width: 360px; overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.5; }
.document-preview-table tbody tr:nth-child(even) { background: #fafbfc; }
.document-preview-text { margin: 0; padding: 24px; font: 13px/1.65 "SF Mono", ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.document-preview-footer { display: flex; flex: 0 0 auto; align-items: center; gap: 12px; min-height: 58px; padding: 10px 16px 2px; font-size: 12px; color: var(--muted); }
#document-preview-count { flex: 1; min-width: 0; }
.document-preview-pages { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.document-preview-pages span { min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; }
.document-preview-content:focus-visible { outline: 2px solid #8e8e93; outline-offset: -2px; }

.answer-citation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  margin: 0 1px;
  padding: 0 3px;
  border: 1px solid rgba(80, 88, 100, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  vertical-align: baseline;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
.answer-citation:enabled:hover, .answer-citation[aria-expanded="true"] { background: #e8ecef; border-color: #8e8e93; }
.answer-citation:focus-visible { outline: 2px solid #8e8e93; outline-offset: 2px; }
.answer-citation:disabled { opacity: 0.55; cursor: default; }
.document-preview-dialog.source-preview {
  position: fixed;
  inset: auto;
  z-index: 100;
  margin: 0;
  width: min(440px, calc(100vw - 24px));
  height: auto;
  max-height: calc(100dvh - 24px);
  border-radius: 24px;
}
.source-preview .document-preview-heading { padding: 10px 10px 14px; gap: 10px; }
.source-preview .document-preview-heading h2 { font-size: 14px; }
.source-preview .document-preview-heading p { line-height: 1.5; }
.source-preview-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(320px, 45dvh);
  padding: 16px;
  border: 1px solid rgba(80, 88, 100, 0.1);
  border-radius: 8px;
  background: #fff;
  overflow: auto;
  overscroll-behavior: contain;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.source-preview-body p { margin: 0; color: var(--muted); }
.source-preview-body p + blockquote { margin-top: 12px; }
.source-preview-body blockquote { margin: 0; white-space: pre-wrap; }
.source-record { margin: 0; }
.source-record > div { display: grid; grid-template-columns: minmax(90px, 0.8fr) minmax(0, 1.5fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.source-record > div:first-child { padding-top: 0; }
.source-record > div:last-child { padding-bottom: 0; border-bottom: 0; }
.source-record dt { color: var(--muted); font-size: 12px; }
.source-record dd { margin: 0; white-space: pre-wrap; }
.source-preview-body mark, .document-preview-text mark, .document-preview-table mark { background: #d9efdf; color: #1d1d1f; border-radius: 2px; }
.document-preview-text mark.preview-current-match { background: #b9e2c5; box-shadow: inset 0 0 0 1px #39754a; }
.document-preview-table .source-match td { background: #e2f2e6; }
.document-preview-table .source-match td:first-child { box-shadow: inset 3px 0 #168a3a; }
.source-preview-footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 12px 8px 4px; }
.source-preview-footer .button { white-space: normal; min-height: 36px; }
.source-preview-footer [data-open-source] { margin-left: auto; }
.source-preview-pages { display: flex; align-items: center; gap: 4px; }
.source-preview-pages span { min-width: 40px; text-align: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.source-document-choices { display: grid; gap: 8px; }
.source-document-choices .button { display: flex; flex-direction: column; align-items: flex-start; height: auto; white-space: normal; text-align: left; overflow-wrap: anywhere; }
.source-document-choices small { font-weight: 400; color: var(--muted); }

@media (max-width: 600px) {
  .document-preview-dialog { width: calc(100vw - 16px); height: calc(100dvh - 24px); padding: 6px; }
  .document-preview-heading { padding: 12px 10px; gap: 10px; }
  .document-preview-dialog .icon-button { flex-basis: 44px; width: 44px; height: 44px; min-height: 44px; }
  .document-preview-toolbar { padding: 4px 10px 12px; gap: 10px; }
  .document-preview-footer { padding: 8px 10px 2px; }
  .document-preview-footer { flex-wrap: wrap; gap: 8px; }
  .document-preview-toolbar { flex-wrap: wrap; }
  .document-preview-search { width: auto; flex: 1 1 180px; }
  .document-preview-text { padding: 16px; }
  .document-preview-dialog.source-preview { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .source-preview-footer .button { min-height: 44px; }
  .answer-citation { min-width: 28px; min-height: 28px; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .document-preview-dialog { background: #f4f5f7; }
}

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .documents-search-field { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .document-preview-dialog { background: var(--glass-fill); border-color: var(--glass-border); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .document-preview-dialog::before, .document-preview-dialog::after { display: none; }
  .document-preview-dialog::backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(30, 32, 38, 0.3); }
  .document-preview-dialog .icon-button, .document-preview-search { background: var(--panel); border-color: var(--glass-border); }
  .document-preview-modes { background: var(--soft); border-color: var(--glass-border); }
  .document-preview-modes .glass-selection { background: var(--panel); border-color: var(--glass-border); }
}

.document-file-icon .side-tool-icon {
  width: 22px;
  height: 22px;
  stroke-width: 1.4;
}

.document-file-text {
  flex: 1;
  min-width: 0;
}

.doc-id {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 11px;
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-table td:nth-child(2),
.document-date {
  color: var(--muted);
  font-size: 12px;
}

.document-date {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status-text::before {
  content: "";
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-text.processed {
  color: #168a3a;
}

.status-text.failed {
  color: var(--danger);
}

.status-text.pending,
.status-text.processing,
.status-text.preprocessed {
  color: #5e5ce6;
}

.checkbox-cell {
  text-align: center;
}

.checkbox {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  display: inline-block;
  background: #fff;
}

.checkbox.checked {
  background: var(--accent);
  box-shadow: inset 0 0 0 3px #fff;
}

.empty-state,
.loading-state,
.error-state {
  display: grid;
  place-items: center;
  min-height: 240px;
  color: var(--muted);
  text-align: center;
  padding: 32px;
  font-size: 14px;
}

.error-state {
  color: var(--danger);
}

.pipeline-panel {
  position: fixed;
  z-index: 18;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
}

.pipeline-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.pipeline-heading strong {
  min-width: 0;
  font-weight: 600;
}

.pipeline-status {
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.feedback-region {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  width: min(476px, calc(100% - 8px));
  max-height: calc(100% - 160px);
  overflow: auto;
  z-index: 1100;
  display: grid;
  gap: 8px;
  padding: 8px;
  pointer-events: none;
}

.feedback-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  pointer-events: auto;
}

.feedback-region[inert],
body:has(#clear-documents-dialog[open], #pipeline-panel) .feedback-region {
  visibility: hidden;
  pointer-events: none;
}

.confirm-dialog :focus-visible,
.entity-popup :focus-visible,
.response-details-panel :focus-visible,
.pipeline-panel :focus-visible,
.feedback-message :focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
  box-shadow: none;
}

.feedback-symbol,
.progress-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.feedback-success .feedback-symbol {
  color: #168a3a;
}

.feedback-error .feedback-symbol {
  color: var(--danger);
}

.feedback-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
  overflow-wrap: anywhere;
}

.feedback-copy strong {
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
}

.feedback-copy > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.feedback-dismiss {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-top: -4px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.feedback-retry {
  flex-shrink: 0;
  padding: 4px 8px;
  min-height: 28px;
  font-size: 12px;
}

.inline-progress {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.progress-symbol {
  animation: progress-turn 1000ms linear infinite;
}

@keyframes progress-turn {
  to { transform: rotate(360deg); }
}

.confirm-dialog {
  width: min(420px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 24px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.confirm-dialog::backdrop {
  background: rgba(30, 32, 38, 0.16);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.confirm-dialog-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.confirm-dialog h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.confirm-dialog p {
  margin: 12px 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.destructive-button {
  background-color: var(--danger);
  border-color: var(--danger);
}

.destructive-button:enabled:hover {
  background-color: #ad2520;
}

.graph-view {
  --graph-dock-space: 104px;
  position: relative;
  height: 100%;
  overflow: hidden;
  background: #fff;
}

.graph-focused-view,
.graph-selected-view {
  --graph-dock-space: 148px;
}

#graph-context-controls:empty { display: none; }

.graph-context-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.graph-relationships-toggle { min-width: 150px; }

.graph-bottom-dock {
  position: absolute;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 24px;
  right: 24px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.graph-bottom-dock > * {
  pointer-events: auto;
}

.graph-controls {
  display: grid;
  gap: 8px;
  width: min(640px, 100%);
  min-width: 0;
  padding: 7px;
  border-radius: 30px;
}

.graph-search-controls,
.graph-focus-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.graph-search-controls {
  height: 44px;
}

.graph-controls .label-select,
.graph-controls .search-input {
  height: 44px;
  border-radius: 999px;
}

.graph-controls .label-select {
  width: 200px;
  max-width: 34%;
}

.graph-controls .search-input {
  flex: 1;
  width: 0;
}

.graph-focus-controls .graph-focus-pill {
  display: block;
  flex: 1;
  max-width: none;
  min-width: 0;
  line-height: 34px;
}

.graph-focus-controls .button {
  flex: 0 0 auto;
}

.graph-controls .icon-button,
.graph-controls .button {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.graph-controls .icon-button:enabled:hover,
.graph-controls .button:enabled:hover {
  background: rgba(118, 118, 128, 0.1);
}

.label-select,
.search-input {
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(245, 246, 249, 0.8);
  padding: 0 12px;
  box-shadow: none;
  outline: none;
}

.label-select {
  width: 240px;
  max-width: 28vw;
  min-width: 100px;
}

.search-input {
  width: 210px;
  min-width: 0;
}

.graph-focus-pill {
  max-width: 260px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0 11px;
  box-shadow: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.graph-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  background: #fff;
}

.graph-canvas.dragging {
  cursor: grabbing;
}

.graph-side-tools {
  position: absolute;
  left: 14px;
  bottom: var(--graph-dock-space);
  z-index: 6;
  display: grid;
  gap: 10px;
}

.graph-tool-group {
  display: grid;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
}

.graph-side-tools button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  display: grid;
  place-items: center;
}

.graph-side-tools button:enabled:hover:not(.active) {
  background: var(--soft);
}

.graph-side-tools button.active {
  background: rgba(52, 199, 89, 0.14);
  color: #168a3a;
}

.side-tool-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.graph-meta {
  position: absolute;
  left: 58px;
  bottom: var(--graph-dock-space);
  color: var(--muted-2);
  font-size: 12px;
  z-index: 4;
}

.legend {
  position: absolute;
  right: 12px;
  bottom: var(--graph-dock-space);
  z-index: 4;
  width: 124px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  padding: 10px 10px 10px 12px;
}

.legend h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.55;
}

.legend-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.graph-inspector {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 7;
  width: min(380px, calc(100vw - 84px));
  max-height: calc(100% - var(--graph-dock-space) - 28px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.graph-view:has(.graph-inspector) .legend {
  right: 408px;
}

.graph-inspector-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.graph-inspector-actions {
  display: flex;
  align-items: center;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-muted);
}

.graph-inspector-actions .button {
  flex: 1 1 180px;
  min-width: 0;
  min-height: 36px;
  padding: 8px 12px;
  white-space: normal;
}

.graph-inspector-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.graph-inspector-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.graph-inspector-body {
  min-height: 0;
  overflow: auto;
  padding: 8px 0;
}

.property-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.property-row:last-child {
  border-bottom: 0;
}

.property-key {
  color: var(--muted);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.property-value {
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.retrieval-view {
  position: relative;
  height: 100%;
  display: grid;
  padding: 0;
  background: var(--panel);
}

.retrieval-main {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.retrieval-history {
  min-height: 0;
  overflow: auto;
  padding: 24px 24px 12px;
  background: var(--panel);
  scroll-behavior: smooth;
}

.retrieval-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
}

.retrieval-turn {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto 24px;
}

.user-message-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: end;
  gap: 8px;
  width: fit-content;
  max-width: min(790px, 80%);
  margin-left: auto;
}

.user-message {
  min-width: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-radius: 20px 20px 6px 20px;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  line-height: 1.5;
  font-size: 14px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.assistant-message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
}

.assistant-message {
  width: fit-content;
  max-width: calc(100% - 36px);
  min-width: 0;
  min-height: 40px;
  border-radius: 20px 20px 20px 6px;
  background: #f5f6f8;
  padding: 14px 18px;
  line-height: 1.65;
  font-size: 14px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.assistant-message.empty {
  color: var(--muted);
}

.assistant-message p {
  margin: 0 0 10px;
}

.assistant-message strong {
  font-weight: 650;
}

.assistant-message code {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 5px;
  background: #e5e5ea;
  color: var(--text);
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.entity-link {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 0;
  border-radius: 5px;
  background: rgba(255, 70, 45, 0.12);
  color: var(--text);
  padding: 1px 5px;
  font: inherit;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 70, 45, 0.2);
}

.entity-link:hover {
  background: rgba(255, 70, 45, 0.18);
}

.entity-link:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px var(--focus-ring), inset 0 0 0 1px rgba(255, 70, 45, 0.3);
}

.answer-tools-row {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.entity-toggle-button {
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.entity-toggle-button:enabled:hover {
  color: var(--text);
  background: #fff;
  border-color: var(--border-strong);
}

.evidence-panel {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  overflow: hidden;
  background: transparent;
}

.evidence-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.evidence-section:last-child {
  border-bottom: 0;
}

.evidence-title {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.evidence-source-grid,
.evidence-entity-grid,
.evidence-relationship-list {
  display: grid;
  gap: 7px;
}

.evidence-source {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
}

.evidence-source span {
  color: var(--muted);
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.evidence-entity-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.evidence-entity {
  min-width: 0;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 6px 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.evidence-entity:hover {
  border-color: var(--border-strong);
  background: var(--panel-muted);
}

.evidence-entity span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-relationship {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.evidence-relationship span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-relationship strong {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  padding: 2px 7px;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.evidence-empty {
  color: var(--muted);
  font-size: 12px;
}

.entity-popup-backdrop {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(30, 32, 38, 0.16);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.entity-popup {
  position: absolute;
  right: 26px;
  top: 72px;
  z-index: 21;
  width: min(720px, calc(100vw - 52px));
  max-height: min(640px, calc(100% - 112px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.entity-popup-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 14px;
  border-bottom: 1px solid var(--border);
}

.entity-popup-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.entity-popup-title div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.entity-popup-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.entity-popup-title span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.entity-popup-body {
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.entity-graph-svg {
  width: 100%;
  min-height: 360px;
  display: block;
  background: #fff;
}

.entity-graph-edge {
  stroke: rgba(0, 0, 0, 0.2);
  stroke-width: 2;
}

.entity-graph-edge-label rect {
  fill: rgba(255, 255, 255, 0.92);
  stroke: rgba(0, 0, 0, 0.12);
}

.entity-graph-edge-label text {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.entity-graph-node-label,
.entity-graph-center-label {
  fill: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.entity-graph-center-ring {
  fill: #fff;
  stroke: #111318;
  stroke-width: 3;
}

.entity-popup-empty {
  padding: 18px 14px;
  color: var(--muted);
  font-size: 13px;
}

.copy-inline {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.copy-inline:enabled:hover {
  background: var(--soft);
}

.copy-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-copy {
  align-self: end;
  flex: 0 0 28px;
  margin-bottom: 6px;
}

.query-error {
  color: var(--danger);
}

.query-bar {
  display: grid;
  grid-template-columns: 72px 142px minmax(0, 1fr) 82px;
  gap: 8px;
  align-items: center;
  min-height: 60px;
  margin: 12px 24px max(20px, env(safe-area-inset-bottom));
  padding: 8px;
  border-radius: 30px;
}

.query-bar .button,
.query-bar .semantic-layer-chip {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.query-bar .button:enabled:hover,
.query-bar .semantic-layer-chip:enabled:hover:not(.active) {
  background: rgba(118, 118, 128, 0.1);
}

.query-bar .semantic-layer-chip.active {
  background: rgba(52, 199, 89, 0.12);
  border-color: rgba(35, 160, 72, 0.24);
  color: #1c6635;
}

#clear-query {
  padding: 0 8px;
  white-space: nowrap;
}

.semantic-layer-chip {
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}

.semantic-layer-chip:enabled:hover:not(.active) {
  background: var(--panel-muted);
  border-color: var(--border-strong);
}

.semantic-layer-chip:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(80, 86, 99, 0.12);
}

.entity-toggle-button,
.copy-inline,
.graph-side-tools button {
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

/* Press feedback stays inside the control, leaving its layout and hit area stable. */
:is(.icon-button, .button, .dark-button, .ghost-button, .toggle-button,
  .entity-toggle-button, .copy-inline, .semantic-layer-chip, .graph-side-tools button):enabled:active:not([data-preview-mode]) {
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.18), inset 0 0 0 999px rgba(0, 0, 0, 0.04);
  transition-duration: 80ms;
}

.semantic-layer-chip.active {
  color: var(--text);
  border-color: rgba(52, 199, 89, 0.42);
  background: rgba(52, 199, 89, 0.12);
}

.semantic-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c6cad2;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.semantic-layer-chip.active .semantic-chip-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.14);
}

.query-input {
  width: 100%;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(236, 238, 243, 0.72);
  box-shadow: none;
  outline: none;
}

.query-input:focus,
.query-input:focus-visible {
  background: #fff;
  border-color: #8b8b93;
  box-shadow: 0 0 0 1px #8b8b93;
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }

  .glass-interactive::before,
  .documents-actions .glass-interactive .side-tool-icon,
  .documents-actions .glass-interactive .button-icon {
    transform: none !important;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --glass-fill: #f4f5f7;
  }

  .filter-tabs {
    --glass-fill: #f4f5f7;
  }
}

@media (prefers-reduced-transparency: reduce) {
  :root {
    --glass-fill: #f4f5f7;
    --glass-filter: none;
  }

  .filter-tabs {
    --glass-fill: #f4f5f7;
    --glass-border: var(--border-strong);
    --glass-filter: none;
  }

  .glass-interactive::before {
    display: none;
  }

  .glass-selection,
  .tabs .glass-selection {
    background: #eceef3;
  }

  .entity-popup-backdrop,
  .response-details-backdrop,
  .confirm-dialog::backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(30, 32, 38, 0.35);
  }
}

@media (prefers-contrast: more) {
  :root {
    --border: rgba(0, 0, 0, 0.3);
    --border-strong: rgba(0, 0, 0, 0.55);
    --glass-fill: #fff;
    --glass-border: rgba(0, 0, 0, 0.5);
    --glass-filter: none;
    --muted: #45454a;
    --muted-2: #55555b;
  }

  .filter-tabs {
    --glass-fill: #fff;
    --glass-border: var(--border-strong);
    --glass-filter: none;
  }

  .filter-tab.active {
    background: var(--soft-2);
    border-color: var(--border-strong);
  }

  .glass-interactive::before {
    display: none;
  }

  .glass-selection,
  .tabs .glass-selection {
    background: var(--soft-2);
    border-color: var(--border-strong);
    box-shadow: none;
  }
}

.hidden {
  display: none !important;
}

@media (max-width: 1000px) {
  .feedback-region {
    top: 128px;
    max-height: calc(100% - 210px);
  }

  .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand actions" "tabs tabs";
    gap: 10px 20px;
    padding: 10px 20px;
  }

  .brand-line {
    grid-area: brand;
  }

  .tabs {
    grid-area: tabs;
    justify-self: center;
  }

  .top-actions {
    grid-area: actions;
  }
}

@media (max-width: 600px) {
  .topbar {
    gap: 10px 12px;
    padding: 10px 12px;
  }

  .brand-line {
    gap: 8px;
  }

  .client-logo-slot {
    gap: 14px;
  }

  .topbar .tabs {
    display: flex;
    justify-self: stretch;
    justify-content: space-between;
    width: 100%;
    max-width: none;
    overflow-x: auto;
  }

  .topbar .tab {
    flex: 0 0 auto;
    padding: 0 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  .account-logout { width: 32px; justify-content: center; padding: 0; }
  .account-logout > span { display: none; }

}

@media (max-width: 900px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    min-height: 0;
    height: 100%;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .documents-view {
    height: 100%;
    padding: 12px;
    grid-template-rows: auto 1fr;
  }

  .knowledge-view {
    padding: 18px 12px 110px;
    gap: 20px;
  }

  .knowledge-content {
    grid-template-columns: minmax(0, 1fr);
  }

  .knowledge-parameters {
    padding-right: 0;
    border-right: 0;
  }

  .knowledge-connect-dock {
    left: 12px;
    right: 12px;
  }

  .documents-actions {
    max-width: 100%;
    gap: 10px;
  }

  .documents-action-group + .documents-action-group {
    padding-left: 10px;
  }

  .documents-filter-dock {
    left: 12px;
    right: 12px;
  }

  .documents-filter-dock::before {
    left: -12px;
    right: -12px;
  }

  .filter-tabs {
    max-width: 100%;
  }

  .retrieval-view {
    height: 100%;
    grid-template-columns: 1fr;
    padding: 0;
  }

  .retrieval-main {
    border-right: 0;
    padding-right: 0;
  }

  .retrieval-history {
    min-height: 0;
    padding: 16px 12px 8px;
  }

  .user-message-row {
    max-width: 92%;
  }

  .query-bar {
    grid-template-columns: 72px 142px minmax(0, 1fr) 82px;
    margin: 10px 12px max(20px, env(safe-area-inset-bottom));
  }

  .semantic-layer-chip {
    min-width: 0;
  }

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

  .logo-search-row,
  .logo-choice-grid {
    grid-template-columns: 1fr;
  }

  .graph-bottom-dock {
    left: 12px;
    right: 12px;
  }

  .graph-controls {
    width: 100%;
  }

  .label-select {
    width: 128px;
    max-width: none;
  }

  .search-input {
    flex: 1 1 120px;
    width: 120px;
  }

  .graph-inspector {
    top: auto;
    right: 12px;
    bottom: var(--graph-dock-space);
    width: min(380px, calc(100% - 24px));
    max-height: calc(100% - var(--graph-dock-space) - 28px);
  }

  .graph-view:has(.graph-inspector) .legend {
    visibility: hidden;
  }
}

@media (max-width: 600px) {
  .graph-focused-view.graph-selected-view { --graph-dock-space: 188px; }
  .graph-focused-view.graph-selected-view .graph-focus-controls { flex-wrap: wrap; }
  .graph-focused-view.graph-selected-view .graph-focus-pill { flex-basis: 100%; height: 26px; line-height: 26px; }
  .graph-context-actions { gap: 4px; }
  .graph-context-actions .button { padding-left: 8px; padding-right: 8px; }
  .graph-relationships-toggle { min-width: 144px; }
  .topbar .tabs:has([data-tab="knowledge"]) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr);
    max-width: 420px;
  }

  .topbar .tabs:has([data-tab="knowledge"]) .tab {
    padding: 0 2px;
    font-size: 11px;
  }

  .knowledge-resource-heading {
    flex-wrap: wrap;
    gap: 12px;
  }

  .knowledge-resource-heading h1 {
    font-size: 20px;
    line-height: 26px;
  }

  .knowledge-prompt-list li {
    grid-template-columns: 16px minmax(0, 1fr) 32px;
    gap: 8px;
  }

  .knowledge-connect-bar {
    gap: 10px;
    padding: 12px;
  }

  .knowledge-search-bar {
    gap: 10px;
    padding: 12px;
  }

  .knowledge-catalog-view .knowledge-option-copy {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .documents-actions {
    width: 100%;
    gap: 8px;
  }

  .documents-action-group + .documents-action-group {
    padding-left: 0;
    border-left: 0;
  }

  .documents-actions .button,
  .documents-actions .dark-button {
    padding: 0 8px;
    gap: 6px;
    font-size: 12px;
  }

  #toggle-doc-details {
    min-width: 116px;
  }

  .setup-screen {
    padding: 16px;
  }

  .setup-panel {
    padding: 20px;
  }

  .setup-brand .semantic-word {
    font-size: 22px;
  }

  .assistant-message {
    padding: 14px;
  }

  .query-bar {
    grid-template-columns: 72px minmax(0, 1fr) 76px;
    grid-template-rows: 34px 38px;
    gap: 6px;
    padding: 8px;
    border-radius: 30px;
  }

  #clear-query {
    grid-column: 1;
    grid-row: 1;
  }

  .query-bar .semantic-layer-chip {
    grid-column: 2 / 4;
    grid-row: 1;
    justify-self: end;
    height: 34px;
  }

  .query-input {
    grid-column: 1 / 3;
    grid-row: 2;
  }

  #send-query {
    grid-column: 3;
    grid-row: 2;
    height: 38px;
  }

  .entity-popup {
    top: 16px;
    right: 12px;
    width: calc(100% - 24px);
    max-height: calc(100% - 32px);
  }
}

/* Semantic Layer browser: content stays opaque beneath the floating glass dock. */
.graph-browser-overview .graph-canvas,
.graph-browser-overview .graph-side-tools,
.graph-browser-overview .graph-meta,
.graph-view:is(.graph-browser-ontology,.graph-browser-claims,.graph-browser-sources):not(.graph-selected-view) .graph-canvas,
.graph-view:is(.graph-browser-ontology,.graph-browser-claims,.graph-browser-sources):not(.graph-selected-view) .graph-side-tools {
  visibility: hidden;
}

.graph-overview {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  overflow: auto;
  background: #fff;
  padding: 36px 24px 128px;
}

.graph-overview-content { width: min(700px, 100%); margin-top: -30px; }
.graph-overview-heading { margin-bottom: 28px; }
.graph-overview-heading > span { display: block; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .08em; }
.graph-overview-heading h1 { margin: 8px 0 0; font-size: clamp(25px, 3vw, 34px); font-weight: 650; letter-spacing: -.045em; line-height: 1.12; }
.graph-overview-index { overflow: hidden; border: 1px solid #e5e5e9; border-radius: 17px; background: #fff; }
.graph-overview-row { display: flex; align-items: center; gap: 17px; width: 100%; min-height: 91px; padding: 16px 22px; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.graph-overview-row + .graph-overview-row { border-top: 1px solid #e9e9ed; }
.graph-overview-row:hover, .graph-overview-row:focus-visible { background: #f7f7f9; }
.graph-overview-row:focus-visible, .graph-browse-item:focus-visible, .graph-browser-head .icon-button:focus-visible { outline: 2px solid var(--brand); outline-offset: -3px; }
.graph-overview-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border: 1px solid #e5e5e9; border-radius: 11px; color: #35405d; }
.graph-overview-icon .side-tool-icon { width: 19px; height: 19px; }
.graph-overview-row-copy { display: grid; gap: 4px; min-width: 0; flex: 1; }
.graph-overview-row-copy strong { font-size: 16px; font-weight: 650; line-height: 1.25; }
.graph-overview-row-copy small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.graph-overview-chevron { color: #8e9198; }
.graph-overview-chevron .side-tool-icon { width: 18px; height: 18px; }

.graph-browser-overview .graph-controls, .graph-view:is(.graph-browser-ontology,.graph-browser-claims,.graph-browser-sources) .graph-controls { width: min(430px, 100%); }
.graph-browse-dock-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 6px 0 15px; }
.graph-browse-dock-controls > span { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.graph-browse-dock-controls .button { display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto; min-height: 36px; border-radius: 999px; font-size: 12px; }
.graph-browse-dock-controls .side-tool-icon { width: 15px; height: 15px; }
.graph-browser-full .graph-controls { width: min(640px, 100%); }
.graph-exit-full { position: absolute; z-index: 7; top: 16px; left: 16px; min-height: 38px; padding: 0 14px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.graph-exit-full .side-tool-icon { width: 16px; height: 16px; }

.graph-view:is(.graph-browser-ontology,.graph-browser-claims,.graph-browser-sources) { --graph-browser-width: 320px; }
.graph-view:is(.graph-browser-ontology,.graph-browser-claims,.graph-browser-sources) .graph-canvas { width: calc(100% - var(--graph-browser-width)); margin-left: var(--graph-browser-width); }
.graph-view:is(.graph-browser-ontology,.graph-browser-claims,.graph-browser-sources) .graph-bottom-dock { left: calc(var(--graph-browser-width) + 12px); right: 12px; }
.graph-view:is(.graph-browser-ontology,.graph-browser-claims,.graph-browser-sources) .graph-side-tools { left: calc(var(--graph-browser-width) + 14px); }
.graph-view:is(.graph-browser-ontology,.graph-browser-claims,.graph-browser-sources) .graph-meta { display: none; }
.graph-browser-sidebar { position: absolute; z-index: 4; top: 0; bottom: 0; left: 0; width: var(--graph-browser-width); display: flex; flex-direction: column; min-height: 0; border-right: 1px solid #e5e5e9; background: #fafafb; view-transition-name: graph-browse-sidebar; }
.graph-browser-head { display: flex; align-items: center; gap: 8px; min-height: 66px; padding: 12px 14px; border-bottom: 1px solid #e9e9ed; }
.graph-browser-head .icon-button { flex: 0 0 32px; width: 32px; height: 32px; padding: 5px; border: 0; background: transparent; box-shadow: none; }
.graph-browser-head h1 { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
.graph-browser-head > span { color: var(--muted); font-size: 12px; }
.graph-browser-tools { position: relative; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 12px 15px; }
.graph-browser-tools input { flex: 1; min-width: 0; height: 37px; padding: 0 12px; border: 1px solid #dedee3; border-radius: 9px; background: #fff; color: var(--text); outline: none; font-size: 12px; }
.graph-browser-tools input:focus, .graph-browser-filter > button:focus-visible { border-color: #9eb0de; box-shadow: 0 0 0 3px #14368e16; }
.graph-browser-filter { position: relative; flex: 0 0 108px; min-width: 0; }
.graph-browser-filter > button { position: relative; display: flex; align-items: center; gap: 5px; width: 100%; height: 37px; padding: 0 19px 0 8px; border: 1px solid #dedee3; border-radius: 9px; background: #fff; color: var(--text); cursor: pointer; text-align: left; }
.graph-browser-filter > button .side-tool-icon { flex: 0 0 15px; width: 15px; height: 15px; color: #5d6473; }
.graph-browser-filter > button span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; }
.graph-browser-filter > button::after { content: ''; position: absolute; right: 9px; top: 14px; width: 5px; height: 5px; border-right: 1.5px solid #5d6473; border-bottom: 1.5px solid #5d6473; transform: rotate(45deg); }
.graph-browser-filter-menu { position: absolute; z-index: 12; top: 44px; right: 0; display: grid; gap: 1px; width: 210px; max-height: min(272px, calc(100vh - 275px)); overflow: auto; padding: 5px; border-radius: 13px; background: rgba(255,255,255,.95); box-shadow: 0 12px 32px rgba(30,34,45,.14); }
.graph-browser-filter-menu[hidden] { display: none; }
.graph-browser-filter-menu button { display: grid; grid-template-columns: minmax(0,1fr) auto 15px; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent; color: var(--text); text-align: left; cursor: pointer; font-size: 12px; }
.graph-browser-filter-menu button:hover, .graph-browser-filter-menu button:focus-visible { background: #f3f4f7; }
.graph-browser-filter-menu button:focus-visible { outline: 2px solid #8d9fc5; outline-offset: -2px; }
.graph-browser-filter-menu button.active { background: #eef1f7; }
.graph-browser-filter-menu button small { color: var(--muted); font-size: 11px; }
.graph-browser-filter-menu button .side-tool-icon { width: 14px; height: 14px; color: #273b73; opacity: 0; }
.graph-browser-filter-menu button.active .side-tool-icon { opacity: 1; }
.graph-browser-results { flex: 1; min-height: 0; overflow: auto; padding: 2px 8px 120px; }
.graph-browse-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 11px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.graph-browse-item:hover { background: #eeeef1; }
.graph-browse-item.active { background: #e8ecf6; }
.graph-browse-item .legend-dot { width: 9px; height: 9px; flex: 0 0 9px; margin-top: 5px; }
.graph-browse-item-copy { display: grid; gap: 4px; min-width: 0; }
.graph-browse-item-copy strong { font-size: 12px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.graph-browse-item-copy small { color: var(--muted); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.graph-browse-no-results { padding: 28px 12px; color: var(--muted); font-size: 12px; text-align: center; }
.graph-browser-prompt { position: absolute; z-index: 2; top: 0; bottom: 100px; left: var(--graph-browser-width); right: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); text-align: center; }
.graph-browser-prompt-icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 5px; border: 1px solid #e6e6ea; border-radius: 17px; color: #3b4972; }
.graph-browser-prompt-icon .side-tool-icon { width: 24px; height: 24px; }
.graph-browser-prompt strong { color: var(--text); font-size: 16px; font-weight: 650; }
.graph-browser-prompt > span:last-child { font-size: 12px; }

.graph-view:is(.graph-browser-ontology,.graph-browser-claims,.graph-browser-sources).graph-selected-view .graph-browser-sidebar { bottom: 45%; }
.graph-view:is(.graph-browser-ontology,.graph-browser-claims,.graph-browser-sources) #graph-inspector-slot { position: absolute; z-index: 6; bottom: 0; left: 0; width: var(--graph-browser-width); height: 45%; padding: 0 5px; border-right: 1px solid #e5e5e9; background: #fafafb; pointer-events: none; }
.graph-view:is(.graph-browser-ontology,.graph-browser-claims,.graph-browser-sources) #graph-inspector-slot:empty { display: none; }
.graph-view:is(.graph-browser-ontology,.graph-browser-claims,.graph-browser-sources) .graph-inspector { position: static; width: 100%; height: 100%; max-height: none; border: 1px solid #e7e9ee; border-bottom: 0; border-radius: 14px 14px 0 0; background: #f8f9fb; box-shadow: 0 0 17px rgba(5, 45, 152, 0.18), 0 -7px 24px rgba(5, 45, 152, 0.12); pointer-events: auto; view-transition-name: graph-browse-inspector; }
.graph-view:is(.graph-browser-ontology,.graph-browser-claims,.graph-browser-sources) .graph-inspector-head { border-bottom-color: #e7e9ee; }
.graph-view:is(.graph-browser-ontology,.graph-browser-claims,.graph-browser-sources) .property-row { border-bottom-color: #e7e9ee; }
.graph-view:is(.graph-browser-ontology,.graph-browser-claims,.graph-browser-sources) .graph-browse-inspector { grid-template-rows: auto minmax(0, 1fr); }
.graph-browse-inspector .graph-inspector-title { flex: 1; }
.graph-browse-inspector .graph-inspector-title { align-items: flex-start; }
.graph-browse-inspector .graph-inspector-title > .legend-dot { margin-top: 5px; }
.graph-inspector-heading { display: grid; justify-items: start; gap: 3px; min-width: 0; }
.graph-browse-inspector .graph-inspector-title strong { display: block; min-width: 0; max-width: 100%; }
.graph-inspector-go-to { display: inline-flex; align-items: center; gap: 2px; min-height: 22px; margin: 0; padding: 0 2px 0 0; border: 0; border-radius: 4px; background: transparent; color: var(--ao-blue); font: inherit; font-size: 11px; font-weight: 650; cursor: pointer; }
.graph-inspector-go-to .side-tool-icon { width: 12px; height: 12px; transition: transform 180ms ease; }
.graph-inspector-go-to:hover { color: #2556b4; }
.graph-inspector-go-to:hover .side-tool-icon { transform: translateX(2px); }
.graph-inspector-go-to:focus-visible { outline: 2px solid var(--ao-blue); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .graph-inspector-go-to .side-tool-icon { transition: none; } }
.graph-browse-inspector .property-row { display: block; padding: 10px 14px; }
.graph-browse-inspector .property-key { margin-bottom: 4px; font-size: 11px; }
.graph-browse-inspector .property-value { font-size: 12px; line-height: 1.45; }
.graph-view:is(.graph-browser-ontology,.graph-browser-claims,.graph-browser-sources) .graph-inspector-actions { padding: 8px; }
.graph-view:is(.graph-browser-ontology,.graph-browser-claims,.graph-browser-sources) .graph-inspector-actions .button { min-height: 32px; }
.graph-claim-inspector { grid-template-rows: auto auto minmax(0, 1fr); }
.graph-claim-statement { display: grid; gap: 7px; padding: 17px 16px; border-bottom: 1px solid var(--border); }
.graph-claim-statement > span { color: #248052; font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.graph-claim-statement strong { font-size: 13px; line-height: 1.35; font-weight: 650; overflow-wrap: anywhere; }
.graph-claim-statement em { color: #344c9c; font-size: 12px; font-style: normal; }
.graph-claim-provenance { padding: 13px 14px 4px; color: var(--muted); font-size: 11px; font-weight: 650; }

@media (max-width: 1050px) {
  .graph-view:is(.graph-browser-ontology,.graph-browser-claims,.graph-browser-sources) { --graph-browser-width: 285px; }
}

@media (max-width: 600px) {
  .graph-overview { align-items: start; padding: 78px 18px 112px; }
  .graph-overview-content { margin-top: 0; }
  .graph-overview-row { min-height: 82px; padding: 14px; }
  .graph-view:is(.graph-browser-ontology,.graph-browser-claims,.graph-browser-sources) { --graph-browser-width: min(43vw, 250px); }
  .graph-view:is(.graph-browser-ontology,.graph-browser-claims,.graph-browser-sources) .graph-browse-dock-controls > span { display: none; }
  .graph-browser-head { padding: 10px 8px; }
  .graph-browser-head h1 { font-size: 14px; }
  .graph-browser-tools { gap: 5px; padding: 10px 8px; }
  .graph-browser-filter { flex-basis: 89px; }
  .graph-browser-filter > button { padding-left: 5px; padding-right: 16px; }
  .graph-browser-filter > button span { font-size: 10px; }
  .graph-browser-prompt > span:last-child { max-width: 190px; }
}

/* Retrieval keeps the answer in the content layer; context and response inspection float above it. */
.query-bar { grid-template-columns: 72px 176px minmax(0, 1fr) 82px; position: relative; z-index: 8; }
.persona-picker { position: relative; min-width: 0; }
.query-bar .persona-trigger { width: 100%; height: 38px; padding: 0 11px; border-color: transparent; background: transparent; box-shadow: none; color: var(--ao-blue); display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.persona-trigger span { overflow: hidden; text-overflow: ellipsis; }
.persona-trigger .side-tool-icon { width: 14px; height: 14px; flex: 0 0 14px; }
.query-bar .persona-trigger:hover, .query-bar .persona-trigger[aria-expanded="true"] { background: rgba(118, 118, 128, .1); }
.persona-popover { position: absolute; left: 0; bottom: calc(100% + 16px); width: 286px; padding: 15px; border-radius: 18px; z-index: 12; --glass-fill: rgba(250, 251, 253, .93); }
.persona-choice-group + .persona-choice-group { margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--border); }
.persona-choice-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 600; }
.persona-choice-group > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.persona-choice { min-height: 34px; border: 1px solid transparent; border-radius: 9px; padding: 4px 5px; background: transparent; color: var(--text); font: inherit; font-size: 11px; cursor: pointer; }
.persona-choice:hover { background: rgba(118, 118, 128, .1); }
.persona-choice.selected { background: #fff; border-color: var(--border); box-shadow: 0 1px 3px rgba(20, 28, 45, .08); font-weight: 650; }
.persona-choice:focus-visible, .persona-trigger:focus-visible { outline: 2px solid #17378f; outline-offset: 2px; }

.answer-result-line { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 0 0 9px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.answer-result { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 650; color: #236b47; }
.answer-result::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.answer-result.is-abstained { color: #915d16; }
.answer-body { line-height: 1.65; }
.answer-tools-row { margin-top: 14px; padding-top: 10px; }
.answer-tools-row .entity-toggle-button { background: #fff; color: #45464d; }

.api-source-row { display: grid; grid-template-columns: 23px minmax(0, 1fr); gap: 8px; padding: 7px 0; font-size: 12px; line-height: 1.45; }
.api-source-row strong, .api-source-row small { display: block; overflow-wrap: anywhere; }
.api-source-row strong { font-weight: 600; }
.api-source-row small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.api-source-number { color: #17378f; font-weight: 650; }
.api-evidence-item { padding: 9px 0; border-top: 1px solid var(--border); }
.api-evidence-item:first-of-type { border-top: 0; }
.api-evidence-item > span { color: var(--muted); font-size: 11px; }
.api-evidence-item p { max-height: 180px; overflow: auto; margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.55; }
.api-knowledge-path { display: grid; gap: 10px; max-width: 100%; margin: 9px 0 0; padding: 12px 0 12px 14px; border-left: 2px solid #cbd8f1; }
.api-knowledge-path + .api-knowledge-path { margin-top: 6px; border-top: 1px solid var(--border); }
.api-path-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 12px; color: #236b47; font-size: 11px; font-weight: 650; }
.api-knowledge-path.is-ontology .api-path-heading { color: var(--ao-blue); }
.api-path-heading code { color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.api-path-triple { display: grid; justify-items: start; gap: 4px; min-width: 0; }
.api-path-triple strong { max-width: 100%; font-size: 12px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.api-path-relation { display: inline-flex; align-items: center; gap: 4px; color: var(--ao-blue); font-size: 11px; font-weight: 650; }
.api-path-relation .side-tool-icon { width: 13px; height: 13px; }
.api-path-source { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 5px; min-width: 0; font-size: 11px; line-height: 1.4; }
.api-path-source small, .api-path-source span { color: var(--muted); font-size: 11px; }
.api-path-source strong { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.api-path-objectives { display: grid; gap: 0; border-top: 1px solid var(--border); }
.api-path-objective { display: grid; gap: 3px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.api-path-objective > span { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; }
.api-path-objective > span svg { width: 11px; height: 11px; }
.api-path-objective strong { font-size: 12px; font-weight: 600; line-height: 1.4; }
.api-path-objective small { color: var(--muted); font-size: 10px; }
.api-path-empty { display: grid; gap: 4px; margin-top: 8px; padding: 10px 0 10px 14px; border-left: 2px solid #d8dbe2; }
.api-path-empty strong { font-size: 12px; font-weight: 600; }
.api-path-empty span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.evidence-empty { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.response-details-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(28, 30, 38, .18); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.response-details-panel { position: fixed; z-index: 1001; top: 16px; bottom: 16px; right: 16px; width: min(500px, calc(100vw - 32px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 23px; --glass-fill: rgba(251, 252, 254, .94); box-shadow: 0 18px 55px rgba(20, 30, 52, .16), inset 0 1px 0 #fff; }
.response-details-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px 15px; border-bottom: 1px solid var(--border); }
.response-details-header h2 { margin: 3px 0 0; font-size: 18px; letter-spacing: -.025em; line-height: 1.2; font-weight: 650; }
.response-details-eyebrow { color: var(--muted); font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.response-details-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 19px 22px 30px; }
.response-details-outcome { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.response-details-metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; margin: 19px 0 5px; }
.response-details-metadata > div { min-width: 0; padding: 10px 0; border-top: 1px solid var(--border); }
.response-details-metadata dt { color: var(--muted); font-size: 11px; }
.response-details-metadata dd { margin: 4px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 550; }
.response-json-section { margin-top: 26px; }
.response-json-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.response-json-heading h3 { margin: 0; font-size: 13px; font-weight: 650; }
.response-json-heading span { color: var(--muted); font-size: 10px; }
.response-json-section pre { max-height: 270px; overflow: auto; margin: 0; padding: 14px; border: 1px solid var(--border); border-radius: 11px; background: #f5f6f8; color: #30323a; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.response-details-footer { display: flex; justify-content: flex-end; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.response-details-panel :focus-visible { outline: 2px solid #17378f; outline-offset: 2px; }

@media (max-width: 600px) {
  .query-bar { grid-template-columns: 72px minmax(0, 1fr) 76px; grid-template-rows: 34px 38px; }
  .persona-picker { grid-column: 2 / 4; grid-row: 1; justify-self: end; width: min(186px, 100%); }
  .query-bar .persona-trigger { height: 34px; }
  .persona-popover { left: auto; right: 0; width: min(286px, calc(100vw - 40px)); }
  .response-details-panel { top: 8px; right: 8px; bottom: 8px; width: calc(100vw - 16px); border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .retrieval-switch-track, .retrieval-switch-thumb { transition: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .persona-popover, .response-details-panel { --glass-fill: #fafbfd; --glass-filter: none; }
  .response-details-backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
