:root {
  --bg:#f6f7f9;
  --surface:#fff;
  --ink:#202630;
  --muted:#626c7b;
  --line:#e6e8ee;
  --blue:#3656d8;
  --blue-bg:#edf1ff;
  --green:#186d52;
  --sidebar:#191d25;
  --shadow:0 18px 65px #17244315;
  --mono:'SFMono-Regular',Consolas,monospace;
  color-scheme:light}
* {
  box-sizing:border-box}
body {
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC',sans-serif;
  font-size:var(--text-body);
  -webkit-font-smoothing:antialiased}
body.dark {
  --bg:#151820;
  --surface:#1d222d;
  --ink:#e8ecf4;
  --muted:#a4aebe;
  --line:#303746;
  --blue:#acbdff;
  --blue-bg:#293351;
  --green:#90ddbe;
  --sidebar:#101319;
  color-scheme:dark}
button,input,select,textarea {
  font:inherit}
button {
  cursor:pointer}
button,a,input,textarea,select {
  outline-offset:4px}
button:focus-visible,a:focus-visible {
  outline:2px solid var(--blue)}
button {
  border:1px solid var(--line);
  background:var(--surface);
  color:var(--ink);
  border-radius:7px;
  padding:9px 13px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  transition:background .15s,transform .15s}
button:hover {
  background:var(--bg)}
button:disabled {
  opacity:.45;
  cursor:not-allowed}
.primary {
  background:var(--accent-solid);
  color:var(--on-accent);
  border-color:var(--accent-solid);
  box-shadow:0 3px 6px #4166ef15}
.primary:hover {
  background:var(--accent-hover);
  color:var(--on-accent)}
.ghost {
  background:transparent;
  border-color:transparent}
.danger {
  color:var(--danger)}
.small {
  padding:6px 9px;
  font-size:var(--text-small)}
.icon {
  width:18px;
  height:18px;
  stroke:currentColor;
  stroke-width:1.7;
  fill:none;
  flex-shrink:0}
.app-shell {
  display:grid;
  grid-template-columns:228px minmax(0,1fr);
  min-height:100vh}
.sidebar {
  background:var(--sidebar);
  color:#a0a7b5;
  position:sticky;
  top:0;
  height:100vh;
  padding:32px 18px 18px;
  display:flex;
  flex-direction:column}
.brand {
  display:flex;
  gap:11px;
  align-items:center;
  color:#f3f5fa;
  padding:0 12px 30px}
.brand-mark {
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  background:#6683ff;
  border-radius:8px;
  color:white;
  transform:rotate(-5deg);
  font-size:23px;
  font-weight:800}
.brand strong {
  font-size:21px;
  letter-spacing:2px}
.brand small {
  display:block;
  font-size:var(--text-caption);
  letter-spacing:1px;
  color:#7d879a;
  margin-top:3px}
.workspace {
  background:#ffffff06;
  border:1px solid #ffffff12;
  display:flex;
  gap:10px;
  align-items:center;
  border-radius:8px;
  padding:12px;
  margin:0 0 25px}
.workspace-icon {
  background:#373b45;
  color:#e0e6f0;
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border-radius:6px}
.workspace strong {
  font-size:var(--text-small);
  color:#dae0ec;
  font-weight:500}
.workspace small {
  display:block;
  font-size:var(--text-caption);
  margin-top:5px;
  color:#737d90}
.nav-label {
  font:var(--text-caption) var(--mono);
  letter-spacing:1.4px;
  margin:12px 12px;
  color:#657083}
.nav {
  display:flex;
  flex-direction:column;
  gap:5px}
.nav button {
  justify-content:flex-start;
  border:0;
  background:transparent;
  color:#949daf;
  padding:12px 13px;
  font-size:13px;
  gap:12px}
.nav button:hover {
  background:#ffffff08;
  color:white}
.nav button.active {
  background:#303a58;
  color:#bacaff}
.nav .count {
  margin-left:auto;
  font-size:var(--text-caption);
  background:#ffffff12;
  border-radius:4px;
  padding:2px 6px}
.side-bottom {
  margin-top:auto}
.status-block {
  padding:20px 10px;
  display:flex;
  align-items:center;
  gap:8px;
  font-size:var(--text-small);
  color:#7e8b9e}
.dot {
  height:6px;
  width:6px;
  display:inline-block;
  border-radius:50%;
  background:#5bc4a2}
.profile {
  border-top:1px solid #ffffff10;
  padding:18px 5px 0;
  display:flex;
  gap:10px;
  align-items:center}
.avatar {
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#e7ecff;
  color:#5870b0;
  font-size:var(--text-small);
  font-weight:600}
.profile strong {
  display:block;
  font-size:var(--text-small);
  color:#d6dce5}
.profile small {
  font-size:var(--text-caption)}
.profile button {
  color:#9ba4b6;
  margin-left:auto;
  padding:6px}
.main {
  min-width:0}
.topbar {
  height:77px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 40px;
  background:var(--surface)}
.breadcrumb {
  display:flex;
  align-items:center;
  gap:14px;
  color:var(--muted);
  font-size:var(--text-small)}
.breadcrumb b {
  color:var(--ink);
  font-weight:500}
.top-actions {
  display:flex;
  gap:10px;
  align-items:center}
.kbd {
  font:var(--text-caption) var(--mono);
  border:1px solid var(--line);
  padding:2px 4px;
  border-radius:3px;
  color:var(--muted)}
.content {
  padding:38px 40px 30px;
  max-width:1600px;
  margin:auto}
.eyebrow {
  font:var(--text-caption) var(--mono);
  letter-spacing:1.6px;
  color:var(--muted);
  margin:0 0 12px}
.page-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:28px}
h1 {
  font-size:30px;
  font-weight:600;
  letter-spacing:-.8px;
  margin:0 0 10px}
h2 {
  font-size:16px;
  font-weight:600;
  margin:0}
h3 {
  font-size:var(--text-body);
  margin:0}
p {
  line-height:1.7}
.subtext {
  font-size:var(--text-small);
  color:var(--muted);
  margin:0}
.row {
  display:flex;
  align-items:center;
  gap:10px}
.metrics {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  border:1px solid var(--line);
  background:var(--surface);
  border-radius:10px;
  margin-bottom:30px}
.metric {
  padding:21px 24px;
  border-right:1px solid var(--line)}
.metric:last-child {
  border:0}
.metric-top {
  display:flex;
  align-items:center;
  justify-content:space-between;
  color:var(--muted);
  font-size:var(--text-small)}
.metric-top .icon {
  width:15px;
  height:15px}
.metric-value {
  font-size:28px;
  font-weight:550;
  letter-spacing:-1px;
  margin-top:13px}
.metric-value small {
  font-size:var(--text-caption);
  color:var(--muted);
  letter-spacing:0;
  margin-left:10px;
  font-weight:400}
.section-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin:0 0 16px}
.section-heading h2 span {
  font:var(--text-small) var(--mono);
  background:var(--line);
  padding:3px 7px;
  margin-left:8px;
  border-radius:4px;
  color:var(--muted)}
.cards {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
  margin-bottom:28px}
.base-card {
  display:block;
  text-align:left;
  padding:22px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:10px;
  position:relative;
  min-height:177px}
@media(hover:hover) {
  .base-card:hover {
  border-color:var(--blue);
  background:var(--surface);
  box-shadow:0 7px 20px #233e7310}
}
.base-card.selected {
  border-color:var(--blue);
  box-shadow:0 0 0 1px var(--blue)}
.base-icon {
  width:36px;
  height:38px;
  border-radius:8px;
  background:var(--blue-bg);
  color:var(--blue);
  display:grid;
  place-items:center}
.base-icon.green {
  background:#e5f4ee;
  color:#3b947a}
.base-icon.orange {
  background:#fff0e0;
  color:#ba8b48}
.base-card .card-top {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:16px}
.badge {
  font-size:var(--text-caption);
  padding:4px 7px;
  border-radius:4px;
  background:var(--blue-bg);
  color:var(--blue);
  white-space:nowrap}
.badge.green {
  background:#28926e12;
  color:var(--green)}
.base-card h3 {
  margin-bottom:8px}
.base-card p {
  color:var(--muted);
  font-size:var(--text-small);
  white-space:normal;
  overflow-wrap:anywhere;
  margin:0 0 18px}
.card-footer {
  border-top:1px solid var(--line);
  padding-top:13px;
  display:flex;
  justify-content:space-between;
  color:var(--muted);
  font-size:var(--text-caption)}
.card-footer span {
  display:flex;
  align-items:center;
  gap:6px}
.card-footer .icon {
  width:13px;
  height:13px}
.panel {
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--surface);
  overflow:hidden}
.toolbar {
  padding:17px 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid var(--line)}
.tabs {
  display:flex;
  gap:18px;
  align-items:center}
.tabs button {
  padding:7px 0;
  border:0;
  border-radius:0;
  background:transparent;
  color:var(--muted);
  font-size:var(--text-small)}
.tabs button.active {
  color:var(--blue);
  box-shadow:0 2px var(--blue)}
.search {
  display:flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--line);
  padding:7px 10px;
  border-radius:6px;
  color:var(--muted);
  background:var(--bg)}
.search input {
  background:transparent;
  border:0;
  padding:0;
  width:185px;
  font-size:var(--text-small);
  color:var(--ink);
  outline:revert}
.search .icon {
  width:14px;
  height:14px}
.table-wrap {
  overflow:auto}
table {
  width:100%;
  border-collapse:collapse;
  text-align:left;
  white-space:nowrap}
th {
  font-size:var(--text-caption);
  font-weight:500;
  color:var(--muted);
  background:var(--bg);
  padding:12px 20px}
td {
  border-top:1px solid var(--line);
  padding:16px 20px;
  font-size:var(--text-small);
  color:var(--muted)}
td strong {
  font-weight:500;
  color:var(--ink);
  font-size:var(--text-small)}
tr:hover td {
  background:var(--bg)}
.doc-name {
  display:flex;
  gap:12px;
  align-items:center;
  text-align:left;
  max-width:360px;
  padding:0;
  border:0;
  background:transparent}
.doc-name strong {
  display:block;
  max-width:290px;
  white-space:normal;
  overflow-wrap:anywhere}
.doc-name small {
  display:block;
  font-size:var(--text-caption);
  color:var(--muted);
  margin-top:5px}
.file-icon {
  font:9px var(--mono);
  color:var(--blue);
  background:var(--blue-bg);
  border:1px solid #4166ef18;
  border-radius:5px;
  width:30px;
  height:36px;
  display:grid;
  place-items:center}
.table-footer {
  padding:14px 20px;
  display:flex;
  justify-content:space-between;
  color:var(--muted);
  font-size:var(--text-caption);
  border-top:1px solid var(--line)}
.footer {
  margin-top:22px;
  display:flex;
  justify-content:space-between;
  color:var(--muted);
  font-size:var(--text-caption)}
.empty {
  padding:40px 24px;
  text-align:center}
.empty .base-icon {
  margin:0 auto 16px}
.empty p {
  font-size:var(--text-small);
  color:var(--muted);
  margin-bottom:20px}
.intro {
  background:var(--blue-bg);
  border:1px solid #4166ef22;
  border-radius:10px;
  padding:22px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:24px}
.intro p {
  color:var(--muted);
  font-size:var(--text-small);
  margin:8px 0 0}
.two-col {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px}
.panel-pad {
  padding:24px}
.field {
  display:block;
  margin:0 0 18px;
  font-size:var(--text-small)}
.field input,.field select,.field textarea {
  display:block;
  width:100%;
  margin-top:8px;
  padding:11px 12px;
  color:var(--ink);
  background:var(--bg);
  border:1px solid var(--line);
  border-radius:6px;
  outline-color:var(--blue)}
.field textarea {
  resize:vertical;
  min-height:110px}
.field small {
  display:block;
  font-size:var(--text-caption);
  line-height:1.6;
  color:var(--muted);
  margin-top:7px}
.code {
  font:12px/1.85 var(--mono);
  background:var(--bg);
  padding:20px;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  border-radius:6px;
  border:1px solid var(--line)}
.result {
  padding:18px;
  border:1px solid var(--line);
  border-radius:8px;
  margin-top:12px}
.result p {
  font-size:var(--text-small);
  white-space:pre-wrap;
  color:var(--muted)}
.result small {
  color:var(--blue);
  font:var(--text-caption) var(--mono)}
.dropzone {
  padding:44px 25px;
  text-align:center;
  border:1px dashed #a9b7d9;
  background:var(--blue-bg);
  border-radius:8px;
  margin-bottom:18px;
  cursor:pointer}
.dropzone.drag {
  outline:3px solid var(--blue)}
.dropzone .icon {
  width:32px;
  height:32px;
  color:var(--blue)}
.dropzone p {
  font-size:var(--text-small)}
.dropzone small {
  font-size:var(--text-caption);
  color:var(--muted)}
.file-progress {
  margin-top:10px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:5px;
  font-size:var(--text-small)}
.editor-layout {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0;
  min-height:440px}
.editor-layout textarea {
  width:100%;
  min-height:440px;
  background:var(--bg);
  color:var(--ink);
  border:0;
  border-right:1px solid var(--line);
  padding:24px;
  resize:vertical;
  font:12px/1.9 var(--mono);
  outline:revert}
.preview {
  padding:24px;
  overflow-wrap:anywhere;
  max-height:650px;
  overflow:auto;
  font-size:13px;
  line-height:1.9}
.preview h1 {
  font-size:24px}
.preview h2 {
  font-size:19px;
  margin-top:20px}
.preview h3 {
  font-size:16px;
  margin-top:18px}
.preview p {
  margin:12px 0}
.preview pre {
  background:var(--bg);
  padding:14px;
  overflow:auto}
.preview code {
  font-family:var(--mono);
  font-size:var(--text-small);
  background:var(--bg)}
.preview blockquote {
  border-left:3px solid var(--blue);
  padding-left:12px;
  color:var(--muted)}
dialog {
  width:min(520px,calc(100% - 32px));
  background:var(--surface);
  color:var(--ink);
  border:1px solid var(--line);
  border-radius:12px;
  padding:28px;
  box-shadow:var(--shadow)}
dialog::backdrop {
  background:#11182770;
  backdrop-filter:blur(3px)}
.dialog-title {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:24px}
.dialog-actions {
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:24px}
.error {
  color:var(--danger);
  font-size:var(--text-small);
  line-height:1.6;
  margin:12px 0}
.hidden {
  display:none!important}
#toast {
  position:fixed;
  bottom:25px;
  left:50%;
  transform:translateX(-50%);
  z-index:10;
  background:var(--ink);
  color:var(--surface);
  padding:12px 22px;
  border-radius:8px;
  box-shadow:var(--shadow);
  font-size:var(--text-small);
  display:none}
#toast.show {
  display:block}
.auth-shell {
  display:grid;
  grid-template-columns:1fr 1fr;
  min-height:100vh}
.auth-art {
  background:#1c253d;
  color:white;
  padding:55px 65px;
  display:flex;
  flex-direction:column;
  position:relative;
  overflow:hidden}
.auth-art .brand {
  padding:0}
.auth-art .auth-statement {
  font-size:44px;
  line-height:1.35;
  max-width:430px;
  margin-top:80px;
  letter-spacing:-1.5px}
.auth-art p {
  color:#a1b0ce;
  max-width:350px;
  font-size:13px}
.knowledge-map {
  height:220px;
  margin:35px 0;
  position:relative;
  display:flex;
  align-items:center;
  gap:25px}
.map-stack {
  display:flex;
  flex-direction:column;
  gap:12px}
.map-node {
  border:1px solid #8197d74a;
  border-radius:7px;
  padding:14px 20px;
  font:var(--text-small) var(--mono);
  color:#b4c5ee;
  background:#2a3759}
.map-link {
  height:1px;
  width:35px;
  background:#6685d8}
.map-core {
  background:#4166ef;
  color:white;
  padding:25px;
  border-radius:12px;
  font-size:16px}
.auth-foot {
  margin-top:auto;
  color:#7f91b5;
  font:var(--text-caption) var(--mono);
  letter-spacing:1px}
.auth-form-wrap {
  display:flex;
  align-items:center;
  justify-content:center;
  padding:40px}
.auth-form {
  width:360px}
.auth-form h1 {
  font-size:30px;
  margin-bottom:12px}
.auth-form .subtext {
  margin-bottom:30px}
.auth-form .primary {
  width:100%;
  margin-top:10px;
  padding:12px}
.auth-form .field {
  margin-bottom:20px}
.security-note {
  display:flex;
  gap:7px;
  justify-content:center;
  color:var(--muted);
  font-size:var(--text-caption);
  margin-top:22px}
.security-note .icon {
  width:13px;
  height:13px}
.boot {
  padding:100px;
  font:24px var(--mono)}
.boot span {
  display:block;
  font-size:var(--text-small);
  color:var(--muted);
  margin-top:14px}
.mobile-menu {
  display:none}
.settings-group {
  margin-bottom:20px}
.settings-group p {
  color:var(--muted);
  font-size:var(--text-small)}
.key-token {
  word-break:break-all}
.inline-edit {
  display:flex;
  gap:10px;
  margin-bottom:20px}
.inline-edit .field {
  flex:1;
  margin:0}
.audit-list {
  padding:0 24px}
.audit-item {
  display:flex;
  gap:18px;
  border-bottom:1px solid var(--line);
  padding:18px 0}
.audit-item p {
  margin:0;
  font-size:var(--text-small)}
.audit-item small {
  font-size:var(--text-caption);
  color:var(--muted)}
.folder-filter {
  max-width:135px;
  border:1px solid var(--line);
  border-radius:5px;
  padding:7px;
  color:var(--muted);
  background:var(--surface);
  font-size:var(--text-small)}
@media(min-width:1500px) {
  .content {
  padding-top:48px}
.cards {
  gap:22px}
.base-card {
  min-height:193px;
  padding:25px}
}
@media(max-width:1100px) {
  .app-shell {
  grid-template-columns:200px minmax(0,1fr)}
.sidebar {
  padding:28px 12px 16px}
.content {
  padding:28px 24px}
.topbar {
  padding:0 24px}
.cards {
  grid-template-columns:repeat(2,minmax(0,1fr))}
.metric {
  padding:18px 15px}
.metric-value {
  font-size:23px}
.auth-art {
  padding:40px}
.auth-art .auth-statement {
  font-size:35px}
}
@media(max-width:760px) {
  .app-shell {
  display:block}
.sidebar {
  display:none;
  position:fixed;
  z-index:5;
  width:228px}
.sidebar.open {
  display:flex}
.mobile-menu {
  display:inline-flex}
.topbar {
  height:64px;
  padding:0 16px}
.content {
  padding:25px 16px}
.top-actions .kbd,.top-actions .search {
  display:none}
.page-heading {
  align-items:flex-start;
  flex-wrap:wrap}
h1 {
  font-size:24px}
.metrics {
  grid-template-columns:1fr 1fr}
.metric:nth-child(2) {
  border:0}
.metric:nth-child(-n+2) {
  border-bottom:1px solid var(--line)}
.cards {
  grid-template-columns:1fr}
.two-col,.editor-layout {
  grid-template-columns:1fr}
.editor-layout textarea {
  border-right:0;
  border-bottom:1px solid var(--line);
  min-height:300px}
.toolbar {
  flex-wrap:wrap;
  padding:13px}
.toolbar .row {
  flex-wrap:wrap}
.search input {
  width:145px}
.intro {
  align-items:flex-start;
  gap:20px;
  flex-direction:column}
.auth-shell {
  display:block}
.auth-art {
  display:none}
.auth-form-wrap {
  min-height:100vh;
  padding:25px}
.inline-edit {
  flex-direction:column}
.footer {
  gap:15px}
.breadcrumb {
  gap:8px}
}
@media(prefers-reduced-motion:reduce) {
  * {
  transition:none!important;
  animation:none!important}
}

/* Explicit surfaces avoid native button painting overriding the dark palette. */
button {
  appearance:none;
  -webkit-appearance:none}
.sidebar {
  overflow-y:auto}
.sidebar .brand,.sidebar .workspace,.sidebar .nav,.side-bottom {
  flex-shrink:0}
@media(max-height:800px) and (min-width:761px) {
  .sidebar {
  padding-top:22px}
.brand {
  padding-bottom:20px}
.workspace {
  margin-bottom:14px}
.nav button {
  padding-top:10px;
  padding-bottom:10px}
.status-block {
  padding-top:14px;
  padding-bottom:14px}
.profile {
  padding-top:12px}
}


/* Semantic tokens: type, feedback and primary actions stay consistent in both themes. */
:root {
  --text-caption: 0.75rem;
  --text-small: 0.8125rem;
  --text-body: 0.875rem;
  --accent-solid: #3656d8;
  --accent-hover: #2b46b7;
  --on-accent: #ffffff;
  --danger: #b32d43;
  --danger-bg: #fff0f2;
  --success-bg: #e9f5ef;
  --focus-ring: #244ddd;
}
body.dark {
  --accent-solid: #4162df;
  --accent-hover: #3656ce;
  --danger: #ff9bae;
  --danger-bg: #3b2430;
  --success-bg: #21382f;
  --focus-ring: #b7c9ff;
}
body { line-height: 1.55; }
button, input, select, textarea { font-size: var(--text-body); }
button { min-height: 40px; line-height: 1.4; }
button.small { min-height: 36px; }
button .icon { pointer-events: none; }
.icon { stroke-width: 1.5; }
.primary .icon { stroke-width: 2; }
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}
.sidebar :focus-visible { outline-color: #c2d0ff; }
.search:focus-within { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.search input:focus-visible { outline: none; }
.editor-layout textarea:focus-visible { outline-offset: -4px; }
h1, h2, h3 { text-wrap: balance; overflow-wrap: anywhere; }
p { text-wrap: pretty; }
h1 { font-size: 30px; line-height: 1.25; letter-spacing: -.6px; }
h2 { font-size: 17px; line-height: 1.4; }
h3 { font-size: 15px; line-height: 1.5; }
.subtext { line-height: 1.7; }
.eyebrow { text-transform: uppercase; letter-spacing: 1.3px; font-size: 11px; }
.numeric, .metric-value, .count, .card-footer { font-variant-numeric: tabular-nums; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.skip-link { position:fixed; inset-inline-start:16px; top:-100px; z-index:100; background:var(--surface); color:var(--ink); padding:12px 18px; border-radius:8px; }
.skip-link:focus { top:12px; }
.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition:none!important; }
.topbar { min-height:72px; height:auto; padding-block:16px; }
.breadcrumb { min-width:0; }
.breadcrumb b { overflow-wrap:anywhere; }
.content { padding:32px; max-width:1536px; }
.page-heading { margin-bottom:24px; }
.page-heading > div:first-child { min-width:0; max-width:70ch; }
.page-heading > .row { flex-wrap:wrap; }
.top-actions { flex-shrink:0; }
.row { flex-wrap:wrap; gap:12px; }
.brand small { color:#a6b0c3; }
.workspace small, .nav-label, .status-block { color:#a3aec1; }
.nav button { color:#b2bccd; font-size:14px; min-height:42px; }
.nav button.active { color:#d9e2ff; background:#303e65; }
.nav button.active::before { content:''; width:3px; height:18px; border-radius:3px; background:#a6baff; margin-inline-start:-8px; margin-inline-end:-4px; }
.profile strong { overflow-wrap:anywhere; }
.profile > div:nth-child(2) { min-width:0; }
.profile small { color:#a6b0c3; }
.side-bottom .badge { background:#303e65; color:#d9e2ff; }
.side-bottom { padding-top:20px; }
.sidebar { scrollbar-width:thin; }
#close-nav { position:absolute; inset-inline-end:10px; top:10px; color:#d9e2ff; }
.nav-scrim { display:none; }
.metrics { border-radius:12px; margin-bottom:30px; }
.metric { padding:20px 24px; }
.metric-value { font-size:30px; margin-top:10px; line-height:1.2; }
.metric-value small { display:block; margin:8px 0 0; font-size:12px; }
.metric-top { font-size:13px; }
.section-heading { gap:16px; margin-bottom:16px; }
.section-heading .subtext { margin-top:5px; }
.library-heading { flex-wrap:wrap; }
.search { min-height:40px; background:var(--surface); padding:9px 12px; }
.search input { font-size:14px; min-width:0; width:210px; }
.search .icon { width:17px; height:17px; }
.cards { gap:18px; margin-bottom:32px; }
.cards > .empty { grid-column:1/-1; }
.base-card { border-radius:12px; padding:22px; min-width:0; display:flex; flex-direction:column; gap:0; }
.base-card h3 { font-size:16px; }
.base-card p { font-size:13px; line-height:1.65; margin-bottom:20px; }
.base-card .card-footer { margin-top:auto; }
.card-footer { font-size:12px; flex-wrap:wrap; gap:12px; }
.card-open { color:var(--blue); }
.badge { display:inline-flex; align-items:center; gap:4px; padding:4px 7px; font-size:12px; line-height:1.5; }
.badge .icon { width:13px; height:13px; }
.badge.green { color:var(--green); background:var(--success-bg); }
.base-icon.green { background:var(--success-bg); color:var(--green); }
.base-icon.orange { background:#faf0dd; color:#866020; }
body.dark .base-icon.orange { background:#3b3224; color:#e2c183; }
.file-icon { flex-shrink:0; width:34px; height:40px; font-size:10px; }
.panel { border-radius:12px; min-width:0; }
.table-wrap { max-width:100%; }
table { white-space:normal; }
th { font-size:12px; padding:13px 16px; }
td { font-size:13px; padding:16px; overflow-wrap:anywhere; }
td strong { font-size:14px; }
.doc-name { min-height:40px; max-width:100%; text-align:start; }
.doc-name > span:last-child { min-width:0; }
.doc-name small { white-space:normal; overflow-wrap:anywhere; font-size:12px; line-height:1.6; }
.table-footer { font-size:12px; gap:16px; flex-wrap:wrap; }
.table-footer > span { display:flex; align-items:center; gap:6px; }
.table-footer .icon { width:14px; height:14px; color:var(--green); }
.empty { padding:42px 24px; }
.empty p { max-width:55ch; margin:10px auto 22px; }
.footer { font-size:12px; flex-wrap:wrap; gap:8px; }
.document-workspace { display:grid; grid-template-columns:184px minmax(0,1fr); gap:20px; align-items:start; }
.directory { padding:18px 12px; }
.directory-title { display:flex; align-items:center; gap:8px; font-weight:600; margin-bottom:20px; padding-inline:6px; }
.directory-select { margin-inline:6px; }
.directory-select select { padding:9px 8px; }
.folder-list { display:flex; flex-direction:column; gap:6px; }
.folder-list button { border:0; background:transparent; justify-content:flex-start; text-align:start; padding:10px; gap:8px; }
.folder-list button span { min-width:0; overflow-wrap:anywhere; flex:1; }
.folder-list button small { font:12px var(--mono); color:var(--muted); }
.folder-list button.active { background:var(--blue-bg); color:var(--blue); }
.directory-hint { font-size:12px; color:var(--muted); margin:22px 6px 0; }
.document-toolbar { padding:16px; }
.document-toolbar .search { flex:1; }
.document-toolbar .search input { width:100%; }
.sort-control { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--muted); }
.sort-control select { border:1px solid var(--line); border-radius:6px; min-height:40px; padding:8px; background:var(--surface); color:var(--ink); }
.filter-strip { display:flex; align-items:center; justify-content:space-between; padding:0 16px 12px; gap:8px; flex-wrap:wrap; }
.tabs { gap:16px; flex-wrap:wrap; }
.tabs button { font-size:13px; min-height:36px; }
.tabs button.active { font-weight:600; }
#clear-filters[hidden] { display:none; }
.danger-zone { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:24px; padding-top:18px; border-top:1px solid var(--line); color:var(--muted); font-size:12px; flex-wrap:wrap; }
.danger-filled { background:var(--danger-bg); border-color:var(--danger); color:var(--danger); font-weight:600; }
.two-col > * { min-width:0; }
.field { font-size:14px; }
.field small { font-size:12px; }
.field input, .field select, .field textarea { min-width:0; font-size:14px; }
.field input::placeholder, .field textarea::placeholder, .search input::placeholder { color:var(--muted); opacity:1; }
.editor-labels { display:grid; grid-template-columns:1fr 1fr; background:var(--bg); border-bottom:1px solid var(--line); padding:10px 24px; color:var(--muted); font-size:12px; }
.editor-layout textarea { font-size:14px; line-height:1.85; }
.preview { font-size:15px; line-height:1.75; }
.preview > * { max-width:70ch; text-wrap:initial; }
.save-state { display:flex; align-items:center; gap:6px; color:var(--green); font-size:12px; }
.save-state::before { content:'✓'; }
.save-state.unsaved { color:var(--muted); }
.save-state.unsaved::before { content:'•'; }
#editor-error:empty { display:none; }
.dropzone { width:100%; display:block; }
.dropzone p { font-size:14px; }
.dropzone small { font-size:12px; }
.file-progress { display:flex; flex-wrap:wrap; gap:8px; align-items:center; overflow-wrap:anywhere; }
.result p { font-size:14px; line-height:1.75; }
.result small { font-size:12px; }
.code { font-size:13px; line-height:1.8; }
.error { font-size:13px; }
dialog { border-radius:16px; padding:24px; overscroll-behavior:contain; }
.dialog-actions { gap:12px; flex-wrap:wrap; }
.dialog-title { gap:12px; }
#toast { padding:10px 12px 10px 18px; max-width:min(560px,calc(100vw - 32px)); }
#toast.show { display:flex; align-items:center; gap:12px; }
#toast button { color:inherit; flex-shrink:0; }
#toast button:hover { background:transparent; }
.auth-art .auth-statement { font-size:40px; line-height:1.35; max-width:430px; margin-top:80px; letter-spacing:-1px; }
.auth-form h1 { font-size:28px; }
.auth-form-wrap { min-width:0; }
.auth-art p, .auth-foot { color:#b1c0dd; }
.audit-item { flex-wrap:wrap; }
.audit-item > div { min-width:0; overflow-wrap:anywhere; }
@media (prefers-reduced-motion:no-preference) {
  button { transition:background-color 120ms, border-color 120ms, scale 120ms cubic-bezier(.2,0,0,1); }
  button:active:not(:disabled):not(.base-card):not(.doc-name) { scale:.96; }
}
@media (max-width:1100px) {
  .content { padding:28px 24px; }
  .document-workspace { grid-template-columns:minmax(0,1fr); }
  .directory { display:flex; flex-wrap:wrap; gap:12px; align-items:center; padding:16px; }
  .directory-title { margin:0; }
  .directory-select { margin:0; flex:1; min-width:180px; }
  .directory-select select { margin-top:4px; }
  .folder-list { flex-direction:row; flex-wrap:wrap; width:100%; }
  .folder-list button { max-width:100%; }
  .directory-hint { display:none; }
}
@media (max-width:760px) {
  .content { padding:24px 16px; }
  .topbar { min-height:64px; padding:12px 16px; }
  .top-actions .subtext { display:none; }
  .top-actions { gap:4px; }
  .top-actions .avatar { display:none; }
  .breadcrumb { flex:1; }
  .breadcrumb > span:first-of-type { display:none; }
  .breadcrumb > span:nth-of-type(2) { display:none; }
  h1 { font-size:25px; }
  .page-heading > div:first-child { max-width:100%; }
  .page-heading > .row { width:100%; }
  .page-heading > .row button { flex-grow:1; }
  .metrics { margin-bottom:24px; }
  .metric { padding:16px; }
  .metric-value { font-size:26px; }
  .metric-top { font-size:12px; }
  .metric-value small { font-size:12px; line-height:1.5; }
  .cards { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
  .base-card { padding:18px; }
  .base-card .card-top { flex-wrap:wrap; gap:10px; }
  .section-heading { flex-wrap:wrap; }
  .library-heading > .row, .library-heading .search { width:100%; }
  .library-heading .search input { width:100%; }
  .document-toolbar { flex-wrap:wrap; }
  .document-toolbar .search { flex-basis:100%; }
  .document-toolbar .sort-control { width:100%; justify-content:space-between; }
  .sort-control select { flex:1; }
  input, textarea, select, .field input, .field select, .field textarea, .search input, .editor-layout textarea { font-size:16px; }
  button, button.small, .tabs button, .folder-list button { min-height:44px; }
  .mobile-menu { min-width:44px; }
  .sidebar.open { width:min(280px,calc(100vw - 32px)); z-index:21; padding-top:48px; overscroll-behavior:contain; }
  .nav-scrim:not(.hidden) { display:block; position:fixed; inset:0; z-index:20; background:#11182780; border:0; border-radius:0; width:100%; height:100dvh; }
  body.drawer-open { overflow:hidden; }
  .documents-table, .documents-table tbody, .documents-table tr { display:block; width:100%; }
  .documents-table thead { position:absolute; width:1px; height:1px; clip-path:inset(50%); overflow:hidden; }
  .documents-table tr { display:grid; grid-template-columns:1fr 1fr; padding:16px; border-bottom:1px solid var(--line); gap:10px 16px; }
  .documents-table td { display:block; padding:0; border:0; min-width:0; }
  .documents-table td:first-child { grid-column:1/-1; margin-bottom:6px; }
  .documents-table td:first-child button { width:100%; justify-content:flex-start; }
  .documents-table td[data-label]::before { content:attr(data-label); display:block; font-size:12px; color:var(--muted); margin-bottom:4px; }
  .documents-table td:last-child { display:none; }
  .doc-name strong { max-width:none; }
  .doc-name { max-width:100%; }
  .table-wrap { overflow-x:auto; }
  .editor-labels { grid-template-columns:1fr; }
  .editor-labels span:last-child { display:none; }
  .preview::before { content:'内容预览'; display:block; font-size:12px; color:var(--muted); margin-bottom:16px; }
  .editor-layout { min-height:0; }
  .editor-layout textarea, .preview { padding:20px; }
  .auth-form-wrap { padding:32px 20px; }
  .panel-pad { padding:20px; }
  .footer { font-size:12px; }
}
@media (max-width:460px) {
  .cards { grid-template-columns:minmax(0,1fr); }
  .metric-top .icon { display:none; }
  .metric { padding:14px; }
  .tabs { gap:12px; }
  .directory { padding:14px; }
  .directory-title { width:100%; }
  .dialog-actions > button { flex:1; }
  .filter-strip { padding-inline:12px; }
}
@media (forced-colors:active) {
  :where(button,a,input,select,textarea,[tabindex]):focus-visible { outline-color:Highlight; }
  .search:focus-within { outline-color:Highlight; }
  .badge, .nav button.active { border:1px solid CanvasText; }
}
.base-card { align-items:stretch; justify-content:flex-start; text-align:start; }
.base-card .card-top { width:100%; }
.preview h3 { font-size:16px; }
.preview h4 { font-size:15px; }
.preview h5, .preview h6 { font-size:14px; }
@media (max-width:760px) {
  .directory { gap:10px; }
}
button[aria-busy="true"]::before { content:'…'; font-weight:600; }

/* Keep model previews readable without stretching the input form. */
#pipeline-form { align-self:start; }
#pipeline-messages, #pipeline-sources { max-height:420px; overflow:auto; }
#pipeline-answer { white-space:pre-wrap; overflow-wrap:anywhere; max-height:480px; overflow:auto; padding:16px 0; }

/* Operator workflow: visible actions, native selection, progressive disclosure. */
.ops-guide { margin-bottom:24px; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:20px; }
.ops-guide h2 { margin:6px 0 10px; }
.batch-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:16px; border-top:1px solid var(--line); }
input[type=checkbox] { width:18px; height:18px; min-width:18px; accent-color:var(--blue); cursor:pointer; }
.scope-folders { border:1px solid var(--line); border-radius:10px; padding:14px; margin:16px 0; max-height:220px; overflow:auto; }
.scope-folders label { display:flex; align-items:center; gap:10px; padding:8px; overflow-wrap:anywhere; }
.scope-summary { padding:12px; margin:12px 0; background:var(--bg); border:1px solid var(--line); border-radius:8px; line-height:1.7; }
#source-cards { max-height:420px; overflow:auto; margin-bottom:24px; }
#pipeline-skill { max-height:420px; overflow:auto; }
#pipeline-answer { min-height:80px; }
#pipeline-skill, #pipeline-messages, #pipeline-sources { white-space:pre-wrap; overflow-wrap:anywhere; }
#association-result { margin:14px 0; font-weight:600; line-height:1.7; }
[aria-label="模型编排结果"] > h2 { margin-top:24px; }
@media(max-width:760px) { .batch-toolbar button { flex:1; } .ops-guide .row { width:100%; flex-wrap:wrap; } .documents-table td:has(input[type=checkbox]) { display:block; } }

.query-flow { margin-bottom:24px; }
#query-flow-steps { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; padding:0; list-style:none; margin:18px 0 0; }
#query-flow-steps li { display:flex; align-items:flex-start; gap:12px; padding:16px; border:1px solid var(--line); border-radius:10px; min-width:0; }
#query-flow-steps li>div { min-width:0; flex:1; }
.flow-number { display:grid; place-items:center; min-width:28px; height:28px; border-radius:50%; background:var(--bg); border:1px solid var(--line); }
.flow-complete .flow-number { color:var(--green); }
#query-flow-steps pre { max-height:260px; white-space:pre-wrap; overflow-wrap:anywhere; overflow:auto; }
.query-flow [data-flow-note] { margin-top:16px; overflow-wrap:anywhere; }
@media(max-width:1100px){ #query-flow-steps { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px){ #query-flow-steps { grid-template-columns:1fr; } .query-flow .section-heading { align-items:stretch; flex-direction:column; } .query-flow .row { flex-wrap:wrap; } }

.photo-composer { padding:14px; border:1px solid var(--line); border-radius:10px; margin:16px 0; }
#photo-previews { display:flex; flex-wrap:wrap; gap:12px; }
#photo-previews figure { margin:0; width:130px; min-width:0; }
#photo-previews img { width:130px; height:110px; object-fit:cover; border-radius:8px; border:1px solid var(--line); }
#photo-previews figcaption { overflow-wrap:anywhere; font-size:12px; margin:6px 0; }
#query-photos { width:100%; max-width:100%; }

.agri-overview { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:24px; padding:28px; margin:0 0 30px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.agri-overview h2 { margin:10px 0; font-size:23px; }
.agri-overview p { color:var(--muted); }
.agri-counts { display:flex; gap:28px; }
.agri-counts span { display:flex; flex-direction:column; gap:8px; font-size:12px; color:var(--muted); }
.agri-counts strong { font-size:28px; color:var(--green); }
.agri-search { width:100%; margin-bottom:14px; }
.topic-pills { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:20px; }
.topic-pills .active { background:var(--blue-bg); color:var(--blue); border-color:var(--blue); }
.knowledge-items { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.document-list .knowledge-items { grid-template-columns:1fr; padding:16px; }
.knowledge-item { display:flex; align-items:flex-start; gap:14px; padding:22px; background:var(--surface); border:1px solid var(--line); border-radius:10px; min-width:0; }
.knowledge-item-body { min-width:0; flex:1; }
.knowledge-item-meta { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; font-size:12px; color:var(--green); margin-bottom:12px; }
.knowledge-title { border:0; padding:0; text-align:left; font-size:18px; line-height:1.5; font-weight:600; display:block; }
.knowledge-excerpt { font-size:14px; line-height:1.8; color:var(--muted); margin:12px 0 18px; overflow-wrap:anywhere; }
.knowledge-item-footer { display:flex; flex-wrap:wrap; align-items:center; gap:12px; font-size:12px; color:var(--muted); }
.knowledge-item-footer button { margin-left:auto; }
.knowledge-select-all { padding:16px; border-bottom:1px solid var(--line); }
.knowledge-select-all label { display:flex; align-items:center; gap:8px; }
.library-secondary { margin-top:36px; }
.library-secondary .base-card { padding:18px; }
@media(max-width:900px){ .knowledge-items { grid-template-columns:1fr; } .agri-overview { padding:20px; } }
@media(max-width:600px){ .knowledge-item { padding:16px; } .agri-counts { gap:20px; } .knowledge-item-footer button { margin-left:0; } }

.auth-filing{display:flex;flex-direction:column;align-items:center;gap:6px;margin-top:28px;color:var(--muted);font-size:12px;line-height:1.8;text-align:center}.auth-filing a,.filing-link{color:var(--muted);text-decoration:none}.auth-filing a:hover,.filing-link:hover{text-decoration:underline}
