﻿:root {
  --bg: #f4f7fb;
  --ink: #1f2937;
  --muted: #667085;
  --accent: #0b5cab;
  --accent-2: #0f7bd9;
  --soft-btn-bg: #e7f2ff;
  --soft-btn-bg-hover: #d8eaff;
  --soft-btn-border: #b8d5f6;
  --soft-btn-text: #1f5f9b;
  --danger: #b42318;
  --card: #ffffff;
  --border: #d0d7e2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Noto Sans SC", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

h1,
h2,
h3,
p {
  margin: 0;
}

label {
  display: block;
  font-size: 14px;
  color: var(--muted);
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fffcf6;
  color: var(--ink);
}

select {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fffcf6;
  color: var(--ink);
}

button,
.link-btn {
  border: 1px solid var(--soft-btn-border);
  border-radius: 8px;
  padding: 10px 16px;
  color: var(--soft-btn-text);
  background: var(--soft-btn-bg);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.15s ease, filter 0.2s ease;
}

button:hover,
.link-btn:hover {
  transform: none;
  filter: none;
  background: var(--soft-btn-bg-hover);
}

.page {
  width: min(980px, 92vw);
  margin: 0 auto;
  padding: 34px 0 48px;
}

.page.narrow {
  width: min(760px, 92vw);
}

.hero {
  margin-bottom: 22px;
}

.eyebrow {
  letter-spacing: 0.2em;
  font-weight: 600;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
}

.hero h1 {
  font-family: "Alegreya Sans SC", "IBM Plex Sans", sans-serif;
  font-size: clamp(28px, 4vw, 46px);
  margin-bottom: 10px;
}

.subtitle {
  color: var(--muted);
  margin-bottom: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.upload-card form {
  display: grid;
  gap: 12px;
}

.kb-picker {
  margin-top: 6px;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
}

.kb-picker select {
  margin-top: 0;
}

.file-picker {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-picker input {
  margin-top: 0;
  display: none;
}

.file-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result {
  margin-top: 14px;
  min-height: 44px;
  white-space: pre-wrap;
  background: #f9f5ec;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px;
}

.chat-page {
  height: 100vh;
  overflow: hidden;
}

.chat-layout {
  height: 100vh;
  display: grid;
  grid-template-columns: 20% 80%;
}

.chat-sidebar {
  border-right: 1px solid #1f3c63;
  background: linear-gradient(180deg, #0d2744 0%, #071a30 100%);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #d9e6f7;
}

.chat-sidebar label {
  color: #c2d7f1;
}

.chat-sidebar input,
.chat-sidebar select {
  background: #0f2d4f;
  border-color: #2d517d;
  color: #e7f0fd;
}

.chat-sidebar .eyebrow {
  color: #9fc2ec;
}

.sidebar-top h2 {
  margin: 4px 0 10px;
}

.sidebar-subtitle {
  font-size: 12px;
  color: #9ab0cc;
}

#newChatBtn {
  background: linear-gradient(180deg, #2a6fb4, #1f5f9b);
  color: #f6fbff;
  border: 1px solid #8fc0f0;
  box-shadow: 0 0 0 1px rgba(143, 192, 240, 0.2), 0 8px 16px rgba(8, 40, 76, 0.35);
  font-weight: 700;
}

#newChatBtn:hover {
  background: linear-gradient(180deg, #3381cd, #2a6fb4);
  box-shadow: 0 0 0 1px rgba(167, 208, 245, 0.35), 0 10px 18px rgba(8, 40, 76, 0.45);
}

.session-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.session-panel h3 {
  font-size: 15px;
  color: #d9e6f7;
}

.session-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 10px 4px;
}

.session-item {
  width: 100%;
  text-align: left;
  border-radius: 12px;
  border: 1px solid #294b74;
  background: #0f2d4f;
  color: #d9e6f7;
  padding: 10px;
}

.session-item.active {
  border-color: #4d84c2;
  background: #1b4270;
}

.session-title {
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-meta {
  font-size: 12px;
  color: #9ab0cc;
  margin-top: 5px;
}

.chat-main {
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #f7f9fc;
}

.chat-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header-spacer {
  flex: 1;
  min-width: 0;
}

.chat-header-btn {
  min-height: 40px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #ffffff;
  color: #0b63d8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  font-weight: 800;
  white-space: nowrap;
}

.chat-header-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-header-primary {
  color: #ffffff;
  background: #0b63d8;
  border-color: #0b63d8;
}

.chat-header-primary:hover {
  background: #0759c7;
}

.chat-header-logout:hover {
  background: #eef5ff;
}

.chat-header-logout {
  width: 40px;
  padding: 0;
}

.session-label {
  color: var(--muted);
  margin-top: 6px;
  font-size: 13px;
}

.filter-label {
  margin-top: 6px;
  font-size: 13px;
  color: #0b5cab;
  background: #edf4ff;
  border: 1px solid #bfd4f5;
  border-radius: 999px;
  padding: 4px 10px;
  display: inline-block;
  max-width: min(70vw, 880px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#clearHistoryBtn {
  background: var(--soft-btn-bg);
  border: 1px solid var(--soft-btn-border);
  color: var(--soft-btn-text);
}

.chat-messages {
  margin-top: 14px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #f9f5ec;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.chat-empty {
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.sidebar-profile {
  margin-top: 8px;
  border: 1px solid #27486f;
  background: #0a223d;
  border-radius: 10px;
  padding: 10px;
}

.profile-link {
  text-decoration: none;
  display: block;
}

.sidebar-bottom-entry {
  margin-top: auto;
}

.sidebar-bottom-entry .process-entry-btn + .process-entry-btn {
  margin-top: 8px;
}

.process-entry-btn {
  display: block;
  text-align: center;
  text-decoration: none;
  color: #f6fbff;
  border: 1px solid #5e8fbe;
  background: linear-gradient(180deg, #12365f, #0f2f54);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(201, 223, 247, 0.18);
}

.process-entry-btn:hover {
  background: linear-gradient(180deg, #1a4779, #163f6e);
  border-color: #7ba9d4;
}

.profile-name {
  color: #e9f2ff;
  font-weight: 600;
}

.profile-email {
  color: #9ab0cc;
  font-size: 12px;
  margin-top: 2px;
}

.sidebar-logout-btn {
  margin-top: 10px;
  width: 100%;
  border: 1px solid #3f658f;
  border-radius: 10px;
  padding: 9px 12px;
  color: #d6e6fa;
  background: #0a223d;
  text-align: center;
}

.sidebar-logout-btn:hover {
  background: #103051;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.message.user {
  justify-content: flex-end;
}

.message.assistant {
  justify-content: flex-start;
}

.bubble {
  width: min(86%, 860px);
  border-radius: 14px;
  padding: 10px 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.message.user .bubble {
  background: #0a9396;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.message.assistant .bubble {
  background: #fffdf8;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.bubble-time {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.message.user .bubble-time {
  color: rgba(230, 244, 255, 0.92);
}

.message-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 400;
  flex-shrink: 0;
}

.message-avatar.user {
  background: #101828;
  color: #fff;
}

.message-avatar.assistant {
  background: #eadbff;
  color: #7d4cb2;
}

.bubble-head {
  margin-bottom: 6px;
}

.bubble-kb-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid #bfd4f5;
  background: #edf4ff;
  color: #1f5f9b;
  font-weight: 400;
}

.message.user .bubble-kb-tag {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.2);
  color: #f6fbff;
}

.bubble-loading {
  color: #5d6b7a;
  font-size: 14px;
}

.bubble-citations {
  margin: 10px 0 0;
  padding-left: 18px;
}

.bubble-previews {
  margin-top: 10px;
  background: #f3f0e8;
  border: 1px solid #ddd5c8;
  border-radius: 10px;
  padding: 8px 10px;
}

.bubble-previews-title {
  font-size: 12px;
  color: #5d6b7a;
  margin-bottom: 6px;
}

.bubble-previews ul {
  margin: 0;
  padding-left: 18px;
}

.bubble-previews li {
  font-size: 13px;
  line-height: 1.5;
}

.table-wrap,
.chart-wrap {
  margin-top: 12px;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  background: #fffdf8;
}

.table-wrap th,
.table-wrap td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  font-size: 14px;
}

.table-wrap thead th {
  background: #f1ece1;
}

.chart-wrap {
  background: #fffdf8;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}

.chart-canvas {
  width: 100%;
  height: auto;
  display: block;
}

.chat-composer {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: end;
  position: relative;
}

.chat-composer textarea {
  margin-top: 0;
  min-height: 72px;
  resize: vertical;
  padding-right: 82px;
}

.kb-switch-bar {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.kb-switch-label {
  font-size: 13px;
  color: #5d6b7a;
  margin-right: 2px;
}

.kb-switch-btn {
  min-width: 88px;
  height: 34px;
  padding: 0 12px;
}

.kb-switch-btn.active {
  background: #2a6fb4;
  border-color: #8fc0f0;
  color: #f6fbff;
}

.process-grid-form {
  display: grid;
  gap: 10px;
}

.process-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.step-chip {
  font-size: 12px;
  color: #0b5cab;
  background: #edf4ff;
  border: 1px solid #bfd4f5;
  border-radius: 999px;
  padding: 4px 10px;
}

.checklist-tools {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.checklist-tools button {
  padding: 6px 12px;
  border-radius: 8px;
}

.review-layout {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checklist {
  max-height: 420px;
  overflow: auto;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 10px;
  background: #f9f5ec;
}

.check-item {
  background: #fffdf8;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}

.check-item label {
  color: var(--ink);
}

.muted-line {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0;
}

.bubble-citations-card {
  list-style: none;
  padding-left: 0;
}

.bubble-citations-card li {
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f9f5ec;
  padding: 8px;
}

.citation-snippet-btn {
  margin-top: 6px;
  width: 100%;
  text-align: left;
  line-height: 1.45;
  white-space: normal;
  color: #145a9e;
  font-weight: 400;
}

.citation-snippet {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.result-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid transparent;
}

.result-pill.通过 {
  color: #14532d;
  background: #dcfce7;
  border-color: #86efac;
}

.result-pill.风险 {
  color: #854d0e;
  background: #fef3c7;
  border-color: #fcd34d;
}

.result-pill.不通过 {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fca5a5;
}

.sections-viewer {
  max-height: 420px;
  overflow: auto;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 10px;
  background: #f9f5ec;
}

.section-block {
  background: #fffdf8;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}

.section-block h4 {
  margin: 0 0 8px;
}

.section-block pre {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
  line-height: 1.6;
}

.source-view-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 12px;
}

.source-doc-pane h3,
.source-hit-pane h3 {
  margin-bottom: 8px;
}

.active-chunk {
  border-color: #0f7bd9;
  background: #edf4ff;
}

.source-page .page {
  width: min(98vw, 1800px);
  max-width: none;
  padding-top: 16px;
}

@media (max-width: 960px) {
  .chat-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: 100vh;
  }

  .chat-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    max-height: 42vh;
  }

  .chat-main {
    min-height: 0;
  }

  .chat-composer {
    grid-template-columns: 1fr;
  }

  .chat-header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .review-layout {
    grid-template-columns: 1fr;
  }

  .source-view-layout {
    grid-template-columns: 1fr;
  }

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

  .file-status {
    white-space: normal;
  }
}



/* Formal theme overrides */
:root {
  --bg: #f4f7fb;
  --ink: #1f2937;
  --muted: #667085;
  --accent: #0b5cab;
  --accent-2: #0f7bd9;
  --soft-btn-bg: #e7f2ff;
  --soft-btn-bg-hover: #d8eaff;
  --soft-btn-border: #b8d5f6;
  --soft-btn-text: #1f5f9b;
  --danger: #b42318;
  --card: #ffffff;
  --border: #d0d7e2;
}

body {
  background: var(--bg);
  font-family: "Noto Sans SC", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

button,
.link-btn {
  border: 1px solid var(--soft-btn-border);
  border-radius: 8px;
  background: var(--soft-btn-bg);
  color: var(--soft-btn-text);
}

.card {
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.filter-label,
.step-chip {
  color: #0b5cab;
  background: #edf4ff;
  border-color: #bfd4f5;
}

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

.kb-files-layout {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.kb-file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #f8fafc;
  max-height: 180px;
  overflow: auto;
}

.kb-file-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #e5eaf2;
}

.kb-file-item:last-child {
  border-bottom: 0;
}

.kb-file-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-view-layout {
  grid-template-columns: 1.6fr 1fr;
}

.source-doc-pane .sections-viewer,
.source-hit-pane .sections-viewer {
  max-height: calc(100vh - 260px);
}

.active-chunk {
  border-color: #0f7bd9;
  background: #edf4ff;
}

.source-page .page {
  width: min(98vw, 1800px);
  max-width: none;
  padding-top: 16px;
}

@media (max-width: 960px) {
  .kb-files-layout {
    grid-template-columns: 1fr;
  }
}

.hidden {
  display: none !important;
}

.kb-admin-page {
  margin: 0;
  min-height: 100vh;
  background: #f4f7fb;
}

.kb-admin-root {
  min-height: 100vh;
  width: 100%;
  padding: 16px 18px;
}

.kb-home-header,
.kb-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.kb-home-header {
  justify-content: flex-start;
}

.kb-home-header h1 {
  margin: 0;
  font-size: 32px;
}

.kb-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 340px));
  gap: 14px;
}

.kb-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  min-height: 190px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kb-card h3 {
  margin: 0 0 8px;
  font-size: 28px;
}

.kb-card p {
  color: var(--muted);
}

.kb-card button {
  width: 140px;
}

.kb-card-add {
  border: 2px dashed #94b6df;
  background: #f8fbff;
}

.kb-card-add h3 {
  font-size: 46px;
  margin-bottom: 0;
}

.kb-detail-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kb-detail-left h2 {
  margin: 0;
  font-size: 30px;
}

.kb-detail-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.file-upload-btn {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--soft-btn-border);
  border-radius: 8px;
  padding: 10px 16px;
  color: var(--soft-btn-text);
  background: var(--soft-btn-bg);
  font-weight: 600;
}

.file-upload-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-upload-btn.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.kb-upload-status {
  margin: -4px 0 12px;
  border: 1px solid #f9d486;
  border-radius: 8px;
  background: #fff8e6;
  color: #9a6700;
  padding: 8px 12px;
  font-size: 13px;
}

.kb-upload-status.is-uploading {
  border-color: #90caf9;
  background: #e8f4ff;
  color: #0c4a6e;
}

.kb-table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  overflow: auto;
  max-height: calc(100vh - 190px);
}

.kb-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.kb-table th,
.kb-table td {
  border-bottom: 1px solid #e8edf5;
  border-right: 1px solid #edf1f7;
  text-align: left;
  padding: 10px 12px;
  font-size: 14px;
}

.kb-table th {
  position: sticky;
  top: 0;
  background: #f8fafd;
  z-index: 1;
}

.kb-table td:last-child,
.kb-table th:last-child {
  border-right: 0;
}

.kb-table td:nth-child(1) {
  max-width: 520px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kb-empty {
  text-align: center !important;
  color: var(--muted);
}

.table-btn {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  margin-right: 6px;
}

.table-view {
  background: var(--soft-btn-bg);
  border: 1px solid var(--soft-btn-border);
  color: var(--soft-btn-text);
}

.table-del {
  background: var(--soft-btn-bg);
  border: 1px solid var(--soft-btn-border);
  color: var(--soft-btn-text);
}

.kb-pager {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.process-design-page {
  width: min(98vw, 1800px);
  max-width: none;
}

.process-design-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.process-tab-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 14px;
}

.process-tab-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.process-tab-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.process-tab-top h3 {
  margin: 0;
  font-size: 22px;
}

.process-tab-top span {
  color: #56667f;
  font-size: 12px;
  border: 1px solid #d4deeb;
  border-radius: 999px;
  padding: 2px 8px;
}

.process-tab-card p {
  color: var(--muted);
  margin: 10px 0 16px;
}

.process-tab-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

@media (max-width: 1200px) {
  .kb-cards {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

@media (max-width: 720px) {
  .kb-cards {
    grid-template-columns: 1fr;
  }

  .process-tab-grid {
    grid-template-columns: 1fr;
  }
}

.spec-main {
  width: 100%;
  padding: 18px 24px;
  height: 100vh;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.spec-header h1 {
  margin: 0;
  font-size: 34px;
}

.spec-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.spec-search-bar {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.spec-search-bar input {
  margin-top: 0;
  height: 48px;
}

.spec-search-bar button {
  min-width: 110px;
}

.spec-search-layout {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 12px;
  min-height: calc(100vh - 220px);
}

.spec-banner {
  margin-top: 12px;
  border: 1px solid #e5d9ef;
  background: #f8f2fb;
  color: #6b4b85;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

.spec-count-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.spec-count-grid article {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  text-align: center;
  padding: 16px 10px;
}

.spec-count-grid h3 {
  margin: 0;
  font-size: 36px;
  color: #2057a4;
}

.spec-count-grid p {
  margin: 6px 0 0;
  color: #56667f;
}

.spec-tabs-wrap {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}

.case-tabs-wrap {
  border: 0;
  background: transparent;
  padding: 0;
}

.spec-rect-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.case-overview-tabs {
  grid-template-columns: 1fr 1fr;
}

.spec-rect-tab {
  border: 1px solid #d8e2ef;
  border-radius: 10px;
  background: #fbfdff;
  padding: 12px;
}

.spec-rect-tab h3 {
  margin: 0 0 10px;
  font-size: 22px;
}

.spec-tab-content {
  min-height: 160px;
}

.spec-tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.spec-tag-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e2e8f3;
  border-radius: 999px;
  background: #f8fafd;
  padding: 8px 12px;
  color: #2a3b55;
}

.spec-tag-item em {
  font-style: normal;
  color: #5c6f8a;
  border-left: 1px solid #dce4f0;
  padding-left: 8px;
}

.spec-filter-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  overflow: auto;
}

.spec-filter-panel h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

.spec-filter-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.spec-filter-group {
  border-top: 1px solid #edf1f7;
  padding: 10px 0;
}

.spec-filter-group h4 {
  margin: 0 0 8px;
  font-size: 18px;
}

.spec-filter-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: #2a3b55;
}

.spec-filter-item input {
  width: 16px;
  height: 16px;
}

.spec-filter-item em {
  font-style: normal;
  color: #667085;
}

.spec-result-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  overflow: auto;
}

.spec-result-summary {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
}

.spec-result-card {
  border: 1px solid #dfe7f2;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.spec-result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.spec-result-head h3 {
  margin: 0;
  font-size: 36px;
}

.spec-result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spec-rel {
  color: #2063b2;
  background: #e8f2ff;
  border: 1px solid #c3d9f6;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 600;
}

.spec-result-tags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spec-result-tags span {
  border: 1px solid #e2e8f3;
  border-radius: 8px;
  background: #f8fafd;
  padding: 6px 10px;
  font-size: 13px;
  color: #2a3b55;
}

.spec-result-snippet {
  margin-top: 10px;
  background: #f8fbff;
  border: 1px solid #e3ebf7;
  border-radius: 8px;
  padding: 10px;
  white-space: pre-wrap;
  line-height: 1.6;
  font: inherit;
}

@media (max-width: 1100px) {
  .spec-search-layout {
    grid-template-columns: 1fr;
  }

  .spec-count-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .spec-rect-tabs {
    grid-template-columns: 1fr;
  }
}

/* Unified app navigation */
.app-page {
  min-height: 100vh;
  overflow: hidden;
  background: #f5f7fb;
}

.app-shell {
  --app-sidebar-width: 236px;
  --app-secondary-width: 0px;
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--app-sidebar-width) var(--app-secondary-width) minmax(0, 1fr);
  grid-template-rows: 64px minmax(0, 1fr);
  background: #f5f7fb;
}

.app-shell.app-sidebar-collapsed {
  --app-sidebar-width: 72px;
}

.app-sidebar {
  grid-column: 1;
  grid-row: 1 / -1;
  width: var(--app-sidebar-width);
  height: 100vh;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid #e3e9f2;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  overflow: hidden;
  transition: width 0.18s ease;
}

.app-topbar {
  grid-column: 2 / -1;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  border-bottom: 1px solid #e3e9f2;
  background: #ffffff;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 32px;
  z-index: 8;
}

.app-feature-switch-wrap {
  position: relative;
  min-width: 0;
}

.app-feature-switch {
  position: relative;
}

.app-feature-switch summary {
  min-width: 170px;
  min-height: 44px;
  border-radius: 8px;
  color: #172b4d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 400;
}

.app-feature-switch summary::-webkit-details-marker {
  display: none;
}

.app-feature-switch summary:hover,
.app-feature-switch[open] summary {
  color: #0b63d8;
  background: #f2f7ff;
}

.app-feature-switch summary svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-feature-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 220px;
  border: 1px solid #dce6f3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
  padding: 8px;
  z-index: 20;
}

.app-feature-option {
  min-height: 40px;
  border-radius: 8px;
  color: #26364f;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  text-decoration: none;
  font-size: 14px;
}

.app-feature-option:hover,
.app-feature-option.active {
  color: #0b63d8;
  background: #eaf2ff;
}

.app-feature-option-icon {
  width: 18px;
  height: 18px;
  color: #98a2b3;
  display: inline-grid;
  place-items: center;
}

.app-feature-option-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-feature-option:hover .app-feature-option-icon,
.app-feature-option.active .app-feature-option-icon {
  color: #0b63d8;
}

.app-sub-feature-tabs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-sub-feature-link {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #4c5f7a;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
}

.app-sub-feature-link:hover {
  color: #0b63d8;
  background: #f2f7ff;
}

.app-sub-feature-link.active {
  color: #ffffff;
  background: #0b63d8;
  border-color: #0b63d8;
  box-shadow: 0 10px 20px rgba(11, 99, 216, 0.18);
}

.app-sub-feature-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
}

.app-sub-feature-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-topbar-spacer {
  flex: 1 1 auto;
  min-width: 20px;
}

.app-topbar-logout {
  width: 42px;
  height: 42px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  color: #0b63d8;
  background: #f6faff;
  display: grid;
  place-items: center;
  padding: 0;
  flex: 0 0 auto;
}

.app-topbar-logout:hover {
  background: #eaf2ff;
  border-color: #9ec7ff;
}

.app-topbar-logout svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-brand-panel {
  position: relative;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #eef2f7;
  padding: 2px 42px 14px 8px;
}

.app-logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #1a6ee6, #0047ab);
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
}

.app-brand-panel strong,
.app-brand-panel span {
  display: block;
}

.app-brand-panel strong {
  color: #172b4d;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
}

.app-brand-panel span {
  margin-top: 3px;
  color: #7a8aa0;
  font-size: 12px;
}

.app-sidebar-toggle {
  position: absolute;
  top: 16px;
  right: 6px;
  width: 30px;
  height: 30px;
  border: 1px solid #cfe0ff;
  border-radius: 7px;
  color: #0b63d8;
  background: #f4f8ff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 0;
}

.app-sidebar-toggle svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s ease;
}

.app-sidebar-toggle:hover {
  background: #eaf2ff;
}

.app-feature-nav {
  display: grid;
  gap: 4px;
  padding: 14px 0 10px;
}

.app-nav-item {
  position: relative;
  min-width: 0;
}

.app-nav-link {
  position: relative;
  min-height: 44px;
  border-radius: 8px;
  color: #26364f;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
}

.app-nav-item.has-action .app-nav-link {
  padding-right: 52px;
}

.app-nav-link:hover,
.app-nav-link.active {
  color: #0b63d8;
  background: #eaf2ff;
}

.app-nav-link.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 9px;
  bottom: 9px;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: #0b63d8;
}

.app-nav-icon {
  width: 20px;
  height: 20px;
  color: #98a2b3;
  display: inline-grid;
  place-items: center;
}

.app-nav-icon svg,
.app-logout-btn svg,
.kb-upload-symbol svg,
.kb-file-delete-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-nav-link:hover .app-nav-icon,
.app-nav-link.active .app-nav-icon {
  color: #0b63d8;
}

.app-nav-action-btn,
.app-sidebar #newChatBtn.app-nav-action-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 32px;
  height: 32px;
  min-height: 0;
  border: 1px solid #b8d4ff;
  border-radius: 8px;
  color: #0b63d8;
  background: #ffffff;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  font-weight: 500;
  transform: translateY(-50%);
  box-shadow: none;
}

.app-nav-action-btn:hover,
.app-sidebar #newChatBtn.app-nav-action-btn:hover {
  color: #ffffff;
  background: #0b63d8;
  border-color: #0b63d8;
}

.app-sidebar-slot {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid #eef2f7;
  padding-top: 12px;
}

.app-sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.app-user-menu {
  border: 1px solid #dfe6f0;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 0;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.app-user-menu-link {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 0;
  color: #26364f;
  background: transparent;
  display: flex;
  align-items: center;
  padding: 0 14px;
  text-align: left;
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
}

.app-user-menu-link:hover {
  color: #0b63d8;
  background: #f5f8ff;
}

.app-user-menu-logout {
  margin-top: 6px;
  border-top: 1px solid #eef2f7;
  color: #e5484d;
  padding-top: 6px;
}

.app-user-menu-logout:hover {
  color: #d92d20;
  background: #fff6f6;
}

.app-user-bar {
  min-width: 0;
  min-height: 58px;
  border-top: 1px solid #eef2f7;
  color: #172b4d;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
}

.app-user-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: #ffffff;
  background: #1a6ee6;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 500;
}

.app-user-avatar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 9px;
  height: 9px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #22c55e;
}

.app-user-text {
  min-width: 0;
}

.app-user-text strong,
.app-user-text small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-user-text strong {
  color: #172b4d;
  font-size: 15px;
  font-weight: 500;
}

.app-user-text small {
  margin-top: 2px;
  color: #7a8aa0;
  font-size: 13px;
}

.app-user-chevron {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #0b63d8;
  display: grid;
  place-items: center;
  padding: 0;
}

.app-user-chevron:hover {
  background: #eef5ff;
}

.app-user-chevron svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s ease;
}

.app-sidebar.is-user-menu-collapsed .app-user-menu {
  display: none;
}

.app-sidebar.is-user-menu-collapsed .app-user-chevron svg {
  transform: rotate(180deg);
}

.app-content-main {
  grid-column: 2 / -1;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  height: auto;
  overflow: auto;
}

.app-sidebar-with-session {
  width: var(--app-sidebar-width, 292px);
}

.app-sidebar-with-session + .app-content-main {
  min-width: 0;
}

.chat-app-shell {
  --app-sidebar-width: 236px;
  --app-secondary-width: 348px;
}

.chat-app-shell.app-sidebar-collapsed {
  --app-sidebar-width: 72px;
}

.app-chat-secondary {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid #e3e9f2;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 26px 18px 14px;
  overflow: hidden;
}

.chat-app-shell .app-content-main {
  grid-column: 3;
  grid-row: 2;
}

.chat-secondary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.chat-secondary-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-secondary-title strong {
  color: #344054;
  font-size: 14px;
  font-weight: 400;
}

.chat-secondary-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: #ffffff;
  background: #0b63d8;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 20px rgba(11, 99, 216, 0.18);
}

.chat-secondary-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#newChatBtn.chat-secondary-new-btn {
  width: 42px;
  height: 42px;
  min-height: 0;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  color: #0b63d8;
  background: #eef5ff;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 24px;
  line-height: 1;
  font-weight: 400;
  box-shadow: none;
}

#newChatBtn.chat-secondary-new-btn:hover {
  color: #ffffff;
  background: #0b63d8;
  border-color: #0b63d8;
}

.chat-session-search {
  min-height: 52px;
  border: 1px solid #dce6f3;
  border-radius: 12px;
  color: #98a2b3;
  background: #fbfdff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}

.chat-session-search svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-session-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: #26364f;
  background: transparent;
  font: inherit;
}

.app-chat-secondary .session-panel {
  flex: 1;
  min-height: 0;
}

.app-chat-secondary .session-panel h3 {
  color: #26364f;
  font-size: 13px;
  font-weight: 400;
}

.app-chat-secondary .session-list {
  gap: 6px;
}

.app-chat-secondary .session-empty {
  color: #667085;
}

.app-chat-secondary .session-item {
  border: 1px solid transparent;
  border-radius: 8px;
  color: #26364f;
  background: transparent;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 400;
}

.app-chat-secondary .session-item:hover,
.app-chat-secondary .session-item.active {
  color: #26364f;
  background: #eef5ff;
}

.app-chat-secondary .session-title {
  color: inherit;
  font-weight: 400;
}

.app-chat-secondary .session-meta {
  color: #8a9bb0;
  font-size: 12px;
}

.app-chat-secondary #clearHistoryBtn.app-clear-chat-btn {
  min-height: 42px;
  border: 1px solid #bfd7ff;
  border-radius: 8px;
  color: #0b63d8;
  background: #f8fbff;
  font-weight: 400;
}

.app-chat-secondary #clearHistoryBtn.app-clear-chat-btn:hover {
  color: #0759c7;
  background: #edf5ff;
  border-color: #91bdff;
}

.app-session-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-new-chat-btn,
.app-clear-chat-btn {
  width: 100%;
  min-height: 40px;
  border-radius: 8px;
  font-weight: 400;
}

.app-sidebar #newChatBtn.app-new-chat-btn {
  color: #0b63d8;
  border-color: #cfe0ff;
  background: #f3f7ff;
  box-shadow: none;
}

.app-sidebar #newChatBtn.app-new-chat-btn:hover {
  color: #0b63d8;
  background: #eaf2ff;
}

.app-sidebar .session-panel {
  flex: 1;
  min-height: 0;
}

.app-sidebar .session-panel h3 {
  color: #667085;
  font-size: 13px;
  font-weight: 400;
}

.app-sidebar .session-list {
  gap: 5px;
}

.app-sidebar .session-empty {
  border: 1px solid #e6eaf0;
  border-radius: 8px;
  color: #667085;
  background: #fafbfc;
}

.app-sidebar .session-item {
  border: 1px solid transparent;
  border-radius: 8px;
  color: #344054;
  background: transparent;
  padding: 8px 9px;
}

.app-sidebar .session-item:hover,
.app-sidebar .session-item.active {
  color: #0b63d8;
  border-color: transparent;
  background: #eef5ff;
}

.app-sidebar .session-title {
  color: #0b63d8;
  font-weight: 400;
}

.app-sidebar .session-meta {
  color: #98a2b3;
}

.app-sidebar .sidebar-kb-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 0;
}

.app-sidebar .kb-switch-label {
  grid-column: 1 / -1;
  color: #667085;
  font-weight: 400;
}

.app-sidebar .kb-switch-btn {
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  color: #2563eb;
  background: #f8fbff;
}

.app-sidebar .kb-switch-btn.active {
  color: #ffffff;
  background: #0b63d8;
  border-color: #0b63d8;
}

.app-sidebar #clearHistoryBtn.app-clear-chat-btn {
  min-height: 42px;
  color: #0b63d8;
  font-weight: 400;
  background: #f8fbff;
  border: 1px solid #bfd7ff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.app-sidebar #clearHistoryBtn.app-clear-chat-btn:hover {
  color: #0759c7;
  background: #edf5ff;
  border-color: #91bdff;
}

.app-sidebar.is-collapsed {
  padding-left: 8px;
  padding-right: 8px;
}

.app-sidebar.is-collapsed .app-brand-panel {
  min-height: 94px;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 2px 0 10px;
}

.app-sidebar.is-collapsed .app-brand-text,
.app-sidebar.is-collapsed .app-nav-label,
.app-sidebar.is-collapsed .app-user-menu,
.app-sidebar.is-collapsed .app-user-text,
.app-sidebar.is-collapsed .app-user-chevron,
.app-sidebar.is-collapsed .app-sidebar-slot {
  display: none;
}

.app-sidebar.is-collapsed .app-sidebar-toggle {
  position: static;
  flex: 0 0 auto;
}

.app-sidebar.is-collapsed .app-sidebar-toggle svg {
  transform: rotate(180deg);
}

.app-sidebar.is-collapsed .app-nav-link {
  justify-content: center;
  padding: 0;
}

.app-sidebar.is-collapsed .app-nav-link.active::before {
  left: -8px;
}

.app-sidebar.is-collapsed .app-nav-item.has-action .app-nav-link {
  padding-right: 0;
}

.app-sidebar.is-collapsed .app-nav-action-btn,
.app-sidebar.is-collapsed #newChatBtn.app-nav-action-btn {
  display: none;
}

.app-sidebar.is-collapsed .app-sidebar-bottom {
  align-items: center;
}

.app-sidebar.is-collapsed .app-user-bar {
  width: 44px;
  min-height: 44px;
  border-top: 0;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 0;
}

.app-sidebar.is-collapsed .app-user-avatar {
  width: 40px;
  height: 40px;
}

/* AI chat workspace */
.app-shell .chat-main {
  padding: 0 18px 18px;
  background: #ffffff;
}

.app-shell .chat-main-header {
  min-height: 54px;
  border-bottom-color: #dfe7f2;
  justify-content: flex-end;
}

.app-shell .chat-main-header h1 {
  color: #111827;
  font-size: 28px;
  letter-spacing: 0;
}

.app-shell .chat-messages {
  margin-top: 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: #26364f;
  font-size: 13px;
  font-weight: 400;
  padding: 10px 0 0;
}

.app-shell .chat-messages .message {
  gap: 8px;
}

.app-shell .chat-messages .bubble,
.app-shell .chat-messages .bubble * {
  font-weight: 400;
}

.app-shell .chat-messages .bubble {
  font-size: 13px;
}

.app-shell .chat-messages .message.user .bubble,
.app-shell .chat-messages .message.assistant .bubble,
.app-shell .chat-messages .bubble-citations-card li,
.app-shell .chat-messages .chart-wrap,
.app-shell .chat-messages .table-wrap table {
  color: #26364f;
  background: #ffffff;
}

.app-shell .chat-messages .message.user .bubble,
.app-shell .chat-messages .message.assistant .bubble {
  border: 0;
  border-radius: 0;
  padding: 4px 0;
}

.app-shell .chat-messages .message.user .bubble {
  width: auto;
  max-width: min(68%, 760px);
  border-radius: 14px;
  color: #1d2939;
  background: #f3f4f6;
  padding: 9px 13px;
}

.app-shell .chat-messages .message.user .bubble-content {
  line-height: 1.5;
}

.app-shell .chat-messages .message.assistant .bubble {
  width: min(88%, 920px);
}

.app-shell .chat-messages .bubble-citations-card li,
.app-shell .chat-messages .bubble-previews,
.app-shell .chat-messages .chart-wrap {
  border: 0;
  border-radius: 0;
  padding: 4px 0;
}

.app-shell .chat-messages .bubble-previews,
.app-shell .chat-messages .chart-wrap {
  background: #ffffff;
}

.app-shell .chat-messages .citation-snippet-btn {
  width: auto;
  min-height: 0;
  border: 0;
  color: #26364f;
  background: #ffffff;
  font-size: 13px;
  font-weight: 400;
  padding: 0;
  text-align: left;
}

.app-shell .chat-messages .citation-snippet-btn:hover {
  color: #0b63d8;
  background: transparent;
}

.app-shell .chat-messages .bubble-time {
  color: #4c5f7a;
  font-size: 12px;
}

.app-shell .chat-messages .message.user .bubble-time {
  color: #667085;
}

.app-shell .chat-messages .bubble-attachment-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.app-shell .chat-messages .bubble-attachment-summary span {
  max-width: 220px;
  border-radius: 999px;
  color: #475467;
  background: #e9edf3;
  display: inline-block;
  padding: 3px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.app-shell .chat-composer {
  align-items: stretch;
  grid-template-columns: 1fr;
  gap: 0;
  background: #ffffff;
}

.app-shell .chat-composer textarea {
  min-height: 96px;
  border-radius: 8px;
  background: #ffffff;
  resize: vertical;
  padding: 14px 132px 58px 18px;
}

.app-shell .chat-composer .chat-attachment-input {
  display: none;
}

.app-shell .chat-composer .chat-attachment-btn {
  position: absolute;
  left: 18px;
  bottom: 16px;
  width: 38px;
  height: 38px;
  min-width: 0;
  min-height: 0;
  border: 1px solid #d8e1ee;
  border-radius: 10px;
  color: #475467;
  background: #ffffff;
  display: grid;
  place-items: center;
  padding: 0;
  font-weight: 400;
}

.app-shell .chat-composer .chat-attachment-btn:hover {
  color: #0b63d8;
  background: #eef5ff;
  border-color: #b8d4ff;
}

.app-shell .chat-composer .chat-attachment-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell .chat-composer .chat-attachment-list {
  position: absolute;
  left: 64px;
  right: 118px;
  bottom: 17px;
  min-width: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.app-shell .chat-composer .chat-attachment-chip {
  max-width: 180px;
  height: 30px;
  border: 1px solid #d8e1ee;
  border-radius: 999px;
  color: #344054;
  background: #f8fafc;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 6px 0 10px;
  flex: 0 0 auto;
  font-size: 12px;
}

.app-shell .chat-composer .chat-attachment-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell .chat-composer .chat-attachment-chip small {
  color: #98a2b3;
  font-size: 11px;
  white-space: nowrap;
}

.app-shell .chat-composer .chat-attachment-remove {
  width: 20px;
  height: 20px;
  min-height: 0;
  border: 0;
  border-radius: 999px;
  color: #667085;
  background: transparent;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  font-weight: 400;
}

.app-shell .chat-composer .chat-attachment-remove:hover {
  color: #0b63d8;
  background: #eaf2ff;
}

.app-shell .chat-composer .chat-send-icon-btn {
  position: absolute;
  right: 18px;
  bottom: 16px;
  width: 38px;
  height: 38px;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 999px;
  color: #9aa7b8;
  background: #f1f4f8;
  display: grid;
  place-items: center;
  padding: 0;
  font-weight: 400;
}

.app-shell .chat-composer::after {
  content: "";
  position: absolute;
  right: 108px;
  bottom: 17px;
  width: 1px;
  height: 36px;
  background: #e4e9f1;
}

.app-shell .chat-composer .chat-voice-btn {
  position: absolute;
  right: 64px;
  bottom: 16px;
  width: 38px;
  height: 38px;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 999px;
  color: #667085;
  background: transparent;
  display: grid;
  place-items: center;
  padding: 0;
  font-weight: 400;
}

.app-shell .chat-composer .chat-voice-btn:hover {
  color: #0b63d8;
  background: #eef5ff;
}

.app-shell .chat-composer .chat-voice-btn.is-recording {
  color: #ffffff;
  background: #e5484d;
}

.app-shell .chat-composer .chat-voice-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell .chat-composer .chat-send-icon-btn:hover {
  color: #ffffff;
  background: #0b63d8;
}

.app-shell .chat-composer .chat-send-icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell .chat-composer .chat-send-icon-btn:disabled {
  color: #9aa7b8;
  background: #f1f4f8;
}

/* Knowledge workbench */
.kb-workbench-main {
  padding: 24px;
  background: #f5f7fb;
}

.kb-tab-panel {
  min-height: 0;
}

.kb-tab-panel[hidden] {
  display: none !important;
}

.kb-workbench-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.kb-workbench-header h1 {
  color: #111827;
  font-size: 30px;
}

.kb-workbench-header p {
  margin-top: 6px;
  color: #667085;
}

.kb-workbench-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kb-workbench-actions button,
.kb-document-toolbar button {
  min-height: 38px;
  border-radius: 8px;
}

.kb-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.kb-stats-grid article {
  min-height: 86px;
  border: 1px solid #dfe7f2;
  border-radius: 8px;
  background: #ffffff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.035);
}

.kb-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
}

.kb-stat-icon.blue {
  color: #1d4ed8;
  background: #eaf2ff;
}

.kb-stat-icon.green {
  color: #059669;
  background: #e8fbf2;
}

.kb-stat-icon.orange {
  color: #d97706;
  background: #fff4df;
}

.kb-stat-icon.red {
  color: #dc2626;
  background: #fff1f2;
}

.kb-stats-grid small {
  color: #667085;
  font-size: 13px;
}

.kb-stats-grid strong {
  display: block;
  margin-top: 5px;
  color: #071a33;
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
}

.kb-console-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 20px;
  min-height: calc(100vh - 150px);
}

.kb-console-side {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 16px;
}

#kbUploadInput {
  display: none;
}

.kb-upload-dropzone {
  min-height: 126px;
  border: 1px dashed #bfd1e6;
  border-radius: 8px;
  color: #64748b;
  background: #ffffff;
  display: grid;
  place-items: center;
  gap: 6px;
  margin: 0;
  padding: 18px;
  text-align: center;
  cursor: pointer;
}

.kb-upload-dropzone:hover,
.kb-upload-dropzone.drag-over {
  border-color: #60a5fa;
  background: #f8fbff;
}

.kb-upload-dropzone.is-disabled {
  opacity: 0.65;
  pointer-events: none;
}

.kb-upload-symbol {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #2563eb;
  background: #eaf2ff;
  display: inline-grid;
  place-items: center;
}

.kb-upload-dropzone strong {
  color: #475569;
  font-size: 13px;
  font-weight: 400;
}

.kb-upload-dropzone small {
  color: #94a3b8;
  font-size: 12px;
}

.kb-side-card,
.kb-document-panel {
  border: 1px solid #dfe7f2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 32, 51, 0.04);
}

.kb-side-card {
  padding: 14px;
}

.kb-side-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kb-side-card-head span {
  color: #26384d;
  font-size: 15px;
  font-weight: 400;
}

.kb-mini-icon-btn {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: 8px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 20px;
}

.kb-category-list {
  display: grid;
  gap: 5px;
  margin-top: 12px;
}

.kb-category-row {
  display: grid;
  border-radius: 8px;
}

.kb-category-row.active {
  background: #eaf2ff;
}

.kb-category-main {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  color: #334155;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 400;
}

.kb-category-main:hover,
.kb-category-row.active .kb-category-main {
  color: #0b63d8;
  background: #eaf2ff;
}

.kb-category-main em {
  color: #0b63d8;
  font-style: normal;
  font-size: 12px;
  font-weight: 400;
}

.kb-document-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 18px;
}

.kb-document-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.kb-document-toolbar button {
  color: #ffffff;
  background: #0b63d8;
  font-weight: 400;
}

.kb-document-search {
  min-width: 0;
  height: 42px;
  border: 1px solid #d7e3f2;
  border-radius: 8px;
  background: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
}

.kb-document-search span {
  color: #64748b;
  font-size: 18px;
}

.kb-document-search input {
  min-width: 0;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  padding: 0;
}

.kb-file-table {
  min-width: 0;
  flex: 1;
  overflow: auto;
  border: 1px solid #e6edf5;
  border-radius: 8px;
}

.kb-file-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.7fr) 64px 82px 108px minmax(120px, 0.8fr) 88px 126px 124px;
  align-items: center;
  min-width: 980px;
  min-height: 52px;
  border-bottom: 1px solid #e6edf5;
}

.kb-file-row.head {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 44px;
  color: #53657a;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 400;
}

.kb-file-row > span {
  min-width: 0;
  padding: 0 14px;
  color: #475569;
  font-size: 13px;
  font-weight: 400;
}

.kb-file-row:not(.head):hover {
  background: #f8fbff;
}

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

.kb-file-name-cell > span:last-child {
  min-width: 0;
}

.kb-file-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #2563eb;
  background: #eaf2ff;
  display: inline-grid;
  place-items: center;
  font-style: normal;
}

.kb-file-title,
.kb-file-name-cell small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-file-title {
  color: #475569;
  font-size: 13px;
  font-weight: 400;
}

.kb-file-name-cell small {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 12px;
}

.kb-file-tags {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.kb-file-tags i,
.kb-file-tags em {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.kb-file-tags i {
  color: #1d4ed8;
  background: #eaf2ff;
}

.kb-file-tags em {
  color: #98a2b3;
  background: #f3f6fa;
}

.kb-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  color: #059669;
  background: #e8fbf2;
  font-size: 12px;
  font-style: normal;
}

.kb-status-pill.running {
  color: #b45309;
  background: #fff7ed;
}

.kb-status-pill.failed {
  color: #dc2626;
  background: #fff1f2;
}

.kb-file-actions-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.kb-file-open-btn,
.kb-file-download-btn,
.kb-file-delete-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  color: #0b63d8;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.kb-file-open-btn,
.kb-file-download-btn {
  color: #0b63d8;
}

.kb-file-open-btn:hover,
.kb-file-download-btn:hover {
  color: #0759c7;
  background: #eef5ff;
}

.kb-file-open-btn svg,
.kb-file-download-btn svg,
.kb-file-delete-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kb-file-delete-btn {
  color: #8a9bb0;
}

.kb-file-delete-btn:hover {
  color: #dc2626;
  background: #fff1f2;
}

.kb-table-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: #667085;
  font-size: 14px;
}

.kb-side-tag-list,
.kb-choice-list,
#pushCategoryFilters,
.kb-push-strategy-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kb-side-tag-list {
  margin-top: 12px;
}

.kb-side-tag-list button,
.kb-choice-list button,
#pushCategoryFilters button,
.kb-push-strategy-tabs button,
.kb-tag-cloud button {
  min-height: 32px;
  border: 1px solid #d9e5f4;
  border-radius: 8px;
  color: #344054;
  background: #f8fbff;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 400;
}

.kb-side-tag-list button.active,
.kb-choice-list button.active,
#pushCategoryFilters button.active,
.kb-push-strategy-tabs button.active {
  color: #0b63d8;
  border-color: #a8ccff;
  background: #eaf2ff;
}

.kb-side-tag-list em,
#pushCategoryFilters em {
  margin-left: 8px;
  color: #0b63d8;
  font-style: normal;
  font-size: 12px;
}

.kb-upload-status {
  border: 1px solid #d9e5f4;
  border-radius: 8px;
  color: #475467;
  background: #ffffff;
  padding: 10px 12px;
  white-space: pre-wrap;
  font-size: 13px;
}

.kb-upload-status.is-uploading {
  color: #0b63d8;
  background: #f3f8ff;
}

.kb-upload-meta-card {
  width: min(760px, 92vw);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.kb-upload-meta-head {
  flex: 0 0 auto;
  padding: 16px 16px 10px;
  border-bottom: 1px solid #eef2f7;
}

.kb-upload-meta-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 16px;
  padding: 14px 16px 8px;
}

.kb-upload-meta-card h3 {
  color: #172b4d;
  font-size: 20px;
  font-weight: 500;
}

.kb-upload-meta-card p {
  color: #667085;
  font-size: 13px;
}

.kb-upload-meta-card section {
  display: grid;
  gap: 10px;
}

.kb-upload-meta-card section > strong {
  color: #344054;
  font-size: 14px;
  font-weight: 400;
}

.kb-pending-file-list {
  display: grid;
  gap: 8px;
  max-height: min(320px, 38vh);
  overflow-y: auto;
  padding-right: 4px;
}

.kb-pending-file-list span {
  min-height: 34px;
  border: 1px solid #e1e8f2;
  border-radius: 8px;
  color: #344054;
  background: #f8fbff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  font-size: 13px;
}

.kb-pending-file-list em {
  color: #98a2b3;
  font-style: normal;
  white-space: nowrap;
}

.kb-custom-tag {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.kb-custom-tag input {
  margin: 0;
  background: #ffffff;
}

.kb-custom-tag button {
  min-height: 40px;
  font-weight: 400;
}

.modal-error {
  min-height: 20px;
  color: #dc2626;
  font-size: 13px;
}

.modal-error.is-info {
  color: #0b63d8;
}

.kb-upload-meta-card > .pre-modal-actions {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 12px 16px 16px;
  border-top: 1px solid #eef2f7;
  background: #ffffff;
}

.kb-feature-panel {
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  min-height: calc(100vh - 120px);
}

.kb-feature-panel.active {
  display: grid;
}

.kb-graph-panel,
.kb-graph-aside section,
.kb-security-main,
.kb-security-side section,
.kb-push-main,
.kb-push-side section,
.kb-permission-card,
.kb-push-control-panel,
.kb-push-filter-row,
.kb-push-queue-panel {
  border: 1px solid #dfe7f2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 32, 51, 0.04);
}

.kb-graph-panel,
.kb-security-main,
.kb-push-main {
  min-width: 0;
  padding: 18px;
}

.kb-graph-head,
.kb-section-title,
.kb-push-control-panel,
.kb-push-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.kb-graph-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.kb-graph-legend strong,
.kb-section-title strong,
.kb-push-control-panel strong,
.kb-push-filter-row strong,
.kb-security-side strong,
.kb-push-side strong {
  color: #344054;
  font-size: 13px;
  font-weight: 400;
}

.kb-graph-legend span {
  position: relative;
  color: #667085;
  font-size: 12px;
  padding-left: 14px;
}

.kb-graph-legend span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: #0b63d8;
}

.kb-graph-legend .tag::before {
  background: #f59e0b;
}

.kb-graph-legend .document::before {
  background: #ef4444;
}

.kb-graph-search {
  width: min(420px, 45%);
  height: 42px;
  border: 1px solid #d7e3f2;
  border-radius: 8px;
  color: #98a2b3;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.kb-graph-search input {
  height: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  padding: 0;
  outline: 0;
}

.kb-graph-controls,
.kb-graph-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.kb-graph-controls button {
  min-height: 32px;
  color: #344054;
  font-size: 13px;
  font-weight: 400;
}

.kb-graph-controls button.active {
  color: #0b63d8;
  background: #eaf2ff;
}

.kb-graph-metrics article,
.kb-permission-headline article,
.kb-push-stat-row article {
  min-width: 150px;
  border: 1px solid #e2eaf5;
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px 14px;
}

.kb-graph-metrics small,
.kb-permission-headline span,
.kb-push-stat-row span {
  color: #667085;
  font-size: 12px;
}

.kb-graph-metrics strong,
.kb-permission-headline strong,
.kb-push-stat-row strong {
  display: block;
  margin-top: 4px;
  color: #071a33;
  font-size: 22px;
  font-weight: 400;
}

.kb-graph-canvas {
  margin-top: 14px;
  min-height: 540px;
  overflow: hidden;
}

.kb-graph-svg {
  width: 100%;
  height: min(58vh, 560px);
  min-height: 480px;
}

.kb-graph-node {
  cursor: pointer;
}

.kb-graph-node circle {
  fill: #eff6ff;
  stroke: #0b63d8;
  stroke-width: 5;
}

.kb-graph-node.core circle {
  fill: #0b63d8;
}

.kb-graph-node.tag circle {
  fill: #fffbeb;
  stroke: #f59e0b;
}

.kb-graph-node.document circle {
  fill: #fff1f2;
  stroke: #ef4444;
}

.kb-graph-node text {
  fill: #475467;
  font-size: 11px;
  font-weight: 400;
  text-anchor: middle;
  dominant-baseline: middle;
}

.kb-graph-node.core text {
  fill: #ffffff;
}

.kb-graph-node .label {
  fill: #344054;
  font-size: 11px;
  font-weight: 400;
}

.kb-graph-aside,
.kb-security-side,
.kb-push-side {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 16px;
}

.kb-graph-aside section,
.kb-security-side section,
.kb-push-side section {
  padding: 18px;
}

.kb-graph-aside span,
.kb-section-title span {
  color: #667085;
  font-size: 13px;
}

.kb-graph-aside h3 {
  margin-top: 8px;
  color: #344054;
  font-size: 18px;
  font-weight: 400;
}

.kb-graph-aside p {
  margin-top: 8px;
  color: #667085;
  line-height: 1.6;
  font-size: 13px;
}

.kb-related-doc-list,
.kb-approval-list,
.kb-log-list,
.kb-push-queue-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.kb-related-doc-list button {
  border: 0;
  border-radius: 8px;
  color: #344054;
  background: #f8fbff;
  display: grid;
  gap: 4px;
  padding: 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 400;
}

.kb-related-doc-list small {
  color: #98a2b3;
  font-size: 12px;
  font-weight: 400;
}

.kb-security-main,
.kb-push-main {
  display: grid;
  align-content: start;
  gap: 16px;
}

.kb-permission-headline,
.kb-push-stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.kb-push-stat-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kb-permission-card,
.kb-push-control-panel,
.kb-push-filter-row,
.kb-push-queue-panel {
  padding: 18px;
}

.kb-permission-role-list {
  display: grid;
  margin-top: 14px;
}

.kb-permission-role-list article {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-top: 1px solid #eef2f7;
  padding: 16px 0;
}

.kb-permission-role-list article.active {
  border-left: 3px solid #0b63d8;
  border-radius: 8px;
  background: #f8fbff;
  padding-left: 12px;
}

.kb-role-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: #0b63d8;
  background: #eaf2ff;
  display: grid;
  place-items: center;
}

.kb-permission-role-list strong {
  color: #172b4d;
  font-weight: 500;
}

.kb-permission-role-list small {
  display: block;
  margin-top: 4px;
  color: #667085;
}

.kb-permission-role-list em {
  display: inline-block;
  margin: 8px 6px 0 0;
  border-radius: 6px;
  color: #344054;
  background: #eef3f8;
  padding: 3px 8px;
  font-style: normal;
  font-size: 12px;
}

.kb-permission-role-list article > button {
  min-width: 30px;
  min-height: 30px;
  border: 0;
  color: #98a2b3;
  background: transparent;
  padding: 0;
  font-weight: 400;
}

.kb-permission-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(96px, 1fr));
  margin-top: 14px;
  border: 1px solid #e4ebf5;
  border-radius: 8px;
  overflow: auto;
}

.kb-permission-grid > * {
  min-height: 42px;
  border-right: 1px solid #e4ebf5;
  border-bottom: 1px solid #e4ebf5;
  display: grid;
  place-items: center;
  padding: 8px;
  font-size: 13px;
}

.kb-permission-grid strong {
  color: #5e6f86;
  background: #f8fafc;
  font-weight: 400;
}

.kb-permission-grid i {
  color: #dc2626;
  background: #fff7f7;
  font-style: normal;
}

.kb-permission-grid i.ok {
  color: #059669;
  background: #f0fdf4;
}

.kb-security-side label {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.kb-security-side select {
  background: #ffffff;
}

.kb-security-result {
  margin-top: 12px;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.kb-security-result.ok {
  color: #047857;
  background: #ecfdf5;
}

.kb-security-result.deny {
  color: #b42318;
  background: #fff1f2;
}

.kb-security-result span,
.kb-approval-list small,
.kb-log-list small {
  color: #667085;
  font-size: 12px;
}

.kb-approval-list article,
.kb-log-list article {
  border: 1px solid #e6edf5;
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 10px;
}

.kb-log-list article {
  grid-template-columns: 1fr;
}

.kb-push-control-panel > div:first-child,
.kb-push-filter-row {
  min-width: 0;
}

.kb-push-control-panel span {
  display: block;
  margin-top: 5px;
  color: #667085;
  font-size: 13px;
}

.kb-push-queue-list article {
  border: 1px solid #e4ebf5;
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px 40px 40px;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
}

.kb-push-queue-list strong {
  color: #172b4d;
  font-weight: 500;
}

.kb-push-queue-list span,
.kb-push-queue-list small {
  display: block;
  margin-top: 5px;
  color: #667085;
}

.kb-push-queue-list i {
  display: block;
  width: 0;
  height: 6px;
  margin-top: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f9ca6, #0b63d8);
}

.kb-push-queue-list button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  color: #0b63d8;
  background: #eef5ff;
  padding: 0;
  font-weight: 400;
}

.kb-push-profile {
  min-height: 230px;
  display: grid;
  place-items: center;
  text-align: center;
}

.kb-push-profile span {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  color: #ffffff;
  background: #0b63d8;
  display: grid;
  place-items: center;
  font-size: 28px;
}

.kb-push-profile strong {
  margin-top: 20px;
}

.kb-push-profile small {
  color: #667085;
}

.kb-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.kb-interest-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  margin-top: 14px;
}

.kb-interest-add input {
  margin: 0;
  background: #ffffff;
}

.kb-interest-add button {
  min-height: 40px;
  padding: 0;
  font-weight: 400;
}

@media (max-width: 1180px) {
  .app-shell,
  .chat-app-shell {
    --app-secondary-width: 0px;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  .app-sidebar {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    height: auto;
    max-height: 42vh;
    border-right: 0;
    border-bottom: 1px solid #e3e9f2;
  }

  .app-topbar {
    grid-column: 1;
    grid-row: 2;
    padding: 0 16px;
    overflow-x: auto;
  }

  .app-content-main {
    grid-column: 1;
    grid-row: 3;
  }

  .app-chat-secondary {
    grid-column: 1;
    grid-row: 3;
    max-height: 38vh;
    border-right: 0;
    border-bottom: 1px solid #e3e9f2;
    padding: 18px;
  }

  .chat-app-shell .app-content-main {
    grid-column: 1;
    grid-row: 4;
  }

  .app-feature-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .app-nav-link {
    justify-content: center;
  }

  .app-sidebar-slot,
  .app-sidebar-bottom {
    display: none;
  }

  .kb-console-shell {
    grid-template-columns: 1fr;
  }

  .kb-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-feature-nav,
  .kb-stats-grid {
    grid-template-columns: 1fr;
  }

  .kb-workbench-header,
  .kb-workbench-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .kb-document-toolbar {
    grid-template-columns: 1fr;
  }

  .app-feature-switch summary {
    min-width: 160px;
  }

  .app-sub-feature-tabs {
    gap: 8px;
  }

  .app-sub-feature-link {
    padding: 0 12px;
    font-size: 14px;
  }
}


.pre-review-main {
  width: 100%;
  padding: 18px 24px;
  gap: 12px;
  height: auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.pre-head-card,
.pre-stats-card,
.pre-task-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  padding: 14px;
  margin-bottom: 12px;
}

.pre-head-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

#preChecklistPanel.pre-task-card {
  margin-bottom: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  min-height: calc(100vh - 56px);
  border-bottom: 1px solid #d8e2ef;
}

#preTaskPanel.pre-task-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  margin-bottom: 0;
}

.pre-head-left h1 {
  margin: 0;
  font-size: 38px;
}

.pre-head-left p {
  margin-top: 8px;
  color: var(--muted);
}

.pre-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pre-top-tabs {
  border: 1px solid #d8e2ef;
  border-radius: 10px;
  background: #f7f9fc;
  padding: 4px;
  display: flex;
  gap: 4px;
}

.pre-tab-btn {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #3d4d63;
  padding: 10px 14px;
}

.pre-tab-btn.active {
  background: #fff;
  border-color: #cfdced;
  color: #1f2937;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.pre-version-box {
  display: none !important;
  border: 1px solid #d8e2ef;
  border-radius: 10px;
  background: #f7f9fc;
  min-width: 118px;
  padding: 10px 12px;
  color: #3d4d63;
}

.pre-version-box span {
  display: block;
  font-size: 12px;
  color: #7a8ca6;
}

.pre-version-box strong {
  display: block;
  margin-top: 2px;
  font-size: 30px;
}

.pre-stats-head,
.pre-task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.pre-stats-head {
  justify-content: flex-end;
  align-items: flex-end;
}

.pre-stats-top-title {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 10px;
  color: #1f2937;
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
}

.pre-stats-head h2,
.pre-task-head h2 {
  margin: 0;
  font-size: 28px;
}

.pre-stats-tools,
.pre-task-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pre-stats-task-select {
  display: grid;
  gap: 6px;
  min-width: min(520px, 100%);
}

.pre-stats-task-select label {
  color: #5c6f8a;
  font-size: 13px;
}

.pre-stats-task-select select {
  margin-top: 0;
  width: min(520px, 100%);
  background: #fff;
}

.task-session-hidden {
  display: none !important;
}

.pre-task-tools button {
  white-space: nowrap;
  min-width: 72px;
  padding: 10px 14px;
}

.pre-stats-tools select {
  width: auto;
  margin-top: 0;
  min-width: 120px;
  background: #fff;
}

.pre-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pre-stat-block {
  border: 1px solid #dfe7f2;
  border-radius: 10px;
  background: #fbfdff;
  padding: 12px;
}

.pre-stat-label {
  color: #5c6f8a;
  font-size: 14px;
}

.pre-stat-value {
  margin-top: 4px;
  font-size: 42px;
  font-weight: 700;
  color: #1f2937;
}

.pre-stats-detail-panel {
  margin-top: 12px;
  border: 1px solid #dfe7f2;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.pre-stats-detail-head {
  min-height: 46px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #edf2f7;
}

.pre-stats-detail-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  color: #1f2937;
}

.pre-stats-opinion-list {
  max-height: calc(100vh - 410px);
  min-height: 220px;
  overflow: auto;
  padding: 10px 12px;
}

.pre-stats-opinion-item {
  border-bottom: 1px solid #edf2f7;
  padding: 10px 0;
}

.pre-stats-opinion-item:last-child {
  border-bottom: 0;
}

.pre-stats-opinion-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #1f2937;
  font-size: 14px;
}

.pre-stats-opinion-item p {
  margin: 6px 0 0;
  color: #4b5f78;
  font-size: 13px;
  line-height: 1.65;
}

.pre-pill-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pre-pill,
.pre-status,
.pre-tag {
  border: 1px solid #dbe5f1;
  border-radius: 999px;
  background: #f8fafc;
  color: #3b4b61;
  padding: 4px 10px;
  font-size: 12px;
}

.pre-pill.ok,
.pre-status.ok,
.pre-tag.ok {
  color: #166534;
  background: #e8f8ee;
  border-color: #b8e7c7;
}

.pre-pill.warn,
.pre-status.warn,
.pre-tag.warn {
  color: #9a3412;
  background: #fff7ed;
  border-color: #fed7aa;
}

.pre-task-list {
  border: 1px solid #e3ebf7;
  border-radius: 10px;
  background: #fbfdff;
  overflow: auto;
  max-height: calc(100vh - 430px);
}

.pre-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #ecf1f8;
  padding: 12px;
}

.pre-task-item:last-child {
  border-bottom: 0;
}

.pre-task-main {
  min-width: 0;
}

.pre-task-main h3 {
  margin: 0;
  font-size: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pre-task-main p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
}

.pre-task-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pre-checklist-layout {
  display: grid;
  grid-template-columns: 33% 67%;
  gap: 0;
  min-height: calc(100vh - 56px);
  height: calc(100vh - 56px);
  background: #fff;
}

.pre-check-left,
.pre-check-right {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 12px;
  min-height: 0;
  height: 100%;
}

.pre-check-left {
  border-right: 1px solid #d8e2ef;
  padding-right: 18px;
  display: flex;
  flex-direction: column;
}

.pre-check-right {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pre-check-left-head,
.pre-check-right-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pre-check-right-head {
  flex: 0 0 auto;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf2f7;
}

.pre-check-left-head h2,
.pre-check-right-head h2 {
  margin: 0;
  font-size: 22px;
}

.pre-check-left-search {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.pre-check-left-search input,
.pre-check-left-search select {
  margin-top: 0;
  background: #fff;
}

.pre-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 16px;
}

.pre-modal-card {
  width: min(560px, 100%);
  background: #fff;
  border: 1px solid #dfe7f2;
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.2);
  padding: 14px;
}

.pre-modal-card h3 {
  margin: 0;
  font-size: 20px;
}

.pre-modal-card p {
  margin: 8px 0 10px;
}

.pre-modal-card select {
  margin-top: 0;
  background: #fff;
}

.pre-modal-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.pre-modal-actions > button {
  min-width: 86px;
  height: 40px;
  padding: 0 14px;
}

.pre-modal-actions > .table-btn {
  margin-right: 0;
  font-size: 14px;
}

.pre-loading-card {
  width: min(320px, 100%);
  padding: 24px 22px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.pre-loading-card h3 {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 400;
  color: #102033;
}

.pre-loading-card p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.pre-loading-card .pre-modal-actions {
  justify-content: center;
  margin-top: 6px;
}

.pre-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #dbeafe;
  border-top-color: #0b63ce;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.pre-viewer-modal-card {
  width: calc(100vw - 40px);
  height: calc(100vh - 40px);
  background: #fff;
  border: 1px solid #dfe7f2;
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.2);
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.pre-viewer-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5edf7;
}

.pre-viewer-modal-head h3 {
  margin: 0;
  font-size: 22px;
}

.pre-dialog-close-btn {
  width: 34px;
  height: 34px;
  min-width: 0;
  padding: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.pre-dialog-close-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.pre-viewer-modal-body {
  margin-top: 10px;
  flex: 1;
  overflow: auto;
  border: 1px solid #e3ebf7;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.pre-viewer-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.pre-standard-list {
  margin-top: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 0 8px 0 0;
}

.pre-standard-item {
  width: 100%;
  text-align: left;
  border: 1px solid #dce6f3;
  background: #f8fbff;
  color: #1f2937;
  border-radius: 8px;
  padding: 7px 10px;
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px 32px;
  align-items: center;
  gap: 8px;
}

.pre-standard-item.active {
  border-color: #80a7da;
  background: #edf4ff;
}

.pre-standard-item.is-imported {
  border-color: #b8d5f6;
}

.pre-standard-main {
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  box-shadow: none;
}

.pre-standard-main:hover {
  background: transparent;
}

.pre-standard-item strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pre-standard-icon-btn {
  width: 32px;
  height: 30px;
  min-height: 0;
  border-radius: 7px;
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: none;
}

.pre-standard-icon-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pre-standard-icon-btn:disabled,
.pre-standard-icon-btn[aria-disabled="true"] {
  color: #667085;
  border-color: #d8e2ef;
  background: #f1f5f9;
  cursor: default;
}

.pre-standard-import-btn[title="导入中"] svg {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.pre-viewer-sections {
  max-height: min(72vh, 760px);
  overflow: auto;
  padding-right: 8px;
}

.pre-check-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pre-check-actions button:disabled,
.pre-check-actions button[aria-disabled="true"] {
  color: #98a2b3 !important;
  border-color: #d8e2ef !important;
  background: #f1f5f9 !important;
  box-shadow: none !important;
  opacity: 0.62;
  cursor: not-allowed;
  pointer-events: none;
}

.pre-check-hint {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: #b42318;
}

.pre-check-items-editor {
  margin-top: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px 0 16px;
}

.pre-check-item-row {
  border: 1px solid #e2e8f3;
  border-radius: 8px;
  background: #f9fbff;
  padding: 10px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.pre-check-item-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
}

.pre-check-item-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pre-check-item-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pre-confirm-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #64748b;
}

.pre-confirm-check {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #16a34a;
}

.pre-check-item-row.is-confirmed .pre-confirm-line {
  color: #166534;
  font-weight: 600;
}

.pre-check-item-toolbar select {
  width: auto;
  min-width: 98px;
  margin-top: 0;
  background: #fff;
}

.pre-page-label {
  color: #64748b;
  font-size: 13px;
}

.pre-page-value {
  min-width: 38px;
  text-align: center;
  border: 1px solid #dce6f3;
  border-radius: 8px;
  padding: 4px 8px;
  background: #fff;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.pre-check-title,
.pre-check-section,
.pre-check-desc {
  margin-top: 0;
  background: #fff;
}

.pre-switch-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #334155;
  font-size: 13px;
}

.pre-mini-chat {
  border: 1px dashed #d7e2f1;
  background: #fff;
  border-radius: 8px;
  padding: 8px;
}

.pre-mini-chat-body {
  max-height: 130px;
  overflow: auto;
}

.pre-mini-chat-line {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 4px;
}

.pre-mini-chat-compose {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.pre-mini-chat-compose input {
  margin-top: 0;
}

.pre-mini-chat-compose button {
  padding: 8px 12px;
}

.pre-item-chat-card {
  width: min(900px, 96vw);
}

.pre-report-card {
  width: min(980px, 96vw);
  display: flex;
  flex-direction: column;
  max-height: 92vh;
}

.pre-modal.is-fullscreen {
  padding: 0;
}

.pre-modal.is-fullscreen .pre-report-card {
  width: 100vw;
  height: 100vh;
  max-height: none;
  border-radius: 0;
  border: 0;
}

.pre-report-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pre-report-tool-btn {
  width: 34px;
  height: 34px;
  min-width: 0;
  padding: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.pre-report-tool-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pre-report-body {
  margin-top: 10px;
  border: 1px solid #e3ebf7;
  border-radius: 8px;
  background: #fff;
  flex: 1;
  min-height: 0;
  max-height: 72vh;
  overflow: auto;
  padding: 12px;
}

.pre-modal.is-fullscreen .pre-report-body {
  max-height: none;
}

.pre-report-item {
  border: 1px solid #e3ebf7;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}

.pre-history-card {
  width: min(1080px, 96vw);
  height: min(760px, 88vh);
  display: flex;
  flex-direction: column;
}

.pre-history-filters {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto 44px;
  gap: 10px;
}

.pre-history-filters > input,
.pre-history-filters > select,
.pre-history-filters > button {
  margin-top: 0;
  background: #fff;
}

.pre-history-range-picker {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 0fr);
  align-items: center;
  gap: 8px;
  width: 44px;
  min-width: 0;
  transition: width 0.18s ease;
}

.pre-history-range-picker.has-complete-range {
  grid-template-columns: 44px minmax(120px, 1fr);
  width: 220px;
}

.pre-history-range-btn {
  display: grid;
  place-items: center;
  min-width: 44px;
  width: 44px;
  height: 44px;
  border: 1px solid #cfe0f5;
  border-radius: 10px;
  background: #fff;
  padding: 0;
  color: #0b63d8;
  cursor: pointer;
}

.pre-history-range-btn:hover,
.pre-history-range-btn[aria-expanded="true"] {
  border-color: #9ac7ff;
  background: #f8fbff;
}

.pre-history-range-btn.has-value {
  border-color: #0b63d8;
  background: #eff6ff;
}

.pre-history-range-text {
  min-width: 0;
  color: #0b63d8;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pre-history-range-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pre-history-calendar {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 300px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  background: #15191f;
  color: #e5e7eb;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.28);
  padding: 12px;
}

.pre-history-calendar-head {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.pre-history-calendar-head button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1f242b;
  color: #d1d5db;
  cursor: pointer;
}

.pre-history-calendar-head button:hover {
  background: #2b323b;
  color: #fff;
}

.pre-history-calendar-head svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pre-history-calendar-title {
  text-align: center;
  color: #f3f4f6;
  font-size: 13px;
}

.pre-history-calendar-hint {
  margin-bottom: 8px;
  border-radius: 8px;
  background: #202733;
  color: #bfdbfe;
  font-size: 12px;
  line-height: 1.4;
  padding: 8px 10px;
  text-align: center;
}

.pre-history-week-grid,
.pre-history-day-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.pre-history-week-grid {
  margin-bottom: 6px;
}

.pre-history-week-grid span {
  height: 24px;
  display: grid;
  place-items: center;
  color: #8b95a1;
  font-size: 11px;
}

.pre-history-day {
  width: 100%;
  height: 32px;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
}

.pre-history-day:hover {
  background: #252c35;
}

.pre-history-day.is-muted {
  color: #6b7280;
}

.pre-history-day.is-today {
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.65);
}

.pre-history-day.is-range {
  background: rgba(29, 78, 216, 0.24);
  color: #eff6ff;
}

.pre-history-day.is-selected {
  background: #0b63d8;
  color: #fff;
}

.pre-history-calendar-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #242b33;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.pre-history-calendar-actions button {
  min-width: 74px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: #f8fafc;
  cursor: pointer;
}

.pre-history-calendar-actions button:first-child {
  background: #262b33;
}

.pre-history-calendar-actions button:last-child {
  background: #0b63d8;
}

.pre-history-calendar-actions button:hover {
  filter: brightness(1.08);
}

.pre-history-sort-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border: 1px solid #cfe0f5;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #0b63d8;
  cursor: pointer;
}

.pre-history-sort-btn:hover {
  border-color: #9ac7ff;
  background: #eff6ff;
}

.pre-history-sort-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pre-history-list {
  margin-top: 12px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid #e3ebf7;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}

.pre-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #edf2f7;
  padding: 10px;
}

.pre-history-item:last-child {
  border-bottom: 0;
}

.pre-history-main {
  min-width: 0;
}

.pre-history-name {
  color: #1f2937;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pre-history-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
}

.pre-history-download {
  white-space: nowrap;
}

.pre-tag.link {
  cursor: pointer;
  text-decoration: underline;
}

.pre-alert-card {
  width: min(420px, 92vw);
}

.pre-item-chat-body {
  margin-top: 10px;
  border: 1px solid #e3ebf7;
  border-radius: 8px;
  background: #fff;
  min-height: 220px;
  max-height: 56vh;
  overflow: auto;
  padding: 10px;
}

.pre-item-chat-compose {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
  align-items: center;
}

.pre-item-chat-compose input {
  margin-top: 0;
  height: 42px;
}

.pre-chat-send-icon-btn {
  width: 42px;
  height: 42px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e5e7eb;
  color: #fff;
  box-shadow: none;
}

.pre-chat-send-icon-btn:hover {
  background: #d1d5db;
}

.pre-chat-send-icon-btn:disabled {
  opacity: 0.75;
  cursor: default;
}

.pre-chat-send-icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pre-section-viewer {
  margin-top: 10px;
  border: 0;
  border-top: 1px solid #d8e2ef;
  border-radius: 0;
  background: transparent;
  min-height: 180px;
  max-height: 260px;
  overflow: auto;
  padding: 14px 0 10px;
}

.pre-task-upload-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.pre-task-action-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}

.pre-task-pending-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  min-height: 0;
  padding: 0;
  margin-bottom: 10px;
}

.pre-pending-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #dce6f3;
  background: #f8fbff;
  border-radius: 8px;
  padding: 10px;
}

.pre-pending-task-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #344054;
}

.pre-pending-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pre-pending-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pre-task-meta-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pre-task-upload-row input {
  margin-top: 0;
}

.pre-review-result-list {
  border: 1px solid #dfe7f2;
  border-radius: 10px;
  background: #fbfdff;
  min-height: 240px;
  max-height: none;
  overflow: visible;
  padding: 10px;
}

.pre-result-item {
  border: 1px solid #e1e9f5;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  margin-bottom: 10px;
}

.pre-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pre-result-head h3 {
  margin: 0;
  font-size: 18px;
}

.pre-result-badges {
  margin-top: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pre-result-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pre-result-item.is-missing-decision .pre-result-actions {
  border: 1px solid #fca5a5;
  border-radius: 8px;
  background: #fff7f7;
  padding: 8px;
}

#preTaskPanel #taskCreateBtn,
#preTaskPanel #taskHistoryBtn,
#preTaskPanel #taskReloadBtn,
#preTaskPanel #taskAiReviewBtn,
#preTaskPanel #taskSaveConfirmBtn,
#preTaskPanel .pre-report-open-btn,
#preTaskPanel .table-view,
#preTaskPanel [data-role="remark-btn"],
#preTaskPanel [data-role="result-chat-open"] {
  background: #e7f2ff;
  border: 1px solid #b8d5f6;
  color: #1f5f9b;
}

#preTaskPanel #taskCreateBtn:hover,
#preTaskPanel #taskHistoryBtn:hover,
#preTaskPanel #taskReloadBtn:hover,
#preTaskPanel #taskAiReviewBtn:hover,
#preTaskPanel #taskSaveConfirmBtn:hover,
#preTaskPanel .pre-report-open-btn:hover,
#preTaskPanel .table-view:hover,
#preTaskPanel [data-role="remark-btn"]:hover,
#preTaskPanel [data-role="result-chat-open"]:hover {
  background: #d8eaff;
  filter: none;
  transform: none;
}

#preTaskPanel .pre-report-open-btn.ok {
  background: #e8f8ee;
  border-color: #b8e7c7;
  color: #166534;
}

#preTaskPanel .pre-report-open-btn.ok:hover {
  background: #dcf4e5;
}

#preTaskPanel #taskAiReviewBtn:disabled,
#preTaskPanel #taskAiReviewBtn[aria-disabled="true"] {
  border-color: #d8e2ef;
  background: #f2f6fb;
  color: #98a2b3;
  cursor: not-allowed;
}

#preTaskPanel #taskAiReviewBtn:disabled:hover,
#preTaskPanel #taskAiReviewBtn[aria-disabled="true"]:hover {
  background: #f2f6fb;
}

.pre-decision-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #cfdff5;
  border-radius: 8px;
  background: #fff;
  color: #27415e;
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
}

.pre-decision-option input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.pre-decision-option.agree-active {
  border-color: #6fd0a8;
  background: #dff7ec;
  color: #1f7a55;
}

.pre-decision-option.nochange-active {
  border-color: #d7c9a3;
  background: #f7f1e1;
  color: #7a5b1f;
}

#preChecklistPanel .pre-check-item-row .table-del {
  background: var(--soft-btn-bg);
  border: 1px solid var(--soft-btn-border);
  color: var(--soft-btn-text);
}

@media (max-width: 1180px) {
  .pre-head-card {
    flex-direction: column;
  }

  .pre-head-right {
    width: 100%;
    justify-content: space-between;
  }

  .pre-stats-grid {
    grid-template-columns: 1fr;
  }

  .pre-stats-head {
    align-items: stretch;
    flex-direction: column;
  }

  .pre-stats-task-select,
  .pre-stats-task-select select,
  .pre-stats-tools select {
    width: 100%;
  }

  .pre-history-filters,
  .pre-history-item {
    grid-template-columns: 1fr;
  }

  .pre-history-download {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .pre-review-main {
    padding: 12px;
  }

  .pre-head-left h1 {
    font-size: 30px;
  }

  .pre-version-box strong {
    font-size: 22px;
  }

  .pre-task-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .pre-task-tags {
    justify-content: flex-start;
  }

  .pre-checklist-layout {
    grid-template-columns: 1fr;
  }

  .pre-check-item-row {
    grid-template-columns: 1fr;
  }

  .pre-task-upload-row {
    grid-template-columns: 1fr;
  }
}

.login-page {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 20%, rgba(20, 89, 163, 0.2), transparent 36%),
    radial-gradient(circle at 82% 8%, rgba(16, 123, 217, 0.15), transparent 40%),
    linear-gradient(165deg, #f6f8fc 0%, #edf2f9 48%, #e3ebf4 100%);
  display: flex;
  align-items: center;
  padding: 24px 0;
}

.login-shell {
  width: min(1040px, 92vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 18px;
}

.login-brand-panel {
  border: 1px solid #2d4f76;
  border-radius: 14px;
  padding: 30px 28px;
  background: linear-gradient(158deg, #12355e 0%, #0d2744 52%, #0a1f36 100%);
  color: #e8f2ff;
  box-shadow: 0 18px 42px rgba(8, 29, 51, 0.24);
}

.login-brand-panel .eyebrow {
  color: #9ec5f2;
}

.login-brand-panel h1 {
  margin-top: 2px;
  font-family: "Alegreya Sans SC", "IBM Plex Sans", sans-serif;
  font-size: clamp(28px, 3.5vw, 42px);
  line-height: 1.18;
}

.login-feature-list {
  margin: 20px 0 0;
  padding: 0 0 0 18px;
  display: grid;
  gap: 8px;
  color: #d6e7fb;
}

.login-card {
  padding: 26px 24px 22px;
  border-radius: 14px;
}

.login-card h2 {
  margin-top: 4px;
  font-size: 28px;
  font-family: "Alegreya Sans SC", "IBM Plex Sans", sans-serif;
}

.login-form {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.password-input-wrap {
  position: relative;
  margin-top: 6px;
}

.password-input-wrap input {
  margin-top: 0;
  padding-right: 46px;
}

.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7a8ea5;
  background: transparent;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.password-toggle-btn:hover {
  transform: translateY(-50%);
  background: #edf3fa;
  color: #3f5f82;
}

.password-toggle-btn:active {
  transform: translateY(-50%);
}

.password-toggle-btn:focus-visible {
  outline: 2px solid #8fb8e1;
  outline-offset: 1px;
}

.password-toggle-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle-btn .icon-eye-off {
  display: none;
}

.password-toggle-btn.is-visible .icon-eye {
  display: none;
}

.password-toggle-btn.is-visible .icon-eye-off {
  display: block;
}

.login-meta-row {
  margin-top: 4px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
}

.login-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #52667f;
}

.login-check input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.login-submit-btn {
  margin-top: 2px;
  width: 100%;
  border-color: #6da6da;
  color: #f5fbff;
  background: linear-gradient(180deg, #2f7ec8, #226ab2);
  box-shadow: 0 8px 18px rgba(17, 74, 133, 0.2);
}

.login-submit-btn:hover {
  background: linear-gradient(180deg, #3a8ad4, #2f7ec8);
}

.login-submit-btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.login-tip {
  display: none;
  margin: 14px 0 0;
  color: #64748b;
  font-size: 13px;
}

.login-tip.show {
  display: block;
}

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

.login-tip.tip-success {
  color: #1f7a55;
}

@media (max-width: 920px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    order: 2;
    padding: 24px 20px;
  }

  .login-card {
    order: 1;
    padding: 22px 18px 18px;
  }
}

@media (max-width: 520px) {
  .login-meta-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.account-admin-page {
  margin: 0;
  min-height: 100vh;
  background: #f4f7fb;
}

.account-admin-root {
  width: min(1280px, 94vw);
  margin: 0 auto;
  padding: 24px 0 36px;
  display: grid;
  gap: 14px;
}

.account-admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.account-admin-header h1 {
  margin-top: 4px;
  font-size: 30px;
}

.account-admin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-admin-form {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 130px 1fr 1fr 1fr 1fr 130px auto;
  gap: 10px;
  align-items: end;
}

.account-admin-form button {
  height: 44px;
}

.account-admin-form select {
  margin-top: 6px;
  height: 44px;
}

.account-admin-status {
  display: none;
  margin-top: 12px;
  border: 1px solid #d4e0ee;
  border-radius: 8px;
  background: #f7fbff;
  color: #516478;
  padding: 8px 12px;
  font-size: 13px;
}

.account-admin-status.show {
  display: block;
}

.account-admin-status.is-error {
  background: #fff1f1;
  border-color: #f3c7c7;
  color: #a23a3a;
}

.account-admin-status.is-success {
  background: #ecfbf2;
  border-color: #bae2ca;
  color: #1f7a55;
}

.account-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.account-list-head h2 {
  margin: 0;
}

.account-table-wrap {
  max-height: calc(100vh - 250px);
}

.account-table td:nth-child(2) {
  font-family: "Consolas", "SFMono-Regular", "Menlo", monospace;
  color: #173b63;
}

.account-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  border: 1px solid #ced9e8;
}

.account-pill.is-enabled {
  background: #eaf7ef;
  border-color: #b8dfc7;
  color: #206d4d;
}

.account-pill.is-disabled {
  background: #f7f2e8;
  border-color: #e5d8b6;
  color: #7c6230;
}

.account-pill.is-normal {
  background: #eef5ff;
  border-color: #b8d4ff;
  color: #0b63d8;
}

.account-pill.is-experience {
  background: #f4efff;
  border-color: #d7c7ff;
  color: #6941c6;
}

.account-pill.is-expired {
  background: #fff1f1;
  border-color: #f3c7c7;
  color: #a23a3a;
}

.account-expiry,
.account-expiry + small {
  display: block;
}

.account-expiry {
  color: #344054;
}

.account-expiry.is-expired {
  color: #a23a3a;
}

.account-expiry + small {
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
}

.account-created-card {
  width: min(520px, 92vw);
}

.account-created-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.account-created-head h3 {
  margin: 0;
}

.account-created-head p {
  margin: 6px 0 0;
  color: #667085;
}

.account-created-grid {
  margin-top: 16px;
  border: 1px solid #dbe5f1;
  border-radius: 8px;
  background: #f8fbff;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}

.account-created-grid span,
.account-created-grid strong {
  min-width: 0;
  border-bottom: 1px solid #e6edf6;
  padding: 11px 12px;
  line-height: 1.5;
}

.account-created-grid span:nth-last-child(-n + 2),
.account-created-grid strong:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.account-created-grid span {
  color: #667085;
  background: #f1f6fd;
}

.account-created-grid strong {
  color: #173b63;
  font-family: "Consolas", "SFMono-Regular", "Menlo", monospace;
  overflow-wrap: anywhere;
}

.account-created-actions {
  margin-top: 16px;
}

.account-copy-tip {
  min-height: 18px;
  margin: 10px 0 0;
  color: #1f7a55;
  font-size: 13px;
}

.account-confirm-card {
  width: min(440px, 92vw);
  padding: 20px;
}

.account-confirm-card h3 {
  color: #172b4d;
}

.account-confirm-card p {
  margin: 12px 0 4px;
  color: #344054;
  line-height: 1.6;
}

@media (max-width: 1220px) {
  .account-admin-form {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .account-admin-header {
    flex-direction: column;
  }

  .account-admin-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .account-admin-form {
    grid-template-columns: 1fr;
  }

  .account-admin-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.profile-main {
  min-width: 0;
  height: 100vh;
  overflow: auto;
  padding: 22px 28px;
  background: #f8fbff;
}

.profile-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.profile-tab-link {
  min-height: 38px;
  border: 1px solid #d7e5f7;
  border-radius: 8px;
  color: #334155;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
}

.profile-tab-link.active {
  color: #0b63d8;
  background: #eaf2ff;
  border-color: #9ec7ff;
}

.profile-panel {
  max-width: 980px;
  border: 1px solid #dfe7f2;
  border-radius: 8px;
  background: #ffffff;
  padding: 20px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
}

.profile-panel-head {
  margin-bottom: 18px;
}

.profile-panel-head h1 {
  margin: 0;
  color: #26384d;
  font-size: 18px;
  font-weight: 400;
}

.profile-panel-head p {
  margin: 6px 0 0;
  color: #667085;
  font-size: 13px;
}

.profile-form {
  display: grid;
  gap: 14px;
  max-width: 520px;
}

.profile-form label {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 13px;
  font-weight: 400;
}

.profile-form input,
.profile-favorite-toolbar input,
.profile-favorite-toolbar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d7e3f2;
  border-radius: 8px;
  color: #26384d;
  background: #ffffff;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 400;
}

.profile-form input[readonly] {
  color: #667085;
  background: #f8fafc;
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-actions button {
  min-height: 38px;
  border: 1px solid #9ec7ff;
  border-radius: 8px;
  color: #0b63d8;
  background: #eaf2ff;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 400;
}

.profile-tip {
  min-height: 18px;
  margin: 0;
  color: #667085;
  font-size: 12px;
}

.profile-tip.is-success {
  color: #059669;
}

.profile-tip.is-error {
  color: #dc2626;
}

.profile-favorite-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 10px;
  margin-bottom: 14px;
}

.profile-favorite-list {
  display: grid;
  gap: 10px;
}

.profile-favorite-item {
  border: 1px solid #e2e8f3;
  border-radius: 8px;
  background: #fbfdff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
}

.profile-favorite-item span {
  color: #0b63d8;
  font-size: 12px;
}

.profile-favorite-item h3 {
  margin: 4px 0 0;
  color: #26384d;
  font-size: 13px;
  font-weight: 400;
}

.profile-favorite-item p {
  margin: 4px 0 0;
  color: #667085;
  font-size: 12px;
}

.profile-favorite-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.profile-empty {
  min-height: 180px;
  border: 1px dashed #cfd9e8;
  border-radius: 8px;
  color: #667085;
  display: grid;
  place-items: center;
  font-size: 13px;
}

@media (max-width: 760px) {
  .profile-main {
    padding: 16px;
  }

  .profile-tabs,
  .profile-favorite-item,
  .profile-favorite-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-favorite-toolbar {
    grid-template-columns: 1fr;
  }
}

/* System-wide compact typography */
:root {
  --ink: #344054;
  --muted: #667085;
}

:where(.app-page, .upload-page, .source-page, .login-page, .account-admin-page) {
  color: #344054;
  font-size: 13px;
  font-weight: 400;
}

:where(.app-page, .upload-page, .source-page, .login-page, .account-admin-page)
  :where(h1, h2, h3, h4, h5, h6, strong, b, th, label, summary) {
  color: #344054 !important;
  font-weight: 400 !important;
}

:where(.app-page, .upload-page, .source-page, .login-page, .account-admin-page)
  :where(p, a, button, input, textarea, select, td, li, span, small, em, label, summary) {
  font-weight: 400 !important;
}

:where(.app-page, .upload-page, .source-page, .login-page, .account-admin-page) h1,
:where(.app-page, .upload-page, .source-page, .login-page, .account-admin-page) .hero h1 {
  font-size: 18px !important;
  line-height: 1.45;
}

:where(.app-page, .upload-page, .source-page, .login-page, .account-admin-page) h2 {
  font-size: 16px !important;
  line-height: 1.45;
}

:where(.app-page, .upload-page, .source-page, .login-page, .account-admin-page) h3,
:where(.app-page, .upload-page, .source-page, .login-page, .account-admin-page) h4,
:where(.app-page, .upload-page, .source-page, .login-page, .account-admin-page) h5,
:where(.app-page, .upload-page, .source-page, .login-page, .account-admin-page) h6 {
  font-size: 14px !important;
  line-height: 1.45;
}

:where(.app-page, .upload-page, .source-page, .login-page, .account-admin-page)
  :where(p, a, button, input, textarea, select, td, th, li, label, summary, .session-title, .bubble, .bubble *, .sections-viewer, .sections-viewer *) {
  font-size: 13px !important;
}

:where(.app-page, .upload-page, .source-page, .login-page, .account-admin-page)
  :where(small, .session-meta, .subtitle, .eyebrow, .kb-file-meta, .kb-related-doc-list small, .app-user-text small) {
  font-size: 12px !important;
}

:where(.app-page, .upload-page, .source-page, .login-page, .account-admin-page)
  :where(.kb-stats-grid strong, .kb-graph-metrics strong, .kb-permission-headline strong, .kb-push-stat-row strong, .spec-count strong, .metric-card strong) {
  color: #344054 !important;
  font-size: 16px !important;
  font-weight: 400 !important;
}

:where(.app-page, .upload-page, .source-page, .login-page, .account-admin-page)
  :where(.app-brand-panel strong, .app-nav-link, .app-feature-switch summary, .app-sub-feature-link, .chat-secondary-title strong, .app-chat-secondary .session-panel h3, .app-chat-secondary .session-title, .session-panel h3, .session-title, .kb-file-name, .kb-category-list button, .kb-side-card-head span, .kb-graph-legend strong, .kb-graph-aside h3, .account-list-head h2) {
  color: #344054 !important;
  font-size: 13px !important;
  font-weight: 400 !important;
}

:where(.app-page, .upload-page, .source-page, .login-page, .account-admin-page)
  :where(.app-nav-link.active, .app-sub-feature-link.active, .kb-graph-controls button.active, .kb-category-list button.active) {
  color: #0b63d8 !important;
}

:where(.app-page, .upload-page, .source-page, .login-page, .account-admin-page)
  :where(.app-sub-feature-link.active) {
  color: #ffffff !important;
}

body.login-page .login-brand-panel .eyebrow {
  color: #9ed8ff !important;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px !important;
  font-weight: 500 !important;
}

body.login-page .login-brand-panel .login-product-name {
  color: #ffffff !important;
  font-size: 16px !important;
  font-weight: 700 !important;
}

body.login-page .login-brand-panel .login-center-name {
  color: #9ed8ff !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

body.login-page .login-brand-panel h1 {
  margin-top: 6px;
  color: #f8fbff !important;
  font-size: 36px !important;
  font-weight: 700 !important;
  line-height: 1.18;
  letter-spacing: 0;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.36);
}

body.login-page .login-feature-list {
  margin-top: 24px;
}

body.login-page .login-feature-list li {
  color: #e7f4ff !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

@media (max-width: 520px) {
  body.login-page .login-brand-panel h1 {
    font-size: 28px !important;
  }
}

