:root {
  --bg: #f4f8ff;
  --panel: #ffffff;
  --ink: #08204a;
  --text: #243b63;
  --muted: #7b8aa8;
  --line: #e5edf8;
  --nav: #06244a;
  --nav-2: #0b376a;
  --blue: #3378ff;
  --green: #19bf9d;
  --amber: #ffad3d;
  --purple: #8c63f7;
  --cyan: #20bdd2;
  --rose: #ff5c7a;
  --shadow: 0 10px 30px rgba(21, 45, 84, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  color: #d7e8ff;
  background:
    radial-gradient(circle at 18% 5%, rgba(25, 191, 157, 0.22), transparent 28%),
    linear-gradient(180deg, #061d3d 0%, #07325f 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 3px 2px 18px;
}

.brand-mark {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(145deg, #a8d991, #294c74 58%, #071f3f);
  flex: 0 0 auto;
  overflow: hidden;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.72);
  transform: rotate(36deg);
}

.brand-mark::before {
  width: 14px;
  height: 42px;
  left: 20px;
  top: 9px;
  border-radius: 20px;
}

.brand-mark::after {
  width: 22px;
  height: 10px;
  left: 7px;
  top: 26px;
  border-radius: 18px;
}

.brand strong,
.brand span,
.sidebar-foot strong,
.sidebar-foot span {
  display: block;
}

.brand strong {
  color: #fff;
  font-size: 18px;
  line-height: 1.1;
}

.brand span {
  color: #b9cbe1;
  font-size: 13px;
  margin-top: 4px;
}

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

.nav-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b9cbe1;
  font-size: 13px;
  padding: 10px 12px 4px;
}

.nav-group-title span {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  margin-left: auto;
}

.nav-item {
  width: 100%;
  border: 0;
  color: #c9dbef;
  background: transparent;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  text-align: left;
  font-weight: 700;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, #2f73ff, #4287ff);
  box-shadow: 0 10px 20px rgba(23, 104, 255, 0.24);
}

.nav-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 12px;
  font-weight: 800;
}

.sub-nav {
  min-height: 34px;
  padding: 8px 12px 8px 50px;
  font-size: 13px;
  color: #b9cbe1;
}

.sub-nav .nav-icon {
  display: none;
}

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 16px 4px 4px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.avatar-dot {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff, #adc3dc);
  box-shadow: inset 0 -8px 18px rgba(6, 36, 74, 0.18);
  flex: 0 0 auto;
}

.sidebar-foot strong {
  color: #fff;
}

.sidebar-foot span {
  color: #b9cbe1;
  font-size: 12px;
}

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

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

.title-line {
  display: flex;
  align-items: baseline;
  gap: 16px;
  min-width: 0;
}

.page-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.18;
  font-weight: 900;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-select {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.top-select span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.top-select select {
  width: auto;
  min-width: 128px;
  min-height: 30px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
}

.top-select select:focus {
  box-shadow: none;
}

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

.ghost-button,
.primary-button,
.mini-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 9px 13px;
  min-height: 36px;
}

.primary-button {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #2f73ff, #4287ff);
  box-shadow: 0 8px 16px rgba(47, 115, 255, 0.18);
}

.mini-button {
  min-height: 30px;
  padding: 5px 12px;
  font-size: 12px;
}

.live-pill {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  white-space: nowrap;
  box-shadow: var(--shadow);
}

.live-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.filters,
.filter-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 220px)) minmax(260px, 1fr);
  gap: 10px;
  align-items: end;
  padding: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.filter-strip {
  grid-template-columns: repeat(6, minmax(130px, 1fr)) 86px;
}

.filters label,
.filter-strip label,
.search-box {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.filters label span,
.filter-strip label span,
.search-box span {
  color: var(--muted);
  font-weight: 700;
}

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

select:focus,
input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(51, 120, 255, 0.12);
}

.filter-summary {
  color: var(--muted);
  font-weight: 600;
  justify-self: end;
  align-self: center;
}

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

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

.stat-card,
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.stat-card {
  min-height: 102px;
  padding: 18px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  background: var(--blue);
  box-shadow: inset 0 -8px 18px rgba(0, 0, 0, 0.08);
}

.stat-icon.green {
  background: var(--green);
}

.stat-icon.amber {
  background: var(--amber);
}

.stat-icon.purple {
  background: var(--purple);
}

.stat-icon.cyan {
  background: var(--cyan);
}

.stat-icon.rose {
  background: var(--rose);
}

.stat-card span,
.stat-card small {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin: 4px 0 2px;
  color: #10182f;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 900;
}

.stat-card small b {
  color: var(--green);
}

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

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

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

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

.span-1 {
  grid-column: span 1;
}

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

.panel {
  min-width: 0;
  padding: 16px;
}

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

.panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 900;
}

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

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

.mini-metrics article {
  padding: 14px;
  border-radius: 10px;
  background: #f6f9fe;
}

.mini-metrics i {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  font-style: normal;
  font-weight: 900;
}

.mini-metrics span,
.mini-metrics small {
  color: var(--muted);
}

.mini-metrics strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 25px;
}

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

.bar-list.compact {
  gap: 9px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 13px;
}

.bar-label span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-label i {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-style: normal;
  font-size: 11px;
  flex: 0 0 auto;
}

.bar-label strong {
  color: #12213f;
  white-space: nowrap;
}

.bar-track,
.progress {
  height: 8px;
  border-radius: 999px;
  background: #edf3fb;
  overflow: hidden;
}

.bar-track span,
.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.donut {
  position: relative;
  width: 142px;
  height: 142px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: #fff;
}

.donut span {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-weight: 900;
}

.legend {
  display: grid;
  gap: 9px;
}

.legend span {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--text);
  font-size: 13px;
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend b {
  color: var(--ink);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 12px;
}

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

.chart-legend i {
  width: 16px;
  height: 4px;
  border-radius: 999px;
}

.line-chart {
  display: block;
  width: 100%;
  min-height: 210px;
}

.line-chart .grid-line {
  stroke: #e7eef9;
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart circle {
  fill: #fff;
  stroke-width: 3;
}

.line-chart text {
  fill: var(--muted);
  font-size: 11px;
  text-anchor: middle;
}

.split-analysis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.insight-panel {
  background: linear-gradient(135deg, #f2fbff, #fff);
  border-color: #cdefff;
}

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

.insight-list article {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
}

.insight-list article > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}

.insight-list strong {
  color: var(--ink);
}

.insight-list p {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 13px;
}

.funnel {
  display: grid;
  gap: 9px;
}

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

.funnel-row span {
  justify-self: end;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 5px;
  font-weight: 800;
}

.funnel-row strong {
  color: var(--ink);
  text-align: right;
}

.funnel-row em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
}

.source-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--line);
}

.source-list article {
  min-height: 72px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  background: #f8fbff;
}

.source-list i {
  font-style: normal;
  font-weight: 900;
  font-size: 24px;
}

.source-note,
.fine-print,
.hint-line {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.body-distribution {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(170px, 1.1fr);
  gap: 12px;
}

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

.body-list div {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--text);
}

.body-list i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.body-list strong {
  color: var(--ink);
  font-size: 12px;
}

.body-grid,
.body-visual {
  position: relative;
  min-height: 210px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(51, 120, 255, 0.08), rgba(25, 191, 157, 0.08)),
    repeating-linear-gradient(90deg, rgba(51, 120, 255, 0.08) 0 1px, transparent 1px 36px);
  overflow: hidden;
}

.body-visual {
  background-image: url("../assets/injury-body-distribution.png");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  background-color: #f7fbff;
}

.body-grid span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  color: #fff;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(21, 45, 84, 0.12);
}

.relation-map {
  min-height: 220px;
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: 10px;
  align-items: stretch;
}

.relation-map > div:first-child,
.relation-map > div:last-child {
  display: grid;
  gap: 8px;
}

.relation-map span {
  display: flex;
  align-items: center;
  border-left: 5px solid var(--blue);
  padding: 5px 8px;
  background: #f8fbff;
  border-radius: 6px;
  color: var(--text);
}

.relation-lines {
  position: relative;
  border-radius: 10px;
  background: linear-gradient(90deg, #f2f7ff, #fff);
  overflow: hidden;
}

.relation-lines i {
  position: absolute;
  left: 4%;
  width: 92%;
  height: 12px;
  border-radius: 999px;
  opacity: 0.18;
  transform: rotate(8deg);
}

.heatmap {
  display: grid;
  grid-template-columns: 82px repeat(6, 1fr);
  gap: 3px;
  align-items: stretch;
  font-size: 12px;
}

.heatmap strong,
.heatmap span {
  color: var(--text);
  font-weight: 700;
}

.heatmap i {
  min-height: 24px;
  border-radius: 3px;
}

.stacked-bars {
  display: grid;
  gap: 11px;
}

.stacked-head,
.stacked-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 86px;
  gap: 10px;
  align-items: center;
}

.stacked-head {
  color: var(--muted);
  font-size: 12px;
}

.stacked-row > span {
  color: var(--text);
  font-weight: 700;
}

.stacked-row > div {
  height: 10px;
  display: flex;
  justify-content: center;
  border-radius: 999px;
  background: #edf3fb;
  overflow: hidden;
}

.stacked-row b {
  height: 100%;
}

.stacked-row strong {
  color: var(--ink);
  font-size: 12px;
}

.wide-table {
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.table-wrap.compact table {
  min-width: 520px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f8;
  text-align: left;
  white-space: nowrap;
}

th {
  background: #f5f8fd;
  color: #557093;
  font-size: 12px;
  font-weight: 900;
}

td {
  color: #253d63;
  font-size: 13px;
}

td b {
  color: var(--ink);
}

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

.segment-cards article {
  min-height: 140px;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #f8fbff;
}

.segment-cards article.blue {
  border-color: rgba(51, 120, 255, 0.25);
  background: #f3f7ff;
}

.segment-cards article.green {
  border-color: rgba(25, 191, 157, 0.25);
  background: #f0fffb;
}

.segment-cards article.amber {
  border-color: rgba(255, 173, 61, 0.25);
  background: #fff8ec;
}

.segment-cards article.purple {
  border-color: rgba(140, 99, 247, 0.25);
  background: #f6f3ff;
}

.segment-cards span,
.segment-cards small,
.segment-cards em {
  display: block;
  color: var(--muted);
}

.segment-cards strong {
  display: block;
  margin: 14px 0 6px;
  color: var(--ink);
  font-size: 24px;
}

.segment-cards em {
  margin-top: 10px;
  color: var(--green);
  font-style: normal;
  font-weight: 800;
}

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

.preference-grid article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}

.preference-grid strong,
.preference-grid span {
  display: block;
}

.preference-grid strong {
  color: var(--blue);
  margin-bottom: 8px;
}

.preference-grid span {
  color: var(--text);
  font-size: 13px;
  padding: 6px 0;
}

.preference-grid b {
  display: block;
  color: var(--ink);
}

.loop-path {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.loop-path article {
  text-align: center;
}

.loop-path i,
.confirm-flow i {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 8px;
  border-radius: 50%;
  color: #fff;
  font-style: normal;
  font-weight: 900;
}

.loop-path strong,
.loop-path span,
.confirm-flow strong,
.confirm-flow span {
  display: block;
}

.loop-path strong {
  color: var(--ink);
}

.loop-path span,
.confirm-flow span {
  color: var(--muted);
  font-size: 12px;
}

.loop-path p {
  grid-column: 1 / -1;
  margin: 10px 0 0;
  color: var(--blue);
  text-align: center;
  font-weight: 800;
}

.trajectory {
  display: grid;
  gap: 18px;
}

.patient-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.patient-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #3378ff, #20bdd2);
  font-weight: 900;
}

.patient-avatar.large {
  width: 72px;
  height: 72px;
  font-size: 24px;
}

.patient-line strong,
.patient-line small {
  display: block;
}

.patient-line small {
  color: var(--muted);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 10px;
  height: 3px;
  background: #dbe8fb;
}

.timeline article {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 5px;
  text-align: center;
}

.timeline i {
  width: 18px;
  height: 18px;
  margin: 1px auto;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--blue);
}

.timeline strong {
  color: var(--blue);
  font-size: 12px;
}

.timeline span {
  color: var(--text);
  font-size: 12px;
}

.summary-table,
.suggestion-table,
.tag-extract {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
}

.summary-table article,
.suggestion-table article,
.tag-extract article {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  background: #fff;
}

.summary-table strong,
.suggestion-table strong,
.tag-extract strong {
  color: var(--ink);
}

.summary-table p,
.suggestion-table p,
.tag-extract span {
  margin: 0;
  color: var(--text);
}

.suggestion-table .warning p {
  color: #e23d4b;
  font-weight: 800;
}

.patient-card dl {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 10px 12px;
  margin: 18px 0;
}

.patient-card dt {
  color: var(--ink);
  font-weight: 900;
}

.patient-card dd {
  margin: 0;
  color: var(--text);
}

.patient-card h3 small {
  margin-left: 8px;
  color: var(--blue);
  font-size: 13px;
}

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

.tag-row span,
.check-list span {
  padding: 6px 10px;
  color: #1d66c4;
  border-radius: 999px;
  background: #eef6ff;
  font-size: 12px;
  font-weight: 800;
}

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

.case-grid article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}

.case-grid h3 {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 15px;
}

.case-grid h3 span {
  color: var(--blue);
  font-size: 12px;
}

.case-grid p {
  margin: 9px 0 0;
  color: var(--text);
}

.case-grid b {
  display: block;
  color: var(--ink);
}

.case-grid em {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-style: normal;
  font-weight: 900;
}

.confirm-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  text-align: center;
}

.risk-pill {
  color: #ff8a00;
  font-weight: 900;
}

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

.basis-grid article {
  padding: 14px;
  border-radius: 10px;
  background: #f8fbff;
  border: 1px solid var(--line);
}

.basis-grid i,
.basis-grid strong,
.basis-grid span,
.basis-grid b {
  display: block;
}

.basis-grid i {
  font-style: normal;
  font-size: 22px;
  font-weight: 900;
}

.basis-grid strong {
  margin-top: 6px;
  color: var(--ink);
}

.basis-grid span {
  color: var(--muted);
}

.basis-grid b {
  margin-top: 7px;
  color: var(--text);
}

.explorer-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
}

.segmented {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.segmented button {
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--muted);
  background: transparent;
}

.segmented button.active {
  color: #fff;
  background: var(--blue);
}

.search-box {
  width: min(360px, 100%);
}

.explorer-table {
  max-height: 560px;
}

.empty {
  min-height: 160px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
}

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(420px, 94vw);
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px rgba(21, 45, 84, 0.18);
  transform: translateX(105%);
  transition: transform 180ms ease;
  padding: 26px;
  z-index: 20;
  overflow: auto;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-close {
  border: 0;
  width: 34px;
  height: 34px;
  float: right;
  border-radius: 8px;
  background: #edf3fb;
  color: var(--ink);
  font-size: 20px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 32, 74, 0.42);
  z-index: 30;
}

.modal {
  width: min(520px, 94vw);
  padding: 24px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(8, 32, 74, 0.22);
}

.check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

/* Concept-screen density pass: tuned to the supplied 1672x941 dashboard references. */
.app-shell {
  grid-template-columns: 206px minmax(0, 1fr);
}

.sidebar {
  padding: 16px 12px;
  gap: 14px;
}

.brand {
  gap: 10px;
  padding-bottom: 14px;
}

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

.brand strong {
  font-size: 17px;
}

.brand span {
  font-size: 12px;
}

.nav-list {
  gap: 5px;
}

.nav-group-title {
  padding: 8px 10px 2px;
}

.nav-item {
  border-radius: 8px;
  gap: 9px;
  padding: 9px 10px;
}

.nav-icon {
  width: 23px;
  height: 23px;
  border-radius: 6px;
}

.sub-nav {
  min-height: 31px;
  padding: 7px 10px 7px 42px;
}

.sidebar-foot {
  padding-top: 12px;
}

.avatar-dot {
  width: 36px;
  height: 36px;
}

.main {
  padding: 18px 18px 20px;
}

.topbar {
  margin-bottom: 14px;
  gap: 14px;
}

h1 {
  font-size: 26px;
}

.page-kicker {
  font-size: 13px;
}

.top-actions {
  gap: 8px;
}

.top-select,
.live-pill {
  min-height: 34px;
  border-radius: 7px;
}

.top-select select {
  min-height: 28px;
  min-width: 118px;
}

.ghost-button,
.primary-button,
.mini-button {
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 7px;
}

.content {
  gap: 8px;
}

.kpi-grid {
  gap: 10px;
}

.stat-card {
  min-height: 80px;
  padding: 10px 12px;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
}

.stat-card span,
.stat-card small {
  font-size: 12px;
}

.stat-card strong {
  margin: 2px 0 1px;
  font-size: 23px;
}

.grid {
  gap: 8px;
}

.panel {
  border-radius: 10px;
  padding: 10px;
}

.panel-head {
  margin-bottom: 7px;
}

.panel h2 {
  font-size: 15px;
}

.filter-strip {
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 9px;
  grid-template-columns: minmax(210px, 1.35fr) repeat(5, minmax(110px, 1fr)) 86px;
}

.filter-strip label {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
}

.filter-strip label span {
  white-space: nowrap;
}

select,
input {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 6px;
}

.mini-metrics {
  gap: 9px;
}

.mini-metrics article {
  padding: 10px;
  border-radius: 9px;
}

.mini-metrics i {
  width: 28px;
  height: 28px;
}

.mini-metrics strong {
  margin-top: 3px;
  font-size: 21px;
}

.bar-list {
  gap: 6px;
}

.bar-list.compact {
  gap: 6px;
}

.bar-row {
  gap: 3px;
}

.bar-label {
  font-size: 12px;
}

.bar-label i {
  width: 18px;
  height: 18px;
  font-size: 10px;
}

.bar-track,
.progress {
  height: 7px;
}

.donut-wrap {
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 10px;
}

.donut {
  width: 108px;
  height: 108px;
}

.donut::after {
  inset: 27px;
}

.legend {
  gap: 7px;
}

.legend span {
  font-size: 12px;
}

.chart-legend {
  gap: 14px;
  margin-bottom: 0;
}

.line-chart {
  min-height: 132px;
  max-height: 154px;
}

.split-analysis {
  gap: 10px;
}

.insight-list {
  gap: 8px;
}

.insight-list article {
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  border-radius: 9px;
}

.insight-list article > span {
  width: 23px;
  height: 23px;
  font-size: 12px;
}

.insight-list p {
  font-size: 12px;
}

.funnel {
  gap: 7px;
}

.funnel-row {
  grid-template-columns: minmax(0, 1fr) 78px 52px;
  gap: 8px;
}

.funnel-row span {
  height: 29px;
  font-size: 12px;
}

.source-list article {
  min-height: 58px;
}

.source-list i {
  font-size: 20px;
}

.source-note,
.fine-print,
.hint-line {
  margin-top: 8px;
  font-size: 12px;
}

.body-distribution {
  grid-template-columns: minmax(130px, 0.95fr) minmax(160px, 1.05fr);
  gap: 10px;
}

.body-list {
  gap: 7px;
}

.body-list div {
  gap: 7px;
  font-size: 12px;
}

.body-grid,
.body-visual {
  min-height: 148px;
}

.relation-map {
  min-height: 150px;
}

.relation-map > div:first-child,
.relation-map > div:last-child {
  gap: 6px;
}

.relation-map span {
  padding: 4px 7px;
  font-size: 12px;
}

.heatmap {
  grid-template-columns: 72px repeat(6, 1fr);
  gap: 2px;
  font-size: 11px;
}

.heatmap i {
  min-height: 18px;
}

.stacked-bars {
  gap: 8px;
}

.stacked-head,
.stacked-row {
  grid-template-columns: 74px minmax(0, 1fr) 76px;
  gap: 8px;
}

th,
td {
  padding: 5px 9px;
}

td {
  font-size: 12px;
}

.segment-cards {
  gap: 8px;
}

.segment-cards article {
  min-height: 116px;
  padding: 11px;
  border-radius: 10px;
}

.segment-cards strong {
  margin: 9px 0 4px;
  font-size: 22px;
}

.segment-cards em {
  margin-top: 6px;
}

.preference-grid {
  gap: 7px;
}

.preference-grid article {
  padding: 10px;
  border-radius: 9px;
}

.preference-grid strong {
  margin-bottom: 6px;
}

.preference-grid span {
  padding: 4px 0;
  font-size: 12px;
}

.activity-matrix {
  position: relative;
  min-height: 158px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 13px 8px 20px 18px;
}

.activity-matrix::before,
.activity-matrix::after {
  content: "";
  position: absolute;
  background: #9fb4d2;
}

.activity-matrix::before {
  left: 10px;
  top: 10px;
  bottom: 18px;
  width: 1px;
}

.activity-matrix::after {
  left: 10px;
  right: 8px;
  bottom: 18px;
  height: 1px;
}

.activity-matrix article {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(51, 120, 255, 0.12);
  background: #f6f9ff;
}

.activity-matrix article.green {
  background: #ecfbf7;
}

.activity-matrix article.blue {
  background: #eef5ff;
}

.activity-matrix article.cyan {
  background: #eefcff;
}

.activity-matrix article.amber {
  background: #fff7e8;
}

.activity-matrix strong {
  color: var(--ink);
  font-size: 12px;
}

.activity-matrix b {
  color: var(--ink);
  font-size: 18px;
}

.activity-matrix span,
.activity-matrix em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.axis-y {
  position: absolute;
  left: 0;
  top: 44%;
  transform: rotate(-90deg);
}

.axis-x {
  position: absolute;
  right: 10px;
  bottom: 0;
}

.loop-path {
  gap: 7px;
}

.loop-path i,
.confirm-flow i {
  width: 38px;
  height: 38px;
  margin-bottom: 6px;
}

.loop-path p {
  margin-top: 7px;
}

.trajectory {
  gap: 12px;
}

.patient-avatar {
  width: 36px;
  height: 36px;
}

.patient-avatar.large {
  width: 54px;
  height: 54px;
  font-size: 19px;
}

.timeline {
  gap: 6px;
}

.summary-table article,
.suggestion-table article,
.tag-extract article {
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 10px;
  padding: 6px 9px;
}

.summary-table p,
.suggestion-table p,
.tag-extract span {
  font-size: 12px;
}

.patient-card dl {
  grid-template-columns: 72px 1fr;
  gap: 6px 10px;
  margin: 10px 0;
}

.patient-card h3 {
  margin-bottom: 8px;
}

.case-grid {
  gap: 8px;
}

.case-grid article {
  padding: 9px;
}

.case-grid p {
  margin-top: 6px;
  font-size: 12px;
}

.case-grid em {
  margin-top: 6px;
}

.confirm-flow {
  gap: 8px;
}

.basis-grid {
  gap: 8px;
}

.basis-grid article {
  padding: 10px;
}

.page-injuries .bar-list {
  gap: 4px;
}

.page-injuries .panel {
  padding: 8px;
}

.page-injuries .panel-head {
  margin-bottom: 5px;
}

.page-injuries .panel h2 {
  font-size: 14px;
}

.page-injuries .bar-row {
  gap: 2px;
}

.page-injuries .bar-label {
  font-size: 11px;
}

.page-injuries .bar-track {
  height: 5px;
}

.page-injuries .bar-label i {
  width: 16px;
  height: 16px;
}

.page-injuries .body-list {
  gap: 4px;
}

.page-injuries .body-list div {
  font-size: 11px;
}

.page-injuries .body-distribution {
  grid-template-columns: minmax(126px, 0.78fr) minmax(142px, 1.22fr);
  gap: 8px;
}

.page-injuries .body-visual {
  min-height: 150px;
}

.page-injuries .body-grid span {
  padding: 4px 7px;
  font-size: 11px;
}

.page-injuries .relation-map {
  min-height: 134px;
}

.page-injuries .heatmap {
  font-size: 10px;
}

.page-injuries .heatmap i {
  min-height: 16px;
}

.page-injuries .stacked-bars {
  gap: 6px;
}

.page-injuries .insight-list article {
  padding: 6px;
}

.page-patients .segment-cards article {
  min-height: 104px;
}

.page-patients .preference-grid article {
  padding: 8px;
}

.page-patients .insight-list article {
  padding: 7px;
}

.page-efficacy .loop-path {
  gap: 5px;
}

.page-efficacy .loop-path i {
  width: 34px;
  height: 34px;
}

.page-efficacy .loop-path span,
.page-efficacy .timeline span,
.page-efficacy .timeline strong {
  font-size: 11px;
}

.page-efficacy .line-chart {
  max-height: 136px;
}

.page-efficacy .trajectory {
  gap: 8px;
}

.page-ai .patient-avatar.large {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.page-ai .case-grid article {
  padding: 7px;
}

.page-ai .confirm-flow i {
  width: 34px;
  height: 34px;
}

.page-injuries .wide-table,
.page-patients .wide-table,
.page-efficacy .wide-table {
  padding: 8px;
}

.page-injuries .wide-table .panel-head,
.page-patients .wide-table .panel-head,
.page-efficacy .wide-table .panel-head {
  margin-bottom: 4px;
}

.page-injuries .wide-table th,
.page-injuries .wide-table td,
.page-patients .wide-table th,
.page-patients .wide-table td,
.page-efficacy .wide-table th,
.page-efficacy .wide-table td {
  padding: 4px 8px;
  font-size: 11px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

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

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

  .span-2,
  .span-3 {
    grid-column: span 1;
  }

  .filter-strip {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
}

@media (max-width: 960px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar,
  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .brand {
    padding: 0;
  }

  .brand strong,
  .brand span,
  .nav-item span:not(.nav-icon),
  .nav-group-title,
  .sidebar-foot {
    display: none;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .nav-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-item {
    width: auto;
    padding: 8px;
  }

  .nav-icon {
    width: 32px;
    height: 32px;
  }

  .main {
    padding: 18px;
  }

  .topbar,
  .explorer-head {
    display: grid;
  }

  .top-actions {
    justify-content: start;
    flex-wrap: wrap;
  }

  .filters,
  .filter-strip,
  .kpi-grid,
  .grid-3,
  .grid-4,
  .grid-5,
  .source-list,
  .segment-cards,
  .preference-grid,
  .loop-path,
  .case-grid,
  .confirm-flow,
  .basis-grid {
    grid-template-columns: 1fr;
  }

  .filter-summary {
    justify-self: start;
  }

  .split-analysis,
  .donut-wrap,
  .body-distribution,
  .relation-map {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 94px;
  }

  .panel {
    padding: 14px;
  }

  .summary-table article,
  .suggestion-table article,
  .tag-extract article,
  .patient-card dl {
    grid-template-columns: 1fr;
  }
}
