:root {
  --brand-50: rgba(0, 113, 227, 0.06);
  --brand-100: rgba(0, 113, 227, 0.1);
  --brand-200: rgba(0, 113, 227, 0.2);
  --brand-300: rgba(0, 113, 227, 0.4);
  --brand-400: #3b9bff;
  --brand-500: #0071e3;
  --brand-600: #0060c9;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-700: #334155;
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: #ffffff;
  --surface-soft: #f5f5f7;
  --border: #d2d2d7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --brand: var(--brand-500);
  --brand-line: rgba(0, 113, 227, 0.22);
  --knowledge: #0071e3;
  --error: #f06543;
  --green: #2ea77a;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  --sidebar-width: 294px;
  --rail-gap: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

body {
  min-height: 100vh;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 8px 16px 12px;
  background: #ffffff;
  box-shadow: inset -1px 0 0 #d2d2d7;
  min-height: 0;
  overflow-y: auto;
}

.sidebar::-webkit-scrollbar,
.nav-scroll::-webkit-scrollbar,
.messages::-webkit-scrollbar,
.detail-panel::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb,
.nav-scroll::-webkit-scrollbar-thumb,
.messages::-webkit-scrollbar-thumb,
.detail-panel::-webkit-scrollbar-thumb {
  background: rgba(159, 172, 198, 0.5);
  border-radius: 999px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 14px;
  border-bottom: 1px solid #d2d2d7;
}

.brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.brand-copy h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 800;
  color: #201633;
}

.brand-copy p {
  display: none;
}

.nav-scroll {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: auto;
  gap: 8px;
}

.nav-top {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-bottom {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.nav-label {
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
  color: rgba(86, 69, 123, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-item {
  width: 212px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  text-align: left;
  color: rgba(49, 37, 82, 0.88);
  background: transparent;
  border-radius: 18px;
  border: 1px solid transparent;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

.nav-item:hover {
  background: rgba(122, 92, 255, 0.1);
  border-color: rgba(122, 92, 255, 0.2);
  transform: translateX(2px);
}

.nav-item.active {
  background: rgba(0, 113, 227, 0.08);
  border-color: rgba(122, 92, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 10px 24px rgba(112, 82, 208, 0.16);
}

.nav-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  background: rgba(0, 113, 227, 0.08);
  color: var(--brand);
}

.nav-icon[data-tone="amber"] {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.nav-icon[data-tone="blue"] {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.nav-icon[data-tone="danger"] {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.nav-icon[data-tone="green"] {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.nav-icon[data-tone="teal"] {
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
}

.nav-icon[data-tone="violet"] {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
}

.nav-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nav-copy strong {
  font-size: 15px;
  line-height: 1.12;
  font-weight: 800;
}

.nav-copy span {
  font-size: 10px;
  line-height: 1.16;
  color: rgba(84, 69, 117, 0.78);
}

.main {
  padding: 24px 28px;
  min-height: 0;
  overflow: hidden;
}

.frame {
  height: calc(100vh - 48px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--rail-gap);
  overflow: hidden;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 4px 2px;
}

.page-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.page-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.page-head--memory {
  padding: 2px 4px 0;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  color: var(--text);
}

.segment {
  padding: 9px 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

.segment.active {
  background: #0071e3;
  color: white;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--border);
  gap: 4px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: saturate(180%) blur(20px);
}

.chat-root {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--rail-gap);
}

.dashboard-root {
  min-height: 0;
  overflow: auto;
}

.dashboard-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
}

.dashboard-grid {
  display: grid;
  gap: 18px;
}

.dashboard-grid--hero,
.dashboard-grid--2 {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
}

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

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

.student-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 16px;
}

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

.student-hero-card,
.hero-panel,
.hero-side-card,
.info-card,
.dashboard-metric-card,
.mini-panel,
.channel-card,
.schedule-card {
  padding: 20px 22px;
}

.student-hero-card,
.hero-panel {
  background:
    transparent,
    #ffffff;
}

.student-hero-card strong,
.hero-panel h3,
.hero-side-card strong,
.mini-panel strong,
.dashboard-metric-card strong,
.channel-card strong,
.schedule-card strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  line-height: 1.35;
}

.student-hero-card p,
.hero-panel p,
.hero-side-card p,
.info-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.student-rail {
  display: grid;
  gap: 12px;
}

.mini-panel {
  background: rgba(255, 255, 255, 0.92);
}

.mini-panel span,
.dashboard-metric-card span,
.channel-stats span,
.schedule-meta span,
.page-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.page-kicker {
  display: inline-block;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.info-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.card-head--compact {
  align-items: center;
  margin-bottom: 12px;
}

.card-head--compact h3 {
  margin: 0;
}

.card-head h3,
.card-head strong {
  margin: 0;
}

.card-head .page-kicker {
  margin-bottom: 6px;
}

.card-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--brand);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(66, 99, 235, 0.12);
  font-size: 14px;
  font-weight: 700;
}

.tool-card p {
  margin-top: 0;
}

.info-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--text);
  line-height: 1.65;
}

.dashboard-metric-card {
  min-height: 148px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dashboard-metric-card small {
  color: var(--muted);
  font-size: 12px;
}

.status-stack {
  display: grid;
  gap: 18px;
}

.status-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.72fr);
  gap: 18px;
  padding: 24px 26px;
  position: relative;
  overflow: hidden;
  background:
    transparent,
    #ffffff;
}

.status-hero::after {
  content: "";
  position: absolute;
  inset: auto -42px -58px auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: transparent;
  pointer-events: none;
}

.status-hero[data-tone="success"] {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.status-hero[data-tone="warning"] {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.status-hero[data-tone="danger"] {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.status-hero__content {
  display: grid;
  gap: 14px;
}

.status-hero__content h3 {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.status-hero__content p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.72;
}

.status-chip-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.status-chip {
  min-width: 0;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(220, 228, 241, 0.98);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.status-chip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-chip strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.3;
  word-break: break-word;
}

.status-hero__side {
  display: grid;
  align-content: start;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.status-hero__model,
.status-hero__stamp {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(220, 228, 241, 0.98);
}

.status-hero__model span,
.status-hero__stamp span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-hero__model strong,
.status-hero__stamp strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  line-height: 1.35;
  word-break: break-word;
}

.status-hero__model small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.status-service-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.status-service-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: rgba(148, 163, 184, 0.16);
}

.status-service-card[data-tone="success"]::before {
  background: rgba(46, 167, 122, 0.92);
}

.status-service-card[data-tone="danger"]::before {
  background: rgba(240, 101, 67, 0.92);
}

.status-service-card[data-tone="brand"]::before {
  background: rgba(0, 113, 227, 0.92);
}

.status-service-card[data-tone="violet"]::before {
  background: rgba(139, 92, 246, 0.92);
}

.status-service-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-service-card__icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(66, 99, 235, 0.12);
  font-weight: 700;
}

.status-service-card__label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-service-card strong {
  display: block;
  margin: 0;
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.status-service-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.68;
}

.status-service-card__meta {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  border-top: 1px solid rgba(220, 228, 241, 0.82);
}

.dashboard-grid--status-bottom {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr) minmax(320px, 0.95fr);
}

.status-wide-card,
.status-chain-card,
.status-note-card {
  padding: 22px;
}

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

.status-summary-tile {
  padding: 16px 18px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(220, 228, 241, 0.98);
}

.status-summary-tile span,
.status-section__label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-summary-tile strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.35;
  word-break: break-word;
}

.status-section {
  margin-top: 18px;
}

.status-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
  color: var(--text);
  border: 1px solid rgba(220, 228, 241, 0.98);
  font-size: 12px;
  font-weight: 700;
}

.status-tag--success {
  background: rgba(46, 167, 122, 0.1);
  color: var(--green);
}

.status-tag--brand {
  background: rgba(0, 113, 227, 0.1);
  color: var(--brand);
}

.status-steps {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.status-step {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(220, 228, 241, 0.98);
}

.status-step__index {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: rgba(232, 238, 255, 0.95);
  font-size: 12px;
  font-weight: 800;
}

.status-step__body strong {
  display: block;
  margin: 0;
  font-size: 15px;
}

.status-step__body p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.62;
}

.status-note-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.status-note {
  padding: 16px 16px 16px 18px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(220, 228, 241, 0.98);
}

.status-note p {
  margin: 10px 0 0;
  color: var(--text);
  line-height: 1.7;
}

.status-note__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-note__tag--brand {
  background: rgba(0, 113, 227, 0.1);
  color: var(--brand);
}

.status-note__tag--warning {
  background: rgba(245, 158, 11, 0.14);
  color: #c87b00;
}

.channel-grid,
.schedule-stack {
  display: grid;
  gap: 18px;
}

.channel-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.channel-card__head,
.schedule-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

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

.channel-stats strong,
.schedule-meta strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-pill--online {
  background: rgba(46, 167, 122, 0.14);
  color: var(--green);
}

.status-pill--success {
  background: rgba(46, 167, 122, 0.14);
  color: var(--green);
}

.status-pill--danger {
  background: rgba(240, 101, 67, 0.14);
  color: var(--error);
}

.status-pill--warning {
  background: rgba(245, 158, 11, 0.14);
  color: #c87b00;
}

.status-pill--brand {
  background: rgba(0, 113, 227, 0.12);
  color: var(--brand);
}

.status-pill--violet {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
}

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

.schedule-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.heartbeat-shell {
  gap: 20px;
}

.heartbeat-hero,
.heartbeat-card,
.heartbeat-note-card {
  position: relative;
  overflow: hidden;
}

.heartbeat-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
  padding: 24px 24px 22px;
  background:
    transparent,
    transparent,
    #ffffff;
}

.heartbeat-hero--warning {
  background:
    transparent,
    transparent,
    #ffffff;
}

.heartbeat-hero--danger {
  background:
    transparent,
    transparent,
    #ffffff;
}

.heartbeat-hero__main h3 {
  margin: 10px 0 12px;
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.heartbeat-hero__main p {
  margin: 0;
  max-width: 820px;
  color: var(--muted);
  line-height: 1.8;
}

.heartbeat-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.heartbeat-hero__pulse {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(46, 167, 122, 0.28);
  animation: heartbeat-pulse 2s ease-out infinite;
}

.heartbeat-hero--warning .heartbeat-hero__pulse {
  background: #d97706;
  box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.22);
}

.heartbeat-hero--danger .heartbeat-hero__pulse {
  background: var(--error);
  box-shadow: 0 0 0 0 rgba(240, 101, 67, 0.22);
}

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

.heartbeat-stat-tile {
  padding: 16px 16px 14px;
  border-radius: 20px;
  border: 1px solid rgba(145, 158, 186, 0.14);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.heartbeat-stat-tile span,
.heartbeat-mini-stat span,
.heartbeat-card__timing span,
.heartbeat-chip,
.heartbeat-check-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.heartbeat-stat-tile strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 18px;
  line-height: 1.35;
}

.heartbeat-stat-tile small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.heartbeat-grid,
.heartbeat-note-grid {
  display: grid;
  gap: 18px;
}

.heartbeat-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.heartbeat-note-grid {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.95fr);
}

.heartbeat-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  background:
    #ffffff,
    transparent;
}

.heartbeat-card--success {
  background:
    #ffffff,
    transparent;
}

.heartbeat-card--warning,
.heartbeat-card--empty {
  background:
    #ffffff,
    transparent;
}

.heartbeat-card--danger {
  background:
    #ffffff,
    transparent;
}

.heartbeat-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.heartbeat-card__head strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.2;
}

.heartbeat-card__timing {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(145, 158, 186, 0.14);
  background: rgba(255, 255, 255, 0.84);
}

.heartbeat-card__timing strong {
  display: block;
  margin: 8px 0 10px;
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.heartbeat-card__timing p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.heartbeat-card__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.heartbeat-mini-stat {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(145, 158, 186, 0.14);
  background: rgba(255, 255, 255, 0.88);
}

.heartbeat-mini-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.35;
}

.heartbeat-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.heartbeat-chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(145, 158, 186, 0.14);
}

.heartbeat-note-card {
  padding: 22px;
  background:
    #ffffff,
    transparent;
}

.heartbeat-checklist,
.heartbeat-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.heartbeat-check-item,
.heartbeat-legend__row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(145, 158, 186, 0.14);
  background: rgba(255, 255, 255, 0.88);
}

.heartbeat-check-item span {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(0, 113, 227, 0.1);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.heartbeat-check-item p,
.heartbeat-legend__row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.heartbeat-note-card--legend .card-icon {
  color: var(--green);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(46, 167, 122, 0.14);
}

@keyframes heartbeat-pulse {
  0% {
    box-shadow: 0 0 0 0 currentColor;
    opacity: 0.95;
  }
  70% {
    box-shadow: 0 0 0 14px rgba(255, 255, 255, 0);
    opacity: 1;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    opacity: 0.95;
  }
}

.plan-shell {
  gap: 20px;
}

.plan-grid--hero {
  grid-template-columns: minmax(0, 1.18fr) minmax(400px, 0.82fr);
}

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

.plan-grid--bottom {
  grid-template-columns: minmax(0, 1.22fr) minmax(360px, 0.78fr);
}

.plan-hero,
.plan-weekly,
.plan-card {
  position: relative;
  overflow: hidden;
}

.plan-hero,
.plan-weekly {
  min-height: 320px;
}

.plan-hero {
  padding: 26px 28px;
  background:
    transparent,
    transparent,
    #ffffff;
}

.plan-weekly {
  padding: 26px 24px;
  background:
    transparent,
    #ffffff;
}

.plan-hero::after,
.plan-weekly::after {
  content: "";
  position: absolute;
  inset: auto -56px -78px auto;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: transparent;
  pointer-events: none;
}

.plan-hero__head,
.plan-weekly__head {
  margin-bottom: 16px;
}

.plan-hero__head h3 {
  margin: 6px 0 0;
  font-size: 34px;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.plan-hero__summary {
  margin: 0;
  max-width: 860px;
  font-size: 15px;
  line-height: 1.9;
  color: #617396;
}

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

.plan-signal-card {
  min-height: 166px;
  padding: 16px 16px 14px;
  border-radius: 20px;
  border: 1px solid rgba(145, 158, 186, 0.14);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.plan-signal-card span,
.plan-goal-card__badge,
.plan-dose-block__head span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plan-signal-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 18px;
  line-height: 1.35;
}

.plan-signal-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.plan-signal-card--brand span {
  color: var(--brand);
}

.plan-signal-card--danger span {
  color: var(--error);
}

.plan-signal-card--amber span {
  color: #d97706;
}

.plan-weekly__head strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  line-height: 1.45;
}

.plan-weekly__rail,
.plan-priority-stack,
.plan-checklist,
.plan-timeline,
.plan-dose-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-goal-card,
.plan-check-item,
.plan-priority-card,
.plan-timeline-card,
.plan-dose-item {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(145, 158, 186, 0.14);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.plan-goal-card {
  grid-template-columns: 44px 1fr;
  padding: 16px;
  border-radius: 18px;
}

.plan-goal-card__index {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(0, 113, 227, 0.1);
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.plan-goal-card strong,
.plan-check-item strong,
.plan-priority-card strong,
.plan-timeline-card strong,
.plan-dose-item strong {
  display: block;
  font-size: 15px;
  line-height: 1.45;
}

.plan-goal-card p,
.plan-check-item p,
.plan-priority-card p,
.plan-timeline-card p,
.plan-dose-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.plan-goal-card p,
.plan-check-item p,
.plan-priority-card p,
.plan-dose-item p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.plan-goal-card p {
  -webkit-line-clamp: 3;
}

.plan-check-item p,
.plan-dose-item p {
  -webkit-line-clamp: 2;
}

.plan-priority-card p {
  -webkit-line-clamp: 5;
}

.plan-card {
  padding: 22px;
  background:
    #ffffff,
    transparent;
}

.plan-card--danger {
  background:
    #ffffff,
    transparent;
}

.plan-card .card-head {
  margin-bottom: 16px;
}

.plan-card .card-head--compact {
  align-items: center;
}

.plan-card .card-head--compact .card-icon {
  width: 36px;
  height: 36px;
  border-radius: 14px;
}

.plan-card h3 {
  font-size: 18px;
}

.plan-check-item {
  grid-template-columns: 40px 1fr;
  padding: 14px 15px;
  border-radius: 20px;
}

.plan-check-item__index {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(0, 113, 227, 0.1);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.plan-check-item--danger .plan-check-item__index {
  background: rgba(240, 101, 67, 0.1);
  color: var(--error);
}

.plan-priority-card {
  grid-template-columns: 42px 1fr;
  min-height: 158px;
  padding: 16px;
  border-radius: 18px;
}

.plan-priority-card__rank {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(0, 113, 227, 0.1);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.plan-priority-card--danger .plan-priority-card__rank {
  background: rgba(240, 101, 67, 0.1);
  color: var(--error);
}

.plan-priority-card__body {
  min-width: 0;
}

.plan-priority-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.plan-priority-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.1);
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
}

.plan-priority-card--danger .plan-priority-card__badge {
  background: rgba(240, 101, 67, 0.1);
  color: var(--error);
}

.plan-timeline {
  gap: 14px;
}

.plan-timeline-card {
  grid-template-columns: 82px 1fr;
  align-items: flex-start;
  padding: 16px;
  border-radius: 18px;
}

.plan-timeline-card__day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(0, 113, 227, 0.08);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

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

.plan-dose-block + .plan-dose-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(145, 158, 186, 0.12);
}

.plan-dose-block__head strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
  line-height: 1.5;
}

.plan-dose-item {
  grid-template-columns: 10px 1fr;
  align-items: stretch;
  padding: 14px 14px 14px 12px;
  border-radius: 20px;
}

.plan-dose-item__bar {
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.08);
}

.plan-dose-item--danger .plan-dose-item__bar {
  background: #ffffff;
}

.plan-card--danger .card-icon {
  color: var(--error);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(240, 101, 67, 0.14);
}

.plan-goal-card--empty,
.plan-priority-card--empty,
.plan-check-item--empty,
.plan-timeline-card--empty,
.plan-dose-item--empty {
  background: rgba(249, 250, 255, 0.92);
}

.plan-grid--bottom .plan-card--timeline {
  min-height: 420px;
}

.plan-grid--bottom .plan-card--load {
  min-height: 420px;
}

.chat-layout {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 318px 1fr;
  gap: var(--rail-gap);
}

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

.session-panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.session-actions {
  display: flex;
  gap: 10px;
}

.pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  color: var(--text);
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.session-item {
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--surface-strong);
  border: 1px solid rgba(142, 154, 189, 0.14);
  color: var(--text);
}

.session-item.active {
  background: #ffffff;
  border-color: var(--brand-line);
}

.content-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 18px;
  gap: 14px;
  overflow: hidden;
}

.content-card {
  flex: 1;
  min-height: 0;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(142, 154, 189, 0.15);
  display: grid;
  place-items: center;
  padding: 28px;
}

.placeholder {
  width: min(680px, 100%);
  min-height: 280px;
  border: 1px dashed rgba(66, 99, 235, 0.18);
  border-radius: 24px;
  background:
    #ffffff,
    repeating-#ffffff;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 32px 24px;
}

.chat-shell {
  min-height: 0;
  padding: 22px;
}

.chat-stage {
  min-height: 0;
  padding: 22px;
  display: block;
  overflow: hidden;
}

.chat-canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 24px;
  border: 1px solid rgba(66, 99, 235, 0.1);
  background:
    #ffffff,
    transparent;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 26px 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.chat-empty {
  flex: 1;
  min-height: 320px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 32px 20px;
}

.chat-empty strong {
  display: block;
  color: var(--text);
  font-size: 22px;
  margin-bottom: 10px;
}

.chat-empty p {
  margin: 0;
  line-height: 1.7;
}

.chat-message {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  max-width: min(76%, 760px);
}

.chat-message--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #3550c9;
  background: rgba(232, 238, 255, 0.95);
  border: 1px solid rgba(66, 99, 235, 0.12);
}

.chat-avatar--assistant {
  background: #ffffff;
}

.chat-avatar--user {
  background: #ffffff;
  color: white;
  border-color: transparent;
}

.chat-bubble-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.chat-message--user .chat-bubble-wrap {
  align-items: flex-end;
}

.chat-bubble {
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(142, 154, 189, 0.14);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.chat-bubble__attachments {
  display: grid;
  gap: 10px;
}

.chat-bubble__text {
  white-space: pre-wrap;
}

.chat-bubble__text + .chat-bubble__attachments,
.chat-bubble__attachments + .chat-bubble__text {
  margin-top: 12px;
}

.chat-inline-image {
  display: block;
  max-width: min(320px, 100%);
  max-height: 280px;
  border-radius: 16px;
  border: 1px solid rgba(142, 154, 189, 0.18);
  object-fit: cover;
  background: rgba(255, 255, 255, 0.72);
}

.chat-inline-file {
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(245, 247, 253, 0.92);
  color: var(--text);
  font-size: 13px;
}

.chat-bubble--user {
  background: #ffffff;
  color: white;
  border-color: transparent;
}

.chat-bubble--user .chat-inline-file {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}

.chat-bubble--user .chat-inline-image {
  border-color: rgba(255, 255, 255, 0.24);
}

.chat-bubble--typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 72px;
}

.chat-bubble--typing span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(78, 97, 162, 0.55);
  animation: chat-typing 1s infinite ease-in-out;
}

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

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

.chat-meta {
  padding: 0 4px;
  font-size: 12px;
  color: rgba(110, 124, 160, 0.9);
}

.chat-alert {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 241, 241, 0.95);
  border: 1px solid rgba(220, 74, 74, 0.12);
  color: #b44343;
}

.placeholder strong {
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
}

.placeholder p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.composer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

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

.chat-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(236, 241, 255, 0.96);
  border: 1px solid rgba(66, 99, 235, 0.14);
  color: var(--text);
}

.attachment-remove {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(66, 99, 235, 0.12);
  color: var(--muted);
}

.upload-button {
  height: 56px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}

.chat-input {
  width: 100%;
  min-height: 56px;
  max-height: 160px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  outline: none;
  resize: none;
  font: inherit;
  color: var(--text);
  line-height: 1.6;
}

.chat-input::placeholder {
  color: rgba(124, 135, 165, 0.9);
}

.chat-input:disabled {
  background: rgba(245, 247, 253, 0.95);
  color: rgba(124, 135, 165, 0.92);
}

.composer-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
}

.composer input {
  width: 100%;
  height: 50px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  outline: none;
}

.primary-button:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

@keyframes chat-typing {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

.primary-button {
  padding: 12px 22px;
  border-radius: 18px;
  background: #ffffff;
  color: white;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.chat-page-shell {
  flex: 1;
  min-height: 0;
  display: flex;
}

.chat-shell {
  flex: 1;
  min-height: 0;
  padding: 18px;
  display: flex;
}

.chat-container {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 16px 16px;
  overflow: hidden;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(222, 229, 242, 0.96);
}

.chat-container.drag-active {
  box-shadow: inset 0 0 0 2px rgba(0, 113, 227, 0.14);
}

.chat-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(0, 113, 227, 0.28);
  border-radius: 18px;
  background: rgba(0, 113, 227, 0.08);
  color: var(--brand);
  font-size: 18px;
  font-weight: 700;
  pointer-events: none;
  backdrop-filter: blur(2px);
}

.chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 12px;
}

.chat-toolbar-session {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg {
  display: flex;
  width: 100%;
  gap: 12px;
  max-width: 100%;
  animation: fade-in-up 0.22s ease both;
}

.msg.user {
  align-self: flex-end;
  width: auto;
  max-width: min(42%, 420px);
  justify-content: flex-end;
  gap: 0;
}

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

.msg-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--slate-700);
  color: var(--brand-300);
  font-size: 12px;
  font-weight: 700;
}

.msg.user .msg-avatar {
  display: none;
}

.msg-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: calc(100% - 46px);
}

.msg.assistant .msg-body {
  width: auto;
  max-width: min(76%, 860px);
  align-items: flex-start;
}

.msg.user .msg-body {
  width: auto;
  max-width: 100%;
  margin-left: 0;
}

.msg.user .msg-body {
  align-items: flex-end;
}

.msg-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.65;
  font-size: 14px;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  display: inline-block;
  width: auto;
}

.msg-bubble__text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.msg-bubble__markdown {
  display: grid;
  gap: 14px;
}

.msg-bubble__markdown > * {
  margin: 0;
}

.msg-bubble__markdown p {
  margin: 0;
  line-height: 1.78;
}

.msg-bubble__markdown h2,
.msg-bubble__markdown h3,
.msg-bubble__markdown h4,
.msg-bubble__markdown h5,
.msg-bubble__markdown h6 {
  margin: 0;
  color: #243256;
  line-height: 1.35;
  font-weight: 800;
}

.msg-bubble__markdown h2 {
  font-size: 22px;
}

.msg-bubble__markdown h3 {
  font-size: 18px;
}

.msg-bubble__markdown h4,
.msg-bubble__markdown h5,
.msg-bubble__markdown h6 {
  font-size: 15px;
}

.msg-bubble__markdown ul,
.msg-bubble__markdown ol {
  margin: 0;
  padding-left: 24px;
  display: grid;
  gap: 8px;
}

.msg-bubble__markdown li {
  line-height: 1.72;
}

.msg-bubble__markdown a {
  color: #3675ff;
  text-decoration: none;
  word-break: break-all;
}

.msg-bubble__markdown a:hover {
  text-decoration: underline;
}

.msg-bubble__markdown strong {
  font-weight: 800;
}

.msg-bubble__markdown del {
  opacity: 0.72;
}

.msg-bubble__markdown hr {
  width: 100%;
  border: 0;
  border-top: 1px solid rgba(168, 180, 205, 0.42);
}

.msg-bubble__markdown blockquote {
  margin: 0;
  padding-left: 14px;
  border-left: 3px solid rgba(135, 150, 189, 0.32);
  color: rgba(60, 74, 103, 0.9);
}

.msg-bubble__markdown pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  border-radius: 16px;
  background: rgba(242, 246, 255, 0.96);
  border: 1px solid rgba(176, 189, 216, 0.24);
}

.msg-bubble__markdown code {
  padding: 0.12em 0.42em;
  border-radius: 8px;
  background: rgba(242, 246, 255, 0.96);
  color: #2d3d67;
  font-size: 0.92em;
  font-family: "Consolas", "SFMono-Regular", monospace;
}

.msg-bubble__markdown pre code {
  display: block;
  padding: 0;
  background: transparent;
  color: inherit;
  white-space: pre;
  font-size: 13px;
  line-height: 1.65;
}

.msg-md__table-wrap {
  overflow-x: auto;
  margin: 2px 0;
  border: 1px solid rgba(176, 189, 216, 0.24);
  border-radius: 16px;
}

.msg-md__table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: rgba(250, 252, 255, 0.98);
}

.msg-md__table thead {
  background: rgba(241, 245, 255, 0.98);
}

.msg-md__table th,
.msg-md__table td {
  padding: 14px 16px;
  vertical-align: top;
  border-bottom: 1px solid rgba(176, 189, 216, 0.22);
  border-right: 1px solid rgba(176, 189, 216, 0.18);
  line-height: 1.68;
}

.msg-md__table th:last-child,
.msg-md__table td:last-child {
  border-right: 0;
}

.msg-md__table tbody tr:last-child td {
  border-bottom: 0;
}

.msg-md__table th {
  font-weight: 800;
  color: #2b3a5f;
}

.msg-md__table td {
  color: var(--text);
}

.msg.user .msg-bubble {
  padding: 10px 16px;
  background: #ffffff;
  color: #2d214f;
  border: 1px solid rgba(108, 92, 231, 0.16);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  border-bottom-right-radius: 4px;
}

.msg.assistant .msg-bubble {
  border-bottom-left-radius: 4px;
}

.msg-bubble__attachments {
  display: grid;
  gap: 10px;
}

.msg-bubble__text + .msg-bubble__attachments,
.msg-bubble__attachments + .msg-bubble__text {
  margin-top: 12px;
}

.msg-inline-image {
  display: block;
  max-width: min(320px, 100%);
  max-height: 280px;
  border-radius: 16px;
  border: 1px solid rgba(142, 154, 189, 0.18);
  object-fit: cover;
  background: rgba(255, 255, 255, 0.72);
}

.msg-inline-file {
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(245, 247, 253, 0.92);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.msg.user .msg-inline-file {
  background: rgba(255, 255, 255, 0.24);
  color: white;
}

.msg-meta {
  padding: 0 4px;
  color: rgba(110, 124, 160, 0.9);
  font-size: 12px;
}

.msg.user .msg-meta {
  text-align: right;
}

.msg-bubble--typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 72px;
}

.msg-bubble--typing span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(78, 97, 162, 0.55);
  animation: chat-typing 1s infinite ease-in-out;
}

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

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

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  text-align: center;
  padding: 48px 24px;
}

.chat-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 113, 227, 0.08);
  color: var(--brand);
  font-size: 28px;
  font-weight: 700;
}

.chat-empty h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.chat-empty p {
  margin: 0;
  max-width: 420px;
  font-size: 14px;
  line-height: 1.7;
}

.chat-alert {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 241, 241, 0.95);
  border: 1px solid rgba(220, 74, 74, 0.12);
  color: #b44343;
}

.chat-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(222, 229, 242, 0.96);
}

.chat-pending-files {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chat-pending-item {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.98);
  border: 1px solid var(--border);
}

.chat-pending-thumb,
.chat-pending-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
}

.chat-pending-thumb {
  object-fit: cover;
}

.chat-pending-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 113, 227, 0.08);
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.chat-pending-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-pending-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-pending-size {
  font-size: 11px;
  color: var(--muted);
}

.chat-pending-remove {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: white;
  border: 1px solid var(--border);
  color: var(--muted);
}

.chat-input-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: end;
}

.upload-button,
.btn-secondary {
  min-height: 50px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  color: #31425d;
  white-space: nowrap;
  cursor: pointer;
}

.chat-input {
  width: 100%;
  min-height: 50px;
  max-height: 160px;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  outline: none;
  resize: none;
  overflow-y: hidden;
  font: inherit;
  color: var(--text);
  line-height: 1.6;
}

.chat-input::placeholder {
  color: rgba(124, 135, 165, 0.9);
}

.chat-input:disabled {
  background: rgba(245, 247, 253, 0.95);
  color: rgba(124, 135, 165, 0.92);
}

.primary-button {
  min-height: 50px;
  padding: 0 22px;
  border-radius: 18px;
  background: #0071e3;
  color: white;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.primary-button:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

.chat-input-hint {
  font-size: 11px;
  color: var(--muted);
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.status-line {
  margin-top: 14px;
  color: var(--green);
  font-size: 13px;
}

.simple-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.memory-root {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.graph-workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  height: 100%;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.graph-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

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

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

.graph-stats {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 6px;
}

.graph-stat {
  min-width: 64px;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(134, 149, 178, 0.18);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.graph-stat strong {
  font-size: 15px;
  color: var(--text);
}

.graph-stat span {
  font-size: 11px;
  color: var(--muted);
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  color: var(--text);
}

.graph-board {
  min-height: 0;
  height: 100%;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  overflow: hidden;
}

.graph-stage {
  height: 100%;
  min-height: 0;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(142, 154, 189, 0.12);
  background:
    #ffffff,
    transparent;
}

.graph-viewport {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  cursor: grab;
  background-color: #fbfbf8;
  background-image: transparent;
  background-size: 24px 24px;
}

.graph-viewport.is-panning {
  cursor: grabbing;
}

.graph-world {
  position: absolute;
  inset: 0;
  width: 1400px;
  height: 820px;
  transform-origin: 0 0;
}

.graph-svg {
  position: absolute;
  inset: 0;
  width: 1400px;
  height: 820px;
  overflow: visible;
}

.graph-node-layer {
  position: absolute;
  inset: 0;
}

.graph-edge {
  fill: none;
  stroke: rgba(146, 156, 176, 0.18);
  stroke-width: 2;
  transition: stroke 160ms ease, opacity 160ms ease, stroke-width 160ms ease, filter 160ms ease;
}

.graph-edge.is-active {
  stroke: rgba(56, 68, 100, 0.82);
  stroke-width: 2.8;
  filter: drop-shadow(0 2px 8px rgba(62, 74, 110, 0.12));
}

.graph-edge.is-candidate {
  stroke-dasharray: 8 6;
  stroke: rgba(152, 162, 184, 0.16);
}

.graph-edge.is-muted {
  opacity: 0.16;
}

.graph-edge-label {
  fill: rgba(101, 112, 140, 0.88);
  font-size: 13px;
  text-anchor: middle;
  dominant-baseline: middle;
  paint-order: stroke;
  stroke: rgba(250, 250, 247, 0.92);
  stroke-width: 8px;
  opacity: 0;
  transition: opacity 160ms ease, fill 160ms ease, transform 160ms ease;
}

.graph-edge-label.is-active {
  fill: var(--text);
  opacity: 1;
}

.graph-edge-label.is-muted {
  opacity: 0;
}

.graph-edge-label.is-candidate {
  fill: rgba(111, 122, 150, 0.54);
}

.graph-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: block;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  text-align: left;
  line-height: 1;
  color: rgba(66, 76, 98, 0.96);
  transition: transform 180ms ease, opacity 180ms ease, color 180ms ease;
}

.graph-node::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 999px;
  background: transparent;
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.graph-node__core {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.98);
  border: 2px solid rgba(133, 144, 171, 0.46);
  box-shadow:
    0 10px 24px rgba(66, 76, 96, 0.12),
    0 0 0 4px rgba(255, 255, 255, 0.74);
}

.graph-node__core::before,
.graph-node__core::after {
  content: "";
  position: absolute;
  border-radius: 999px;
}

.graph-node__core::before {
  inset: 4px;
  border: 1px solid rgba(255, 255, 255, 0.88);
}

.graph-node__core::after {
  width: 8px;
  height: 8px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.92);
}

.graph-node:hover {
  transform: translate(-50%, -50%) scale(1.04);
}

.graph-node.is-active {
  transform: translate(-50%, -50%) scale(1.08);
  color: var(--text);
}

.graph-node.is-selected {
  transform: translate(-50%, -50%) scale(1.08);
}

.graph-node.is-focus {
  color: var(--text);
}

.graph-node.is-muted {
  opacity: 0.24;
}

.graph-node.is-candidate {
  opacity: 0.62;
}

.graph-node__title {
  position: absolute;
  z-index: 2;
  width: 120px;
  max-width: 120px;
  display: -webkit-box;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.01em;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-height: calc(2 * 1.16em);
  color: rgba(74, 84, 108, 0.96);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.96),
    0 0 12px rgba(255, 255, 255, 0.82);
  transition: color 160ms ease, opacity 160ms ease;
  pointer-events: none;
}

.graph-node__badge {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: rgba(31, 39, 64, 0.76);
  font-size: 10px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid rgba(217, 224, 242, 0.88);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  opacity: 0;
  transition: opacity 160ms ease;
  pointer-events: none;
}

.graph-node.is-active .graph-node__badge,
.graph-node.is-selected .graph-node__badge {
  opacity: 1;
}

.graph-node.is-muted .graph-node__title {
  opacity: 0.42;
}

.graph-node--knowledge .graph-node__core {
  border-color: rgba(97, 117, 178, 0.56);
  color: #4364da;
}

.graph-node--error .graph-node__core {
  border-color: rgba(196, 112, 90, 0.56);
  color: #df6845;
}

.graph-node.is-candidate .graph-node__core {
  border-style: dashed;
  box-shadow:
    0 8px 18px rgba(78, 88, 113, 0.08),
    0 0 0 3px rgba(255, 255, 255, 0.66);
}

.graph-node--knowledge.is-linked .graph-node__core,
.graph-node--knowledge.is-active .graph-node__core,
.graph-node--knowledge.is-selected .graph-node__core {
  border-color: rgba(66, 99, 235, 0.86);
  box-shadow:
    0 14px 26px rgba(76, 95, 149, 0.16),
    0 0 0 5px rgba(213, 223, 255, 0.92);
}

.graph-node--error.is-linked .graph-node__core,
.graph-node--error.is-active .graph-node__core,
.graph-node--error.is-selected .graph-node__core {
  border-color: rgba(240, 101, 67, 0.9);
  box-shadow:
    0 14px 26px rgba(144, 91, 77, 0.16),
    0 0 0 5px rgba(255, 230, 222, 0.94);
}

.graph-node--knowledge .graph-node__badge {
  color: #3155cf;
}

.graph-node--error .graph-node__badge {
  color: #cf5c3f;
}

.graph-node--anchor-right .graph-node__title {
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
  text-align: left;
}

.graph-node--anchor-left .graph-node__title {
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
  text-align: right;
}

.graph-node--anchor-top .graph-node__title {
  left: 50%;
  bottom: calc(100% + 18px);
  transform: translateX(-50%);
  text-align: center;
}

.graph-node--anchor-bottom .graph-node__title {
  left: 50%;
  top: calc(100% + 18px);
  transform: translateX(-50%);
  text-align: center;
}

.graph-node--badge-top .graph-node__badge {
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
}

.graph-node--badge-bottom .graph-node__badge {
  left: 50%;
  top: calc(100% + 10px);
  transform: translateX(-50%);
}

.graph-overlay {
  position: absolute;
  left: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.graph-overlay__label {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(134, 149, 178, 0.18);
  font-size: 12px;
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.graph-overlay__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 420px;
}

.legend-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(134, 149, 178, 0.18);
  color: var(--muted);
  font-size: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.detail-panel {
  height: 100%;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow: auto;
}

.detail-empty {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(134, 149, 178, 0.18);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  padding: 24px;
}

.detail-empty strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

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

.detail-header > :first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.detail-header__actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.detail-header h3 {
  margin: 6px 0 8px;
  font-size: 24px;
  line-height: 1.15;
}

.detail-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 13px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow-wrap: anywhere;
}

.detail-kicker {
  font-size: 12px;
  color: var(--muted);
}

.detail-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(247, 248, 252, 0.96);
  border: 1px solid rgba(134, 149, 178, 0.16);
  color: var(--muted);
  flex: 0 0 auto;
}

.detail-delete {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 239, 236, 0.95);
  border: 1px solid rgba(240, 101, 67, 0.18);
  color: #c24e35;
  font-size: 12px;
  white-space: nowrap;
}

.detail-delete:disabled {
  opacity: 0.6;
  cursor: default;
}

.detail-path {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(247, 248, 252, 0.96);
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

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

.detail-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(247, 248, 252, 0.96);
  border: 1px solid rgba(134, 149, 178, 0.16);
  color: var(--muted);
  font-size: 12px;
}

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

.metric-card {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(247, 248, 252, 0.96);
  border: 1px solid rgba(134, 149, 178, 0.14);
}

.metric-card span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.metric-card strong {
  display: block;
  font-size: 18px;
}

.detail-section {
  padding: 14px 0 0;
  border-top: 1px solid rgba(134, 149, 178, 0.12);
}

.detail-section h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.detail-example-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(134, 149, 178, 0.14);
  color: var(--text);
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.8;
}

.detail-list__item {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(134, 149, 178, 0.12);
}

.detail-list__item:last-child {
  border-bottom: 0;
}

.detail-list__label {
  color: var(--muted);
  font-size: 12px;
}

.skills-root {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--rail-gap);
  overflow: auto;
  padding-right: 6px;
}

.skills-overview {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.35fr);
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 24px;
  background:
    #ffffff,
    transparent;
  border: 1px solid rgba(134, 149, 178, 0.14);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.skills-overview__lead {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.skills-overview__lead strong {
  display: block;
  font-size: 26px;
  line-height: 1.14;
  letter-spacing: -0.03em;
}

.skills-overview__lead p,
.skills-overview__stat small {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.skills-overview__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.skills-overview__stat {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(134, 149, 178, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.skills-overview__lead .page-kicker,
.skills-overview__stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.skills-overview__stat strong {
  display: block;
  font-size: 16px;
  line-height: 1.35;
}

.skills-overview__stat:first-child strong {
  font-size: 28px;
  line-height: 1;
}

.skills-overview__chips,
.skills-overview__order {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.skills-overview__chips .skills-channel-chip {
  padding: 6px 10px;
  background: rgba(246, 248, 254, 0.98);
}

.skills-order-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(246, 248, 254, 0.98);
  border: 1px solid rgba(134, 149, 178, 0.14);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.skills-order-chip--base {
  background: #ffffff;
  color: var(--brand);
}

.skills-order-chip--pending {
  color: var(--muted);
}

.skills-order-sep {
  color: rgba(112, 126, 157, 0.72);
  font-weight: 700;
}

.skills-shell {
  display: grid;
  grid-template-columns: minmax(360px, 460px) minmax(0, 1fr);
  gap: var(--rail-gap);
  align-items: start;
}

.skills-pane,
.skills-list-panel {
  padding: 22px;
  overflow: visible;
}

.skills-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background:
    #ffffff,
    transparent;
}

.skills-pane__head,
.skills-list-panel__head,
.skill-box-card__head,
.skill-box-card__foot,
.skills-creator__foot,
.skills-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.skills-pane__hero,
.skills-flow-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skills-pane__hero,
.skills-flow-card,
.skills-template-strip,
.skills-creator,
.skills-empty,
.skill-box-card {
  border-radius: 24px;
  border: 1px solid rgba(134, 149, 178, 0.14);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.skills-pane__hero,
.skills-flow-card,
.skills-template-strip,
.skills-creator {
  padding: 18px;
  background: rgba(255, 255, 255, 0.88);
}

.skills-pane__head strong,
.skills-list-panel__head strong,
.skills-template-strip strong,
.skills-flow-card__head strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.skills-pane__head p,
.skills-list-panel__head span,
.skill-box-card__desc,
.skills-flow-card__head span,
.skills-template-strip p,
.skills-creator__head span,
.skills-creator__foot span,
.skills-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.skills-pane__head,
.skills-list-panel__head,
.skills-creator__foot,
.skill-box-card__foot {
  flex-wrap: wrap;
}

.skills-counter {
  min-width: 64px;
  padding: 10px 16px;
  border-radius: 999px;
  text-align: center;
  background: #ffffff;
  border: 1px solid rgba(112, 131, 208, 0.16);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.skills-flow {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.skills-flow-card__head {
  margin-bottom: 14px;
}

.skills-flow__chip {
  flex: 0 0 auto;
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(247, 248, 252, 0.96);
  border: 1px solid rgba(134, 149, 178, 0.16);
  font-size: 13px;
  font-weight: 600;
}

.skills-flow__chip--base {
  background: #ffffff;
  border-color: rgba(112, 131, 208, 0.22);
}

.skills-flow__arrow {
  color: var(--muted);
  flex: 0 0 auto;
}

.skills-template-strip {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.skills-template {
  appearance: none;
  border: 1px solid rgba(134, 149, 178, 0.16);
  background: rgba(248, 250, 255, 0.94);
  border-radius: 18px;
  padding: 14px 14px 13px;
  text-align: left;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.skills-template strong,
.skill-box-card__eyebrow {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.skills-template span,
.skill-meta-chip,
.skill-box-card__body-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.skills-template:hover,
.skills-template.is-active {
  transform: translateY(-1px);
  border-color: rgba(99, 118, 235, 0.24);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.skills-template.is-active {
  background: #ffffff;
}

.skills-status {
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 13px;
}

.skills-status--error {
  background: rgba(255, 236, 232, 0.9);
  color: #b54733;
  border: 1px solid rgba(240, 101, 67, 0.18);
}

.skills-status--success {
  background: rgba(234, 248, 242, 0.96);
  color: #217657;
  border: 1px solid rgba(46, 167, 122, 0.18);
}

.skills-creator {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skills-creator__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.skills-creator__label {
  font-size: 13px;
  font-weight: 700;
}

.skills-creator__input {
  width: 100%;
  min-height: 180px;
  padding: 18px 18px;
  border-radius: 18px;
  border: 1px solid rgba(134, 149, 178, 0.18);
  background: rgba(248, 250, 255, 0.92);
  color: var(--text);
  resize: vertical;
  outline: none;
  line-height: 1.7;
}

.skills-creator__input:focus {
  border-color: rgba(66, 99, 235, 0.28);
  box-shadow: 0 0 0 4px rgba(66, 99, 235, 0.08);
}

.skills-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skills-list-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background:
    #ffffff,
    transparent;
}

.skills-list-panel__head {
  align-items: flex-start;
}

.skill-box-card__head {
  align-items: flex-start;
}

.skills-list-panel__channels,
.skill-box-card__channels,
.skill-box-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.skills-channel-chip,
.skill-meta-chip {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(246, 248, 254, 0.96);
  border: 1px solid rgba(134, 149, 178, 0.14);
}

.skills-empty,
.skill-box-card {
  padding: 20px;
  background: rgba(248, 250, 255, 0.92);
}

.skills-empty strong {
  display: block;
  margin-bottom: 8px;
}

.skill-box-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background:
    #ffffff,
    transparent;
}

.skill-box-card__title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.skill-box-card__head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.skill-state-pill {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.skill-state-pill--enabled {
  background: rgba(232, 248, 240, 0.98);
  color: #227655;
  border: 1px solid rgba(46, 167, 122, 0.18);
}

.skill-state-pill--muted {
  background: rgba(245, 247, 252, 0.98);
  color: #6d7894;
  border: 1px solid rgba(134, 149, 178, 0.14);
}

.skill-box-card__body-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skill-box-card__body {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(134, 149, 178, 0.12);
  white-space: pre-wrap;
  line-height: 1.75;
  font-size: 13px;
  max-height: 192px;
  overflow: auto;
}

.skill-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.skill-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.skill-toggle__track {
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: rgba(218, 225, 241, 0.96);
  border: 1px solid rgba(134, 149, 178, 0.14);
  transition: background 160ms ease, border-color 160ms ease;
}

.skill-toggle__thumb {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: transform 160ms ease;
}

.skill-toggle input:checked + .skill-toggle__track {
  background: #ffffff;
  border-color: rgba(90, 116, 223, 0.18);
}

.skill-toggle input:checked + .skill-toggle__track .skill-toggle__thumb {
  transform: translateX(18px);
}

.skill-box-card__delete {
  padding: 8px 12px;
}

@media (max-width: 1320px) {
  .graph-board,
  .chat-layout {
    grid-template-columns: 1fr;
  }

  .student-strip,
  .dashboard-grid--hero,
  .dashboard-grid--2,
  .dashboard-grid--3,
  .dashboard-grid--4,
  .dashboard-grid--status-bottom,
  .status-chip-row,
  .status-hero {
    grid-template-columns: 1fr;
  }

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

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

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

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

  .detail-panel {
    height: auto;
    min-height: 320px;
  }
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}

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

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

  .skills-overview__meta {
    grid-template-columns: 1fr;
  }

  .page-head,
  .graph-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar-actions,
  .toolbar-left,
  .composer,
  .chat-input-bar,
  .schedule-meta,
  .channel-card__head,
  .schedule-card__head {
    width: 100%;
  }

  .skills-pane__head,
  .skills-list-panel__head,
  .skills-creator__head,
  .skill-box-card__head,
  .skill-box-card__foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .skills-flow {
    flex-wrap: wrap;
  }

  .skills-creator__foot {
    width: 100%;
  }

  .composer-single,
  .chat-input-bar {
    grid-template-columns: 1fr;
  }

  .status-hero__side,
  .status-service-card__meta {
    width: 100%;
  }

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

  .upload-button,
  .primary-button {
    justify-content: center;
  }

  .nav-item {
    width: 100%;
  }

  .chat-container {
    padding: 12px;
  }

  .graph-viewport {
    min-height: 560px;
  }

  .channel-stats,
  .student-rail {
    grid-template-columns: 1fr;
  }
}

/* Memory graph redesign */
.graph-workspace--knowledge {
  --graph-accent: #4263eb;
  --graph-accent-strong: #2f55dc;
  --graph-accent-soft: rgba(66, 99, 235, 0.1);
  --graph-accent-glow: rgba(66, 99, 235, 0.18);
  --graph-accent-border: rgba(66, 99, 235, 0.16);
  --graph-surface:
    #ffffff,
    transparent;
}

.graph-workspace--error {
  --graph-accent: #f06543;
  --graph-accent-strong: #e0522f;
  --graph-accent-soft: rgba(240, 101, 67, 0.1);
  --graph-accent-glow: rgba(240, 101, 67, 0.18);
  --graph-accent-border: rgba(240, 101, 67, 0.18);
  --graph-surface:
    #ffffff,
    transparent;
}

.graph-workspace {
  position: relative;
  gap: 12px;
  padding: 16px 18px 18px;
  border-radius: 28px;
  overflow: hidden;
  background:
    #ffffff,
    transparent;
}

.graph-workspace::before {
  content: "";
  position: absolute;
  inset: -140px auto auto -100px;
  width: 300px;
  height: 300px;
  border-radius: 999px;
  background: transparent;
  filter: blur(18px);
  pointer-events: none;
}

.graph-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: 10px;
  align-items: stretch;
}

.graph-summary__main,
.graph-summary__tile {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--graph-accent-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.graph-summary__main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  min-height: 102px;
  padding: 12px 18px;
  background: var(--graph-surface);
}

.graph-summary__main::after,
.detail-hero::after {
  content: "";
  position: absolute;
  inset: auto -28px -68px auto;
  width: 126px;
  height: 126px;
  border-radius: 999px;
  background: transparent;
  pointer-events: none;
}

.graph-summary__main h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.14;
  letter-spacing: -0.03em;
}

.graph-summary__main p {
  margin: 0;
  max-width: 640px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.graph-summary__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-height: 102px;
}

.graph-summary__tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.95);
}

.graph-summary__tile span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.graph-summary__tile strong {
  display: block;
  font-size: 14px;
  line-height: 1.28;
  color: var(--text);
}

.toolbar-left--memory {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: auto auto minmax(260px, 1fr);
  align-items: center;
  gap: 12px;
}

.toolbar-actions--memory {
  flex: 0 0 auto;
  align-items: stretch;
  gap: 12px;
}

.graph-hint-card {
  min-height: 58px;
  padding: 12px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(151, 166, 194, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.graph-hint-card__label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--graph-accent-strong);
}

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

.graph-control-stack {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(151, 166, 194, 0.18);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.graph-workspace--knowledge .segment.active {
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.graph-workspace--error .segment.active {
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.graph-workspace .icon-button,
.graph-workspace .ghost-button {
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.graph-workspace .icon-button:hover,
.graph-workspace .ghost-button:hover {
  transform: translateY(-1px);
  border-color: var(--graph-accent-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.graph-stats--compact {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(78px, 1fr));
  gap: 10px;
  margin-right: 0;
}

.graph-stats--compact .graph-stat {
  min-width: 78px;
  padding: 12px 12px 10px;
  border-radius: 18px;
}

.graph-stats--compact .graph-stat strong {
  font-size: 20px;
  line-height: 1;
}

.graph-stats--compact .graph-stat span {
  font-size: 11px;
}

.graph-board {
  grid-template-columns: minmax(0, 1fr) 372px;
  gap: 18px;
}

.graph-stage {
  position: relative;
  border-radius: 28px;
  border: 1px solid var(--graph-accent-border);
  background:
    #ffffff,
    transparent;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 18px 40px rgba(67, 82, 117, 0.08);
}

.graph-workspace--knowledge .graph-stage {
  background:
    #ffffff,
    transparent;
}

.graph-workspace--error .graph-stage {
  background:
    #ffffff,
    transparent;
}

.graph-viewport {
  background-color: #fdfefd;
  background-image: transparent;
  background-size: 24px 24px;
}

.graph-workspace--knowledge .graph-viewport {
  background-color: #fcfdff;
  background-image: transparent;
}

.graph-workspace--error .graph-viewport {
  background-color: #fffdfb;
  background-image: transparent;
}

.graph-edge {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.84;
}

.graph-edge.is-active {
  opacity: 1;
  stroke-width: 2.9;
  filter: drop-shadow(0 0 10px rgba(92, 104, 140, 0.14));
}

.graph-edge.is-candidate {
  opacity: 0.28;
}

.graph-edge.is-muted {
  opacity: 0.1;
}

.graph-edge--knowledge.graph-edge--prerequisite {
  stroke: rgba(92, 108, 152, 0.62);
}

.graph-edge--knowledge.graph-edge--similar {
  stroke: rgba(136, 144, 173, 0.52);
  stroke-dasharray: 7 8;
}

.graph-edge--knowledge.graph-edge--contains {
  stroke: rgba(82, 132, 198, 0.56);
  stroke-width: 2.1;
}

.graph-edge--knowledge.graph-edge--related {
  stroke: rgba(152, 160, 182, 0.44);
  stroke-dasharray: 4 8;
}

.graph-edge--knowledge.graph-edge--extension {
  stroke: rgba(83, 152, 139, 0.5);
  stroke-dasharray: 10 8;
}

.graph-edge--error.graph-edge--corresponds {
  stroke: rgba(184, 111, 96, 0.58);
}

.graph-edge--error.graph-edge--similar {
  stroke: rgba(197, 120, 99, 0.52);
  stroke-dasharray: 7 8;
}

.graph-edge--error.graph-edge--correction {
  stroke: rgba(222, 133, 88, 0.58);
  stroke-width: 2.15;
}

.graph-edge--error.graph-edge--repeat {
  stroke: rgba(187, 94, 74, 0.62);
  stroke-dasharray: 4 6;
}

.graph-edge--knowledge.is-active {
  stroke: rgba(66, 99, 235, 0.84);
}

.graph-edge--error.is-active {
  stroke: rgba(240, 101, 67, 0.88);
}

.graph-edge-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.96);
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
}

.graph-edge-label--knowledge.graph-edge-label--prerequisite {
  fill: #4263eb;
}

.graph-edge-label--knowledge.graph-edge-label--similar {
  fill: #6277d7;
}

.graph-edge-label--knowledge.graph-edge-label--contains {
  fill: #3b82f6;
}

.graph-edge-label--knowledge.graph-edge-label--related {
  fill: #6a7a9c;
}

.graph-edge-label--knowledge.graph-edge-label--extension {
  fill: #1f8f7d;
}

.graph-edge-label--error.graph-edge-label--corresponds {
  fill: #e76b49;
}

.graph-edge-label--error.graph-edge-label--similar {
  fill: #d95c4a;
}

.graph-edge-label--error.graph-edge-label--correction {
  fill: #ef8b52;
}

.graph-edge-label--error.graph-edge-label--repeat {
  fill: #d54b35;
}

.graph-node {
  border-width: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.graph-node::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 999px;
  background: transparent;
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.graph-node:hover,
.graph-node.is-linked {
  transform: translate(-50%, -50%) scale(1.04);
}

.graph-node.is-active,
.graph-node.is-selected {
  transform: translate(-50%, -50%) scale(1.08);
}

.graph-node.is-linked::before,
.graph-node.is-active::before,
.graph-node.is-selected::before {
  opacity: 1;
}

.graph-node.is-linked {
  opacity: 0.98;
}

.graph-node--knowledge.is-linked,
.graph-node--knowledge.is-active,
.graph-node--knowledge.is-selected {
  color: #25346e;
}

.graph-node--error.is-linked,
.graph-node--error.is-active,
.graph-node--error.is-selected {
  color: #7a3728;
}

.graph-node__title {
  width: 120px;
  max-width: 120px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.01em;
  white-space: normal;
}

.graph-node__badge {
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.94);
  font-weight: 700;
}

.graph-overlay {
  left: 22px;
  right: 22px;
  bottom: 20px;
  gap: 12px;
  max-width: 440px;
}

.graph-overlay__header {
  width: fit-content;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--graph-accent-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  backdrop-filter: saturate(180%) blur(20px);
}

.graph-overlay__mode {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.graph-overlay__sub {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.graph-overlay__legend {
  gap: 10px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.legend-chip__dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent);
}

.legend-chip--knowledge {
  border-color: rgba(66, 99, 235, 0.14);
}

.legend-chip--error {
  border-color: rgba(240, 101, 67, 0.16);
}

.legend-chip--prerequisite,
.detail-list__label--prerequisite {
  color: #4263eb;
  background: rgba(66, 99, 235, 0.1);
}

.legend-chip--similar,
.detail-list__label--similar {
  color: #6b73d8;
  background: rgba(107, 115, 216, 0.1);
}

.legend-chip--contains,
.detail-list__label--contains {
  color: #2f8bff;
  background: rgba(47, 139, 255, 0.1);
}

.legend-chip--related,
.detail-list__label--related {
  color: #637597;
  background: rgba(99, 117, 151, 0.1);
}

.legend-chip--extension,
.detail-list__label--extension {
  color: #17907b;
  background: rgba(23, 144, 123, 0.1);
}

.legend-chip--corresponds,
.detail-list__label--corresponds {
  color: #e76b49;
  background: rgba(231, 107, 73, 0.1);
}

.legend-chip--correction,
.detail-list__label--correction {
  color: #e37a2f;
  background: rgba(227, 122, 47, 0.12);
}

.legend-chip--repeat,
.detail-list__label--repeat {
  color: #d84c36;
  background: rgba(216, 76, 54, 0.12);
}

.detail-panel {
  position: relative;
  padding: 18px;
  gap: 16px;
  border-radius: 28px;
  border-color: var(--graph-accent-border);
  background:
    #ffffff,
    transparent;
}

.detail-panel--knowledge {
  background:
    #ffffff,
    transparent;
}

.detail-panel--error {
  background:
    #ffffff,
    transparent;
}

.detail-empty--rich {
  justify-content: space-between;
  align-items: stretch;
  gap: 18px;
  min-height: 100%;
  text-align: left;
  border-style: solid;
  border-color: var(--graph-accent-border);
  background: rgba(255, 255, 255, 0.82);
}

.detail-empty--rich strong {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.detail-empty--rich p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.detail-empty__icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: var(--graph-accent-soft);
  color: var(--graph-accent-strong);
  font-size: 24px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

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

.detail-empty__guide-item {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(151, 166, 194, 0.14);
  background: rgba(248, 250, 255, 0.88);
}

.detail-empty__guide-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-empty__guide-item strong {
  font-size: 14px;
  line-height: 1.5;
}

.detail-empty__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 236px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--graph-accent-border);
  background: var(--graph-surface);
  overflow: hidden;
}

.detail-header h3 {
  margin: 8px 0 10px;
  font-size: 30px;
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.detail-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--graph-accent-strong);
}

.detail-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 14%, transparent);
}

.detail-close {
  background: rgba(255, 255, 255, 0.88);
}

.detail-delete {
  background: rgba(255, 241, 237, 0.96);
}

.detail-tag {
  background: rgba(255, 255, 255, 0.76);
}

.detail-tag--signal {
  color: var(--graph-accent-strong);
  background: var(--graph-accent-soft);
  border-color: var(--graph-accent-border);
  font-weight: 700;
}

.metric-grid {
  gap: 12px;
}

.metric-card {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(151, 166, 194, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.detail-summary-card,
.detail-action,
.detail-list > li,
.detail-list__item,
.detail-example-card {
  border: 1px solid rgba(151, 166, 194, 0.14);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.detail-summary-card {
  padding: 14px 16px;
  border-radius: 20px;
}

.detail-summary-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.detail-summary-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.detail-action-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-action {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 18px;
}

.detail-action__index {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--graph-accent-soft);
  color: var(--graph-accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.detail-action p {
  margin: 0;
  line-height: 1.65;
  color: var(--text);
}

.detail-list {
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-list > li {
  list-style: none;
  padding: 12px 14px;
  border-radius: 18px;
  line-height: 1.72;
}

.detail-list__item {
  gap: 8px;
  padding: 12px 14px;
  border-radius: 18px;
  border-bottom: 0;
}

.detail-list__label {
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-example-card {
  border-radius: 20px;
}

@media (max-width: 1460px) {
  .graph-summary {
    grid-template-columns: 1fr;
  }

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

  .toolbar-left--memory {
    grid-template-columns: auto auto 1fr;
  }
}

@media (max-width: 1320px) {
  .graph-board {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    min-height: 360px;
  }
}

@media (max-width: 1120px) {
  .toolbar-left--memory {
    grid-template-columns: 1fr;
  }

  .toolbar-actions--memory {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 900px) {
  .graph-summary__stats,
  .detail-empty__guide {
    grid-template-columns: 1fr;
  }

  .graph-stats--compact {
    grid-template-columns: repeat(3, minmax(68px, 1fr));
  }
}

@media (max-width: 720px) {
  .graph-workspace {
    padding: 14px;
    gap: 14px;
  }

  .graph-summary__main,
  .graph-summary__tile,
  .detail-hero,
  .detail-panel {
    border-radius: 18px;
  }

  .graph-overlay {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }

  .graph-control-stack,
  .graph-stats--compact {
    width: 100%;
  }

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

  .detail-header {
    flex-direction: column;
  }

  .detail-header__actions {
    width: 100%;
    justify-content: space-between;
  }

  .detail-action {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1440px) {
  .heartbeat-hero,
  .heartbeat-note-grid,
  .plan-grid--hero,
  .plan-grid--bottom {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 1180px) {
  .heartbeat-hero__stats,
  .plan-signal-grid,
  .plan-grid--focus {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .heartbeat-card__metrics,
  .heartbeat-check-item,
  .heartbeat-legend__row,
  .plan-timeline-card,
  .plan-goal-card,
  .plan-check-item,
  .plan-priority-card {
    grid-template-columns: 1fr;
  }

  .plan-timeline-card__day,
  .plan-goal-card__index,
  .plan-check-item__index,
  .plan-priority-card__rank {
    width: fit-content;
  }
}

@media (max-width: 720px) {
  .heartbeat-hero,
  .heartbeat-card,
  .heartbeat-note-card,
  .plan-hero,
  .plan-weekly,
  .plan-card {
    padding: 18px;
  }

  .plan-hero__head h3 {
    font-size: 28px;
  }

  .plan-hero,
  .plan-weekly,
  .plan-grid--bottom .plan-card--timeline,
  .plan-grid--bottom .plan-card--load {
    min-height: auto;
  }

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

  .plan-dose-item__bar {
    width: 100%;
    min-height: 8px;
  }

  .heartbeat-card__head {
    flex-direction: column;
  }
}

/* KaTeX 公式渲染 */
.msg-md__math {
  margin: 8px 0;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: center;
}
.msg-md__math-inline .katex {
  font-size: 1.05em;
}
.msg-md__math-fallback {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  padding: 1px 5px;
}
