:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f0f6ff;
  --text: #121212;
  --muted: #646464;
  --line: #ebebeb;
  --primary: #1772f6;
  --primary-dark: #0f5fd6;
  --primary-soft: #eaf3ff;
  --accent: #8590a6;
  --warning: #d46b08;
  --danger: #d93025;
  --shadow: 0 16px 42px rgba(18, 18, 18, 0.08);
  --admin-bg: #f5f8fc;
  --admin-line: #e7edf5;
  --admin-text: #172033;
  --admin-muted: #65758b;
  --admin-shadow: 0 14px 34px rgba(26, 49, 83, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.admin-page {
  height: 100vh;
  overflow: hidden;
  color: var(--admin-text);
  background:
    radial-gradient(circle at 85% 0%, rgba(23, 114, 246, 0.08), transparent 30%),
    linear-gradient(180deg, #f8fbff 0%, var(--admin-bg) 100%);
}

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

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.supplier-page .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

.admin-page .app-shell {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  color: #121212;
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 62%, #f0f6ff 100%);
  border-right: 1px solid var(--line);
}

.admin-page .sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  gap: 24px;
  padding: 24px 20px;
  color: var(--admin-text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 251, 255, 0.96) 100%);
  border-right: 1px solid var(--admin-line);
  box-shadow: 8px 0 28px rgba(30, 57, 91, 0.04);
}

.supplier-page .sidebar {
  display: none;
}

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

.admin-page .brand {
  gap: 13px;
  padding: 4px 0 10px;
}

.zhihu-logo {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex: 0 0 auto;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3,
.panel p,
.hero-band h3,
.hero-band p,
.article-card h4,
.article-card p {
  margin: 0;
}

.brand h1 {
  overflow: hidden;
  font-size: 17px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-page .brand h1 {
  color: #111827;
  font-size: 18px;
  font-weight: 760;
  letter-spacing: 0;
}

.brand > div {
  min-width: 0;
}

.brand p,
.side-panel p {
  color: var(--muted);
}

.admin-page .brand p,
.admin-page .side-panel p {
  color: var(--admin-muted);
}

.nav {
  display: grid;
  gap: 8px;
}

.admin-page .nav {
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: #444444;
  background: transparent;
  text-align: left;
  padding: 0 12px;
}

.admin-page .nav-item {
  min-height: 42px;
  border-radius: 10px;
  color: #526070;
  font-size: 15px;
  font-weight: 560;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.nav-item span {
  width: 20px;
  text-align: center;
}

.nav-item.active,
.nav-item:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.admin-page .nav-item.active {
  color: #0f66e8;
  background: linear-gradient(90deg, rgba(23, 114, 246, 0.14), rgba(23, 114, 246, 0.06));
  box-shadow: inset 3px 0 0 #1772f6;
}

.admin-page .nav-item:hover {
  color: #0f66e8;
  background: rgba(23, 114, 246, 0.08);
}

.side-panel {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8fa;
}

.admin-page .side-panel {
  border-color: #dbe8f8;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7fbff, #ffffff);
  box-shadow: 0 10px 22px rgba(26, 49, 83, 0.05);
}

.side-panel p {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

.status-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(23, 114, 246, 0.12);
}

.main {
  min-width: 0;
  padding: 28px;
}

.admin-page .main {
  height: 100vh;
  overflow-y: auto;
  padding: 0 34px 42px;
  scroll-behavior: smooth;
}

.supplier-page .main {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
}

.supplier-page {
  background:
    linear-gradient(180deg, #eaf4ff 0%, #f7fbff 42%, #ffffff 100%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 3px solid var(--primary);
}

.admin-page .topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  margin-bottom: 0;
  padding: 30px 0 20px;
  border-bottom: 0;
  background: #f8fbff;
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 24px rgba(248, 251, 255, 0.96);
}

.admin-page .topbar::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 -34px -28px;
  background:
    linear-gradient(180deg, #f8fbff 0%, #f8fbff 84%, rgba(248, 251, 255, 0.98) 100%);
  border-bottom: 1px solid rgba(212, 225, 241, 0.72);
}

.admin-page .topbar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #1772f6 0%, rgba(23, 114, 246, 0.20) 68%, rgba(23, 114, 246, 0) 100%);
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
}

.admin-page .eyebrow {
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 560;
}

.topbar h2 {
  margin-top: 4px;
  font-size: 28px;
}

.admin-page .topbar h2 {
  color: #0f172a;
  font-size: 30px;
  font-weight: 780;
  line-height: 1.2;
}

.top-actions,
.button-row,
.dialog-actions,
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.supplier-page .top-actions,
.supplier-page #portalMetrics,
.supplier-page #categoryFilter,
.supplier-page #ticketsView,
.supplier-page #knowledgeView,
.supplier-page #analyticsView,
.supplier-page #exportDataBtn {
  display: none;
}

.supplier-page .topbar {
  justify-content: center;
  text-align: center;
  border-bottom: 0;
  margin-bottom: 8px;
}

.chat-shell {
  position: relative;
  max-width: 920px;
  min-height: calc(100vh - 140px);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto;
  gap: 14px;
}

.chat-intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
  border: 1px solid #d7eaff;
  border-radius: 8px;
  background:
    radial-gradient(circle at 82% 20%, rgba(23, 114, 246, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(226, 242, 255, 0.96), rgba(255, 255, 255, 0.88));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-intro h3,
.chat-intro p {
  margin: 0;
}

.chat-intro h3 {
  margin-top: 6px;
  font-size: 28px;
  line-height: 1.2;
  color: #0f2f5f;
}

.chat-intro p:last-child {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.7;
}

.mascot-scene {
  position: relative;
  min-height: 104px;
  display: grid;
  place-items: center;
}

.mascot-scene::before {
  content: "";
  position: absolute;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(23, 114, 246, 0.16), rgba(23, 114, 246, 0.04));
}

.ask-mascot {
  position: relative;
  width: 96px;
  filter: drop-shadow(0 12px 18px rgba(23, 114, 246, 0.14));
}

.chat-thread {
  display: grid;
  align-content: start;
  gap: 16px;
  overflow: auto;
  padding: 8px 4px 16px;
}

.scroll-bottom-button {
  position: absolute;
  left: 50%;
  bottom: 116px;
  z-index: 8;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(23, 114, 246, 0.18);
  border-radius: 999px;
  color: #1772f6;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(23, 114, 246, 0.18);
  transform: translate(-50%, 10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.scroll-bottom-button.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.scroll-bottom-button:hover {
  color: #ffffff;
  background: #1772f6;
}

.chat-message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.chat-message.user {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.chat-message.user .message-avatar {
  grid-column: 2;
  grid-row: 1;
  background: #0f5fd6;
}

.chat-message.user .message-bubble {
  grid-column: 1;
  justify-self: end;
  background: #1772f6;
  color: #ffffff;
  border-color: #1772f6;
}

.chat-message.user .message-bubble p {
  color: #ffffff;
}

.message-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #1772f6;
  font-weight: 700;
}

.message-bubble {
  max-width: min(760px, 100%);
  border: 1px solid #d7eaff;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  padding: 14px;
  box-shadow: 0 8px 20px rgba(28, 43, 56, 0.06);
  font-size: 15px;
}

.message-bubble h4,
.message-bubble p {
  margin: 0;
}

.message-bubble p,
.message-bubble li {
  line-height: 1.65;
}

.message-bubble ol {
  margin: 8px 0 0;
  padding-left: 22px;
}

.generated-answer p {
  margin: 0 0 12px;
}

.generated-answer p:last-child {
  margin-bottom: 0;
}

.generated-answer strong {
  color: #15283d;
  font-weight: 700;
}

.generated-answer .answer-steps,
.generated-answer .answer-list {
  margin: 8px 0 12px;
  padding-left: 22px;
}

.generated-answer .answer-steps:last-child,
.generated-answer .answer-list:last-child {
  margin-bottom: 0;
}

.generated-answer .answer-steps li,
.generated-answer .answer-list li {
  margin: 5px 0;
  line-height: 1.65;
}

.answer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(117, 139, 166, 0.14);
}

.answer-actions button {
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #7a8da3;
  background: transparent;
  padding: 0 9px;
  font-size: 12px;
}

.answer-feedback-label {
  color: #6a7d93;
  font-size: 12px;
  font-weight: 650;
}

.answer-action-divider {
  width: 1px;
  height: 16px;
  background: rgba(117, 139, 166, 0.22);
}

.answer-actions button:hover,
.answer-actions button.selected {
  color: #1772f6;
  border-color: rgba(23, 114, 246, 0.16);
  background: #f4f9ff;
}

.feedback-followup {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  color: #315170;
  background: #f7fbff;
  font-size: 14px;
  line-height: 1.6;
}

.no-answer-card {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(23, 114, 246, 0.12);
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbff, #ffffff);
}

.no-answer-title {
  color: #173b63;
  font-weight: 700;
}

.no-answer-card p {
  margin: 0;
  color: #425466;
  line-height: 1.65;
}

.thinking-line {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #365b82;
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 2px;
  background: #1772f6;
  animation: cursorBlink 0.9s steps(2, start) infinite;
}

.typing-cursor.inline {
  vertical-align: -0.15em;
}

@keyframes cursorBlink {
  0%,
  45% {
    opacity: 1;
  }

  46%,
  100% {
    opacity: 0;
  }
}

.chat-composer {
  position: sticky;
  bottom: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid #cfe5ff;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 255, 0.96));
  box-shadow: var(--shadow);
  padding: 12px;
}

.chat-composer .attachment-button {
  margin-bottom: 3px;
}

.attachment-button {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #1f2329;
  background: #f1f2f4;
  cursor: pointer;
  line-height: 1;
}

.attachment-button:hover,
.attachment-button:focus-within {
  color: #1f2329;
  background: #e7e9ee;
}

.attachment-icon {
  content: "";
  display: block;
  width: 17px;
  height: 17px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M8%207v9a4%204%200%200%200%208%200V6a6%206%200%200%200-12%200v10a8%208%200%200%200%2016%200V8'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M8%207v9a4%204%200%200%200%208%200V6a6%206%200%200%200-12%200v10a8%208%200%200%200%2016%200V8'/%3E%3C/svg%3E") center / contain no-repeat;
}

.attachment-button em {
  position: absolute;
  right: -34px;
  bottom: calc(100% + 10px);
  z-index: 3;
  display: none;
  width: max-content;
  max-width: min(320px, calc(100vw - 48px));
  padding: 8px 12px;
  border-radius: 10px;
  color: #ffffff;
  background: rgba(18, 18, 18, 0.88);
  box-shadow: 0 10px 24px rgba(18, 43, 74, 0.18);
  font-size: 13px;
  font-style: normal;
  font-weight: 500;
  line-height: 1.45;
  pointer-events: none;
}

.attachment-button em::after {
  content: "";
  position: absolute;
  right: 37px;
  top: 100%;
  width: 8px;
  height: 8px;
  background: rgba(18, 18, 18, 0.88);
  transform: translateY(-4px) rotate(45deg);
}

.attachment-button:hover em,
.attachment-button:focus-within em {
  display: block;
}

.attachment-list {
  display: grid;
  gap: 8px;
  width: min(720px, 100%);
  margin: 10px auto 0;
}

.attachment-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border: 1px solid rgba(23, 114, 246, 0.10);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
}

.attachment-chip.failed {
  border-color: rgba(192, 54, 44, 0.20);
}

.attachment-chip strong,
.attachment-chip span {
  display: block;
}

.attachment-chip strong {
  color: #17233d;
  font-size: 13px;
}

.attachment-chip span,
.attachment-tip {
  color: #6a7b8b;
  font-size: 12px;
}

.attachment-chip button {
  border: 0;
  color: #6a7b8b;
  background: transparent;
  white-space: nowrap;
}

.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.message-attachments span {
  padding: 4px 8px;
  border-radius: 999px;
  color: #315f88;
  background: #eef6ff;
  font-size: 12px;
}

.chat-composer textarea {
  min-height: 48px;
  max-height: 140px;
  border: 0;
  box-shadow: none;
  padding: 8px;
  font-size: 16px;
}

.chat-composer textarea:focus {
  border: 0;
  box-shadow: none;
}

.supplier-answer-layout {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.supplier-page .legacy-answer {
  display: none;
}

.supplier-page .legacy-answer.ticket-modal-open,
.supplier-page .legacy-answer:has(.human-panel.open) {
  display: block;
  margin: 0;
}

.supplier-page .legacy-answer.ticket-modal-open .answer-panel,
.supplier-page .legacy-answer:has(.human-panel.open) .answer-panel {
  display: none;
}

.answer-panel {
  border: 1px solid #d7eaff;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(28, 43, 56, 0.05);
  overflow: hidden;
}

.supplier-page .answer-box {
  padding: 16px;
}

.human-panel {
  display: none;
  border: 1px solid #d5e7ff;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.human-panel.open {
  display: block;
}

.supplier-page .human-panel.open {
  position: fixed;
  z-index: 30;
  top: 50%;
  left: 50%;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  transform: translate(-50%, -50%);
  box-shadow: 0 24px 70px rgba(18, 43, 74, 0.22);
}

.supplier-page .legacy-answer.ticket-modal-open::before,
.supplier-page .legacy-answer:has(.human-panel.open)::before {
  position: fixed;
  z-index: 29;
  inset: 0;
  content: "";
  background: rgba(15, 39, 66, 0.28);
}

.human-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.human-panel-header h3,
.human-panel-header p {
  margin: 0;
}

.human-panel-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.is-hidden {
  display: none !important;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
}

.admin-page .primary-button,
.admin-page .secondary-button,
.admin-page .ghost-button,
.admin-page .icon-button {
  min-height: 38px;
  border-radius: 10px;
  padding: 0 16px;
  font-weight: 620;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.primary-button {
  color: #ffffff;
  background: var(--primary);
}

.admin-page .primary-button {
  border-color: #1772f6;
  background: linear-gradient(180deg, #2682ff, #1768e8);
  box-shadow: 0 10px 20px rgba(23, 114, 246, 0.20);
}

.primary-button:hover {
  background: var(--primary-dark);
}

.admin-page .primary-button:hover {
  background: linear-gradient(180deg, #1772f6, #0f5fd6);
  box-shadow: 0 12px 24px rgba(23, 114, 246, 0.24);
  transform: translateY(-1px);
}

.secondary-button {
  color: var(--primary-dark);
  border-color: #b8d6ff;
  background: var(--primary-soft);
}

.admin-page .secondary-button {
  color: #1159c9;
  border-color: #cfe2ff;
  background: #eef6ff;
}

.admin-page .secondary-button:hover {
  border-color: #a9ccff;
  background: #e4f1ff;
}

.ghost-button,
.icon-button {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface);
}

.admin-page .ghost-button,
.admin-page .icon-button {
  color: #27364a;
  border-color: #dce5ef;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 14px rgba(26, 49, 83, 0.05);
}

.admin-page .ghost-button:hover,
.admin-page .icon-button:hover {
  border-color: #c8d8ec;
  background: #ffffff;
  box-shadow: 0 9px 18px rgba(26, 49, 83, 0.08);
}

.ghost-button.danger {
  color: var(--danger);
  border-color: #ffd6d1;
}

.ghost-button.danger:hover {
  background: #fff5f4;
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 22px;
}

.full {
  width: 100%;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.admin-page .view.active {
  padding-top: 28px;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: 24px;
  align-items: center;
  padding: 26px;
  border-radius: 8px;
  border: 1px solid #d5e7ff;
  background:
    linear-gradient(135deg, rgba(23, 114, 246, 0.15), rgba(255, 255, 255, 0.95)),
    #ffffff;
  box-shadow: var(--shadow);
}

.supplier-page .hero-band {
  grid-template-columns: minmax(0, 0.8fr) minmax(360px, 1.2fr);
}

.hero-band h3 {
  font-size: 26px;
}

.hero-band p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.7;
}

.search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  padding: 10px 12px;
  outline: none;
}

.admin-page input,
.admin-page select,
.admin-page textarea {
  min-height: 40px;
  border-color: #dbe4ef;
  border-radius: 10px;
  color: #172033;
  background: #fbfdff;
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.admin-page textarea {
  min-height: 96px;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 114, 246, 0.14);
}

.admin-page input:focus,
.admin-page select:focus,
.admin-page textarea:focus {
  border-color: #1772f6;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(23, 114, 246, 0.11);
}

.search-box button {
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--primary);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.metric-grid.large {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-page .metric-grid.large {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.metric-card {
  min-height: 94px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-page .metric-card {
  min-height: 96px;
  padding: 18px 20px;
  border-color: var(--admin-line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 255, 0.98));
  box-shadow: var(--admin-shadow);
}

.metric-card strong {
  display: block;
  font-size: 28px;
  margin-top: 7px;
}

.admin-page .metric-card strong {
  color: #0f172a;
  font-size: 30px;
  font-weight: 780;
  letter-spacing: 0;
}

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

.admin-page .metric-card span {
  color: var(--admin-muted);
  font-weight: 600;
}

.dashboard-loading-card strong {
  color: #b9c8d8;
}

.dashboard-loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 72px;
  padding: 18px;
  color: var(--admin-muted, var(--muted));
  font-size: 14px;
}

.dashboard-loading-state span {
  width: 16px;
  height: 16px;
  border: 2px solid #d8e7f6;
  border-top-color: #1772f6;
  border-radius: 50%;
  animation: dashboard-loading-spin 0.8s linear infinite;
}

.ops-checklist > .dashboard-loading-state {
  grid-column: 1 / -1;
}

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

@media (prefers-reduced-motion: reduce) {
  .dashboard-loading-state span { animation: none; }
}

.admin-page #retrievalEvaluationResult .retrieval-metric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.admin-page #retrievalEvaluationResult .metric-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-width: 0;
  min-height: 74px;
  padding: 14px 16px;
  border-radius: 10px;
  box-shadow: none;
}

.admin-page #retrievalEvaluationResult .metric-card span {
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  word-break: keep-all;
}

.admin-page #retrievalEvaluationResult .metric-card strong {
  flex: 0 0 auto;
  margin: 0 0 0 10px;
  font-size: clamp(21px, 2vw, 28px);
  line-height: 1;
  white-space: nowrap;
}

.admin-page #retrievalEvaluationResult .metric-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.admin-page #retrievalEvaluationResult > .empty-state,
.admin-page #retrievalEvaluationResult > .qa-log-card {
  margin-top: 10px;
}

.admin-page #debugView #runRetrievalEvaluationBtn {
  flex: 0 0 auto;
  min-width: 88px;
  white-space: nowrap;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.7fr);
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(28, 43, 56, 0.05);
  overflow: hidden;
}

.admin-page .panel {
  border-color: var(--admin-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--admin-shadow);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.admin-page .panel-header {
  padding: 20px 22px;
  border-bottom-color: var(--admin-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 255, 0.94));
}

.panel-header h3 {
  font-size: 18px;
}

.admin-page .panel-header h3 {
  color: #111827;
  font-size: 18px;
  font-weight: 740;
}

.panel-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.admin-page .panel-header p {
  margin-top: 6px;
  color: var(--admin-muted);
  font-size: 13px;
  line-height: 1.55;
}

.panel-header select {
  max-width: 190px;
}

.article-list,
.stack-form,
.bar-list,
.empty-searches {
  padding: 16px;
}

.qa-log-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.admin-page .qa-log-list {
  gap: 12px;
  padding: 18px 22px;
}

.qa-log-list.embedded,
.article-list.embedded {
  padding: 0;
}

.knowledge-manager {
  display: grid;
  gap: 18px;
  padding: 16px;
}

.admin-page .knowledge-manager {
  gap: 18px;
  padding: 20px 22px;
}

.ops-panel {
  margin-bottom: 18px;
}

.ops-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  padding: 16px;
}

.ops-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 162px;
  padding: 16px;
  border: 1px solid var(--admin-line, var(--line));
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 10px 28px rgba(32, 92, 148, 0.06);
}

.ops-item .ghost-button {
  grid-column: 2;
  justify-self: start;
  min-height: 32px;
  padding: 0 9px;
  font-size: 13px;
}

.ops-priority {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 28px;
  border-radius: 999px;
  color: #ffffff;
  background: #1766d1;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
}

.ops-item.warn .ops-priority {
  background: #f59f00;
}

.ops-item.ok .ops-priority {
  background: #12a150;
}

.ops-label {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #5f7285;
  background: #eef6ff;
  font-size: 12px;
  font-weight: 700;
}

.ops-item.warn .ops-label {
  color: #875800;
  background: #fff4cf;
}

.ops-item strong,
.ops-item p {
  margin: 0;
}

.ops-item strong {
  color: #17233d;
  font-size: 14px;
}

.ops-item p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.diagnosis-item {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--admin-line, var(--line));
  border-radius: 12px;
  background: #ffffff;
}

.diagnosis-item + .diagnosis-item {
  margin-top: 10px;
}

.diagnosis-item h4,
.diagnosis-item p {
  margin: 0;
}

.diagnosis-item h4 {
  color: #17233d;
  font-size: 14px;
}

.diagnosis-item p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.diagnosis-item .ghost-button {
  width: fit-content;
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.diagnosis-item.healthy {
  background: #f8fbff;
}

.admin-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(auto-fit, minmax(140px, 180px));
  gap: 10px;
  padding: 0 16px 14px;
}

.admin-time-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.admin-time-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 650;
}

.admin-time-toolbar select {
  min-width: 132px;
}

.date-range-fields {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.date-range-fields[hidden] {
  display: none;
}

.date-range-fields label {
  gap: 8px;
}

.date-range-fields input {
  min-width: 150px;
}

.detail-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-meta-grid span {
  border-radius: 999px;
  color: #285f9d;
  background: #edf6ff;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 620;
}

.detail-content {
  max-height: min(58vh, 620px);
  overflow: auto;
  margin: 0;
  border: 1px solid #e2eaf4;
  border-radius: 12px;
  color: #243247;
  background: #fbfdff;
  padding: 16px;
  font: inherit;
  line-height: 1.75;
  white-space: pre-wrap;
}

.detail-content.full-source {
  max-height: min(56vh, 560px);
}

.detail-content.compact-detail {
  max-height: 220px;
}

.detail-section {
  display: grid;
  gap: 10px;
}

.detail-section h4 {
  margin: 0;
  color: #172033;
  font-size: 15px;
  font-weight: 740;
}

.detail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-list span {
  padding: 6px 10px;
  border: 1px solid #dbe7f5;
  border-radius: 999px;
  color: #285f9d;
  background: #f6fbff;
  font-size: 12px;
}

.admin-filters.compact {
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 180px);
  padding: 0;
}

.admin-filters input,
.admin-filters select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #17233d;
  font-size: 14px;
  padding: 0 12px;
}

.admin-page .admin-filters input,
.admin-page .admin-filters select {
  min-height: 40px;
  border-color: #dbe4ef;
  border-radius: 10px;
  background: #fbfdff;
  color: #172033;
}

.admin-filters input:focus,
.admin-filters select:focus {
  outline: none;
  border-color: #1766d1;
  box-shadow: 0 0 0 3px rgba(23, 102, 209, 0.10);
}

.knowledge-section {
  display: grid;
  gap: 12px;
}

.admin-page #knowledgeView .content-grid {
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.62fr);
  align-items: start;
}

.knowledge-tabs {
  display: inline-flex;
  gap: 5px;
  margin-bottom: 14px;
  padding: 5px;
  border: 1px solid #dfe7f0;
  border-radius: 12px;
  background: #eef3f8;
}

#knowledgeView [data-knowledge-panel][hidden] {
  display: none !important;
}

.knowledge-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  padding: 0 20px;
  color: #617187;
  background: transparent;
  font-size: 14px;
  font-weight: 680;
  cursor: pointer;
}

.knowledge-tabs button:hover {
  color: #1766d1;
}

.knowledge-tabs button.active {
  color: #155fbf;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(31, 64, 102, 0.12);
}

.admin-page #knowledgeView[data-knowledge-tab="chunks"] .content-grid {
  grid-template-columns: minmax(0, 1fr);
}

.admin-page #knowledgeView[data-knowledge-tab="chunks"] .knowledge-manager {
  padding-top: 16px;
}

.admin-page #knowledgeView .knowledge-section {
  gap: 14px;
  padding: 18px;
  border: 1px solid #e3eaf3;
  border-radius: 14px;
  background: #fbfdff;
}

.admin-page .knowledge-maintenance-group {
  display: block;
  padding: 0;
}

.admin-page .knowledge-maintenance-group > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 18px 22px;
  color: #172033;
  cursor: pointer;
  list-style: none;
}

.admin-page .knowledge-maintenance-group > summary::-webkit-details-marker {
  display: none;
}

.admin-page .knowledge-maintenance-group > summary::after {
  content: "+";
  grid-column: 2;
  grid-row: 1 / span 2;
  color: #1766d1;
  font-size: 22px;
  font-weight: 500;
}

.admin-page .knowledge-maintenance-group[open] > summary::after {
  content: "−";
}

.admin-page .knowledge-maintenance-group > summary span {
  font-size: 15px;
  font-weight: 740;
}

.admin-page .knowledge-maintenance-group > summary small {
  color: #78879a;
  font-size: 12px;
  font-weight: 500;
}

.admin-page .knowledge-maintenance-group[open] > summary {
  border-bottom: 1px solid var(--admin-line);
  background: #fbfdff;
}

.admin-page .knowledge-maintenance-group > form {
  padding: 18px 22px 22px;
}

.admin-page #knowledgeView .section-title {
  align-items: center;
  padding-bottom: 13px;
}

.admin-page #knowledgeView .section-title h4 {
  font-size: 16px;
  letter-spacing: -0.01em;
}

.admin-page #knowledgeView .section-title p {
  margin-top: 5px;
  color: #68778a;
  font-size: 13px;
  line-height: 1.5;
}

.admin-page .chunk-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(150px, 0.55fr) minmax(120px, 0.42fr);
  gap: 10px;
}

.chunk-list-meta {
  color: #68778a;
  font-size: 12px;
  font-weight: 650;
}

.admin-page #documentChunkList .qa-log-card {
  gap: 10px;
  padding: 16px 17px;
  border-color: #e1e8f0;
  box-shadow: 0 4px 14px rgba(35, 61, 90, 0.035);
}

.admin-page #documentChunkList .qa-log-card h4 {
  color: #172033;
  font-size: 15px;
  line-height: 1.45;
}

.admin-page #documentChunkList .qa-log-card > p {
  color: #526174;
  font-size: 13px;
  line-height: 1.7;
}

.knowledge-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
}

.knowledge-pagination button {
  min-width: 36px;
  min-height: 34px;
  border: 1px solid #dbe4ef;
  border-radius: 9px;
  padding: 0 10px;
  color: #405268;
  background: #ffffff;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.knowledge-pagination button:hover:not(:disabled),
.knowledge-pagination button.active {
  border-color: #1766d1;
  color: #ffffff;
  background: #1766d1;
}

.knowledge-pagination button:disabled {
  cursor: default;
  opacity: 0.42;
}

.pagination-ellipsis {
  padding: 0 3px;
  color: #8a98a8;
}

/* Knowledge workspace */
.admin-page #knowledgeView {
  color: #162033;
}

.admin-page #knowledgeView button,
.admin-page #knowledgeView input,
.admin-page #knowledgeView select,
.admin-page #knowledgeView textarea {
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.admin-page #knowledgeView .knowledge-tabs {
  display: flex;
  width: max-content;
  margin: 0 0 18px;
  padding: 4px;
  border: 1px solid #e3e9f1;
  border-radius: 11px;
  background: #edf2f7;
  box-shadow: none;
}

.admin-page #knowledgeView .knowledge-tabs button {
  min-width: 116px;
  min-height: 40px;
  border-radius: 8px;
  padding: 0 22px;
  letter-spacing: 0.01em;
}

.admin-page #knowledgeView .knowledge-tabs button.active {
  color: #0f5ec7;
  box-shadow: 0 1px 4px rgba(28, 55, 88, 0.12);
}

.admin-page #knowledgeView [data-knowledge-panel]:not([hidden]) {
  animation: knowledge-panel-in 180ms ease-out;
}

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

.admin-page #knowledgeView .knowledge-maintenance-page {
  display: flex !important;
  flex-direction: column;
  gap: 0;
  align-items: start;
  overflow: hidden;
  border: 1px solid #e4eaf2;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(30, 55, 86, 0.055);
}

.admin-page #knowledgeView .knowledge-maintenance-page > .panel {
  width: 100%;
  min-width: 0;
}

.admin-page #knowledgeView .knowledge-maintenance-page > .panel:first-child {
  order: 2;
}

.admin-page #knowledgeView .knowledge-maintenance-page > .panel:last-child {
  order: 1;
  position: static;
  max-height: none;
  overflow: visible;
  border-bottom: 1px solid #e6ebf1;
}

.admin-page #knowledgeView .knowledge-maintenance-page > .panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.admin-page #knowledgeView .knowledge-maintenance-page > .panel:first-child > .panel-header {
  display: none;
}

.admin-page #knowledgeView .maintenance-tools-section {
  width: calc(100% - 40px);
  margin: 20px 20px 0;
  overflow: hidden;
  border: 1px solid #e7ecf2;
  border-radius: 11px;
  background: #ffffff;
}

.admin-page #knowledgeView .maintenance-tools-section > .panel-header {
  display: flex;
  padding: 17px 18px;
  border-bottom: 1px solid #e6ebf1;
  background: #ffffff;
}

.admin-page #knowledgeView .maintenance-tools-section > .panel-header h3 {
  font-size: 16px;
}

.admin-page #knowledgeView .maintenance-tools-section > .panel-header p {
  font-size: 13px;
}

.admin-page #knowledgeView .maintenance-tools-section + .knowledge-manager {
  width: 100%;
}

.admin-page #knowledgeView .knowledge-maintenance-page > .panel:first-child .knowledge-manager {
  padding-top: 20px;
}

.admin-page #knowledgeView .panel {
  border-color: #e4eaf2;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(30, 55, 86, 0.055);
}

.admin-page #knowledgeView .panel-header {
  padding: 19px 22px;
  background: #ffffff;
}

.admin-page #knowledgeView .panel-header h3 {
  font-size: 17px;
  font-weight: 720;
  letter-spacing: -0.015em;
}

.admin-page #knowledgeView .knowledge-manager {
  gap: 18px;
  padding: 20px;
}

.admin-page #knowledgeView .knowledge-mode-card {
  padding: 14px 16px;
  border: 0;
  border-radius: 10px;
  background: #f3f7fc;
  box-shadow: none;
}

.admin-page #knowledgeView .knowledge-section {
  gap: 14px;
  padding: 18px;
  border-color: #e7ecf2;
  border-radius: 11px;
  background: #ffffff;
}

.admin-page #knowledgeView .source-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 180px) minmax(120px, 150px);
  gap: 10px;
  padding: 0;
}

.admin-page #knowledgeView .article-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 170px) minmax(130px, 170px) minmax(120px, 150px);
  gap: 10px;
  padding: 0;
}

.list-result-summary {
  color: #718096;
  font-size: 12px;
  font-weight: 580;
}

.admin-page #knowledgeView .source-filters input,
.admin-page #knowledgeView .source-filters select {
  min-height: 40px;
}

.admin-page #knowledgeView #sourceList,
.admin-page #knowledgeView #knowledgeArticles {
  gap: 10px;
}

.admin-page #knowledgeView #sourceList .qa-log-card,
.admin-page #knowledgeView #knowledgeArticles .article-card {
  border-color: #e5eaf0;
  border-radius: 10px;
  box-shadow: none;
}

.admin-page #knowledgeView #sourceList .qa-log-card:hover,
.admin-page #knowledgeView #knowledgeArticles .article-card:hover {
  border-color: #cfdae7;
  background: #fcfdff;
}

.admin-page #knowledgeView #sourceList .qa-log-card h4 {
  font-size: 14px;
  font-weight: 680;
  line-height: 1.45;
}

.admin-page #knowledgeView #sourceList .qa-log-card > p,
.admin-page #knowledgeView #sourceList .source-preview {
  font-size: 13px;
  line-height: 1.65;
}

.admin-page #knowledgeView #sourceList .qa-log-head,
.admin-page #knowledgeView #sourceList .qa-log-meta,
.admin-page #knowledgeView #sourceList .qa-log-head small {
  font-size: 12px;
}

.admin-page #knowledgeView #knowledgeArticles .article-card h4 {
  font-size: 14px;
  font-weight: 680;
  line-height: 1.45;
}

.admin-page #knowledgeView #knowledgeArticles .article-card p {
  font-size: 13px;
  line-height: 1.65;
}

.admin-page #knowledgeView #knowledgeArticles .article-card small,
.admin-page #knowledgeView #knowledgeArticles .tag {
  font-size: 12px;
}

.admin-page #knowledgeView #knowledgeArticles .article-actions button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 620;
}

.admin-page #knowledgeView #sourceList .answer-note {
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.55;
}

.admin-page #knowledgeView #sourceList .answer-note strong {
  font-size: 12px;
}

.admin-page #knowledgeView .knowledge-maintenance-group {
  border-bottom: 1px solid #e7ecf2;
  background: #ffffff;
}

.admin-page #knowledgeView .knowledge-maintenance-group:last-child {
  border-bottom: 0;
}

.admin-page #knowledgeView .knowledge-maintenance-group > summary {
  padding: 17px 20px;
}

.admin-page #knowledgeView .knowledge-maintenance-group[open] > summary {
  background: #f7f9fc;
}

.admin-page #knowledgeView .knowledge-maintenance-group > form {
  padding: 18px 20px 22px;
}

.admin-page #knowledgeView #sourceForm,
.admin-page #knowledgeView #webSourceForm,
.admin-page #knowledgeView #articleForm {
  grid-template-columns: minmax(0, 1fr);
  max-width: 760px;
}

.admin-page #knowledgeView .knowledge-maintenance-group .compact-form {
  gap: 13px;
}

.admin-page #knowledgeView .knowledge-maintenance-group label {
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
}

.admin-page #knowledgeView .knowledge-maintenance-group input,
.admin-page #knowledgeView .knowledge-maintenance-group select,
.admin-page #knowledgeView .knowledge-maintenance-group textarea {
  min-height: 40px;
  border-radius: 8px;
  font-size: 13px;
}

.admin-page #knowledgeView .ghost-button,
.admin-page #knowledgeView .secondary-button,
.admin-page #knowledgeView .primary-button {
  min-height: 36px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 660;
}

.admin-page #knowledgeView .secondary-button:hover,
.admin-page #knowledgeView .primary-button:hover {
  transform: translateY(-1px);
}

.knowledge-chunks-page {
  padding: 24px;
}

.knowledge-page-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid #e8edf3;
}

.knowledge-page-heading h3 {
  margin: 4px 0 5px;
  color: #111827;
  font-size: 23px;
  font-weight: 740;
  letter-spacing: -0.025em;
}

.knowledge-page-heading p {
  color: #69788d;
  font-size: 13px;
}

.knowledge-eyebrow {
  color: #2971ce;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.14em;
}

.chunk-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 14px;
}

.chunk-overview > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 70px;
  padding: 15px 17px;
  border: 1px solid #e6ebf1;
  border-radius: 10px;
  background: #f9fbfd;
}

.chunk-overview span {
  color: #69788d;
  font-size: 12px;
  font-weight: 620;
}

.chunk-overview strong {
  color: #15243a;
  font-size: 24px;
  font-weight: 740;
}

.chunk-toolbar {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(160px, 220px) minmax(130px, 170px);
  gap: 10px;
  margin-bottom: 10px;
}

.chunk-toolbar input,
.chunk-toolbar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #dfe6ee;
  border-radius: 9px;
  color: #22324a;
  background: #ffffff;
  padding: 0 12px;
  font-size: 13px;
}

.chunk-search-field {
  position: relative;
}

.chunk-search-field span {
  position: absolute;
  top: 50%;
  left: 13px;
  color: #8190a3;
  font-size: 19px;
  transform: translateY(-52%);
  pointer-events: none;
}

.chunk-search-field input {
  padding-left: 38px;
}

.chunk-toolbar input:focus,
.chunk-toolbar select:focus {
  outline: none;
  border-color: #2873d3;
  box-shadow: 0 0 0 3px rgba(40, 115, 211, 0.09);
}

.inline-chunk-editor {
  display: grid;
  gap: 14px;
  margin: 14px 0;
  padding: 18px;
  border: 1px solid #9fc3ee;
  border-radius: 12px;
  background: #f7fbff;
  box-shadow: 0 8px 22px rgba(32, 91, 158, 0.08);
}

.inline-chunk-editor[hidden] {
  display: none !important;
}

.inline-chunk-editor-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.inline-chunk-editor-head span {
  color: #1766d1;
  font-size: 11px;
  font-weight: 720;
}

.inline-chunk-editor-head h4 {
  margin: 4px 0 0;
  color: #172033;
  font-size: 16px;
}

.inline-chunk-editor label {
  display: grid;
  gap: 7px;
  color: #34445a;
  font-size: 13px;
  font-weight: 650;
}

.inline-chunk-editor textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #cfdceb;
  border-radius: 9px;
  padding: 11px 12px;
  color: #1f3048;
  background: #ffffff;
  font-size: 13px;
  line-height: 1.65;
  pointer-events: auto !important;
  user-select: text !important;
  cursor: text;
}

.inline-chunk-editor textarea:focus {
  outline: none;
  border-color: #1766d1;
  box-shadow: 0 0 0 3px rgba(23, 102, 209, 0.1);
}

.knowledge-chunks-page .chunk-list-meta {
  padding: 5px 2px 10px;
  font-weight: 580;
}

.admin-page .knowledge-chunks-page #documentChunkList {
  gap: 8px;
}

.admin-page .knowledge-chunks-page #documentChunkList .qa-log-card {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 18px;
  padding: 15px 17px;
  border-radius: 10px;
  box-shadow: none;
}

.admin-page .knowledge-chunks-page #documentChunkList .qa-log-card:hover {
  border-color: #cad9eb;
  box-shadow: 0 5px 16px rgba(34, 67, 105, 0.055);
  transform: translateY(-1px);
}

.knowledge-chunks-page #documentChunkList .qa-log-head,
.knowledge-chunks-page #documentChunkList .qa-log-card h4,
.knowledge-chunks-page #documentChunkList .qa-log-card > p,
.knowledge-chunks-page #documentChunkList .qa-log-meta {
  grid-column: 1;
}

.knowledge-chunks-page #documentChunkList .chunk-image-preview,
.knowledge-chunks-page #documentChunkList .chunk-no-image {
  grid-column: 1;
}

.chunk-image-preview {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-top: 2px;
}

.chunk-image-preview img {
  width: 58px;
  height: 46px;
  border: 1px solid #e2e8ef;
  border-radius: 7px;
  object-fit: contain;
  background: #f5f7fa;
}

.chunk-image-preview span {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: #4f6682;
  background: #edf3f8;
  font-size: 11px;
  font-weight: 700;
}

.chunk-no-image {
  color: #9aa6b5;
  font-size: 11px;
}

.chunk-detail-images {
  padding: 14px;
  border: 1px solid #e4eaf1;
  border-radius: 10px;
  background: #f9fbfd;
}

.chunk-detail-images .answer-images {
  margin-top: 0;
}

.chunk-detail-images .answer-images-title {
  display: none;
}

.compact-empty {
  padding: 16px;
}

.chunk-editor {
  order: 1;
  border: 1px solid #dfe7f0;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.chunk-detail-images {
  order: 2;
}

.chunk-detail-content {
  order: 3;
}

.chunk-source-content {
  order: 4;
}

.chunk-editor-heading {
  padding: 14px 16px;
  color: #285f9d;
  background: #f6f9fc;
  font-size: 13px;
  font-weight: 700;
}

.chunk-editor-body {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-top: 1px solid #e5ebf2;
}

.chunk-editor-body label {
  display: grid;
  gap: 7px;
  color: #34445a;
  font-size: 13px;
  font-weight: 650;
}

.chunk-editor-body textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #dce4ed;
  border-radius: 9px;
  padding: 11px 12px;
  color: #24344b;
  background: #fbfdff;
  font-size: 13px;
  line-height: 1.65;
  pointer-events: auto !important;
  user-select: text !important;
  cursor: text;
}

.chunk-editor-body textarea:focus {
  outline: none;
  border-color: #2873d3;
  box-shadow: 0 0 0 3px rgba(40, 115, 211, 0.09);
}

.chunk-image-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chunk-image-upload-row span {
  color: #718096;
  font-size: 12px;
}

.knowledge-chunks-page #documentChunkList .button-row {
  grid-column: 2;
  grid-row: 1 / span 5;
  align-self: center;
  flex-wrap: nowrap;
}

.chunk-index {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 24px;
  border-radius: 7px;
  color: #55708e;
  background: #edf3f8;
  font-size: 11px;
  font-weight: 720;
}

.admin-page #knowledgeView .compact-edit-button {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12px;
}

.knowledge-mode-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid #d8eaff;
  border-radius: 8px;
  background: linear-gradient(135deg, #f5faff, #ffffff);
}

.admin-page .knowledge-mode-card {
  border-color: #d5e8ff;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(238, 247, 255, 0.92), rgba(255, 255, 255, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.knowledge-mode-card strong {
  color: #14345c;
  font-size: 15px;
}

.knowledge-mode-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.knowledge-mode-card span {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  color: #1766d1;
  background: #eaf4ff;
  font-size: 12px;
  white-space: nowrap;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.admin-page .section-title {
  border-bottom-color: var(--admin-line);
}

.compact-export {
  justify-self: end;
  min-height: 34px;
  font-size: 13px;
}

.section-title h4 {
  margin: 0;
  color: #17233d;
  font-size: 15px;
}

.admin-page .section-title h4 {
  color: #172033;
  font-size: 15px;
  font-weight: 720;
}

.section-title p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.qa-log-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-page .qa-log-card {
  gap: 10px;
  padding: 16px 18px;
  border-color: #e2eaf4;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: 0 8px 18px rgba(26, 49, 83, 0.04);
}

.qa-log-head,
.qa-log-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.qa-log-head small,
.qa-log-meta {
  color: var(--muted);
  font-size: 12px;
}

.qa-log-card .button-row {
  justify-content: flex-start;
  margin-top: 2px;
}

.qa-log-card h4,
.qa-log-card p {
  margin: 0;
}

.qa-log-card h4 {
  font-size: 16px;
}

.admin-page .qa-log-card h4 {
  color: #111827;
  font-size: 16px;
  font-weight: 720;
}

.qa-log-card p {
  color: #303030;
  line-height: 1.65;
}

.admin-page .qa-log-card p {
  color: #344256;
  font-size: 14px;
  line-height: 1.7;
}

.qa-log-card.compact-card {
  gap: 7px;
}

.access-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.access-stat-row span {
  min-height: 26px;
  border-radius: 999px;
  color: #315f88;
  background: #f1f7ff;
  padding: 4px 9px;
  font-size: 12px;
}

.admin-page .access-stat-row span {
  color: #285f9d;
  background: #edf6ff;
  font-weight: 620;
}

.source-preview {
  max-height: 120px;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid #e6edf7;
  border-radius: 8px;
  color: #303030;
  background: #fbfdff;
  line-height: 1.65;
  white-space: pre-wrap;
}

.admin-attachment-box {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e6edf7;
  border-radius: 8px;
  background: #fbfdff;
}

.admin-attachment-box > strong {
  color: #14345c;
  font-size: 13px;
}

.admin-attachment-item {
  display: grid;
  gap: 3px;
}

.admin-attachment-item span {
  color: #315f88;
  font-size: 12px;
  font-weight: 700;
}

.admin-attachment-item p {
  color: #5f7285;
  font-size: 12px;
  line-height: 1.55;
}

.form-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.inline-status {
  min-height: 0;
  margin: 0 18px;
  padding: 8px 0 0;
}

.global-status {
  min-height: 0;
  margin: -12px 0 14px;
}

.form-status[data-type="success"] {
  color: #0f7a38;
}

.form-status[data-type="error"] {
  color: #c0362c;
}

.admin-form-group {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.admin-page .admin-form-group {
  gap: 14px;
  padding: 20px 22px;
  border-bottom-color: var(--admin-line);
}

.admin-form-group:last-child {
  border-bottom: 0;
}

.admin-form-group h4 {
  margin: 0;
  color: #17233d;
  font-size: 15px;
}

.admin-page .admin-form-group h4 {
  color: #111827;
  font-size: 16px;
  font-weight: 740;
}

.form-help {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.admin-page .form-help {
  color: var(--admin-muted);
  font-size: 13px;
  line-height: 1.65;
}

.article-image-uploader {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px dashed #c9d8ea;
  border-radius: 12px;
  background: #f8fbff;
}

.article-image-uploader .secondary-button {
  width: fit-content;
}

.qa-log-card.muted-card {
  background: #f8fafc;
  border-color: #e4eaf2;
  opacity: 0.78;
}

.tag.warning {
  color: #8a5b00;
  background: #fff5d6;
  border-color: #f1d48a;
}

.compact-form {
  padding: 0;
}

.debug-search {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.debug-search input {
  flex: 1;
}

.debug-rules {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.debug-rules div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.debug-rules strong {
  color: #17233d;
  font-size: 14px;
}

.debug-rules span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.answer-box {
  padding: 16px 16px 0;
}

.answer-placeholder,
.answer-card {
  border: 1px solid #d5e7ff;
  border-radius: 8px;
  background: #f7fbff;
  padding: 16px;
}

.answer-placeholder {
  color: var(--muted);
  line-height: 1.7;
}

.answer-card {
  display: grid;
  gap: 10px;
}

.answer-card.low-confidence {
  border-color: #ffe1ad;
  background: #fffaf2;
}

.answer-kicker {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.answer-card h4,
.answer-card p {
  margin: 0;
}

.answer-card h4 {
  font-size: 18px;
}

.answer-card p,
.answer-card li,
.answer-note {
  color: #303030;
  line-height: 1.7;
}

.answer-card ol {
  margin: 0;
  padding-left: 22px;
}

.answer-note {
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 10px 12px;
}

.answer-sources {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.answer-images {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.answer-images-title {
  color: #5f7285;
  font-size: 13px;
  font-weight: 700;
}

.answer-intent-title {
  margin: 18px 0 8px;
  color: #183b66;
  font-size: 16px;
}

.answer-prerequisite {
  margin: 6px 0 10px;
  color: #52677d;
}

.answer-image-group + .answer-image-group {
  margin-top: 20px;
}

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

.answer-image-button {
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 1px solid #e6edf7;
  border-radius: 8px;
  background: #fbfdff;
  padding: 8px;
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.answer-image-button.low-resolution {
  justify-self: start;
  width: fit-content;
  max-width: 100%;
}

.answer-image-button:hover {
  transform: translateY(-1px);
  border-color: rgba(23, 114, 246, 0.26);
  box-shadow: 0 8px 18px rgba(23, 114, 246, 0.08);
}

.answer-image-button img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: contain;
  border-radius: 6px;
  background: #f6f7f9;
}

.answer-image-button .answer-image-title {
  justify-self: stretch;
  color: #3d5268;
  font-size: 12px;
  line-height: 1.4;
}

.answer-image-button.low-resolution img {
  justify-self: start;
  image-rendering: auto;
}

.image-preview {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(18, 18, 18, 0.64);
  padding: 24px;
}

.image-preview-card {
  width: fit-content;
  min-width: min(420px, 96vw);
  max-width: min(1080px, 96vw);
  max-height: 92vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.image-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.image-preview-card img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(92vh - 58px);
  place-self: center;
  object-fit: contain;
  background: #f6f7f9;
}

.answer-sources span {
  color: var(--muted);
  font-size: 13px;
}

.source-chip {
  min-height: 28px;
  border: 1px solid #b8d6ff;
  border-radius: 999px;
  color: var(--primary);
  background: #ffffff;
  padding: 0 10px;
  font-size: 12px;
}

.section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 0;
  color: var(--muted);
  font-size: 13px;
}

.section-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.article-list {
  display: grid;
  gap: 12px;
}

.article-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.article-card.highlight {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 114, 246, 0.14);
}

.article-main {
  min-width: 0;
}

.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
}

.tag.warn {
  color: #8a4b00;
  background: #fff4e5;
}

.tag.danger {
  color: var(--danger);
  background: #fff0f0;
}

.tag.neutral {
  color: #646464;
  background: #f6f6f6;
}

.tag.success {
  color: #0f7a38;
  background: #eaf8ef;
}

.article-card h4 {
  font-size: 16px;
  line-height: 1.45;
}

.article-card p {
  margin-top: 7px;
  color: #4f5f68;
  line-height: 1.65;
}

.article-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.article-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  align-items: flex-start;
}

.article-actions button {
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 0 10px;
}

.compact .article-card p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form label {
  display: grid;
  gap: 7px;
  color: #35434b;
  font-size: 14px;
}

.admin-page .stack-form label,
.admin-page .admin-form-group label {
  display: grid;
  gap: 8px;
  color: #344256;
  font-size: 13px;
  font-weight: 650;
}

.admin-page .button-row {
  gap: 10px;
}

.launch-check-list {
  display: grid;
  gap: 10px;
}

.launch-check-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #ffffff;
}

.launch-check-item > span {
  flex: 0 0 auto;
  min-width: 44px;
  border-radius: 999px;
  padding: 3px 8px;
  color: #315f88;
  background: #eaf3ff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.launch-check-item.fail > span {
  color: #b42318;
  background: #fee4e2;
}

.launch-check-item.warn > span {
  color: #9a5700;
  background: #fff4d6;
}

.launch-check-item.pass > span {
  color: #087443;
  background: #dcfae6;
}

.launch-check-item strong {
  display: block;
  color: #172033;
  font-size: 14px;
}

.launch-check-item p {
  margin: 4px 0 0;
  color: var(--admin-muted);
  font-size: 13px;
  line-height: 1.45;
}

.upload-progress-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dbe8f8;
  border-radius: 8px;
  background: #f8fbff;
}

.upload-progress-card[hidden] {
  display: none;
}

.upload-progress-head {
  display: flex;
  gap: 8px;
  align-items: center;
}

.upload-progress-head strong {
  color: #172033;
  font-size: 14px;
}

.upload-progress-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #1772f6;
  box-shadow: 0 0 0 4px rgba(23, 114, 246, 0.12);
}

.upload-progress-card.loading .upload-progress-dot {
  animation: pulseUpload 1s ease-in-out infinite;
}

.upload-progress-card.success {
  border-color: #b7ebc6;
  background: #f0fff4;
}

.upload-progress-card.success .upload-progress-dot {
  background: #12a150;
  box-shadow: 0 0 0 4px rgba(18, 161, 80, 0.12);
}

.upload-progress-card.error {
  border-color: #ffd1cc;
  background: #fff7f6;
}

.upload-progress-card.error .upload-progress-dot {
  background: #d93025;
  box-shadow: 0 0 0 4px rgba(217, 48, 37, 0.12);
}

.upload-progress-card p {
  margin: 0;
  color: var(--admin-muted);
  font-size: 13px;
  line-height: 1.5;
}

@keyframes pulseUpload {
  0%, 100% {
    opacity: 0.45;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.12);
  }
}

.toolbar {
  margin-bottom: 16px;
}

.toolbar input {
  flex: 1 1 320px;
}

.toolbar select {
  width: 180px;
}

.ticket-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}

.ticket-column {
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8fa;
  overflow: hidden;
}

.ticket-column h3 {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.ticket-stack {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.ticket-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  text-align: left;
}

.ticket-card h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
}

.ticket-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.bar-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}

.bar-fill {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  border: 0;
  background: #e8eef0;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
}

.bar-fill::-webkit-progress-bar {
  border-radius: inherit;
  background: #e8eef0;
}

.bar-fill::-webkit-progress-value {
  border-radius: inherit;
  background: var(--primary);
}

.bar-fill::-moz-progress-bar {
  border-radius: inherit;
  background: var(--primary);
}

.empty-searches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.admin-page #adminDetailDialog {
  width: min(980px, calc(100vw - 32px));
}

dialog::backdrop {
  background: rgba(15, 24, 32, 0.42);
}

.dialog-card {
  margin: 0;
  background: var(--surface);
}

.admin-detail-card {
  max-height: min(86vh, 860px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.dialog-header,
.dialog-actions {
  padding: 18px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h3 {
  margin: 4px 0 0;
}

.dialog-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.admin-detail-card .dialog-body {
  overflow: auto;
  align-content: start;
}

.detail-box {
  padding: 12px;
  border-radius: 8px;
  background: #f5f7f8;
  line-height: 1.65;
}

.dialog-actions {
  border-top: 1px solid var(--line);
}

.dialog-actions select {
  width: 170px;
}

.empty-state {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-action {
  margin-top: 14px;
}

.admin-lock {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(246, 247, 249, 0.96);
  padding: 20px;
}

.admin-lock-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 22px;
}

.admin-lock-card h2,
.admin-lock-card p {
  margin: 0;
}

.admin-lock-card p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.admin-lock-card form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.admin-lock-error {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .admin-page {
    overflow-x: auto;
  }

  .admin-page .app-shell {
    min-width: 820px;
  }

  .admin-page .main {
    padding: 24px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 16px;
  }

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

  .admin-page .sidebar {
    position: sticky;
    left: 0;
    min-width: 820px;
    overflow-x: auto;
  }

  .admin-page .nav {
    grid-template-columns: repeat(6, minmax(112px, 1fr));
  }

  .side-panel {
    display: none;
  }

  .hero-band,
  .content-grid,
  .ticket-board,
  .ops-checklist {
    grid-template-columns: 1fr;
  }

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

  .admin-page .metric-grid.large {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }
}

@media (max-width: 1180px) {
  .admin-page {
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .admin-page .app-shell {
    display: block;
    height: auto;
    min-width: 0;
    overflow: visible;
  }

  .admin-page .sidebar {
    position: sticky;
    top: 0;
    left: auto;
    z-index: 20;
    min-width: 0;
    height: auto;
    padding: 14px 18px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--admin-line);
  }

  .admin-page .brand {
    margin-bottom: 8px;
  }

  .admin-page .nav {
    grid-template-columns: repeat(6, minmax(96px, 1fr));
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .admin-page .nav-item {
    justify-content: center;
    min-height: 38px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .admin-page .nav-item.active {
    box-shadow: inset 0 -3px 0 #1772f6;
  }

  .admin-page .main {
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 24px;
  }

  .admin-page .content-grid {
    grid-template-columns: 1fr;
  }

  .admin-page #knowledgeView .knowledge-maintenance-page > .panel:last-child {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .admin-page .panel-header {
    align-items: flex-start;
  }

  .admin-page .metric-grid.large {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 680px) {
  .main {
    padding: 18px;
  }

  .brand {
    align-items: flex-start;
  }

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

  .topbar,
  .panel-header,
  .article-card {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .article-actions,
  .dialog-actions {
    width: 100%;
  }

  .top-actions button,
  .article-actions button,
  .dialog-actions button,
  .dialog-actions select {
    flex: 1 1 auto;
  }

  .search-box,
  .metric-grid,
  .metric-grid.large {
    grid-template-columns: 1fr;
  }

  .admin-filters,
  .admin-filters.compact {
    grid-template-columns: 1fr;
  }

  .admin-page .admin-filters,
  .admin-page .admin-filters.compact {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-page .admin-time-toolbar {
    justify-content: flex-start;
  }

  .answer-image-grid {
    grid-template-columns: 1fr;
  }

  .chat-intro {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 22px 18px;
  }

  .mascot-scene {
    min-height: 112px;
    order: -1;
  }

  .mascot-scene::before {
    width: 112px;
    height: 112px;
  }

  .ask-mascot {
    width: 96px;
  }

  .chat-intro h3 {
    font-size: 26px;
  }

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

/* Supplier-facing full-screen chat workspace */
.supplier-page {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% 0%, rgba(23, 114, 246, 0.10), transparent 34%),
    linear-gradient(180deg, #f4f9ff 0%, #ffffff 58%, #ffffff 100%);
}

.supplier-page:not(.supplier-authenticated) .app-shell {
  visibility: hidden;
}

.supplier-page.supplier-auth-pending .supplier-access-lock,
.supplier-page.supplier-auth-pending .app-shell {
  visibility: hidden;
}

.supplier-page.supplier-authenticated .supplier-access-lock {
  display: none;
}

.supplier-access-lock {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 48px);
  background:
    radial-gradient(circle at 50% 0%, rgba(23, 114, 246, 0.16), transparent 38%),
    linear-gradient(180deg, #f3f9ff 0%, #ffffff 100%);
}

.supplier-access-card {
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid rgba(23, 114, 246, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 70px rgba(23, 82, 150, 0.14);
}

.supplier-access-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #315f88;
  font-size: 13px;
  font-weight: 700;
}

.supplier-access-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.supplier-access-card h1 {
  margin: 22px 0 8px;
  color: #0f2f5f;
  font-size: 28px;
  letter-spacing: 0;
}

.supplier-access-card p {
  margin: 0;
  color: #5f7285;
  line-height: 1.7;
}

.supplier-login-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.supplier-login-form label {
  display: grid;
  gap: 7px;
  color: #315f88;
  font-size: 13px;
  font-weight: 700;
}

.supplier-login-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d8e7f7;
  border-radius: 10px;
  background: #ffffff;
  color: #17233d;
  font-size: 15px;
  padding: 0 13px;
}

.supplier-login-form input:focus {
  outline: none;
  border-color: #1766d1;
  box-shadow: 0 0 0 3px rgba(23, 102, 209, 0.10);
}

.password-field {
  position: relative;
  display: block;
}

.admin-page .password-field {
  display: block;
}

.password-field input {
  padding-right: 52px;
}

.admin-page .password-field input {
  min-height: 44px;
  padding-right: 54px;
  font-size: 15px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  min-height: 34px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  color: #a3acc2;
  background: transparent;
  padding: 0;
  transform: translateY(-50%);
}

.admin-page .password-toggle {
  right: 8px;
  width: 36px;
  height: 32px;
  min-height: 32px;
  border-radius: 8px;
  color: #8a98ad;
}

.password-toggle:hover {
  color: #7f8ca8;
  background: #f5f7fb;
}

.admin-page .password-toggle:hover {
  color: #1772f6;
  background: #eef6ff;
}

.password-toggle:focus-visible {
  outline: 2px solid rgba(23, 114, 246, 0.22);
  outline-offset: 2px;
}

.password-toggle-icon {
  display: block;
  width: 20px;
  height: 20px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.1'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M6.2%2013.2c1.45%201.55%203.4%202.3%205.8%202.3s4.35-.75%205.8-2.3'/%3E%3Cpath%20d='M8.8%2015.1%207.8%2017'/%3E%3Cpath%20d='M12%2015.5V18'/%3E%3Cpath%20d='M15.2%2015.1l1%201.9'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.1'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M6.2%2013.2c1.45%201.55%203.4%202.3%205.8%202.3s4.35-.75%205.8-2.3'/%3E%3Cpath%20d='M8.8%2015.1%207.8%2017'/%3E%3Cpath%20d='M12%2015.5V18'/%3E%3Cpath%20d='M15.2%2015.1l1%201.9'/%3E%3C/svg%3E") center / contain no-repeat;
}

.password-toggle[aria-pressed="true"] .password-toggle-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.1'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M2%2012s3.7-6%2010-6%2010%206%2010%206-3.7%206-10%206S2%2012%202%2012Z'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='2.7'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.1'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M2%2012s3.7-6%2010-6%2010%206%2010%206-3.7%206-10%206S2%2012%202%2012Z'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='2.7'/%3E%3C/svg%3E");
}

.supplier-page .app-shell,
.supplier-page .main,
.supplier-page #portalView {
  min-height: 100dvh;
}

.supplier-page .main {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(16px, 2.4vw, 32px);
}

.supplier-page .topbar {
  display: none;
}

.supplier-page .chat-shell {
  width: 100%;
  max-width: none;
  min-height: calc(100dvh - clamp(32px, 4.8vw, 64px));
  height: calc(100dvh - clamp(32px, 4.8vw, 64px));
  margin: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: clamp(12px, 1.6vw, 18px);
  overflow: hidden;
}

.home-start-panel {
  display: contents;
}

.supplier-top-brand {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  justify-self: start;
  align-self: start;
  gap: 8px;
  width: 100%;
  max-width: none;
  min-height: 32px;
  color: #315f88;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.supplier-brand-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.supplier-brand-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-logout-button {
  flex: 0 0 auto;
  min-height: 30px;
  border: 1px solid rgba(23, 114, 246, 0.12);
  border-radius: 999px;
  color: #6a7b8b;
  background: rgba(255, 255, 255, 0.66);
  padding: 0 12px;
  font-size: 12px;
}

.supplier-logout-button:hover {
  color: #1772f6;
  border-color: rgba(23, 114, 246, 0.28);
  background: #ffffff;
}

.supplier-logo-image {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: none;
}

.chat-homebar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 34px;
}

.back-home-button {
  min-height: 34px;
  border: 1px solid rgba(23, 114, 246, 0.16);
  border-radius: 999px;
  color: #24537d;
  background: rgba(255, 255, 255, 0.78);
  padding: 0 14px;
  box-shadow: 0 8px 24px rgba(29, 91, 158, 0.08);
}

.back-home-button:hover {
  color: #1772f6;
  border-color: rgba(23, 114, 246, 0.32);
}

.inline-back-home {
  display: none;
  width: fit-content;
  min-height: 26px;
  margin-bottom: 7px;
  padding: 0 8px;
  border-color: rgba(23, 114, 246, 0.10);
  color: #5f7285;
  background: rgba(255, 255, 255, 0.48);
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
}

.chat-compact-header {
  display: contents;
}

.supplier-page .chat-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: auto;
  padding: clamp(16px, 1.8vw, 22px);
  border: 1px solid rgba(23, 114, 246, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.92), rgba(233, 244, 255, 0.78)),
    linear-gradient(90deg, rgba(23, 114, 246, 0.10), rgba(0, 191, 255, 0.04));
  box-shadow: 0 22px 60px rgba(29, 91, 158, 0.12);
}

.supplier-brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: #26547c;
  font-size: 13px;
  font-weight: 700;
}

.zhihu-logo.mini {
  width: 44px;
  height: 28px;
  border-width: 1px;
  font-size: 14px;
}

.supplier-page .chat-intro h3 {
  margin-top: 0;
  color: #082f63;
  font-size: clamp(24px, 2.6vw, 34px);
}

.supplier-page .chat-intro p:last-child {
  max-width: 760px;
  color: #46637e;
  font-size: clamp(14px, 1.2vw, 16px);
}

.chat-intro-kicker {
  display: none;
}

.supplier-page .mascot-scene {
  min-height: 112px;
}

.supplier-page .mascot-scene::before {
  width: clamp(96px, 10vw, 132px);
  height: clamp(96px, 10vw, 132px);
  border: 1px solid rgba(23, 114, 246, 0.20);
  background:
    linear-gradient(135deg, rgba(23, 114, 246, 0.13), rgba(255, 255, 255, 0.22));
}

.supplier-page .ask-mascot {
  width: clamp(74px, 8vw, 104px);
}

.ask-mascot-chat {
  display: none;
}

.mascot-scene-home {
  display: none;
}

.supplier-page .chat-thread {
  min-height: 0;
  overflow-y: auto;
  padding: clamp(14px, 1.6vw, 22px);
  scroll-padding-bottom: 24px;
  border: 1px solid rgba(23, 114, 246, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
}

.supplier-page .message-bubble {
  max-width: min(720px, 100%);
  border-color: rgba(23, 114, 246, 0.13);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(28, 77, 128, 0.06);
  font-size: 14px;
}

.supplier-page .chat-message.user .message-bubble {
  background: linear-gradient(135deg, #1772f6, #0f83ff);
  box-shadow: 0 14px 32px rgba(23, 114, 246, 0.20);
}

.supplier-page .message-avatar {
  box-shadow: 0 0 0 4px rgba(23, 114, 246, 0.10);
}

.supplier-page .chat-composer {
  position: relative;
  bottom: auto;
  grid-template-columns: minmax(0, 1fr) auto;
  border-color: rgba(23, 114, 246, 0.18);
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(23, 114, 246, 0.09);
  backdrop-filter: none;
}

.supplier-page .chat-composer textarea {
  min-height: 50px;
  color: #10253c;
  background: transparent;
  resize: none;
}

.supplier-page .chat-composer textarea::placeholder {
  color: #8a9bad;
}

.supplier-page .chat-send-button:disabled {
  cursor: default;
  opacity: 0.44;
  background: #9fc7fb;
}

.keyword-suggestions {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: min(100%, 1100px);
  overflow: visible;
}

.keyword-suggestion-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
}

.keyword-suggestions button {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  color: #315f88;
  background: #ffffff;
  padding: 0 7px;
  box-shadow: none;
  line-height: 1.35;
  white-space: nowrap;
  font-size: clamp(10px, 0.9vw, 12px);
}

.keyword-suggestions button:hover {
  color: #1772f6;
  border-color: rgba(23, 114, 246, 0.32);
  background: rgba(255, 255, 255, 0.94);
}

.supplier-page .primary-button {
  min-width: 86px;
  background: #1772f6;
  box-shadow: none;
}

.supplier-page.is-empty-chat .chat-send-button {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  height: 40px;
  min-height: 40px;
  justify-self: end;
  border-radius: 50%;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

@media (min-width: 1280px) {
  .supplier-page .chat-thread {
    padding-left: clamp(22px, 5vw, 72px);
    padding-right: clamp(22px, 5vw, 72px);
  }
}

@media (max-width: 760px) {
  .admin-page #retrievalEvaluationResult .retrieval-metric-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-page #retrievalEvaluationResult .metric-card:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .admin-page #knowledgeView #sourceForm,
  .admin-page #knowledgeView #webSourceForm,
  .admin-page #knowledgeView #articleForm {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-page #knowledgeView .source-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-page #knowledgeView .article-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-page #knowledgeView .knowledge-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .admin-page #knowledgeView .knowledge-tabs button {
    min-width: 0;
    padding: 0 12px;
  }

  .knowledge-chunks-page {
    padding: 17px;
  }

  .knowledge-page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .chunk-overview,
  .chunk-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .chunk-overview {
    gap: 8px;
  }

  .chunk-overview > div {
    min-height: 58px;
  }

  .admin-page .knowledge-chunks-page #documentChunkList .qa-log-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .knowledge-chunks-page #documentChunkList .button-row {
    grid-column: 1;
    grid-row: auto;
  }

  .admin-page .chunk-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .knowledge-pagination {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .answer-actions {
    opacity: 1;
  }

  .answer-image-grid {
    grid-template-columns: 1fr;
  }

  .supplier-page .main {
    padding: 12px;
  }

  .supplier-page .chat-shell {
    min-height: calc(100dvh - 24px);
    height: calc(100dvh - 24px);
  }

  .supplier-page .chat-intro {
    grid-template-columns: 1fr;
    min-height: auto;
    text-align: left;
  }

  .supplier-page .mascot-scene {
    display: none;
  }

  .supplier-page .chat-thread {
    padding: 10px 2px 12px;
  }

  .supplier-page .chat-message,
  .supplier-page .chat-message.user {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .supplier-page .chat-message.user .message-avatar {
    grid-column: 1;
  }

  .supplier-page .chat-message.user .message-bubble {
    grid-column: 2;
    justify-self: stretch;
  }

  .supplier-page .message-avatar {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .supplier-page .chat-composer {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .supplier-page .primary-button {
    width: auto;
  }

  .supplier-page.is-empty-chat .chat-composer {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .supplier-page.is-empty-chat .primary-button {
    width: auto;
  }

}

.supplier-page.is-empty-chat .chat-shell {
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
  max-width: none;
  margin: 0 auto;
}

.supplier-page.is-empty-chat .chat-homebar {
  display: none;
}

.supplier-page.is-empty-chat .home-start-panel {
  grid-row: 2 / 3;
  position: relative;
  align-self: center;
  width: min(100%, 820px);
  margin: 0 auto;
  display: block;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.supplier-page.is-empty-chat .home-start-content {
  min-width: 0;
}

.supplier-page.is-empty-chat .chat-intro {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  display: block;
  text-align: center;
}

.supplier-page.is-empty-chat .chat-intro h3 {
  margin-top: 0;
  color: #0f2f5f;
  font-size: clamp(34px, 5vw, 50px);
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.2vw, 12px);
}

.supplier-page.is-empty-chat .chat-intro p:last-child {
  max-width: 620px;
  margin: 12px auto 0;
  font-size: 16px;
  color: #5f7285;
}

.supplier-page.is-empty-chat .chat-thread {
  display: none;
}

.supplier-page.is-empty-chat .scroll-bottom-button {
  display: none;
}

.supplier-page.is-empty-chat .mascot-scene-home {
  position: static;
  z-index: auto;
  display: inline-grid;
  min-height: 0;
  align-self: center;
  justify-self: center;
  transform: translateY(-2px);
  pointer-events: none;
}

.supplier-page.is-empty-chat .mascot-scene::before {
  display: none;
}

.supplier-page.is-empty-chat .mascot-scene-chat {
  display: none;
}

.supplier-page.is-empty-chat .ask-mascot {
  width: clamp(32px, 3.8vw, 44px);
  max-height: 54px;
  object-fit: contain;
  opacity: 0.78;
}

.supplier-page.is-empty-chat .chat-composer {
  z-index: 1;
  position: relative;
  bottom: auto;
  width: 100%;
  margin: 32px 0 0;
  padding: 16px 16px 16px 20px;
  border-radius: 18px;
  align-items: center;
}

.supplier-page.is-empty-chat .chat-composer textarea {
  min-height: 66px;
  padding: 10px 4px;
  line-height: 1.6;
}

.supplier-page.is-empty-chat .keyword-suggestions {
  display: flex;
  justify-content: center;
  margin-top: 14px;
  padding: 0 clamp(4px, 4vw, 34px);
}

.supplier-page:not(.is-empty-chat) .keyword-suggestions {
  display: none;
}

.supplier-page:not(.is-empty-chat) .chat-shell {
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
}

.supplier-page:not(.is-empty-chat) .supplier-top-brand,
.supplier-page:not(.is-empty-chat) .chat-homebar {
  display: none;
}

.supplier-page:not(.is-empty-chat) .home-start-panel {
  display: contents;
}

.supplier-page:not(.is-empty-chat) .home-start-content {
  display: contents;
}

.supplier-page:not(.is-empty-chat) .chat-intro {
  grid-row: 1 / 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px;
  align-items: center;
  min-height: 58px;
  padding: 9px 14px;
  border-color: rgba(23, 114, 246, 0.08);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: none;
}

.supplier-page:not(.is-empty-chat) .chat-compact-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 2px;
}

.supplier-page:not(.is-empty-chat) .inline-back-home {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin: 0;
  min-height: 24px;
  padding: 0 8px;
  color: #5f7285;
  font-size: 12px;
  background: transparent;
  border-color: rgba(23, 114, 246, 0.12);
}

.supplier-page:not(.is-empty-chat) .chat-intro-kicker {
  display: block;
  overflow: hidden;
  margin: 0;
  color: #6d7f90;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-page:not(.is-empty-chat) .chat-intro h3 {
  display: block;
  color: #0f2f5f;
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.15;
}

.supplier-page:not(.is-empty-chat) .chat-intro p:last-child {
  margin-top: 4px;
  color: #6a7b8b;
  font-size: 12px;
  line-height: 1.35;
}

.supplier-page:not(.is-empty-chat) .mascot-scene {
  display: grid;
  min-height: 44px;
  place-items: center;
  justify-self: center;
  position: relative;
  opacity: 0.76;
}

.supplier-page:not(.is-empty-chat) .mascot-scene::before {
  display: block;
  content: "";
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border-color: rgba(23, 114, 246, 0.10);
  background: linear-gradient(180deg, rgba(230, 243, 255, 0.80), rgba(246, 251, 255, 0.70));
}

.supplier-page:not(.is-empty-chat) .ask-mascot {
  position: relative;
  z-index: 1;
  width: 34px;
  opacity: 0.9;
}

.supplier-page:not(.is-empty-chat) .mascot-scene-home,
.supplier-page:not(.is-empty-chat) .ask-mascot-home {
  display: none;
}

.supplier-page:not(.is-empty-chat) .mascot-scene-chat,
.supplier-page:not(.is-empty-chat) .ask-mascot-chat {
  display: block;
}

.supplier-page:not(.is-empty-chat) .chat-thread {
  grid-row: 2 / 3;
  min-height: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.supplier-page:not(.is-empty-chat) .chat-composer {
  grid-row: 3 / 4;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 9px 11px;
}

.supplier-page:not(.is-empty-chat) .chat-composer textarea {
  min-height: 44px;
  font-size: 14px;
}

.supplier-page:not(.is-empty-chat) .chat-send-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  border-radius: 50%;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

@media (max-width: 760px) {
  .supplier-page.is-empty-chat .chat-shell {
    grid-template-rows: auto minmax(0, 1fr);
    max-width: 100%;
  }

  .supplier-top-brand {
    max-width: calc(100vw - 24px);
    font-size: 12px;
  }

  .supplier-logo-image {
    width: 26px;
    height: 26px;
  }

  .supplier-page.is-empty-chat .home-start-panel {
    display: block;
    padding: 22px;
  }

  .supplier-page.is-empty-chat .chat-intro h3 {
    font-size: 32px;
  }

  .supplier-page.is-empty-chat .chat-intro {
    text-align: center;
  }

  .supplier-page.is-empty-chat .chat-intro h3 {
    gap: 8px;
  }

  .supplier-page.is-empty-chat .chat-intro p:last-child {
    margin-left: auto;
    margin-right: auto;
    font-size: 15px;
  }

  .supplier-page.is-empty-chat .mascot-scene-home {
    display: inline-grid;
  }

  .supplier-page.is-empty-chat .ask-mascot {
    width: 32px;
  }

  .supplier-page.is-empty-chat .chat-composer {
    margin-top: 18px;
  }

  .supplier-page:not(.is-empty-chat) .chat-composer {
    width: 100%;
    padding: 10px;
  }

  .supplier-page:not(.is-empty-chat) .chat-intro {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 9px 12px;
  }

  .supplier-page:not(.is-empty-chat) .chat-intro h3 {
    display: block;
    font-size: 20px;
  }

  .supplier-page:not(.is-empty-chat) .chat-intro p:last-child {
    display: block;
    font-size: 13px;
  }

  .supplier-page:not(.is-empty-chat) .chat-message,
  .supplier-page:not(.is-empty-chat) .chat-message.user {
    gap: 8px;
  }

  .supplier-page:not(.is-empty-chat) .message-bubble {
    max-width: 100%;
    padding: 12px;
  }

  .supplier-page:not(.is-empty-chat) .mascot-scene-chat {
    display: none;
  }

  .supplier-page.is-empty-chat .keyword-suggestions {
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
  }

}

@media (max-height: 760px) {
  .supplier-page:not(.is-empty-chat) .chat-shell {
    gap: 8px;
  }

  .supplier-page:not(.is-empty-chat) .chat-intro {
    min-height: 0;
    padding: 8px 12px;
  }

  .supplier-page:not(.is-empty-chat) .chat-intro-kicker {
    margin-bottom: 0;
    font-size: 12px;
  }

  .supplier-page:not(.is-empty-chat) .chat-intro h3 {
    display: block;
    font-size: 20px;
  }

  .supplier-page:not(.is-empty-chat) .chat-intro p:last-child {
    display: block;
    margin-top: 5px;
    font-size: 13px;
  }

  .supplier-page:not(.is-empty-chat) .mascot-scene-chat {
    display: none;
  }

  .supplier-page:not(.is-empty-chat) .chat-thread {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .supplier-page:not(.is-empty-chat) .chat-composer {
    padding: 10px 12px;
  }

  .supplier-page:not(.is-empty-chat) .chat-composer textarea {
    min-height: 42px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .supplier-page.is-empty-chat .chat-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .supplier-page.is-empty-chat .home-start-panel {
    align-self: center;
    padding: 0 12px;
  }

  .supplier-page.is-empty-chat .ask-mascot {
    width: 32px;
  }
}

/* Supplier conversation: centered, lightweight reading layout. */
.supplier-page:not(.is-empty-chat) .chat-shell {
  background: #ffffff;
}

.supplier-page:not(.is-empty-chat) .chat-thread {
  width: min(820px, calc(100% - 40px));
  margin-right: auto;
  margin-left: auto;
  padding: 24px 4px 34px;
}

.supplier-page:not(.is-empty-chat) .chat-message {
  width: 100%;
  max-width: 100%;
  gap: 12px;
  align-items: flex-start;
}

.supplier-page:not(.is-empty-chat) .chat-message.assistant .message-avatar {
  width: 30px;
  min-width: 30px;
  height: 30px;
  margin-top: 1px;
  border: 1px solid #dcecff;
  background: #1772f6;
  box-shadow: none;
  font-size: 13px;
}

.supplier-page:not(.is-empty-chat) .chat-message.assistant .message-bubble {
  width: min(100%, 720px);
  max-width: 720px;
  padding: 2px 0 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #1f2329;
}

.supplier-page:not(.is-empty-chat) .message-bubble,
.supplier-page:not(.is-empty-chat) .message-bubble p,
.supplier-page:not(.is-empty-chat) .message-bubble li {
  font-size: 14px;
  line-height: 1.72;
}

.supplier-page:not(.is-empty-chat) .message-bubble h4,
.supplier-page:not(.is-empty-chat) .message-bubble strong {
  font-size: 14px;
}

.supplier-page:not(.is-empty-chat) .chat-message.user {
  width: min(100%, 760px);
  margin-left: auto;
}

.supplier-page:not(.is-empty-chat) .chat-message.user .message-avatar {
  display: none;
}

.supplier-page:not(.is-empty-chat) .chat-message.user .message-bubble {
  max-width: min(72%, 520px);
  padding: 9px 14px;
  border: 0;
  border-radius: 14px;
  background: #f3f4f6;
  box-shadow: none;
  color: #1f2329;
}

.supplier-page:not(.is-empty-chat) .answer-feedback {
  margin-top: 18px;
  padding-top: 12px;
  font-size: 12px;
}

.supplier-page:not(.is-empty-chat) .answer-feedback button {
  font-size: 12px;
}

.supplier-page:not(.is-empty-chat) .chat-composer {
  width: min(760px, calc(100% - 40px));
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(31, 35, 41, 0.08);
}

.supplier-page:not(.is-empty-chat) .chat-intro {
  width: min(820px, calc(100% - 40px));
  margin-right: auto;
  margin-left: auto;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
}

.supplier-page:not(.is-empty-chat) .chat-intro > div:first-child {
  order: 2;
}

.supplier-page:not(.is-empty-chat) .mascot-scene-chat {
  display: grid;
  order: 1;
  align-self: center;
}

.supplier-page:not(.is-empty-chat) .ask-mascot-chat {
  width: 34px;
  max-height: 40px;
}

@media (max-width: 720px) {
  .supplier-page:not(.is-empty-chat) .chat-thread,
  .supplier-page:not(.is-empty-chat) .chat-intro,
  .supplier-page:not(.is-empty-chat) .chat-composer {
    width: calc(100% - 24px);
  }

  .supplier-page:not(.is-empty-chat) .chat-message.assistant .message-bubble {
    max-width: calc(100% - 42px);
  }

  .supplier-page:not(.is-empty-chat) .chat-message.user .message-bubble {
    max-width: 86%;
  }
}

/* Compact supplier composer and clearer user-message contrast. */
.supplier-page:not(.is-empty-chat) .chat-composer {
  min-height: 0;
  padding: 6px 10px;
  border-radius: 14px;
}

.supplier-page:not(.is-empty-chat) .chat-composer textarea {
  min-height: 38px;
  max-height: 92px;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 14px;
  line-height: 1.45;
}

.supplier-page:not(.is-empty-chat) .chat-send-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
}

.supplier-page:not(.is-empty-chat) .chat-message.user .message-bubble {
  background: #1772f6;
  color: #ffffff;
}

.supplier-page:not(.is-empty-chat) .chat-message.user .message-bubble p {
  color: inherit;
}

/* Place the active-chat composer closer to the viewport bottom so the
   conversation keeps more of the available reading height. */
.supplier-page:not(.is-empty-chat) .main {
  box-sizing: border-box;
  height: 100dvh;
  padding-bottom: 8px;
}

.supplier-page:not(.is-empty-chat) {
  overflow: hidden;
}

.supplier-page:not(.is-empty-chat) #portalView {
  min-height: 0;
  height: 100%;
}

.supplier-page:not(.is-empty-chat) .chat-shell {
  min-height: calc(100dvh - clamp(16px, 2.4vw, 32px) - 8px);
  height: calc(100dvh - clamp(16px, 2.4vw, 32px) - 8px);
}

@media (max-width: 720px) {
  .supplier-page:not(.is-empty-chat) .main {
    padding-bottom: 4px;
  }

  .supplier-page:not(.is-empty-chat) .chat-shell {
    min-height: calc(100dvh - 16px);
    height: calc(100dvh - 16px);
  }
}

/* Keep the assistant identity in a calm left rail only when the viewport has
   enough room for both the rail and the centered conversation. At narrower
   desktop widths it remains in normal flow above the conversation, avoiding
   overlap while the page is resized. */
@media (min-width: 1280px) {
  .supplier-page:not(.is-empty-chat) .chat-intro {
    position: fixed;
    top: 28px;
    left: 28px;
    z-index: 4;
    width: 188px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
  }

  .supplier-page:not(.is-empty-chat) .chat-intro-kicker,
  .supplier-page:not(.is-empty-chat) .inline-back-home {
    display: none;
  }

  .supplier-page:not(.is-empty-chat) .chat-intro h3 {
    margin: 1px 0 5px;
    font-size: 15px;
    line-height: 1.4;
  }

  .supplier-page:not(.is-empty-chat) .chat-intro p:last-child {
    display: block;
    margin: 0;
    color: #7a8594;
    font-size: 12px;
    line-height: 1.55;
  }

  .supplier-page:not(.is-empty-chat) .mascot-scene-chat {
    align-self: start;
  }
}

/* Keep scrolling available without showing a visual scrollbar. */
.supplier-page .chat-thread {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.supplier-page .chat-thread::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
/* Persistent navigation for the active conversation. */
.supplier-page:not(.is-empty-chat) .inline-back-home {
  display: none;
}

.chat-return-home-button {
  display: none;
}

.supplier-page:not(.is-empty-chat) .chat-return-home-button {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(23, 114, 246, 0.16);
  border-radius: 18px;
  color: #31546f;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 20px rgba(31, 63, 89, 0.08);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.supplier-page:not(.is-empty-chat) .chat-return-home-button:hover {
  color: #1769e0;
  border-color: rgba(23, 114, 246, 0.34);
  box-shadow: 0 8px 24px rgba(23, 114, 246, 0.12);
  transform: translateY(-1px);
}

.supplier-page:not(.is-empty-chat) .chat-return-home-button:focus-visible {
  outline: 3px solid rgba(23, 114, 246, 0.2);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .supplier-page:not(.is-empty-chat) .chat-return-home-button {
    top: 12px;
    right: 12px;
    min-height: 32px;
    padding: 0 11px;
    font-size: 12px;
  }
}
.knowledge-maintenance-stack {
  display: flex !important;
  flex-direction: column !important;
  width: 100%;
}

.knowledge-maintenance-stack > .maintenance-order-primary {
  order: 1;
  width: 100%;
  min-width: 0;
}

.knowledge-maintenance-stack > .maintenance-order-secondary {
  order: 2;
  width: 100%;
  min-width: 0;
}

.supplier-page .chat-composer textarea {
  field-sizing: content;
  max-height: 152px;
}

.editable-chunk-field {
  pointer-events: auto;
  user-select: text;
}
