/* Live implementation of the user's plan-1 prototype. Base styles retain its 90% density. */
html,
body,
#app {
  height: 100%;
  min-height: 0;
}
body {
  margin: 0;
}
.startup {
  display: grid;
  place-items: center;
  height: 100%;
  color: #888;
}
.main {
  margin-left: var(--sidebar);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.main-body {
  flex: 1;
  min-height: 0;
}
.reference-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.nav {
  display: flex;
  flex-direction: column;
}
.sidebottom {
  margin-top: auto;
}
.account-name {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
}
.avatar-letter {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #e5e3ed;
  color: #5c5575;
}
.reference-topbar {
  height: 44px;
}
.runtime-badge {
  font-size: 11px;
  color: #777;
  display: flex;
  align-items: center;
  gap: 6px;
}
.runtime-badge:before {
  content: "";
  width: 5px;
  height: 5px;
  background: #32846c;
  border-radius: 50%;
}
.muted {
  color: #999;
}
.spacer {
  flex: 1;
}
.scope-content .scope-heading h1 {
  font-size: 20px;
}
.scope-header {
  padding-top: 14px;
}
.scope-heading {
  margin-bottom: 15px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}
.btn.primary {
  background: #1b1b1b;
  color: white;
  border-color: #1b1b1b;
}
.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.scope-project {
  height: auto;
  min-height: 34px;
  line-height: 1.5;
  padding-top: 7px;
  padding-bottom: 7px;
}
.scope-project span:last-child {
  overflow-wrap: anywhere;
}
.navbtn[disabled],
.scope-item[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.scope-files {
  padding: 16px 30px 30px;
}
.scope-files .files-filter-row {
  margin-bottom: 8px;
}
.eke-table {
  width: 100%;
  border-collapse: collapse;
}
.eke-table th {
  text-align: left;
  color: #999;
  font-weight: 400;
  font-size: 11px;
  padding: 16px 8px;
  border-bottom: 1px solid #f1f1f1;
}
.eke-table td {
  padding: 18px 8px;
  border-bottom: 1px solid #f4f4f4;
  font-size: 11px;
  color: #777;
}
.eke-table td:first-child {
  min-width: 150px;
  color: #333;
  width: 45%;
}
.eke-table .file-open {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
}
.file-open > span:last-child {
  min-width: 0;
}
.file-title {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.file-sub {
  color: #aaa;
  font-size: 10px;
  margin-top: 5px;
}
.file-badge {
  font-size: 8px;
  border-radius: 5px;
  background: #f0f5f3;
  color: #5f8b7c;
  padding: 7px 3px;
  min-width: 30px;
  text-align: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  background: #f4f4f4;
  border-radius: 4px;
  font-size: 10px;
  color: #777;
  gap: 4px;
}
.badge.ready {
  color: #347a65;
  background: #eff7f3;
}
.badge.pending {
  color: #9c7b44;
  background: #faf5eb;
}
.badge.failed {
  color: #b45454;
  background: #fff2ef;
}
.link {
  color: #487b9b;
  font-size: 11px;
  padding: 5px 0;
}
.file-status {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  color: #999;
  margin-top: 22px;
  padding-bottom: 12px;
}
.pagination .btn {
  height: 28px;
  font-size: 11px;
}
.eke-empty {
  min-height: 280px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  color: #999;
  padding: 35px;
}
.eke-empty > .ic {
  width: 32px;
  height: 32px;
  color: #c8c8c8;
}
.eke-empty h3 {
  color: #777;
  font-weight: 400;
}
.eke-empty p {
  max-width: 460px;
  font-size: 12px;
}
.knowledge-detail-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}
.knowledge-directory-tree {
  overflow: auto;
  border-right: 1px solid #f0f0f0;
  padding: 15px 10px;
}
.knowledge-entry {
  width: 100%;
  border: 0;
  display: flex;
  gap: 8px;
  text-align: left;
  padding: 10px 8px;
  font-size: 11px;
  color: #888;
  border-radius: 5px;
  line-height: 1.6;
  margin-bottom: 3px;
}
.knowledge-entry.active {
  background: #f3f3f3;
  color: #333;
}
.knowledge-entry .ic {
  margin-top: 3px;
  flex: none;
}
.reader {
  min-width: 0;
  overflow: auto;
}
.reader-toolbar {
  position: sticky;
  top: 0;
  background: #ffffffed;
  z-index: 2;
  border-bottom: 1px solid #f4f4f4;
  padding: 10px 20px;
  display: flex;
  gap: 8px;
}
.reader-content {
  padding: 30px 30px 55px;
  max-width: 1000px;
  margin: auto;
}
.reader-content h1 {
  font-size: 25px;
  line-height: 1.6;
  margin: 16px 0;
}
.reader-meta {
  display: flex;
  gap: 12px;
  color: #999;
  font-size: 10px;
  margin: 12px 0 25px;
  flex-wrap: wrap;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  margin: 24px 0 14px;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.fact-card {
  border: 1px solid #ededed;
  background: #fafafa;
  border-radius: 8px;
  padding: 16px;
  min-width: 0;
}
.fact-card .field-label {
  font-size: 10px;
  color: #999;
}
.fact-value {
  font-size: 17px;
  color: #333;
  line-height: 1.6;
  margin: 6px 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.fact-card .qualification {
  font-size: 10px;
  color: #999;
  overflow-wrap: anywhere;
}
.fact-card.conflicted {
  border-color: #edd8b4;
  background: #fffcf5;
}
.fact-card.unknown .fact-value {
  color: #bbb;
}
.evidence-link {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #8b9290;
  font-size: 10px;
  text-align: left;
  margin-top: 8px;
}
.evidence-link:hover {
  color: #397c69;
}
.notice {
  font-size: 11px;
  line-height: 1.8;
  padding: 12px 15px;
  margin: 10px 0;
  background: #faf7f0;
  color: #95774e;
  border-radius: 6px;
}
.evidence-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 15px;
  border: 1px solid #ededed;
  border-radius: 7px;
  margin: 8px 0;
  background: #fff;
}
.evidence-card strong {
  font-weight: 500;
  font-size: 12px;
  display: block;
  margin-bottom: 7px;
}
.evidence-card p {
  font-size: 11px;
  color: #777;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.eke-layer {
  position: fixed;
  inset: 0;
  background: #0003;
  display: flex;
  justify-content: flex-end;
  z-index: 60;
}
.eke-drawer {
  width: min(620px, 100%);
  height: 100%;
  background: white;
  box-shadow: -10px 0 40px #0001;
  display: flex;
  flex-direction: column;
}
.eke-drawer.wide {
  width: min(770px, 100%);
}
.drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}
.drawer-head h2 {
  font-size: 17px;
  flex: 1;
}
.drawer-body {
  overflow: auto;
  flex: 1;
  padding: 24px;
}
.drawer-body h3 {
  font-size: 14px;
  margin: 20px 0 10px;
}
.drawer-body p {
  font-size: 12px;
  color: #777;
}
.drawer-body pre {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.9;
  font: 12px/1.9 inherit;
  background: #fafafa;
  padding: 18px;
  border: 1px solid #eee;
  border-radius: 7px;
}
.drawer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.drop-zone {
  border: 1px dashed #ccc;
  border-radius: 12px;
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 15px;
  background: #fcfcfc;
  padding: 20px;
}
.drop-zone.dragover {
  background: #eef6f2;
  border-color: #478b72;
}
.upload-progress {
  margin-top: 15px;
}
.upload-item {
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.login {
  display: grid;
  place-items: center;
  height: 100%;
  background: #fafafa;
}
.login-card {
  width: min(430px, 90vw);
  padding: 40px;
  border: 1px solid #eee;
  border-radius: 16px;
  background: #fff;
}
.login-card h1 {
  margin: 24px 0 12px;
  font-size: 23px;
}
.login-card p {
  font-size: 12px;
  color: #888;
  margin-bottom: 25px;
}
.login-card .btn {
  width: 100%;
  margin-top: 15px;
  height: 40px;
}
.login-card input {
  margin-top: 15px;
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
}
.login-card details {
  margin-top: 18px;
  font-size: 11px;
  color: #999;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #252525;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  z-index: 100;
  display: none;
  max-width: 80vw;
  font-size: 12px;
}
.chat-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.chat-question {
  align-self: flex-end;
  max-width: 90%;
  background: #f1f3f2;
  border-radius: 12px 12px 3px 12px;
  padding: 13px 16px;
  white-space: pre-wrap;
  font-size: 13px;
}
.chat-answer {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 18px;
}
.chat-answer .field-grid {
  grid-template-columns: 1fr;
}
.chat-answer .fact-value {
  font-size: 14px;
}
.chat-input {
  border-top: 1px solid #eee;
  padding: 16px 22px;
}
.chat-input textarea {
  width: 100%;
  resize: vertical;
  min-height: 65px;
  max-height: 200px;
  border: 0;
  outline: 0;
  font-size: 13px;
}
.chat-input .row {
  justify-content: space-between;
}
.chat-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}
.chat-examples button {
  padding: 10px 13px;
  border: 1px solid #e9e9e9;
  border-radius: 8px;
  font-size: 11px;
  text-align: left;
}
.graph-live {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
  background: #fcfdfc;
}
.graph-stage {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
  background-image: radial-gradient(#e5eae6 1px, transparent 1px);
  background-size: 18px 18px;
}
.graph-stage svg {
  width: 100%;
  height: 100%;
  touch-action: none;
  min-height: 400px;
}
.graph-node {
  cursor: pointer;
}
.graph-node rect {
  fill: #fff;
  stroke: #d9e4dd;
  stroke-width: 1.2;
}
.graph-node:hover rect,
.graph-node.selected rect {
  stroke: #2b8969;
  stroke-width: 2;
  fill: #f7fcf8;
}
.graph-node text {
  pointer-events: none;
}
.graph-edge {
  cursor: pointer;
}
.graph-edge text {
  stroke: none;
  fill: #62776a;
}
.graph-edge path {
  stroke: #a8bcb1;
  stroke-width: 1.5;
  fill: none;
}
.graph-edge .edge-hit {
  stroke: transparent;
  stroke-width: 18;
}
.graph-controls {
  position: absolute;
  bottom: 16px;
  left: 16px;
  display: flex;
  gap: 6px;
  background: #fff;
  border: 1px solid #eee;
  padding: 5px;
  border-radius: 8px;
}
.graph-info {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 10px;
  color: #888;
  max-width: 70%;
}
.graph-inspector {
  width: 270px;
  border-left: 1px solid #eee;
  background: #fff;
  overflow: auto;
  padding: 20px;
}
.graph-inspector h3 {
  font-size: 16px;
  line-height: 1.6;
  margin: 15px 0;
}
.graph-inspector .btn {
  font-size: 11px;
}
.graph-inspector p {
  color: #888;
  font-size: 11px;
}
.model-fields {
  border-top: 1px solid #eee;
  margin-top: 12px;
}
.model-fields summary {
  padding: 12px 0;
  cursor: pointer;
}
.model-fields small {
  color: #999;
  display: block;
  padding: 6px 12px;
}
.type-select {
  max-width: 170px;
  padding: 6px 9px;
  border: 1px solid #eee;
  border-radius: 6px;
  background: #fff;
  font-size: 11px;
}
.busy {
  opacity: 0.6;
  pointer-events: none;
}
.inline-error {
  font-size: 12px;
  color: #b35757;
  padding: 12px;
  overflow-wrap: anywhere;
}
.scope-workspace:has(.graph-live) {
  overflow: hidden;
}
.reader-content details summary {
  cursor: pointer;
  color: #888;
  font-size: 12px;
  padding: 15px 0;
}
.brand-crop img {
  mix-blend-mode: multiply;
}
.live-health {
  color: #aaa;
  font-size: 10px;
}
.small-note {
  color: #999;
  font-size: 10px;
  line-height: 1.8;
}
.source-description {
  display: grid;
  grid-template-columns: 75px 1fr;
  gap: 10px;
  font-size: 12px;
  margin: 18px 0;
  overflow-wrap: anywhere;
}
.source-description dt {
  color: #999;
}
.source-description dd {
  margin: 0;
}
.directory-heading {
  padding: 10px 8px;
  color: #999;
  font-size: 10px;
}
.shell-collapsed {
  --sidebar: 58px;
}
.shell-collapsed .navbtn span,
.shell-collapsed .brand-crop,
.shell-collapsed .account-name > span:last-child {
  display: none;
}
.shell-collapsed .brand {
  justify-content: center;
}
.shell-collapsed .reference-sidebar .navbtn {
  padding: 0 10px;
}
.shell-collapsed .account-name {
  padding: 10px 4px;
}
.shell-collapsed .brand .iconbtn {
  display: block;
}
.scope-primary-tabs button {
  cursor: pointer;
}
.scope-files .search input {
  width: 100%;
}
.source-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.9;
  padding: 14px;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 6px;
}
.scope-files .search {
  margin-left: auto;
}
.source-unit {
  margin: 12px 0;
}
.source-unit small {
  display: block;
  margin-bottom: 6px;
  color: #999;
}
.query-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #777;
  font-size: 12px;
}
.query-loading:before {
  content: "";
  height: 12px;
  width: 12px;
  border: 2px solid #ddd;
  border-top-color: #347a65;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 1200px) {
  :root,
  body.is-g6 {
    --sidebar: 180px;
  }
  .library-layout {
    grid-template-columns: 150px minmax(0, 1fr);
  }
  .scope-header {
    padding-left: 24px;
    padding-right: 24px;
  }
  .scope-files {
    padding-left: 24px;
    padding-right: 24px;
  }
  .knowledge-switch {
    padding: 0 20px;
  }
  .knowledge-detail-layout {
    grid-template-columns: 160px minmax(0, 1fr);
  }
  .reader-content {
    padding: 22px;
  }
  .graph-inspector {
    width: 225px;
  }
  .reference-sidebar .navbtn {
    font-size: 12px;
    gap: 8px;
  }
  .scope-nav-head strong {
    font-size: 18px;
  }
  .scope-heading {
    gap: 10px;
  }
  .scope-header .scope-heading h1 {
    font-size: 18px;
  }
}
@media (max-width: 850px) {
  :root,
  body.is-g6 {
    --sidebar: 58px;
  }
  .navbtn span,
  .brand-crop,
  .account-name > span:last-child {
    display: none;
  }
  .reference-sidebar .navbtn {
    padding: 0 10px;
  }
  .reference-sidebar .brand {
    padding: 0;
    justify-content: center;
  }
  .account-name {
    padding: 8px 0;
  }
  .library-layout {
    grid-template-columns: 130px minmax(0, 1fr);
  }
  .scope-nav {
    padding: 12px 5px;
  }
  .scope-nav-head strong {
    font-size: 16px;
  }
  .scope-heading {
    margin-bottom: 10px;
  }
  .scope-header {
    padding: 10px 18px 0;
  }
  .scope-files {
    padding: 14px;
  }
  .knowledge-detail-layout {
    grid-template-columns: 145px minmax(0, 1fr);
  }
  .knowledge-switch {
    gap: 6px;
  }
  .knowledge-switch .btn {
    padding: 0 7px;
  }
  .graph-inspector {
    width: 190px;
  }
  .eke-table .hide-small {
    display: none;
  }
  .file-title {
    font-size: 11px;
  }
}
@media (max-width: 600px) {
  .library-layout {
    grid-template-columns: 1fr;
  }
  .scope-nav {
    display: none;
  }
  .reference-topbar {
    height: 38px;
  }
  .scope-heading h1 {
    font-size: 16px !important;
  }
  .knowledge-detail-layout {
    display: flex;
    flex-direction: column;
  }
  .knowledge-directory-tree {
    max-height: 150px;
    border-bottom: 1px solid #eee;
    flex: none;
  }
  .reader {
    flex: 1;
  }
  .field-grid {
    grid-template-columns: 1fr;
  }
  .scope-header-actions .btn {
    font-size: 10px;
    padding: 0 8px;
  }
  .graph-inspector {
    display: none;
  }
  .scope-heading {
    flex-wrap: wrap;
  }
  .eke-table td:first-child {
    width: 58%;
  }
  .scope-files .files-filter-row {
    flex-wrap: wrap;
  }
  .type-select {
    max-width: 125px;
  }
  .reader-content h1 {
    font-size: 20px;
  }
  .graph-info {
    font-size: 9px;
  }
  .runtime-badge {
    font-size: 10px;
  }
}

.login-logo {
  display: block;
  width: 130px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
.file-sub {
  display: block;
}
.source-unit small {
  overflow-wrap: anywhere;
}

.reader > .reader-content {
  width: 100%;
  flex-shrink: 0;
}
.reader-toolbar {
  flex-shrink: 0;
}
