/* ================= Home ================= */

.hero {
  padding: 22px 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
}

.hero-chatbox {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--r-xl);
  box-shadow: 0 12px 40px rgba(46, 107, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  padding: 20px 22px 14px;
  transition: border 0.15s ease, box-shadow 0.2s ease;
}

.hero-chatbox:focus-within {
  border-color: rgba(46, 107, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(46, 107, 255, 0.1), 0 16px 48px rgba(46, 107, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.hero-chatbox textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  min-height: 72px;
  background: transparent;
}

.hero-chatbox textarea::placeholder {
  color: var(--text-3);
}

.hero-chatbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.hero-chatbar .icon-btn {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  color: var(--text);
}

.hero-chatbar .icon-btn:hover {
  background: #fff;
  border-color: var(--blue);
  color: var(--blue);
}

.hero-chatbar .model-select {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--border-strong);
  color: var(--text);
}

.hero-chatbar .spacer {
  flex: 1;
}

.hero-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.hero-starter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(46, 107, 255, 0.16);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hero-starter svg {
  width: 14px;
  height: 14px;
  color: var(--blue);
}

.hero-starter:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.hero .hero-text {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 6px;
}

.hero h1 .wave {
  display: inline-block;
  animation: wave 2.4s ease-in-out infinite;
  transform-origin: 70% 70%;
}

@keyframes wave {
  0%,
  60%,
  100% {
    transform: rotate(0);
  }
  10% {
    transform: rotate(14deg);
  }
  20% {
    transform: rotate(-8deg);
  }
  30% {
    transform: rotate(12deg);
  }
  40% {
    transform: rotate(-4deg);
  }
}

.hero .hero-sub {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.quick-action {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border 0.15s ease;
}

.quick-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(46, 107, 255, 0.35);
}

.quick-action .qa-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.quick-action .qa-icon svg {
  width: 18px;
  height: 18px;
}

.quick-action .qa-title {
  font-weight: 600;
  font-size: 13.5px;
}

.quick-action .qa-sub {
  font-size: 11.5px;
  color: var(--text-3);
}

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

.priority-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.priority-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.priority-card .pc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.priority-card h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
}

.priority-card .pc-desc {
  font-size: 12.5px;
  color: var(--text-2);
  flex: 1;
}

.priority-card .pc-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-3);
}

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

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

.assistant-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.assistant-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.assistant-card .ac-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.assistant-card .ac-icon svg {
  width: 19px;
  height: 19px;
}

.assistant-card .ac-name {
  font-weight: 600;
  font-size: 13.5px;
}

.assistant-card .ac-desc {
  font-size: 11.5px;
  color: var(--text-3);
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.shortcut {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: all 0.15s ease;
}

.shortcut:hover {
  border-color: rgba(46, 107, 255, 0.4);
  color: var(--blue);
  box-shadow: var(--shadow-sm);
}

.shortcut svg {
  width: 20px;
  height: 20px;
  display: block;
  margin: 0 auto 6px;
  color: var(--blue);
}

/* ================= Ask ================= */

.ask-input-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 16px;
}

.ask-input-card textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  min-height: 64px;
  background: transparent;
}

.ask-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.ask-input-bar .spacer {
  flex: 1;
}

.model-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
}

.model-select svg {
  width: 13px;
  height: 13px;
}

.example-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.example-prompt {
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.example-prompt:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-soft);
}

.chat-flow {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.chat-msg {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.chat-msg .avatar,
.chat-msg .avatar-fallback {
  flex-shrink: 0;
}

.chat-msg .chat-user-avatar {
  width: 44px;
  height: 44px;
}

.chat-user-bubble {
  background: var(--blue-soft);
  border: 1px solid rgba(46, 107, 255, 0.18);
  border-radius: 4px var(--r-md) var(--r-md) var(--r-md);
  padding: 12px 16px;
  font-size: 13.5px;
  max-width: 720px;
}

.chat-ai-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  flex: 1;
  min-width: 0;
  max-width: calc(100% - 56px);
}

.chat-ai-bubble h4 {
  margin: 0 0 8px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--blue-deep);
}

.chat-ai-bubble h4 svg {
  width: 15px;
  height: 15px;
}

.chat-ai-bubble p {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--text-2);
}

.chat-ai-bubble ul {
  margin: 0 0 10px;
  padding-left: 18px;
  color: var(--text-2);
  font-size: 13.5px;
}

.chat-ai-bubble li {
  margin-bottom: 4px;
}

.data-card {
  aspect-ratio: 543 / 724;
  background: var(--surface) url("../img/rail-data-bg.webp") top center / 100% 100% no-repeat;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.data-card > * {
  position: relative;
}

.data-card .rail-list {
  margin-top: auto;
  gap: 10px;
}

.data-card .rail-item {
  padding: 6px 0;
}

.data-card .rail-item .ri-sub {
  font-size: 12.5px;
  color: var(--text);
}

.data-card .kpi-delta {
  font-size: 12.5px;
}

.md-body .md-h {
  font-weight: 700;
  color: var(--text);
  margin: 12px 0 6px;
}

.md-body .md-h:first-child {
  margin-top: 0;
}

.md-body .md-h1 {
  font-size: 15.5px;
}

.md-body .md-h2 {
  font-size: 14.5px;
}

.md-body .md-h3,
.md-body .md-h4 {
  font-size: 13.5px;
}

.md-body .md-list {
  margin: 4px 0 10px;
  padding-left: 18px;
  color: var(--text-2);
  font-size: 13.5px;
}

.md-body .md-list li {
  margin-bottom: 4px;
}

.md-body .md-hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

.md-body code {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 12px;
  font-family: var(--font-num);
}

.md-body strong {
  color: var(--text);
  font-weight: 600;
}

.md-table {
  border-collapse: collapse;
  margin: 8px 0 12px;
  font-size: 12.5px;
  width: 100%;
}

.md-table th,
.md-table td {
  border: 1px solid var(--border);
  padding: 6px 12px;
  text-align: left;
  white-space: nowrap;
}

.md-table th {
  background: var(--bg-soft);
  font-weight: 600;
  color: var(--text);
}

.md-table td {
  color: var(--text-2);
}

.answer-sources {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px dashed var(--border-strong);
  font-size: 12px;
  color: var(--text-3);
}

.answer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.typing-dots {
  display: inline-flex;
  gap: 5px;
  padding: 14px 4px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--violet);
  animation: typing 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* ================= Workbench ================= */

.task-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card h3 {
  margin: 0;
  font-size: 14.5px;
}

.task-card .tc-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-3);
}

.task-card .tc-ai {
  background: var(--grad-ai-soft);
  border: 1px solid rgba(124, 92, 255, 0.14);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.task-card .tc-ai svg {
  width: 14px;
  height: 14px;
  color: var(--violet);
  flex-shrink: 0;
  margin-top: 2px;
}

.task-card .tc-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.flow-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.flow-item:last-child {
  border-bottom: none;
}

.flow-item .fi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.flow-item .fi-steps {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-3);
}

.flow-item .fi-steps .step-node {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.flow-item .fi-steps .step-node.done {
  color: var(--green);
}

.flow-item .fi-steps .step-node.current {
  color: var(--blue);
  font-weight: 600;
}

.flow-item .fi-steps svg {
  width: 12px;
  height: 12px;
}

/* ================= Agents ================= */

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

.combo-card {
  border-radius: var(--r-lg);
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.combo-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.combo-card h3 {
  margin: 0;
  font-size: 14.5px;
}

.combo-card .cc-desc {
  font-size: 12.5px;
  color: var(--text-2);
  flex: 1;
}

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

.agent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.agent-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.agent-card .ag-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.agent-card .ag-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.agent-card .ag-icon svg {
  width: 21px;
  height: 21px;
}

.agent-card .ag-name {
  font-weight: 700;
  font-size: 14.5px;
}

.agent-card .ag-role {
  font-size: 11.5px;
  color: var(--text-3);
}

.agent-card .ag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.agent-card .ag-stats {
  display: flex;
  gap: 16px;
  font-size: 11.5px;
  color: var(--text-3);
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.agent-card .ag-stats b {
  color: var(--text);
  font-family: var(--font-num);
  font-size: 13px;
}

.agent-card .ag-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.agent-card .ag-tools {
  display: flex;
  gap: 4px;
}

.agent-card .ag-tools .tool-dot {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--bg-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
}

.agent-card .ag-tools .tool-dot svg {
  width: 12px;
  height: 12px;
}

.flow-svg-wrap {
  overflow-x: auto;
}

.maf-card {
  background: linear-gradient(180deg, #fbfcff 0%, #ffffff 60%);
}

.maf-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-deep);
  background: var(--blue-soft);
  border: 1px solid rgba(46, 107, 255, 0.16);
  border-radius: 999px;
  padding: 5px 14px;
  width: fit-content;
  margin-bottom: 6px;
}

.maf-flow {
  display: flex;
  align-items: flex-start;
  padding: 22px 6px 8px;
}

.maf-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 132px;
  flex-shrink: 0;
  text-align: center;
}

.maf-node {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  position: relative;
  transition: all 0.35s ease;
}

.maf-node svg {
  width: 22px;
  height: 22px;
}

.maf-step.done .maf-node {
  border-color: var(--mint);
  color: #12996f;
  background: var(--mint-soft);
}

.maf-step.active .maf-node {
  background: var(--grad-ai);
  color: #fff;
  border-color: transparent;
  transform: scale(1.1);
  box-shadow: 0 8px 22px rgba(46, 107, 255, 0.4), 0 0 0 6px rgba(46, 107, 255, 0.1);
}

.maf-step.active .maf-node::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1.5px solid rgba(46, 107, 255, 0.35);
  animation: maf-ring 1.5s ease-out infinite;
}

@keyframes maf-ring {
  from {
    transform: scale(0.85);
    opacity: 1;
  }
  to {
    transform: scale(1.25);
    opacity: 0;
  }
}

.maf-label {
  font-size: 13px;
  font-weight: 600;
  transition: color 0.3s ease;
}

.maf-step.active .maf-label {
  color: var(--blue);
}

.maf-desc {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.4;
}

.maf-link {
  flex: 1;
  height: 2px;
  margin-top: 48px;
  background: var(--border);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  min-width: 30px;
}

.maf-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, var(--blue) 40%, var(--violet) 60%, transparent 100%);
  background-size: 45% 100%;
  background-repeat: no-repeat;
  animation: maf-travel 1.8s linear infinite;
}

@keyframes maf-travel {
  from {
    background-position: -45% 0;
  }
  to {
    background-position: 145% 0;
  }
}

/* ================= Knowledge ================= */

.kb-search {
  background: rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kb-search .tabs {
  background: transparent;
  border: none;
  padding: 0;
  gap: 22px;
}

.kb-search .tab {
  border-radius: 0;
  padding: 4px 2px 8px;
  position: relative;
}

.kb-search .tab::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2.5px;
  border-radius: 2px;
  background: var(--grad-ai);
  transform: translateX(-50%);
  transition: width 0.22s ease;
}

.kb-search .tab:hover {
  color: var(--blue-deep);
}

.kb-search .tab.active {
  background: transparent;
  color: var(--blue);
  box-shadow: none;
}

.kb-search .tab.active::after {
  width: 100%;
}

.kb-input-wrap {
  position: relative;
}

.kb-search .kb-input {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 16px;
  color: var(--text-3);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.kb-search .kb-input:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46, 107, 255, 0.12);
  color: var(--blue);
}

.kb-search .kb-input input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--text);
}

.kb-search .kb-input svg {
  width: 16px;
  height: 16px;
}

#kb-go {
  display: none;
}

#kb-go.show {
  display: inline-flex;
}

.kb-suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 40;
}

.kb-suggest.open {
  display: block;
  animation: kb-suggest-in 0.16s ease;
}

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

.kb-suggest-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  padding: 7px 10px 4px;
}

.kb-suggest-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.kb-suggest-item:hover {
  background: var(--blue-soft);
  color: var(--blue-deep);
}

.kb-suggest-item svg {
  width: 14px;
  height: 14px;
  color: var(--text-3);
  flex-shrink: 0;
}

.kb-suggest-type {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-3);
}

.kb-suggest-empty {
  padding: 12px 10px;
  font-size: 12.5px;
  color: var(--text-3);
}

.kb-cats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.install-stats {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 4px;
}

.is-label {
  margin-top: 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
}

.is-legend {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
}

.is-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.is-legend b {
  color: var(--text);
  font-family: var(--font-num);
  font-weight: 700;
}

.is-legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.kb-cat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.kb-cat:hover {
  border-color: rgba(46, 107, 255, 0.4);
  box-shadow: var(--shadow-sm);
}

.kb-cat .kc-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.kb-cat .kc-icon svg {
  width: 17px;
  height: 17px;
}

.kb-cat .kc-name {
  font-size: 12.5px;
  font-weight: 600;
}

.kb-cat .kc-count {
  font-size: 11px;
  color: var(--text-3);
}

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

.extract-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  transition: all 0.15s ease;
}

.extract-card:hover {
  border-color: rgba(124, 92, 255, 0.4);
  box-shadow: var(--shadow-sm);
}

.extract-card .ec-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--violet-soft);
  color: var(--violet);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.extract-card .ec-icon svg {
  width: 16px;
  height: 16px;
}

.extract-card .ec-title {
  font-size: 13px;
  font-weight: 600;
}

.extract-card .ec-sub {
  font-size: 11.5px;
  color: var(--text-3);
}

/* ================= Marketplace ================= */

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

.featured-card {
  border-radius: var(--r-lg);
  padding: 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.featured-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.featured-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -40px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.featured-card .fc-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.featured-card .fc-icon svg {
  width: 19px;
  height: 19px;
}

.featured-card h3 {
  margin: 4px 0 0;
  font-size: 15.5px;
}

.featured-card p {
  margin: 0;
  font-size: 12px;
  opacity: 0.85;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  font-size: 12.5px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.filter-chip.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 600;
}

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

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.app-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.app-card .ap-foot .btn {
  transition: all 0.2s ease;
}

.app-card:hover .ap-cta {
  background: var(--grad-ai);
  color: #fff;
  box-shadow: 0 4px 14px rgba(46, 107, 255, 0.3);
}

.app-card:hover .ap-foot .btn-quiet:not(.ap-cta) {
  border-color: var(--border-strong);
  color: var(--text);
}

.app-card .ap-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.app-card .ap-icon svg {
  width: 20px;
  height: 20px;
}

.app-card h3 {
  margin: 0;
  font-size: 14px;
}

.app-card .ap-desc {
  font-size: 12px;
  color: var(--text-2);
  flex: 1;
  min-height: 36px;
}

.app-card .ap-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-3);
}

.app-card .ap-meta svg {
  width: 12px;
  height: 12px;
  vertical-align: -2px;
}

.app-card .ap-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.scenario-card {
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: var(--surface);
  padding: 14px 16px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.15s ease;
}

.scenario-card::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -32px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

.scenario-card::before {
  content: "";
  position: absolute;
  right: 34px;
  top: -26px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.scenario-card:hover {
  border-color: rgba(46, 107, 255, 0.4);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.scenario-card .sc-name,
.scenario-card .sc-sub {
  position: relative;
  z-index: 1;
}

.scenario-card .sc-name {
  font-size: 13px;
  font-weight: 600;
}

.scenario-card .sc-sub {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ================= Insights ================= */

.insight-kpi-unified {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
}

.insight-kpi-unified .kpi-tile {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 14px 22px;
  position: relative;
}

.insight-kpi-unified .kpi-tile + .kpi-tile::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22%;
  height: 56%;
  width: 1px;
  background: var(--border);
}

.chart-grid-trio {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}

.chart-grid-trio .card-region {
  grid-column: 1 / -1;
}

.chart-grid-trio .card-region #chart-region {
  max-width: 720px;
}

@media (min-width: 1280px) {
  .chart-grid-trio {
    grid-template-columns: 1.25fr 1fr 1.25fr;
  }

  .chart-grid-trio .card-revenue {
    order: 1;
  }

  .chart-grid-trio .card-region {
    order: 2;
    grid-column: auto;
  }

  .chart-grid-trio .card-margin {
    order: 3;
  }

  .chart-grid-trio .card-region #chart-region {
    max-width: none;
  }
}

.table-anomalies {
  font-size: 12.5px;
}

.table-anomalies th,
.table-anomalies td {
  white-space: nowrap;
  padding-top: 11px;
  padding-bottom: 11px;
}

.table-anomalies .cell-main {
  font-size: 12.5px;
}

.filter-select {
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
}

.filter-select svg {
  width: 13px;
  height: 13px;
  color: var(--text-3);
}

/* ================= Settings ================= */

.settings-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.settings-nav {
  width: 200px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
}

.settings-nav .sn-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: var(--font);
  text-align: left;
}

.settings-nav .sn-item svg {
  width: 15px;
  height: 15px;
}

.settings-nav .sn-item:hover {
  background: var(--bg-soft);
}

.settings-nav .sn-item.active {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 600;
}

.settings-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-row {
  display: flex;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.field-row:last-child {
  border-bottom: none;
}

.field-row .fr-label {
  width: 140px;
  color: var(--text-3);
  flex-shrink: 0;
}

.field-row .fr-value {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-row .fr-action {
  margin-left: auto;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.ok {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.status-dot.warn {
  background: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
}

.model-route {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.model-route:last-child {
  border-bottom: none;
}

.model-route .mr-task {
  width: 150px;
  font-weight: 600;
  flex-shrink: 0;
}

.model-route .mr-arrow {
  color: var(--text-3);
}

.model-route .mr-arrow svg {
  width: 16px;
  height: 16px;
}

.model-route .mr-model {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.model-route .mr-usage {
  width: 180px;
  flex-shrink: 0;
}

.model-route .mr-usage .mu-label {
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.settings-hero {
  display: flex;
  align-items: center;
  gap: 16px;
}

.settings-hero img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  animation: orb-float 8s ease-in-out infinite;
}

.status-card {
  aspect-ratio: 471 / 836;
  background: url("../img/status-bg.webp") top center / 100% 100% no-repeat;
  border-color: rgba(255, 255, 255, 0.25);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.status-card > * {
  position: relative;
}

.status-card .card-title {
  color: var(--text);
}

.status-card .rail-list {
  gap: 12px;
  margin-top: auto;
}

.status-card .rail-item {
  padding: 8px 0;
}

.status-card .rail-item .ri-title {
  color: var(--text);
}

.status-card .rail-item .ri-sub {
  color: var(--text-2);
}

.timeline {
  display: flex;
  flex-direction: column;
  padding: 4px 0 0;
}

.tl-item {
  display: flex;
  gap: 12px;
  position: relative;
  padding-bottom: 18px;
}

.tl-item:last-child {
  padding-bottom: 2px;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 30px;
  bottom: 0;
  width: 2px;
  border-radius: 1px;
  background: linear-gradient(to bottom, var(--border-strong), var(--border));
}

.tl-item:last-child::before {
  display: none;
}

.tl-node {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.tl-node svg {
  width: 13px;
  height: 13px;
}

.tl-item:first-child .tl-node {
  background: var(--grad-ai);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(46, 107, 255, 0.14), 0 3px 10px rgba(46, 107, 255, 0.3);
}

.tl-content {
  padding-top: 4px;
  min-width: 0;
}

.tl-title {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
}

.tl-item:first-child .tl-title {
  font-weight: 600;
  color: var(--blue-deep);
}

.tl-time {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ---------- Theme picker ---------- */

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

.theme-card {
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.theme-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.theme-card.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46, 107, 255, 0.12);
}

.theme-preview {
  height: 92px;
  border-radius: 9px;
  border: 1px solid var(--border);
  display: flex;
  overflow: hidden;
  margin-bottom: 10px;
}

.theme-preview .tp-side {
  width: 26%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 8px;
}

.theme-preview .tp-side i {
  height: 6px;
  border-radius: 3px;
  display: block;
}

.theme-preview .tp-body {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-preview .tp-bar {
  height: 8px;
  border-radius: 4px;
  display: block;
}

.theme-preview .tp-bar.b2 {
  width: 62%;
}

.theme-preview .tp-row {
  display: flex;
  gap: 6px;
  margin-top: auto;
}

.theme-preview .tp-chip {
  width: 34px;
  height: 14px;
  border-radius: 7px;
  display: block;
}

.tp-slop {
  background: linear-gradient(135deg, #eaf1ff, #f1edff);
}

.tp-slop .tp-side {
  background: rgba(255, 255, 255, 0.72);
}

.tp-slop .tp-side i {
  background: #cdd9f6;
}

.tp-slop .tp-side i:first-child {
  background: linear-gradient(90deg, #2e6bff, #7c5cff);
}

.tp-slop .tp-bar {
  background: linear-gradient(90deg, #2e6bff, #7c5cff);
  opacity: 0.85;
}

.tp-slop .tp-chip {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #d8e2f8;
}

.tp-slop .tp-chip.c2 {
  background: linear-gradient(90deg, #35b6f6, #2ecfa0);
  border: none;
  opacity: 0.7;
}

.tp-ent {
  background: #f4f6fa;
}

.tp-ent .tp-side {
  background: #1e3a8a;
}

.tp-ent .tp-side i {
  background: rgba(255, 255, 255, 0.28);
}

.tp-ent .tp-side i:first-child {
  background: #fff;
}

.tp-ent .tp-bar {
  background: #1d4ed8;
  border-radius: 2px;
}

.tp-ent .tp-chip {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
}

.tp-ent .tp-chip.c2 {
  background: #1d4ed8;
  border: none;
}

.theme-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
}

.theme-check {
  margin-left: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--grad-ai);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-check svg {
  width: 12px;
  height: 12px;
}

.theme-desc {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
  line-height: 1.5;
}
