:root {
  color-scheme: light;
  --red: #b20d0a;
  --red-strong: #970806;
  --red-dark: #740000;
  --red-soft: #f7e9e8;
  --ink: #1f2933;
  --ink-soft: #65717c;
  --line: #e8e5e1;
  --paper: #ffffff;
  --canvas: #f5f4f2;
  --warm: #fbfaf8;
  --success: #17814f;
  --shadow: 0 18px 45px rgba(56, 33, 29, 0.08);
  --sidebar: 250px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family:
    "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

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

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  background: var(--paper);
  border-right: 1px solid var(--line);
  padding: 26px 18px 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.brand-copy {
  display: grid;
  line-height: 1;
}

.brand-copy strong {
  color: var(--red);
  font-size: 22px;
  letter-spacing: -0.6px;
}

.brand-copy small {
  margin-top: 7px;
  color: #46515b;
  font-size: 12px;
  letter-spacing: 0.25em;
}

.product-name {
  margin: 30px 8px 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.product-name span,
.product-name small {
  display: block;
}

.product-name span {
  font-size: 15px;
  font-weight: 700;
}

.product-name small {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4b5660;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.nav-item:hover {
  background: #faf3f2;
  color: var(--red);
  transform: translateX(2px);
}

.nav-item.active {
  background: var(--red);
  color: #fff;
  box-shadow: 0 8px 20px rgba(178, 13, 10, 0.18);
}

.nav-mark {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.sidebar-security {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 14px 12px;
  border: 1px solid #e9dedc;
  border-radius: 9px;
  background: #fff9f8;
}

.model-nav {
  margin-top: auto;
}

.security-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(23, 129, 79, 0.11);
}

.sidebar-security strong,
.sidebar-security small {
  display: block;
}

.sidebar-security strong {
  font-size: 12px;
}

.sidebar-security small {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 10px;
}

.main {
  min-height: 100vh;
  margin-left: var(--sidebar);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(24px, 3.4vw, 54px);
  border-bottom: 1px solid rgba(232, 229, 225, 0.88);
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(18px);
}

.topbar-kicker,
.page-intro p,
.section-heading p,
.eyebrow,
.collection-card > p,
.architecture-strip > div p,
.security-principle p,
.evaluation-guide > p {
  margin: 0 0 5px;
  color: var(--red);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}

.service-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12px;
}

.service-state i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c6c6c6;
}

.service-state.ready i {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(23, 129, 79, 0.1);
}

.service-state.offline i {
  background: var(--red);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
}

.user-chip > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.user-chip strong,
.user-chip small {
  display: block;
}

.user-chip strong {
  font-size: 12px;
}

.user-chip small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.mobile-menu {
  display: none;
}

.content {
  width: min(1420px, 100%);
  margin: 0 auto;
  padding: 30px clamp(24px, 3.4vw, 54px) 60px;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: view-in 220ms ease;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.expert-hero {
  position: relative;
  overflow: hidden;
  min-height: 455px;
  padding: clamp(36px, 5vw, 66px);
  border-radius: 4px;
  background:
    linear-gradient(120deg, rgba(116, 0, 0, 0.14), transparent 47%),
    var(--red);
  color: #fff;
  box-shadow: var(--shadow);
}

.answer-mode-bar {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(870px, 100%);
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 25px;
}

.answer-mode-switch {
  display: flex;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(88, 0, 0, 0.22);
}

.answer-mode-switch button {
  min-height: 34px;
  padding: 0 15px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.63);
  font-size: 10px;
  cursor: pointer;
}

.answer-mode-switch button.active {
  background: #fff;
  color: var(--red);
  font-weight: 700;
}

.active-model-chip {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expert-hero::after {
  content: "";
  position: absolute;
  right: -100px;
  top: -170px;
  width: 470px;
  height: 470px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 0 55px rgba(255, 255, 255, 0.025),
    0 0 0 110px rgba(255, 255, 255, 0.02);
}

.hero-decoration {
  position: absolute;
  right: 7%;
  bottom: 0;
  width: 210px;
  height: 160px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  transform: skewX(-24deg);
}

.hero-decoration span {
  position: absolute;
  display: block;
  background: rgba(255, 255, 255, 0.14);
}

.hero-decoration span:first-child {
  left: 24px;
  bottom: 33px;
  width: 28px;
  height: 28px;
}

.hero-decoration span:last-child {
  left: 57px;
  bottom: 17px;
  width: 12px;
  height: 12px;
}

.expert-hero .eyebrow {
  color: rgba(255, 255, 255, 0.75);
}

.expert-hero h2 {
  position: relative;
  z-index: 2;
  max-width: 780px;
  margin: 17px 0 12px;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: clamp(34px, 4.3vw, 62px);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.04em;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 690px;
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  line-height: 1.8;
}

.ask-form {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(870px, 100%);
  margin-top: 30px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: #fff;
  box-shadow: 0 14px 40px rgba(64, 0, 0, 0.18);
}

.ask-form textarea {
  width: 100%;
  min-height: 54px;
  max-height: 150px;
  resize: none;
  padding: 16px 18px;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}

.ask-form textarea::placeholder {
  color: #9a9fa4;
}

.ask-form button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex: 0 0 auto;
  border: 0;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.ask-form button {
  min-width: 142px;
  padding: 0 20px;
}

.ask-form button:hover,
.primary-button:hover {
  background: #0e151b;
  transform: translateY(-1px);
}

.ask-form button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.ask-form b {
  font-size: 20px;
  font-weight: 400;
}

.scope-row {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(930px, 100%);
  align-items: center;
  flex-wrap: wrap;
  gap: 11px 16px;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.87);
  font-size: 11px;
}

.scope-row > span {
  color: rgba(255, 255, 255, 0.56);
}

.scope-row label {
  cursor: pointer;
}

.scope-row input {
  accent-color: #fff;
}

.scope-row label.disabled {
  color: rgba(255, 255, 255, 0.45);
  cursor: not-allowed;
}

.scope-row em {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.63);
  font-style: normal;
}

.section-heading,
.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.section-heading {
  margin: 38px 0 17px;
}

.section-heading.compact {
  margin: 0 0 18px;
}

.section-heading h3,
.page-intro h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

.section-heading h3 {
  font-size: 22px;
}

.page-intro {
  margin: 4px 0 26px;
}

.page-intro h2 {
  font-size: clamp(28px, 3vw, 40px);
}

.page-intro > div > span {
  display: block;
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: 13px;
}

.text-button {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 12px;
  cursor: pointer;
}

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

.metric-card {
  position: relative;
  min-height: 150px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -19px;
  bottom: -19px;
  width: 58px;
  height: 58px;
  border: 1px solid #eee9e6;
  transform: rotate(45deg);
}

.metric-card > span,
.metric-card > small,
.metric-card > strong {
  display: block;
}

.metric-card > span {
  color: var(--ink-soft);
  font-size: 11px;
}

.metric-card > strong {
  margin: 13px 0 8px;
  color: var(--ink);
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 42px;
  font-weight: 500;
  line-height: 1;
}

.metric-card > small {
  color: #8c949b;
  font-size: 10px;
}

.metric-card.accent {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.metric-card.accent > span,
.metric-card.accent > small,
.metric-card.accent > strong {
  color: #fff;
}

.metric-card.accent > small,
.metric-card.accent > span {
  opacity: 0.72;
}

.metric-card.accent::after {
  border-color: rgba(255, 255, 255, 0.22);
}

.metric-card > strong.metric-word {
  margin-top: 21px;
  font-family: inherit;
  font-size: 30px;
  font-weight: 700;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.quick-card {
  position: relative;
  min-height: 190px;
  padding: 25px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.quick-card.dark {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.quick-card.muted {
  background: #ecebea;
  color: #7a8288;
}

.quick-index {
  position: absolute;
  top: 20px;
  right: 22px;
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 12px;
}

.quick-card.dark .quick-index {
  color: #ef6b68;
}

.quick-card p {
  margin: 0 0 26px;
  color: var(--red);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.quick-card.dark p {
  color: #ef6b68;
}

.quick-card h4 {
  max-width: 220px;
  margin: 0;
  font-size: 20px;
  line-height: 1.45;
}

.quick-question,
.coming-soon {
  position: absolute;
  left: 25px;
  bottom: 23px;
  font-size: 11px;
}

.quick-question {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.coming-soon {
  color: #8e9499;
}

.query-result {
  margin-top: 22px;
  padding: 25px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.ai-answer {
  margin-bottom: 18px;
  padding: 23px;
  border: 1px solid #d9c0bd;
  background:
    linear-gradient(135deg, transparent 92%, rgba(178, 13, 10, 0.06) 92%),
    #fff9f8;
}

.ai-answer-head {
  display: flex;
  gap: 13px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid #eadfdd;
}

.ai-answer-head > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 11px;
}

.ai-answer-head p {
  margin: 0 0 4px;
  color: var(--red);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.ai-answer-head h3 {
  margin: 0;
  font-size: 14px;
}

.ai-answer-content {
  padding-top: 17px;
  color: #39444d;
  font-size: 13px;
  line-height: 1.9;
}

.ai-answer-content .answer-reference {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  margin: 0 2px;
  padding: 0 5px;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  cursor: pointer;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.ai-answer-content .answer-reference:hover {
  background: var(--red-dark);
  box-shadow: 0 4px 12px rgba(184, 16, 14, 0.24);
  transform: translateY(-1px);
}

.ai-answer-content .answer-reference:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.query-result.loading .source-list {
  opacity: 0.45;
}

#query-route {
  padding: 7px 10px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 10px;
  font-weight: 700;
}

.result-summary {
  margin-bottom: 18px;
  padding: 15px 18px;
  border-left: 3px solid var(--red);
  background: var(--warm);
  color: #4c555d;
  font-size: 13px;
  line-height: 1.75;
}

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

.source-item {
  border: 1px solid var(--line);
  transition: border 160ms ease;
}

.source-item:hover {
  border-color: #d7b8b5;
}

.source-item .source-toggle-button {
  display: grid;
  width: 100%;
  grid-template-columns: auto 1fr auto;
  gap: 13px;
  align-items: center;
  padding: 15px 17px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.source-rank {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 11px;
}

.source-title strong,
.source-title small {
  display: block;
}

.source-title strong {
  font-size: 13px;
}

.source-title small {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 10px;
}

.source-toggle {
  color: var(--red);
  font-size: 18px;
}

.source-content {
  display: none;
  margin: 0 17px 17px 59px;
  padding: 14px 16px;
  background: #f8f7f5;
  color: #525d66;
  font-size: 12px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.source-item.open .source-content {
  display: block;
}

.source-item.reference-target {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(184, 16, 14, 0.1);
  animation: reference-pulse 900ms ease-out;
}

@keyframes reference-pulse {
  0% {
    background: #fff0ee;
    box-shadow: 0 0 0 0 rgba(184, 16, 14, 0.24);
  }

  100% {
    background: transparent;
    box-shadow: 0 0 0 8px rgba(184, 16, 14, 0);
  }
}

.primary-button {
  min-height: 42px;
  padding: 0 20px;
  font-size: 12px;
}

.outline-badge {
  padding: 9px 13px;
  border: 1px solid #d7c9c7;
  color: var(--red);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.collection-card {
  position: relative;
  min-height: 270px;
  padding: 27px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
}

.collection-card.ready::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--red);
}

.collection-card.empty {
  background:
    linear-gradient(135deg, transparent 76%, rgba(178, 13, 10, 0.035) 76%),
    #eeece9;
  color: #777f85;
}

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

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

.status-pill {
  padding: 5px 8px;
  border-radius: 99px;
  background: #e9f5ee;
  color: var(--success);
  font-size: 9px;
  font-weight: 700;
}

.empty .status-pill {
  background: #e4dedb;
  color: #776d69;
}

.collection-card > span {
  display: block;
  min-height: 42px;
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.collection-numbers {
  display: flex;
  gap: 32px;
  margin: 24px 0 20px;
}

.collection-numbers strong,
.collection-numbers small {
  display: block;
}

.collection-numbers strong {
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 500;
}

.collection-numbers small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
}

.type-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.type-tags span {
  padding: 5px 7px;
  background: #f4f1ef;
  color: #69737b;
  font-size: 9px;
}

.architecture-strip {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 30px;
  margin-top: 16px;
  padding: 29px;
  background: var(--ink);
  color: #fff;
}

.architecture-strip h3 {
  margin: 0;
  font-size: 20px;
}

.architecture-strip ol {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.architecture-strip li {
  display: flex;
  gap: 9px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 11px;
  line-height: 1.5;
}

.architecture-strip li b {
  color: #ef6b68;
  font-family: Georgia, serif;
  font-size: 10px;
}

.architecture-strip li small {
  color: rgba(255, 255, 255, 0.52);
  font-size: 9px;
}

.filter-tabs {
  display: flex;
  padding: 3px;
  background: #eae8e5;
}

.filter-tabs button {
  min-width: 50px;
  padding: 8px 11px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  cursor: pointer;
}

.filter-tabs button.active {
  background: #fff;
  color: var(--red);
  box-shadow: 0 2px 7px rgba(47, 38, 35, 0.08);
}

.table-card {
  border: 1px solid var(--line);
  background: var(--paper);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.table-toolbar input {
  width: min(330px, 70vw);
  padding: 10px 13px;
  border: 1px solid var(--line);
  outline: 0;
  background: var(--warm);
  font-size: 12px;
}

.table-toolbar input:focus {
  border-color: var(--red);
}

.table-toolbar > span {
  color: var(--ink-soft);
  font-size: 10px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

th,
td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  background: #faf9f7;
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.08em;
}

td.document-name {
  max-width: 420px;
  white-space: normal;
}

td.document-name strong,
td.document-name small {
  display: block;
}

td.document-name strong {
  font-size: 12px;
}

td.document-name small {
  margin-top: 5px;
  color: #8a9298;
  font-size: 9px;
}

.table-domain,
.table-status {
  display: inline-block;
  padding: 5px 7px;
  font-size: 9px;
  font-weight: 700;
}

.table-domain {
  background: var(--red-soft);
  color: var(--red);
}

.table-status {
  border-radius: 99px;
  background: #e9f5ee;
  color: var(--success);
}

.document-actions {
  white-space: nowrap;
}

.document-delete {
  padding: 5px 8px;
  border: 1px solid #e2b4b1;
  background: #fff;
  color: var(--red);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.document-delete:hover:not(:disabled) {
  border-color: var(--red);
  background: var(--red-soft);
}

.document-delete:disabled {
  opacity: 0.55;
  cursor: wait;
}

.empty-row {
  padding: 40px;
  color: var(--ink-soft);
  text-align: center;
}

.pipeline {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.pipeline-step {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 20px;
  align-items: center;
  min-height: 105px;
  padding: 22px 26px;
  background: var(--paper);
}

.pipeline-step > b {
  font-family: Georgia, serif;
  color: var(--red);
  font-size: 24px;
  font-weight: 500;
}

.pipeline-step h3 {
  margin: 0;
  font-size: 15px;
}

.pipeline-step p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.pipeline-step > span {
  padding: 7px 10px;
  border-radius: 99px;
  background: #e9f5ee;
  color: var(--success);
  font-size: 9px;
  font-weight: 700;
}

.pipeline-step.waiting {
  background: #f1efed;
}

.pipeline-step.waiting > b {
  color: #998f8b;
}

.pipeline-step.waiting > span {
  background: #e4dedb;
  color: #776d69;
}

.ingestion-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 15px;
}

.ingestion-notes article {
  min-height: 190px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.ingestion-notes p {
  margin: 0 0 5px;
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.ingestion-notes h3 {
  margin: 0 0 18px;
  font-size: 17px;
}

.ingestion-notes code {
  display: inline-block;
  padding: 7px 9px;
  background: #f4f1ef;
  color: var(--red-dark);
  font-size: 11px;
}

.ingestion-notes span {
  display: block;
  margin-top: 15px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
}

.ingestion-notes article.warning-note {
  border-color: #d5b8b5;
  background: #fff7f6;
}

.domain-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.domain-fieldset legend {
  margin-bottom: 13px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.upload-domain-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.upload-domain-card {
  position: relative;
  min-height: 230px;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.upload-domain-card:hover {
  border-color: #d7b8b5;
  transform: translateY(-2px);
}

.upload-domain-card.reserved {
  border-color: #d3d3d3;
  background: #eeeeee;
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.7;
  pointer-events: none;
}

.upload-domain-card.reserved:hover {
  border-color: #d3d3d3;
  transform: none;
}

.upload-domain-card.reserved .domain-check {
  color: #747474;
  font-weight: 700;
}

.upload-domain-card.selected {
  border-color: var(--red);
  box-shadow: 0 12px 30px rgba(117, 27, 22, 0.09);
}

.upload-domain-card.selected::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: var(--red);
}

.upload-domain-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.domain-number {
  display: grid;
  width: 47px;
  height: 47px;
  place-items: center;
  background: #f3efed;
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 17px;
}

.selected .domain-number {
  background: var(--red);
  color: #fff;
}

.domain-check {
  position: absolute;
  top: 29px;
  right: 26px;
  color: #9a9290;
  font-size: 9px;
}

.selected .domain-check {
  color: var(--red);
  font-weight: 700;
}

.upload-domain-card > p {
  margin: 24px 0 7px;
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.upload-domain-card h3 {
  margin: 0;
  font-size: 18px;
}

.upload-domain-card small {
  display: block;
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.75;
}

.upload-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(310px, 0.8fr);
  gap: 14px;
  margin-top: 16px;
}

.upload-panel {
  min-width: 0;
  padding: 27px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.upload-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.upload-panel-heading p,
.local-pipeline > p,
.active-job-head p {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.upload-panel-heading h3,
.local-pipeline h3,
.active-job-head h3 {
  margin: 0;
  font-size: 18px;
}

.upload-panel-heading select {
  width: min(330px, 52%);
  min-height: 42px;
  padding: 0 36px 0 13px;
  border: 1px solid var(--line);
  outline: 0;
  background: var(--warm);
  color: var(--ink);
  font-size: 11px;
}

.upload-panel-heading select:focus {
  border-color: var(--red);
}

.drop-zone {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  padding: 32px 20px;
  border: 1px dashed #cdb9b6;
  outline: 0;
  background:
    linear-gradient(135deg, transparent 88%, rgba(178, 13, 10, 0.05) 88%),
    #fcfaf9;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.drop-zone:hover,
.drop-zone:focus,
.drop-zone.dragover {
  border-color: var(--red);
  background:
    linear-gradient(135deg, transparent 88%, rgba(178, 13, 10, 0.09) 88%),
    #fff7f6;
}

.drop-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  margin-bottom: 16px;
  border: 1px solid var(--red);
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 27px;
}

.drop-zone h3 {
  margin: 0;
  font-size: 15px;
}

.drop-zone p {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
}

.selected-files {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.selected-files > p {
  margin: 0;
  padding: 13px;
  background: #f7f5f3;
  color: var(--ink-soft);
  font-size: 10px;
  text-align: center;
}

.selected-file {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.file-kind {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  background: var(--red-soft);
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
}

.selected-file strong,
.selected-file small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file strong {
  font-size: 11px;
}

.selected-file small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
}

.selected-file button {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #9b8f8c;
  cursor: pointer;
}

.selected-file button:hover {
  color: var(--red);
}

.local-pipeline {
  padding: 28px;
  background: var(--ink);
  color: #fff;
}

.local-pipeline > p {
  color: #ef6b68;
}

.local-pipeline ol {
  display: grid;
  gap: 0;
  margin: 23px 0;
  padding: 0;
  list-style: none;
}

.local-pipeline li {
  position: relative;
  display: flex;
  gap: 13px;
  align-items: center;
  min-height: 47px;
  padding-left: 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
}

.local-pipeline li b {
  color: #ef6b68;
  font-family: Georgia, serif;
  font-size: 9px;
}

.local-pipeline li.done,
.local-pipeline li.active {
  color: #fff;
}

.local-pipeline li.skipped {
  color: rgba(255, 255, 255, 0.28);
}

.local-pipeline li.done::after,
.local-pipeline li.active::after {
  content: "";
  position: absolute;
  right: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.local-pipeline li.active::after {
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.local-only-note {
  padding: 14px;
  border-left: 2px solid #ef6b68;
  background: rgba(255, 255, 255, 0.05);
}

.local-only-note strong,
.local-only-note span {
  display: block;
}

.ingestion-security-warning {
  margin: 16px 0 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.c3-reserved-notice {
  margin-top: 16px;
  padding: 24px 28px;
  border: 1px dashed #d9b1ad;
  background: #fffafa;
}

.c3-reserved-notice p {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.c3-reserved-notice h3 {
  margin: 0;
  font-size: 18px;
}

.c3-reserved-notice span {
  display: block;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
}

.local-only-note strong {
  color: #fff;
  font-size: 10px;
}

.local-only-note span {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 9px;
  line-height: 1.6;
}

.ingestion-submit {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding: 0 17px;
  border: 0;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.ingestion-submit:hover:not(:disabled) {
  background: #cd1714;
}

.ingestion-submit:disabled {
  background: #4a535b;
  color: rgba(255, 255, 255, 0.4);
  cursor: not-allowed;
}

.ingestion-submit span {
  font-size: 18px;
  font-weight: 400;
}

.c3-enhancement {
  margin-top: 16px;
  padding: 28px;
  border: 1px solid #d5b8b5;
  background: #fff9f8;
}

.c3-enhancement-head,
.c3-model-gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.c3-enhancement-head p,
.c3-model-copy p {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.c3-enhancement-head h3,
.c3-model-copy h4 {
  margin: 0;
}

.c3-enhancement-head h3 {
  font-size: 18px;
}

.c3-enhancement-head > div > span,
.c3-model-copy > span {
  display: block;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
}

.c3-security-badge {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid var(--red);
  color: var(--red);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.c3-stage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.c3-stage-grid article {
  position: relative;
  min-height: 170px;
  padding: 22px;
  border: 1px solid var(--line);
  background: #fff;
}

.c3-stage-grid article > span {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #e4d8d4;
  font-family: Georgia, serif;
  font-size: 28px;
}

.c3-stage-grid p {
  margin: 0 0 7px;
  color: var(--red);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.c3-stage-grid h4 {
  margin: 0;
  font-size: 15px;
}

.c3-stage-grid strong,
.c3-stage-grid small {
  display: block;
}

.c3-stage-grid strong {
  margin-top: 20px;
  color: var(--ink);
  font-size: 11px;
}

.c3-stage-grid small {
  margin-top: 8px;
  max-width: 88%;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.6;
}

.c3-model-gate {
  margin-top: 12px;
  padding: 18px 20px;
  border-left: 4px solid var(--red);
  background: #fff;
}

.c3-model-copy h4 {
  font-size: 14px;
}

.c3-model-gate .primary-button {
  flex: 0 0 auto;
}

.c3-model-gate .primary-button:disabled {
  border-color: #d7cfcb;
  background: #d7cfcb;
  color: #8f8581;
  cursor: not-allowed;
}

.c3-enhancement-progress {
  margin-top: 15px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: #fff;
}

.c3-enhancement-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin: 17px 0 0;
  padding: 0;
  list-style: none;
}

.c3-enhancement-steps li {
  padding: 9px 8px;
  background: #f2efed;
  color: var(--ink-soft);
  font-size: 8px;
  text-align: center;
}

.c3-enhancement-steps li.done {
  background: #e9f5ee;
  color: var(--success);
}

.c3-enhancement-steps li.active {
  background: var(--red);
  color: #fff;
}

.active-job,
.ingestion-history {
  margin-top: 16px;
  padding: 26px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.active-job-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.active-job-head > span {
  padding: 7px 10px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 9px;
  font-weight: 700;
}

.progress-track {
  height: 7px;
  margin-top: 23px;
  overflow: hidden;
  background: #eeeae7;
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--red);
  transition: width 300ms ease;
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 10px;
}

.progress-copy strong {
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 14px;
}

.job-file-list {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.job-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 11px 13px;
  background: #f8f6f4;
}

.job-file strong,
.job-file small {
  display: block;
}

.job-file strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-file small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
}

.job-file > span {
  color: var(--ink-soft);
  font-size: 9px;
}

.job-file > span.succeeded {
  color: var(--success);
}

.job-file > span.duplicate {
  color: #9a6d28;
}

.job-file > span.failed {
  color: var(--red);
}

.job-complete-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}

.ingestion-history .section-heading {
  margin-bottom: 15px;
}

.job-history-list {
  display: grid;
  gap: 7px;
}

.job-history-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 15px;
  align-items: center;
  min-height: 65px;
  padding: 11px 14px;
  border: 1px solid var(--line);
}

.job-domain {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  background: var(--red-soft);
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 11px;
}

.job-history-item strong,
.job-history-item small {
  display: block;
}

.job-history-item strong {
  font-size: 11px;
}

.job-history-item small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
}

.job-history-item > time {
  color: var(--ink-soft);
  font-size: 9px;
}

.job-status-pill {
  min-width: 58px;
  padding: 6px 8px;
  background: #eeeae7;
  color: #756d69;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}

.job-status-pill.succeeded {
  background: #e9f5ee;
  color: var(--success);
}

.job-status-pill.failed,
.job-status-pill.partial {
  background: var(--red-soft);
  color: var(--red);
}

.empty-history {
  margin: 0;
  padding: 30px;
  background: #f8f6f4;
  color: var(--ink-soft);
  font-size: 10px;
  text-align: center;
}

.current-model-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  min-height: 130px;
  padding: 27px;
  background: var(--ink);
  color: #fff;
}

.current-model-banner.active {
  background:
    linear-gradient(115deg, rgba(116, 0, 0, 0.42), transparent 55%),
    var(--ink);
}

.current-model-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid #ef6b68;
  color: #ef6b68;
  font-family: Georgia, serif;
  font-size: 15px;
}

.current-model-copy p {
  margin: 0 0 6px;
  color: #ef6b68;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.current-model-copy h3 {
  margin: 0;
  font-size: 20px;
}

.current-model-copy span {
  display: block;
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 10px;
}

.current-model-domains {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 300px;
}

.current-model-domains span,
.model-domain-tags span {
  padding: 6px 8px;
  font-size: 9px;
}

.current-model-domains span {
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.72);
}

.model-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 17px 0 13px;
}

.model-toolbar > span,
.model-audit .section-heading > span {
  color: var(--ink-soft);
  font-size: 9px;
}

.model-tabs {
  display: flex;
  padding: 3px;
  background: #e8e5e2;
}

.model-tabs button {
  min-width: 100px;
  padding: 9px 14px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  cursor: pointer;
}

.model-tabs button.active {
  background: #fff;
  color: var(--red);
  box-shadow: 0 2px 8px rgba(50, 37, 34, 0.08);
}

.model-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.model-card {
  position: relative;
  min-height: 260px;
  padding: 25px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
}

.model-card.active {
  border-color: var(--red);
  box-shadow: 0 13px 32px rgba(97, 27, 22, 0.09);
}

.model-card.active::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--red);
}

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

.model-card-type {
  display: inline-block;
  margin-bottom: 9px;
  color: var(--red);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.model-card h3 {
  margin: 0;
  font-size: 18px;
}

.model-card-status {
  padding: 6px 8px;
  background: #eeeae7;
  color: #776f6b;
  font-size: 8px;
  font-weight: 700;
}

.model-card-status.success {
  background: #e9f5ee;
  color: var(--success);
}

.model-card-status.failed {
  background: var(--red-soft);
  color: var(--red);
}

.model-card-status.active {
  background: var(--red);
  color: #fff;
}

.model-endpoint {
  display: grid;
  gap: 6px;
  margin: 19px 0;
  padding: 12px;
  background: #f7f5f3;
  color: var(--ink-soft);
  font-size: 9px;
}

.model-endpoint strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-domain-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.model-domain-tags span {
  background: var(--red-soft);
  color: var(--red);
  font-weight: 700;
}

.model-card-meta {
  display: flex;
  gap: 15px;
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 9px;
}

.model-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
}

.model-card-actions button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-size: 9px;
  cursor: pointer;
}

.model-card-actions button:hover {
  border-color: var(--red);
  color: var(--red);
}

.model-card-actions button.activate {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.model-card-actions button.danger:hover {
  background: var(--red);
  color: #fff;
}

.empty-model-list {
  grid-column: 1 / -1;
  margin: 0;
  padding: 40px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 10px;
  text-align: center;
}

.model-editor {
  margin-top: 16px;
  padding: 28px;
  border: 1px solid #d5b8b5;
  background: #fff9f8;
}

.model-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.model-form-grid label,
.model-parameter-grid label {
  display: grid;
  gap: 7px;
}

.model-form-grid label > span,
.model-parameter-grid label > span {
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
}

.model-form-grid input,
.model-form-grid select,
.model-parameter-grid input,
.model-parameter-grid select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  outline: 0;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
}

.model-form-grid input:focus,
.model-form-grid select:focus,
.model-parameter-grid input:focus,
.model-parameter-grid select:focus {
  border-color: var(--red);
}

.model-form-grid label > small {
  color: var(--ink-soft);
  font-size: 8px;
  line-height: 1.5;
}

.model-domain-fieldset {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 23px 0 17px;
  padding: 17px;
  border: 1px solid var(--line);
  background: #fff;
}

.model-domain-fieldset legend {
  padding: 0 7px;
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
}

.model-domain-fieldset label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: #f5f2f0;
  cursor: pointer;
}

.model-domain-fieldset input {
  accent-color: var(--red);
}

.model-domain-fieldset b {
  color: var(--red);
  font-size: 10px;
}

.model-domain-fieldset span,
.model-domain-fieldset p {
  color: var(--ink-soft);
  font-size: 9px;
}

.model-domain-fieldset p {
  flex-basis: 100%;
  margin: 4px 0 0;
}

.model-domain-fieldset label.disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.model-parameter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 13px;
}

.context-budget-note {
  margin: 13px 0 0;
  padding: 11px 13px;
  border-left: 3px solid var(--red);
  background: #fff;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.65;
}

.model-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 23px;
  padding-top: 18px;
  border-top: 1px solid #eadfdd;
}

.model-form-actions > span {
  color: var(--ink-soft);
  font-size: 9px;
}

.model-form-actions > div {
  display: flex;
  align-items: center;
  gap: 18px;
}

.model-audit {
  margin-top: 16px;
  padding: 26px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.audit-list {
  display: grid;
  gap: 7px;
}

.audit-entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 11px 13px;
  background: #f7f5f3;
}

.audit-entry > span:first-child {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  background: var(--red-soft);
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
}

.audit-entry strong,
.audit-entry small {
  display: block;
}

.audit-entry strong {
  font-size: 10px;
}

.audit-entry small,
.audit-entry time {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 8px;
}

.audit-result {
  color: var(--success);
  font-size: 9px;
}

.audit-result.failed {
  color: var(--red);
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.permission-grid article {
  position: relative;
  min-height: 330px;
  padding: 29px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.permission-grid article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--red);
}

.permission-grid article.locked {
  background: #eeece9;
  color: #777f85;
}

.permission-grid article.locked::before {
  background: #9c9692;
}

.permission-code {
  position: absolute;
  top: 25px;
  right: 26px;
  color: #e5d7d5;
  font-family: Georgia, serif;
  font-size: 38px;
}

.permission-grid p {
  margin: 0 0 27px;
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.permission-grid h3 {
  margin: 0;
  font-size: 20px;
}

.permission-grid ul {
  display: grid;
  gap: 10px;
  margin: 24px 0 30px;
  padding: 0;
  color: var(--ink-soft);
  font-size: 11px;
  list-style: none;
}

.permission-grid li::before {
  content: "—";
  margin-right: 8px;
  color: var(--red);
}

.permission-grid article > strong {
  position: absolute;
  left: 29px;
  bottom: 27px;
  color: #776d69;
  font-size: 10px;
}

.permission-grid article > strong.enabled {
  color: var(--success);
}

.security-principle {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-top: 15px;
  padding: 27px;
  background: var(--red);
  color: #fff;
}

.principle-mark {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  font-family: STKaiti, KaiTi, serif;
  font-size: 25px;
}

.security-principle p {
  color: rgba(255, 255, 255, 0.63);
}

.security-principle h3 {
  margin: 0;
  font-size: 20px;
}

.security-principle span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  line-height: 1.6;
}

.evaluation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 15px;
}

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

.evaluation-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 15px;
  min-height: 125px;
  align-items: center;
  padding: 23px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.evaluation-item div span {
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
}

.evaluation-item h3 {
  margin: 9px 0 0;
  font-size: 15px;
}

.evaluation-item button {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--red);
  background: #fff;
  color: var(--red);
  font-size: 10px;
  cursor: pointer;
}

.evaluation-item button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.evaluation-state {
  grid-column: 1 / -1;
  margin: -4px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.evaluation-state.passed {
  color: var(--success);
}

.evaluation-state.failed {
  color: var(--red);
}

.evaluation-guide {
  min-height: 370px;
  padding: 29px;
  background: var(--ink);
  color: #fff;
}

.evaluation-guide h3 {
  margin: 8px 0 25px;
  font-family: STKaiti, KaiTi, serif;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.4;
}

.evaluation-guide ol {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.evaluation-guide li {
  display: flex;
  gap: 13px;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.evaluation-guide li b {
  color: #ef6b68;
  font-family: Georgia, serif;
  font-size: 10px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: 360px;
  padding: 13px 16px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

[hidden] {
  display: none !important;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  background: #8f0000;
}

#silk-canvas,
.login-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.login-shade {
  background:
    radial-gradient(circle at 50% 46%, transparent 0, rgba(56, 0, 0, 0.1) 38%, rgba(35, 0, 0, 0.48) 100%),
    linear-gradient(115deg, rgba(255, 255, 255, 0.08), transparent 42%);
}

.login-form {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(390px, calc(100vw - 48px));
  color: #fff;
  text-align: center;
}

.login-form > img {
  width: 62px;
  height: 62px;
  margin: 0 auto 25px;
  border-radius: 14px;
  box-shadow: 0 12px 35px rgba(31, 0, 0, 0.28);
}

.login-form > p {
  margin: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.28em;
}

.login-form > h1 {
  margin: 9px 0 42px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(38px, 5vw, 54px);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.login-form label {
  display: grid;
  gap: 9px;
  margin-bottom: 24px;
  text-align: left;
}

.login-form label span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.login-form input {
  width: 100%;
  padding: 10px 2px 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 17px;
  caret-color: #fff;
}

.login-form input:focus {
  border-bottom-color: #fff;
  box-shadow: 0 1px 0 #fff;
}

.login-form > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 15px 2px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.68);
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.login-form > button:hover {
  border-bottom-color: #fff;
}

.login-form > button b {
  font-size: 20px;
}

.login-form > small {
  min-height: 18px;
  margin-top: 21px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
}

.login-form > small.error {
  color: #fff;
  font-weight: 700;
}

.user-chip {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.logout-button {
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 10px;
}

.permission-grid article > strong.denied {
  color: var(--red);
}

.user-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 15px;
}

.user-summary-grid article {
  display: flex;
  min-height: 96px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 22px;
  border: 1px solid var(--line);
  background: #fff;
}

.user-summary-grid span {
  color: var(--ink-soft);
  font-size: 11px;
}

.user-summary-grid strong {
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 32px;
}

.user-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.user-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  text-align: left;
}

.user-table th,
.user-table td {
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.user-table th {
  background: #faf8f6;
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.role-pill,
.domain-pill {
  display: inline-flex;
  margin: 2px 4px 2px 0;
  padding: 5px 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
}

.role-pill.superadmin {
  background: var(--red);
  color: #fff;
}

.role-pill.admin {
  background: var(--ink);
  color: #fff;
}

.user-row-actions {
  display: flex;
  gap: 7px;
}

.user-row-actions button {
  padding: 6px 9px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 9px;
}

.user-row-actions button.danger {
  color: var(--red);
}

.integration-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 15px;
  border: 1px solid var(--line);
  background: var(--line);
}

.integration-guide > div {
  padding: 24px;
  background: #fff;
}

.integration-guide p {
  margin: 0 0 7px;
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.integration-guide h3 {
  margin: 0 0 14px;
  font-size: 15px;
}

.integration-guide code {
  display: inline-block;
  margin-bottom: 12px;
  padding: 7px 10px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 10px;
}

.integration-guide span {
  display: block;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.7;
}

.integration-table {
  min-width: 1120px;
}

.credential-state {
  display: inline-flex;
  padding: 5px 8px;
  background: #eaf6ef;
  color: var(--success);
  font-size: 9px;
  font-weight: 800;
}

.credential-state.disabled {
  background: var(--red-soft);
  color: var(--red);
}

.integration-audit {
  margin-top: 15px;
}

.form-span-two {
  grid-column: 1 / -1;
}

.switch-label > span:last-child {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
}

.switch-label input {
  width: auto;
  min-height: auto;
}

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

.secret-dialog-content {
  padding: 30px;
}

.secret-dialog code {
  display: block;
  overflow-wrap: anywhere;
  margin: 18px 0 24px;
  padding: 18px;
  border: 1px dashed rgba(178, 13, 10, 0.4);
  background: #fff8f7;
  color: var(--red-dark);
  font-size: 13px;
  line-height: 1.7;
  user-select: all;
}

.account-dialog {
  width: min(760px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  background: #fff;
  box-shadow: 0 30px 90px rgba(37, 16, 13, 0.28);
}

.account-dialog::backdrop {
  background: rgba(28, 15, 13, 0.58);
  backdrop-filter: blur(5px);
}

.account-dialog form {
  padding: 30px;
}

.dialog-heading,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.dialog-heading {
  margin-bottom: 26px;
}

.dialog-heading p {
  margin: 0 0 5px;
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.dialog-heading h2 {
  margin: 0;
}

.dialog-heading > button {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 10px;
}

.account-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.account-form-grid label {
  display: grid;
  gap: 7px;
}

.account-form-grid label > span,
.managed-domain-fieldset legend {
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.account-form-grid input,
.account-form-grid select {
  width: 100%;
  min-height: 42px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  background: #fff;
}

.account-form-grid small {
  color: var(--ink-soft);
  font-size: 9px;
}

.password-warning {
  margin: -8px 0 20px;
  padding: 12px 14px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 10px;
}

.managed-domain-fieldset {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0;
  padding: 18px;
  border: 1px solid var(--line);
}

.managed-domain-fieldset legend {
  padding: 0 8px;
}

.managed-domain-fieldset label {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 11px;
  background: #faf8f6;
  font-size: 10px;
}

.managed-domain-fieldset label b {
  color: var(--red);
}

.managed-domain-fieldset p {
  grid-column: 1 / -1;
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
}

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

.dialog-actions > span {
  max-width: 430px;
  color: var(--ink-soft);
  font-size: 9px;
}

@media (max-width: 1080px) {
  :root {
    --sidebar: 214px;
  }

  .topbar-actions {
    gap: 12px;
  }

  .user-chip div {
    display: none;
  }

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

  .collection-grid,
  .permission-grid,
  .upload-domain-grid {
    grid-template-columns: 1fr;
  }

  .collection-card {
    min-height: 230px;
  }

  .architecture-strip {
    grid-template-columns: 1fr;
  }

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

  .upload-workbench {
    grid-template-columns: 1fr;
  }

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

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

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

  .integration-guide {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  :root {
    --sidebar: 260px;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: 20px 0 50px rgba(36, 24, 21, 0.16);
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
  }

  .mobile-menu {
    display: inline-block;
    padding: 8px 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--red);
    font-size: 11px;
  }

  .topbar {
    min-height: 72px;
    padding: 12px 18px;
  }

  .topbar-kicker,
  .service-state,
  .user-chip {
    display: none;
  }

  .logout-button {
    display: none;
  }

  .topbar h1 {
    font-size: 17px;
  }

  .content {
    padding: 18px 16px 40px;
  }

  .expert-hero {
    min-height: 440px;
    padding: 32px 22px;
  }

  .expert-hero h2 {
    font-size: 34px;
  }

  .ask-form {
    display: grid;
  }

  .ask-form button {
    min-height: 48px;
  }

  .scope-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .answer-mode-bar,
  .model-toolbar,
  .model-form-actions,
  .current-model-banner,
  .c3-enhancement-head,
  .c3-model-gate {
    align-items: flex-start;
    flex-direction: column;
  }

  .answer-mode-bar {
    display: flex;
  }

  .current-model-banner {
    display: flex;
  }

  .c3-stage-grid,
  .c3-enhancement-steps {
    grid-template-columns: 1fr;
  }

  .c3-model-gate .primary-button {
    width: 100%;
  }

  .current-model-domains {
    justify-content: flex-start;
  }

  .model-form-grid,
  .model-parameter-grid {
    grid-template-columns: 1fr;
  }

  .audit-entry {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .audit-entry time {
    display: none;
  }

  .scope-row em {
    margin-left: 0;
  }

  .metrics,
  .quick-grid,
  .ingestion-notes,
  .upload-domain-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 130px;
  }

  .page-intro,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .architecture-strip ol {
    grid-template-columns: 1fr;
  }

  .pipeline-step {
    grid-template-columns: 38px 1fr;
  }

  .pipeline-step > span {
    grid-column: 2;
    justify-self: start;
  }

  .upload-panel-heading,
  .active-job-head,
  .job-complete-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .upload-panel-heading select {
    width: 100%;
  }

  .job-history-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .job-history-item > time {
    display: none;
  }

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

  .evaluation-state {
    grid-column: 1;
  }

  .account-form-grid,
  .managed-domain-fieldset {
    grid-template-columns: 1fr;
  }

  .form-span-two {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
