:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --rail: #111318;
  --rail-soft: #202329;
  --panel: #ffffff;
  --surface: #f8f9fb;
  --line: #d9dce2;
  --line-strong: #c5cad3;
  --ink: #172033;
  --text: #172033;
  --muted: #667085;
  --accent: #111318;
  --accent-soft: #eef0f3;
  --danger: #b42318;
  --warning: #b54708;
  --success: #0f766e;
  --focus: #0f766e;
  --focus-soft: rgba(15, 118, 110, 0.14);
  --shadow: 0 6px 18px rgba(16, 24, 40, 0.045);
  --icp-footer-height: 48px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg);
}

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

button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

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

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6L8 10L12 6' stroke='%23526079' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(17, 19, 24, 0.38);
  box-shadow: 0 0 0 3px rgba(17, 19, 24, 0.06);
}

button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--focus-soft);
}

textarea {
  resize: vertical;
}

label {
  display: block;
  margin: 12px 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.site-icp-footer {
  width: 100%;
  min-height: var(--icp-footer-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 24px;
  border-top: 1px solid rgba(17, 19, 24, 0.08);
  background: var(--bg);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
}

.site-icp-footer a {
  color: inherit;
  text-decoration: none;
}

.site-icp-footer a:hover,
.site-icp-footer a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.auth-view {
  min-height: calc(100vh - var(--icp-footer-height));
  display: grid;
  place-items: center;
  padding: 34px 24px;
  background: #fff;
}

.auth-card {
  width: min(100%, 1120px);
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.auth-hero-image {
  width: min(100%, 1120px);
  height: clamp(150px, 22vw, 300px);
  display: block;
  margin-bottom: 6px;
  object-fit: cover;
  object-position: center;
}

.auth-brand-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-bottom: 30px;
}

.auth-wordmark {
  color: #000;
  font-size: clamp(38px, 5vw, 60px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0;
}

.auth-badge {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-radius: 16px;
  background: #000;
  color: #fff;
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 900;
  line-height: 1;
}

.auth-card .brand-mark {
  width: 68px;
  height: 68px;
  margin-bottom: 4px;
}

.auth-card h1 {
  margin: 0;
  color: #111318;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.2;
}

.auth-card p {
  max-width: 500px;
  margin: -8px 0 10px;
  color: #828893;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.55;
}

.auth-card input {
  width: min(100%, 520px);
  min-height: 58px;
  border: 1px solid #d9dce2;
  border-radius: 999px;
  background: #fff;
  padding: 0 28px;
  color: #111318;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  text-align: left;
}

.auth-card input::placeholder {
  color: #a9afb8;
  opacity: 1;
}

.auth-card input:focus {
  border-color: #111318;
  box-shadow: 0 0 0 2px rgba(17, 19, 24, 0.08);
}

.auth-card input:-webkit-autofill,
.auth-card input:-webkit-autofill:hover,
.auth-card input:-webkit-autofill:focus {
  -webkit-text-fill-color: #111318;
  caret-color: #111318;
  box-shadow: 0 0 0 1000px #fff inset, 0 0 0 2px rgba(17, 19, 24, 0.08);
  transition: background-color 9999s ease-out;
}

.auth-card .primary {
  width: min(100%, 520px);
  min-height: 62px;
  margin-top: 20px;
  border-radius: 999px;
  background: #111318;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  box-shadow: none;
}

.auth-card .primary:hover {
  background: #000;
}

.auth-card .action-status {
  min-height: 24px;
  margin-top: 4px;
  color: #667085;
  font-size: 15px;
  font-weight: 800;
}

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

.app-shell.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 18px 14px;
  background: #111318;
  color: #dbe4ef;
}

.brand {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  justify-items: center;
  gap: 12px;
  width: 100%;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.brand-mark {
  width: 66.666%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: none;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-copy {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  text-align: center;
}

.brand h1 {
  margin: 0;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0;
}

.brand p {
  margin: 0;
  color: #d6d9df;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: 0;
}

.sidebar-toggle {
  justify-self: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #f5f5f5;
}

.sidebar-toggle::before {
  content: "";
  width: 10px;
  height: 10px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.tabs {
  display: grid;
  gap: 6px;
  width: 100%;
}

.tab {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 14px;
  border-radius: 10px;
  background: transparent;
  color: #b8bcc4;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.18;
}

.tab.active {
  background: #fff;
  color: #111318;
  font-weight: 900;
  box-shadow: none;
}

.app-shell.sidebar-collapsed .brand-mark {
  width: 46px;
  height: 46px;
}

.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .tabs,
.app-shell.sidebar-collapsed .sidebar-footer .user-bar,
.app-shell.sidebar-collapsed .sidebar-footer .muted {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar {
  justify-content: flex-start;
  align-items: center;
}

.app-shell.sidebar-collapsed .brand {
  grid-template-columns: 1fr;
  justify-items: center;
}

.app-shell.sidebar-collapsed .sidebar-toggle::before {
  transform: rotate(225deg);
}

.sidebar-footer {
  margin-top: auto;
  width: 100%;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  justify-items: stretch;
  gap: 8px;
}

.sidebar-footer .muted {
  display: none;
}

.user-bar {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  justify-items: stretch;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
}

.user-bar strong,
.user-bar span {
  grid-column: 1 / -1;
  justify-self: center;
  text-align: center;
}

.user-bar strong {
  max-width: 100%;
  color: #fff;
  font-size: 14px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-bar span {
  color: #b8bcc4;
  font-size: 12px;
}

.user-bar .ghost {
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.content {
  min-width: 0;
  min-height: 100vh;
  padding: 24px;
  background: #f6f7f9;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.panel-head {
  min-height: 58px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
  padding: 0 0 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.panel-head h2 {
  margin: 0 0 4px;
  color: #111318;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

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

.primary,
.ghost,
.small {
  min-height: 36px;
  padding: 8px 14px;
  white-space: nowrap;
}

.primary {
  background: #111318;
  color: #fff;
  font-weight: 900;
  box-shadow: none;
}

.primary:hover {
  background: #000;
}

.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: #263347;
  font-weight: 800;
}

.ghost:hover {
  border-color: var(--line-strong);
  background: #f8f9fb;
  color: #111318;
}

.small {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 13px;
}

.grid {
  display: grid;
  gap: 14px;
}

.two-col {
  grid-template-columns: minmax(360px, 0.92fr) minmax(420px, 1.08fr);
}

.lower {
  margin-top: 14px;
}

.card,
.info-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card {
  padding: 16px;
}

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

.card-head h3,
.info-card h3 {
  margin: 0;
  font-size: 18px;
}

.inline-fields,
.form-grid,
.meta-grid,
.stats-grid,
.cards {
  display: grid;
  gap: 10px;
}

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

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

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

.knowledge-title-field {
  grid-column: 1 / -1;
}

.knowledge-extra-row {
  margin-bottom: 14px;
}

.department-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.department-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
  margin: 0;
  font-weight: 800;
  color: #526079;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  width: max-content;
  margin-bottom: 12px;
  font-weight: 800;
  color: #526079;
}

.department-checks input[type="checkbox"],
.checkbox-line input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  padding: 0;
}

.knowledge-edit-title-row {
  margin-bottom: 14px;
}

.knowledge-edit-picker-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.reply-output {
  white-space: pre-wrap;
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  line-height: 1.72;
  font-size: 15px;
}

.reply-feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  min-height: 40px;
}

.reply-feedback-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.reply-feedback .small {
  min-width: 82px;
  min-height: 38px;
  padding: 0 14px;
}

.reply-feedback button.active {
  background: #eaf7ef;
  color: #1d6b3a;
  border: 1px solid #a6d8b7;
}

.reply-feedback button[disabled] {
  cursor: not-allowed;
}

.reply-feedback button.active[disabled] {
  opacity: 1;
}

.question-composer {
  display: grid;
  min-height: 130px;
  padding: 10px;
  border: 1px solid #d9dce2;
  border-radius: 10px;
  background: #f8f9fb;
}

.question-composer textarea {
  min-height: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  resize: none;
}

.question-composer textarea:focus {
  box-shadow: none;
}

.append-conversation label {
  margin-top: 0;
}

.conversation-preview,
.conversation-timeline {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #d9dce2;
  border-radius: 8px;
  background: #f8f9fb;
}

.conversation-preview {
  max-height: 160px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.conversation-preview.empty-state {
  min-height: 96px;
  padding: 14px;
  border: 1px solid #d9dce2;
  background: #f8f9fb;
}

.append-conversation {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.append-conversation textarea {
  min-height: 64px;
}

.append-conversation-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
}

.conversation-message {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(117, 135, 163, 0.24);
  border-radius: 8px;
  background: #fff;
}

.conversation-message.customer {
  border-color: rgba(17, 19, 24, 0.22);
}

.conversation-message.service {
  background: #fcfcfd;
}

.conversation-message.assistant {
  background: #f5f7fa;
}

.conversation-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #667085;
  font-size: 12px;
}

.conversation-message-meta strong {
  color: #263347;
}

.conversation-message p {
  margin: 0;
  color: #526079;
  font-size: 13px;
  line-height: 1.6;
}

.reply-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
  gap: 18px;
  align-items: stretch;
  min-height: 0;
}

.reply-layout > .card:nth-child(1) {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.reply-right {
  grid-column: 2;
  display: grid;
  align-self: stretch;
  align-items: stretch;
  min-height: 0;
}

.reply-result-card {
  display: grid;
  grid-template-rows: auto auto 220px;
  gap: 14px;
  min-height: 0;
  overflow: hidden;
}

.reply-result-body {
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 10px;
  min-height: 0;
}

.reply-result-body .reply-output {
  min-height: 120px;
  max-height: clamp(120px, 18vh, 220px);
  overflow: auto;
}

.reply-result-body .reply-feedback {
  margin-top: 0;
}

.reply-insight-dock {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 180px;
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.reply-insight-content {
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
}

@media (min-width: 1181px) {
  .reply-layout {
    min-height: clamp(500px, 62vh, 620px);
  }

  .panel[data-panel="reply"] .question-composer {
    flex: 0 1 auto;
    min-height: 150px;
    max-height: 150px;
  }

  .reply-result-card {
    grid-template-rows: auto auto 260px;
  }

  .panel[data-panel="reply"] .reply-result-body .reply-output {
    min-height: 150px;
    max-height: 150px;
  }
}

.input-card-footer {
  --reply-action-width: clamp(136px, 16vw, 220px);
  --reply-action-height: 44px;
  display: grid;
  grid-template-columns: var(--reply-action-width) var(--reply-action-width);
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
}

.input-card-footer .action-status {
  grid-column: 1 / -1;
}

.input-card-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: var(--reply-action-width) var(--reply-action-width);
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.panel[data-panel="reply"] .input-card-actions .primary,
.panel[data-panel="reply"] .input-card-actions .ghost {
  height: var(--reply-action-height);
  min-height: var(--reply-action-height);
  width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
}

.reply-insight-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 4px;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.reply-insight-tabs button {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: transparent;
  color: #526079;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  padding: 0 10px;
  white-space: nowrap;
}

.reply-insight-tabs button.active {
  background: #111318;
  color: #fff;
}

.reply-insight-panel {
  display: none;
  min-height: 0;
  padding-top: 10px;
}

.reply-insight-panel.active {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
}

.meta-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.meta-grid div,
.stat-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  padding: 10px 12px;
}

.meta-grid span,
.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.tag-list,
.bullet-list,
.citation-list {
  display: grid;
  gap: 10px;
}

.bullet-list {
  margin: 0;
  padding-left: 18px;
}

.reply-insight-dock .tag-list:not(:empty),
.reply-insight-dock .bullet-list:not(:empty) {
  margin-top: 10px;
}

.reply-insight-dock .tag-list,
.reply-insight-dock .bullet-list,
.reply-insight-dock .citation-list {
  min-height: 0;
  max-height: 100%;
  overflow: auto;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.tag.high {
  background: #fff1f2;
  color: var(--danger);
  border-color: #fecdd3;
}

.tag.medium {
  background: #fffbeb;
  color: var(--warning);
  border-color: #fde68a;
}

.citation {
  padding: 12px;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px solid var(--line);
  line-height: 1.55;
}

.citation-button {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.citation-button:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.citation.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.citation strong {
  display: block;
  margin-bottom: 4px;
}

.knowledge-grid {
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
}

.knowledge-query-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
}

.knowledge-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 320px);
  gap: 4px;
  padding: 4px;
  border: 1px solid #d9dce2;
  border-radius: 12px;
  background: #fff;
}

.knowledge-switch button {
  width: 100%;
  min-height: 36px;
  padding: 8px 16px;
  border-radius: 8px;
  background: transparent;
  color: #172033;
  font-weight: 900;
}

.knowledge-switch button.active {
  background: #111318;
  color: #fff;
  box-shadow: none;
}

.manage-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 320px);
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
  border: 1px solid #d9dce2;
  border-radius: 12px;
  background: #fff;
}

.manage-switch button {
  width: 100%;
  min-height: 36px;
  padding: 8px 16px;
  border-radius: 8px;
  background: transparent;
  color: #172033;
  font-weight: 900;
}

.manage-switch button.active {
  background: #111318;
  color: #fff;
  box-shadow: none;
}

.manage-section {
  display: none;
}

.manage-section.active {
  display: block;
}

.knowledge-section {
  display: none;
}

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

.knowledge-query-card,
.knowledge-reading-card {
  align-self: stretch;
  height: 100%;
  border-radius: 8px;
}

.knowledge-query-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  max-height: clamp(420px, calc(100vh - 170px), 760px);
  min-height: 0;
}

.knowledge-reading-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.knowledge-query-card .card-head,
.knowledge-reading-card .card-head {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(117, 135, 163, 0.16);
}

.knowledge-query-controls {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

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

.knowledge-query-search-row .primary {
  min-width: 92px;
}

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

.knowledge-filter-row label {
  margin: 0;
  color: #526079;
  font-size: 13px;
  font-weight: 900;
}

.knowledge-detail {
  height: 100%;
  min-height: 0;
}

.knowledge-detail h4 {
  margin: 0 0 8px;
  font-size: 20px;
}

.knowledge-detail pre {
  white-space: pre-wrap;
  margin: 0;
  color: #344054;
  font-family: inherit;
  line-height: 1.82;
}

.knowledge-reading-card {
  min-height: 0;
}

.knowledge-detail-article {
  display: grid;
  gap: 16px;
}

.knowledge-detail-header {
  display: grid;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(117, 135, 163, 0.16);
}

.knowledge-detail-header h4 {
  margin: 0;
  font-size: 22px;
  line-height: 1.32;
}

.knowledge-detail-body {
  min-height: 280px;
  padding: 16px;
  border: 1px solid rgba(117, 135, 163, 0.16);
  border-radius: 8px;
  background: #f8fafc;
}

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

.knowledge-detail-field,
.knowledge-detail-script {
  padding: 12px 14px;
  border: 1px solid rgba(117, 135, 163, 0.16);
  border-radius: 8px;
  background: #fff;
}

.knowledge-detail-field strong,
.knowledge-detail-script strong {
  display: block;
  margin-bottom: 6px;
  color: #172033;
  font-size: 13px;
}

.knowledge-detail.empty-state {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: solid;
  border-color: rgba(117, 135, 163, 0.16);
  background: #f8f9fb;
  color: rgba(82, 96, 121, 0.72);
  font-weight: 700;
}

.knowledge-detail-placeholder {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: rgba(82, 96, 121, 0.72);
  font-weight: 800;
}

.knowledge-list-card .toolbar,
.toolbar {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 10px;
  margin-bottom: 12px;
}

.knowledge-list-card .knowledge-search-toolbar {
  grid-template-columns: 1fr;
}

.knowledge-list-card .knowledge-search-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.knowledge-list-card .knowledge-search-actions .primary {
  min-width: 92px;
}

.preview-toolbar {
  grid-template-columns: 1fr 120px;
}

.import-card {
  margin-bottom: 14px;
}

.knowledge-section[data-knowledge-section="add"] {
  gap: 18px;
}

.document-import-card .card-head,
.manage-section .card-head,
.package-card .card-head {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(117, 135, 163, 0.16);
}

.import-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.88fr) minmax(280px, 1.12fr);
  gap: 16px;
  align-items: stretch;
}

.file-drop {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 176px;
  margin: 0;
  padding: 22px;
  border: 1px dashed rgba(15, 23, 42, 0.22);
  border-radius: 10px;
  background: #fff;
  color: #667085;
  text-align: center;
  cursor: pointer;
}

.file-drop .file-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: #111318;
  color: #fff;
  font-weight: 800;
}

.file-drop:hover .file-button {
  background: #25272c;
}

.file-drop strong {
  color: #526079;
  font-size: 13px;
}

.file-drop em {
  max-width: 100%;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #667085;
  font-size: 13px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.document-import-card .import-fields {
  display: grid;
  grid-auto-rows: minmax(0, auto);
  gap: 12px;
  min-height: 176px;
  height: 100%;
}

.import-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 12px;
  align-items: end;
}

.import-mode-row {
  grid-template-columns: minmax(0, 1fr);
}

.import-field-row > div {
  min-width: 0;
}

.import-mode-field,
.import-type-field,
.import-tags-field {
  display: grid;
  gap: 6px;
  align-content: end;
}

.import-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  align-content: end;
  gap: 10px;
  align-self: end;
}

.import-actions .muted {
  min-height: 22px;
}

.import-actions button {
  min-width: 128px;
  padding-inline: 10px;
}

.action-status {
  min-height: 22px;
  margin-top: 12px;
  font-weight: 700;
}

.action-status.success {
  color: #166534;
}

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

.tag-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.tag-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 10px;
}

.editable-tags {
  min-height: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #fff;
}

.tag-list-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 10px;
  align-items: stretch;
}

.manage-section.active > .card {
  display: grid;
  gap: 12px;
}

.manage-section textarea {
  min-height: 220px;
}

.package-card .file-drop {
  min-height: 112px;
}

.package-card .actions button {
  min-width: 112px;
}

.tag-placeholder {
  color: #667085;
  font-size: 14px;
}

.editable-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #111318;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.editable-tag.selected {
  outline: 2px solid rgba(17, 19, 24, 0.24);
  outline-offset: 2px;
  background: #30333a;
}

.list {
  display: grid;
  gap: 10px;
}

.knowledge-query-card .list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.knowledge-list-empty {
  min-height: 116px;
}

.knowledge-result-card {
  display: grid;
  align-content: start;
  height: 180px;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.knowledge-result-card:hover {
  border-color: rgba(17, 19, 24, 0.28);
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.06);
}

.knowledge-result-card.active {
  border-color: #c8d5e8;
  background: #f7faff;
  box-shadow: 0 10px 24px rgba(46, 82, 132, 0.08);
}

.knowledge-result-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.knowledge-result-title h4 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: #172033;
  font-size: 15px;
  line-height: 1.42;
}

.knowledge-result-card .knowledge-snippet {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.62;
}

.list-item {
  padding: 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fbfdff;
  cursor: pointer;
}

.list-item.active {
  border-color: var(--accent);
  background: rgba(232, 239, 255, 0.72);
}

.list-item h4 {
  margin: 0 0 6px;
}

.list-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  min-height: 140px;
  display: grid;
  place-items: center;
  padding: 22px;
  border: 1px dashed rgba(15, 23, 42, 0.16);
  border-radius: 8px;
  color: #667085;
  text-align: center;
  background: #f8f9fb;
}

.knowledge-result-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-height: 32px;
  overflow: hidden;
  margin: 6px 0 8px;
}

.knowledge-result-meta span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 999px;
  background: #fff;
  color: #526079;
  font-size: 12px;
  line-height: 1.2;
}

.list-item .knowledge-snippet {
  color: #667085;
  line-height: 1.65;
}

.knowledge-list-footer {
  display: flex;
  justify-content: center;
  padding: 4px 0 8px;
}

.knowledge-expand-btn {
  width: 100%;
  min-height: 42px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  max-width: 920px;
}

.analytics-side-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: none;
  gap: 10px;
}

.analytics-side-stats .stat-card {
  min-height: 86px;
  padding: 12px 13px;
}

.stat-card strong {
  font-size: 26px;
  letter-spacing: 0;
}

.analytics-side-stats .stat-card strong {
  font-size: 24px;
}

.analytics-lower-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.58fr) minmax(720px, 1.42fr);
  gap: 14px;
  align-items: start;
}

.analytics-side-column {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.analytics-top-question-card {
  min-height: 0;
}

.analytics-question-card {
  display: grid;
  grid-template-rows: auto auto auto minmax(280px, 1fr);
  min-height: 0;
  max-height: clamp(640px, calc(100vh - 180px), 880px);
}

.analytics-query-head {
  align-items: center;
}

.analytics-query-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.analytics-query-actions .small {
  min-width: 82px;
}

.analytics-filter-panel {
  padding: 12px;
  border: 1px solid rgba(117, 135, 163, 0.18);
  border-radius: 8px;
  background: #f8f9fb;
}

.analytics-question-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.analytics-question-filters label {
  margin-top: 0;
  font-weight: 800;
}

.analytics-question-keyword {
  min-width: 0;
}

.analytics-feedback-filter-field {
  min-width: 0;
}

.analytics-feedback-filter-field select {
  width: 100%;
}

.analytics-question-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 8px;
}

.analytics-summary-strip {
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 10px 0 8px;
}

.analytics-summary-block {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(117, 135, 163, 0.16);
  border-radius: 8px;
  background: #fff;
}

.analytics-summary-strip .analytics-summary-block {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
}

.analytics-summary-block h4 {
  margin: 0 0 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.3;
}

.analytics-summary-strip .analytics-summary-block h4 {
  flex: 0 0 92px;
  margin: 6px 0 0;
  white-space: nowrap;
}

.analytics-summary-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.analytics-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f9fb;
  color: var(--muted);
  font-size: 13px;
}

.analytics-summary-chip strong {
  color: var(--ink);
  font-size: 14px;
}

.analytics-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  margin-bottom: 8px;
  padding-top: 2px;
  border-top: 1px solid rgba(117, 135, 163, 0.14);
}

.analytics-results-head .action-status {
  margin: 0;
  font-size: 13px;
}

.analytics-results-head h4 {
  margin: 0;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.analytics-results-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(117, 135, 163, 0.14);
}

.analytics-results-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.analytics-results-tabs::-webkit-scrollbar {
  display: none;
}

.analytics-results-tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
}

.analytics-results-tab.active {
  border-color: rgba(47, 111, 237, 0.34);
  background: #eef4ff;
  color: #2459c7;
}

.analytics-result-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
}

.analytics-result-panel[hidden] {
  display: none;
}

.analytics-feedback-head {
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0;
  padding-top: 0;
  border-top: 0;
}

.analytics-feedback-head h4 {
  margin: 0;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.analytics-question-results,
.analytics-feedback-results {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  max-height: clamp(360px, calc(100vh - 500px), 540px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.analytics-question-item {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfdff;
}

.analytics-feedback-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "meta action"
    "preview action";
  gap: 7px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfdff;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.analytics-feedback-item:hover,
.analytics-feedback-item:focus {
  border-color: rgba(47, 111, 237, 0.34);
  background: #f7faff;
  outline: none;
}

.analytics-feedback-item.selected {
  border-color: rgba(47, 111, 237, 0.46);
  background: #eef4ff;
  box-shadow: 0 0 0 2px rgba(47, 111, 237, 0.08);
}

.analytics-feedback-item .analytics-question-meta {
  grid-area: meta;
}

.analytics-feedback-preview {
  display: grid;
  grid-area: preview;
  gap: 4px;
  min-width: 0;
}

.analytics-feedback-preview strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.analytics-feedback-preview p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.analytics-feedback-open-label {
  grid-area: action;
  align-self: center;
  color: #2f6fed;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.analytics-feedback-drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.18);
}

.analytics-feedback-drawer[hidden] {
  display: none;
}

.analytics-feedback-drawer-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(520px, calc(100vw - 24px));
  height: 100%;
  padding: 18px;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -16px 0 42px rgba(15, 23, 42, 0.16);
}

.analytics-feedback-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(117, 135, 163, 0.16);
}

.analytics-feedback-drawer-head h4 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.analytics-feedback-drawer-content {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding-top: 14px;
}

.analytics-feedback-detail-actions {
  display: flex;
  justify-content: flex-end;
}

.analytics-feedback-detail-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(117, 135, 163, 0.16);
  border-radius: 8px;
  background: #fff;
}

.analytics-feedback-detail-field strong {
  color: #344054;
  font-size: 12px;
  font-weight: 900;
}

.analytics-feedback-detail-field p,
.analytics-feedback-detail-field pre {
  margin: 0;
  color: var(--ink);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.analytics-feedback-detail-field pre {
  white-space: pre-wrap;
  font-family: inherit;
}

.analytics-question-item p {
  margin: 0;
  color: var(--ink);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.analytics-question-meta,
.analytics-question-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.analytics-question-meta span,
.analytics-question-meta time,
.analytics-question-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #f1f3f5;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.analytics-question-tags span {
  background: transparent;
  border: 1px solid rgba(117, 135, 163, 0.18);
  color: #6b7280;
}

.analytics-question-meta .is-danger {
  background: #fff1f0;
  color: #b42318;
}

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

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

.info-card {
  padding: 22px;
}

.info-card p {
  color: var(--muted);
  line-height: 1.65;
}

.panel:not([data-panel="reply"]) .card-head h3,
.panel:not([data-panel="reply"]) .info-card h3 {
  font-size: 19px;
  font-weight: 800;
}

.panel:not([data-panel="reply"]) label {
  color: #526079;
  font-weight: 700;
}

/* Workspace polish: login-aligned, white, operational surface. */
.panel[data-panel="reply"] {
  --reply-bg: rgba(255, 255, 255, 0.78);
  --reply-border: rgba(15, 23, 42, 0.08);
  --reply-shadow: var(--shadow);
  font-family: "SF Pro Display", "SF Pro Text", "Segoe UI Variable", "Inter", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.panel:not([data-panel="reply"]) {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.panel:not([data-panel="reply"]) .panel-head {
  min-height: 58px;
  margin-bottom: 16px;
  padding: 0 0 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.panel:not([data-panel="reply"]) .panel-head h2 {
  font-size: 28px;
  font-weight: 900;
}

.panel:not([data-panel="reply"]) .panel-head p {
  color: #617089;
  font-size: 14px;
}

.panel:not([data-panel="reply"]) .card,
.panel:not([data-panel="reply"]) .info-card,
.stat-card {
  border-color: var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.panel:not([data-panel="reply"]) input,
.panel:not([data-panel="reply"]) select {
  border-color: #d9dce2;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.panel:not([data-panel="reply"]) textarea {
  border-color: #d9dce2;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.panel:not([data-panel="reply"]) .list-item,
.panel:not([data-panel="reply"]) .citation {
  border-color: #d9dce2;
  border-radius: 8px;
  background: #fff;
}

.panel:not([data-panel="reply"]) .primary {
  border-radius: 999px;
  background: #111318;
  font-weight: 900;
  box-shadow: none;
}

.panel:not([data-panel="reply"]) .ghost {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: #263347;
  font-weight: 800;
}

.panel[data-panel="reply"] .panel-head {
  min-height: 58px;
  margin-bottom: 16px;
  padding: 0 0 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.panel[data-panel="reply"] .panel-head h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
}

.panel[data-panel="reply"] .panel-head p {
  color: #617089;
  font-size: 14px;
}

.panel[data-panel="reply"] .card {
  border-color: var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--reply-shadow);
  padding: 18px;
}

.panel[data-panel="reply"] .card-head {
  min-height: 46px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 12px;
  align-items: center;
  gap: 12px;
}

.panel[data-panel="reply"] .card-head h3 {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0;
}

.reply-source-label {
  margin-left: 6px;
  color: #617089;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.panel[data-panel="reply"] .reply-layout > .card:first-child .card-head,
.panel[data-panel="reply"] .reply-result-card .card-head {
  min-height: 46px;
  margin-bottom: 12px;
  align-items: center;
  flex-wrap: nowrap;
}

.panel[data-panel="reply"] .reply-result-card .card-head {
  align-items: start;
}

.panel[data-panel="reply"] .reply-result-card .card-head h3 {
  align-self: start;
}

.panel[data-panel="reply"] .reply-question-head {
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 12px;
}

.panel[data-panel="reply"] .reply-question-controls {
  display: grid;
  grid-template-columns: minmax(180px, 240px) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.panel[data-panel="reply"] #replyDemandSelect {
  justify-self: start;
  max-width: 240px;
  min-width: 0;
  height: 46px;
  min-height: 46px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1.2;
}

.panel[data-panel="reply"] .question-actions {
  align-items: center;
  flex-wrap: nowrap;
  min-width: max-content;
}

.panel[data-panel="reply"] label {
  color: #526079;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0;
}

.panel[data-panel="reply"] input,
.panel[data-panel="reply"] select {
  border-color: #d9dce2;
  border-radius: 10px;
  background: #fff;
  color: rgba(31, 42, 61, 0.78);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.78;
  letter-spacing: 0;
  box-shadow: none;
}

.panel[data-panel="reply"] textarea {
  border-color: #d9dce2;
  border-radius: 10px;
  background: #fff;
  color: rgba(31, 42, 61, 0.78);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.78;
  letter-spacing: 0;
  box-shadow: none;
}

.panel[data-panel="reply"] input::placeholder,
.panel[data-panel="reply"] textarea::placeholder {
  color: rgba(102, 112, 133, 0.46);
  opacity: 1;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.78;
}

.panel[data-panel="reply"] textarea {
  line-height: 1.78;
}

.panel[data-panel="reply"] input:focus,
.panel[data-panel="reply"] textarea:focus,
.panel[data-panel="reply"] select:focus {
  border-color: rgba(17, 19, 24, 0.38);
  box-shadow: 0 0 0 3px rgba(17, 19, 24, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.panel[data-panel="reply"] .question-composer textarea {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.panel[data-panel="reply"] .question-composer textarea:focus {
  box-shadow: none;
}

.panel[data-panel="reply"] .append-conversation textarea {
  border: 1px solid #d9dce2;
  border-radius: 10px;
  background: #f8f9fb;
}

.panel:not([data-panel="reply"]) select,
.panel[data-panel="reply"] select {
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6L8 10L12 6' stroke='%23526079' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}

.panel[data-panel="reply"] .primary {
  min-height: 46px;
  border-radius: 999px;
  background: #111318;
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0;
  line-height: 1;
  box-shadow: none;
}

.panel[data-panel="reply"] .ghost {
  border-radius: 999px;
  background: #fff;
  color: #263347;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0;
  line-height: 1;
  border: 1px solid var(--line);
}

.panel[data-panel="reply"] .card-head .small {
  min-width: 96px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
}

.panel[data-panel="reply"] .primary:hover {
  background: #000;
}

.panel[data-panel="reply"] .ghost:hover {
  background: #f8f9fb;
  color: #111318;
  border-color: var(--line-strong);
}

.panel[data-panel="reply"] .question-actions .ghost.active {
  background: #30333a;
  border-color: #30333a;
  color: #fff;
}

.panel[data-panel="reply"] .reply-output {
  font-family: inherit;
  min-height: 120px;
  max-height: clamp(120px, 18vh, 220px);
  overflow: auto;
  overscroll-behavior: contain;
  border-color: #d9dce2;
  border-radius: 8px;
  background: #f8f9fb;
  color: rgba(31, 42, 61, 0.78);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.78;
  letter-spacing: 0;
}

.panel[data-panel="reply"] .reply-output-text {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 10px;
  margin: 0 0 14px;
  white-space: normal;
}

.panel[data-panel="reply"] .reply-output-text:last-child {
  margin-bottom: 0;
}

.panel[data-panel="reply"] .reply-output-content {
  min-width: 0;
  white-space: pre-wrap;
}

.panel[data-panel="reply"] .reply-copy-btn {
  min-width: 54px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  padding: 0 10px;
  font-size: 12px;
}

.panel[data-panel="reply"] .bullet-list,
.panel[data-panel="reply"] .tag-list,
.panel[data-panel="reply"] .tag {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0;
}

.panel[data-panel="reply"] .follow-up-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.panel[data-panel="reply"] .follow-up-item span {
  min-width: 0;
}

.panel[data-panel="reply"] .copy-follow-up-btn {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.panel[data-panel="reply"] .reply-insight-dock .bullet-list,
.panel[data-panel="reply"] .reply-insight-dock .tag-list,
.panel[data-panel="reply"] .reply-insight-dock .citation-list {
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
}

.panel[data-panel="reply"] .reply-layout.reply-empty .reply-right {
  align-self: stretch;
  height: 100%;
  min-height: 0;
}

.panel[data-panel="reply"] .reply-layout.reply-empty .reply-result-card {
  height: 100%;
  min-height: 0;
}

.panel[data-panel="reply"] .reply-layout.reply-empty .reply-result-card .reply-output {
  min-height: 150px;
  max-height: 150px;
}

.panel[data-panel="reply"] .citation {
  border-color: rgba(117, 135, 163, 0.22);
  border-radius: 8px;
  background: #fff;
}

.panel[data-panel="reply"] .citation.active {
  border-color: rgba(17, 19, 24, 0.22);
  background: rgba(255, 255, 255, 0.78);
}

.knowledge-gap-prompt {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(180, 83, 9, 0.22);
  border-radius: 8px;
  background: rgba(255, 251, 235, 0.72);
  color: #46331d;
}

.knowledge-gap-prompt strong {
  font-size: 14px;
  font-weight: 800;
}

.knowledge-gap-prompt span {
  color: #705328;
  font-size: 13px;
  line-height: 1.45;
}

.knowledge-gap-prompt em {
  min-height: 16px;
  color: #8a5a12;
  font-size: 12px;
  font-style: normal;
}

.knowledge-gap-prompt .ghost {
  justify-self: start;
}

.narrow {
  max-width: 720px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 16px;
  align-items: start;
}

.setting-card {
  min-height: 100%;
}

.setting-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(117, 135, 163, 0.20);
}

.setting-card-head h3 {
  margin: 0 0 4px;
  font-size: 19px;
}

.setting-card-head p {
  margin: 0;
  color: #667085;
  font-size: 13px;
}

.setting-card-head span {
  flex: 0 0 auto;
  max-width: 190px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(17, 19, 24, 0.08);
  color: #263347;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.settings-status {
  min-height: 22px;
  margin-top: 12px;
  font-weight: 700;
}

.demand-status-summary {
  display: grid;
  grid-template-columns: repeat(7, minmax(96px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.demand-status-chip {
  min-height: 50px;
  display: grid;
  gap: 4px;
  justify-items: start;
  padding: 9px 12px;
  border: 1px solid #d9dce2;
  border-radius: 10px;
  background: #fff;
  color: #263347;
}

.demand-status-chip.active {
  border-color: #111318;
  background: #111318;
  color: #fff;
}

.demand-status-chip span {
  color: #617089;
  font-size: 12px;
  font-weight: 800;
}

.demand-status-chip strong {
  font-size: 20px;
  line-height: 1;
}

.demand-status-chip.active span,
.demand-status-chip.active strong {
  color: #fff;
}

.demand-toolbar {
  grid-template-columns: minmax(0, 1fr) 150px auto;
  margin-bottom: 14px;
}

.demand-grid {
  grid-template-columns: minmax(300px, 0.72fr) minmax(560px, 1.28fr);
  align-items: stretch;
  gap: 16px;
}

.demand-list-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: clamp(360px, calc(100vh - 260px), 640px);
  min-height: 0;
}

.demand-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.demand-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid #d9dce2;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.demand-list-item.selected {
  border-color: #111318;
  background: #f8f9fb;
}

.demand-list-item h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.demand-list-item p {
  margin: 0;
  color: #617089;
  font-size: 13px;
  line-height: 1.45;
}

.demand-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.demand-meta span,
.demand-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(17, 19, 24, 0.08);
  color: #263347;
  font-size: 12px;
  font-weight: 800;
}

.demand-list-side {
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 8px;
}

.demand-list-side time {
  color: #7a879b;
  font-size: 12px;
}

.demand-list-toggle {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d9dce2;
  border-radius: 999px;
  background: #fff;
  color: #263347;
  font-weight: 800;
}

.demand-list-toggle:hover {
  background: #f8f9fb;
}

.demand-contact-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.demand-fields-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.demand-detail-actions {
  align-items: center;
}

.panel:not([data-panel="reply"]) .demand-delete-btn {
  border: 1px solid rgba(180, 35, 24, 0.32);
  background: #fff;
  color: var(--danger);
}

#deleteKnowledgeBtn,
button[data-user-action="disable"] {
  border: 1px solid rgba(180, 35, 24, 0.32);
  background: #fff;
  color: var(--danger);
}

.panel:not([data-panel="reply"]) .demand-delete-btn:hover {
  background: #fef3f2;
  color: var(--danger);
}

#deleteKnowledgeBtn:hover,
button[data-user-action="disable"]:hover {
  border-color: rgba(180, 35, 24, 0.42);
  background: #fef3f2;
  color: var(--danger);
}

.panel:not([data-panel="reply"]) .demand-delete-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.demand-reply-snapshot {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #d9dce2;
  border-radius: 8px;
  background: #f8f9fb;
}

.demand-reply-snapshot p {
  margin: 0;
  color: #526079;
  line-height: 1.6;
}

.conversation-timeline {
  margin-top: 10px;
  margin-bottom: 0;
}

.conversation-timeline-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.account-grid {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 16px;
}

#accountForm {
  display: block;
}

#accountForm .card-head {
  margin-bottom: 0;
}

.account-form-grid {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(160px, 0.8fr);
  align-items: end;
}

.account-list-head {
  align-items: flex-start;
}

.account-list-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.account-list-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: clamp(520px, calc(100vh - 220px), 860px);
  min-height: 0;
}

.account-list-card .user-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

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

.initial-password-note {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(117, 135, 163, 0.20);
  border-radius: 8px;
  background: #f8fafc;
  color: #526079;
  font-size: 13px;
  font-weight: 700;
}

.user-list-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(250px, 0.9fr) minmax(250px, auto);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(117, 135, 163, 0.24);
  border-radius: 8px;
  background: #fff;
}

.user-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.user-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef2f7;
  color: #263347;
  font-weight: 900;
}

.user-identity {
  min-width: 0;
}

.user-list-item h4 {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}

.user-identity p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.user-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.user-badges span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #526079;
  font-size: 12px;
  font-weight: 800;
}

.user-badges .is-success {
  background: rgba(15, 118, 110, 0.10);
  color: #0f766e;
}

.user-badges .is-warning {
  background: rgba(181, 71, 8, 0.10);
  color: #b54708;
}

.user-badges .is-danger {
  background: rgba(180, 35, 24, 0.10);
  color: #b42318;
}

.user-role-control {
  display: grid;
  gap: 6px;
}

.user-role-control label {
  margin: 0;
}

.user-role-select {
  min-height: 38px;
}

.user-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
}

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

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    padding: 10px 12px;
  }

  .brand {
    width: auto;
    grid-template-columns: 42px;
    justify-items: center;
    border-bottom: 0;
    padding-bottom: 0;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .brand-copy,
  .sidebar-toggle {
    display: none;
  }

  .tabs {
    display: flex;
    flex: 1 1 auto;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

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

  .tab {
    flex: 0 0 auto;
    width: auto;
    min-width: 104px;
    min-height: 42px;
    justify-content: center;
    padding: 8px 14px;
    font-size: 16px;
    white-space: nowrap;
  }

  .sidebar-footer {
    display: none;
  }

  .knowledge-query-grid,
  .knowledge-grid,
  .two-col,
  .reply-layout,
  .demand-grid,
  .cards,
  .stats-grid,
  .account-grid,
  .inline-fields,
  .form-grid,
  .knowledge-title-row,
  .knowledge-filter-row,
  .knowledge-detail-field-grid,
  .import-panel,
  .settings-grid,
  .import-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .knowledge-edit-picker-row,
  .knowledge-title-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reply-layout > .card:nth-child(1),
  .reply-right {
    grid-column: auto;
  }

  .user-list-item {
    grid-template-columns: 1fr;
  }

  .account-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .user-actions {
    justify-content: flex-start;
  }

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

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

  .analytics-lower-grid {
    grid-template-columns: 1fr;
  }

  .analytics-question-filters .primary {
    min-height: 44px;
  }

  .demand-toolbar {
    grid-template-columns: minmax(0, 1fr) 150px auto;
  }
}

@media (max-width: 720px) {
  .content {
    padding: 12px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow: hidden;
    padding: 10px 12px;
  }

  .brand {
    display: none;
  }

  .tabs {
    display: flex;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

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

  .tab {
    flex: 0 0 auto;
    width: auto;
    min-width: 76px;
    min-height: 40px;
    padding: 8px 14px;
    font-size: 15px;
    white-space: nowrap;
  }

  .panel[data-panel="reply"],
  .panel:not([data-panel="reply"]) {
    padding: 0;
    border-radius: 0;
  }

  .panel[data-panel="reply"] .card,
  .panel:not([data-panel="reply"]) .card {
    padding: 16px;
  }

  .panel-head {
    display: grid;
  }

  .actions {
    justify-content: stretch;
  }

  .actions button {
    flex: 1;
  }

  .user-main,
  .account-form-grid {
    grid-template-columns: 1fr;
  }

  .user-avatar {
    width: 38px;
    height: 38px;
  }

  .user-actions button {
    flex: 1;
  }

  .tag-editor {
    grid-template-columns: 1fr;
  }

  .import-actions,
  .tag-input-row,
  .tag-list-panel,
  .user-list-item {
    grid-template-columns: 1fr;
  }

  .import-actions .muted {
    grid-column: auto;
  }

  .demand-status-summary,
  .demand-toolbar {
    grid-template-columns: 1fr;
  }

  .analytics-question-summary,
  .analytics-question-filters {
    grid-template-columns: 1fr;
  }

  .analytics-question-keyword {
    grid-column: auto;
  }

  .demand-status-summary {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .demand-status-summary::-webkit-scrollbar {
    display: none;
  }

  .demand-status-chip {
    flex: 0 0 132px;
  }

  .demand-list-item {
    grid-template-columns: 1fr;
  }

  .demand-list-side {
    justify-items: start;
  }

  .panel-head {
    min-height: 0;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
  }

  .panel-head h2 {
    font-size: 26px;
  }

  .panel-head p {
    font-size: 13px;
    line-height: 1.45;
  }

  .panel-head > button {
    width: auto;
    min-width: 112px;
    justify-self: start;
  }

  .panel[data-panel="reply"] .card {
    padding: 14px;
  }

  .panel[data-panel="reply"] .card-head {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .panel[data-panel="reply"] .reply-question-controls {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .panel[data-panel="reply"] #replyDemandSelect {
    max-width: none;
    width: 100%;
  }

  .panel[data-panel="reply"] .question-actions {
    width: 100%;
    min-width: 0;
    justify-content: stretch;
  }

  .panel[data-panel="reply"] .question-actions .small {
    flex: 1 1 0;
    min-width: 0;
  }

  .panel[data-panel="reply"] .question-composer {
    min-height: 132px;
    padding: 8px;
  }

  .panel[data-panel="reply"] #question {
    min-height: 132px;
  }

  .panel[data-panel="reply"] .input-card-footer {
    --reply-action-width: 1fr;
    padding-top: 10px;
  }

  .panel[data-panel="reply"] .input-card-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .panel[data-panel="reply"] .reply-output {
    min-height: 120px;
    max-height: 180px;
  }

  .panel[data-panel="reply"] .reply-layout.reply-empty .reply-result-card .reply-output {
    min-height: 120px;
    max-height: 180px;
  }

  .demand-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  #demandSearch {
    grid-column: 1 / -1;
  }

  #demandStatusFilter {
    min-width: 0;
  }

  #demandSearchBtn {
    min-width: 104px;
  }

  .demand-contact-grid,
  .demand-fields-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .demand-detail-card textarea {
    min-height: 118px;
  }

  .panel[data-panel="knowledge"] .panel-head {
    gap: 10px;
  }

  .panel[data-panel="knowledge"] .knowledge-switch {
    width: 100%;
    max-width: none;
  }

  .knowledge-query-card {
    max-height: none;
  }

  .knowledge-query-card,
  .knowledge-reading-card {
    height: auto;
  }

  .knowledge-detail-placeholder {
    min-height: 140px;
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: none;
    gap: 8px;
  }

  .stat-card {
    min-height: 76px;
    padding: 8px 9px;
  }

  .stat-card strong {
    font-size: 22px;
  }

  .analytics-question-card {
    order: 1;
    grid-template-rows: auto auto auto auto;
    max-height: none;
    overflow: hidden;
  }

  .analytics-side-column {
    order: 2;
  }

  .analytics-top-question-card {
    order: 2;
  }

  .analytics-filter-panel {
    padding: 10px;
  }

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

  .analytics-question-keyword {
    grid-column: 1 / -1;
  }

  .analytics-question-summary {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .analytics-question-summary::-webkit-scrollbar {
    display: none;
  }

  .analytics-summary-block {
    flex: 0 0 220px;
    max-height: 132px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .analytics-summary-strip {
    display: grid;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .analytics-summary-strip .analytics-summary-block {
    flex: none;
    max-height: none;
  }

  .analytics-question-results {
    max-height: 340px;
  }

  .analytics-feedback-results {
    max-height: 340px;
  }

  .analytics-feedback-item {
    grid-template-columns: 1fr;
    grid-template-areas:
      "meta"
      "preview"
      "action";
  }

  .analytics-feedback-open-label {
    justify-self: start;
  }

  .analytics-feedback-drawer {
    align-items: flex-end;
  }

  .analytics-feedback-drawer-panel {
    width: 100%;
    height: min(82vh, 680px);
    border-top: 1px solid var(--line);
    border-left: 0;
    border-radius: 12px 12px 0 0;
  }

  .panel[data-panel="settings"] .panel-head {
    gap: 10px;
  }

  .account-list-card {
    order: 1;
  }

  #accountForm {
    order: 2;
  }

  .account-list-card .user-list {
    max-height: min(58vh, 520px);
  }

  #accountForm .card-head {
    align-items: center;
  }
}
