/* ============================================================
   DieHard · Still beating
   Tema claro inspirado en Apple Health. Sistema visual propio.
   Sin sombras en cards · bento por sistema · tablas en modal.
   ============================================================ */

:root {
  --bg: #f2f2f7;
  --bg-grad-1: #fff1f3;
  --bg-grad-2: #eef4ff;
  --card: #ffffff;
  --card-2: #f8f8fb;
  --hover: #f1f1f5;
  --border: #e6e6ec;
  --border-strong: #d6d6de;

  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #a1a1a6;

  --green: #34c759;  --green-bg: rgba(52, 199, 89, 0.13);
  --orange: #ff9500; --orange-bg: rgba(255, 149, 0, 0.14);
  --red: #ff3b30;    --red-bg: rgba(255, 59, 48, 0.12);
  --blue: #007aff;   --blue-bg: rgba(0, 122, 255, 0.12);

  --c-higado: #ff9500;
  --c-metabolico: #af52de;
  --c-lipidos: #ff2d92;
  --c-hemato: #ff3b30;
  --c-renal: #0a84ff;
  --c-endocrino: #30b0c7;
  --c-autoinmune: #5e5ce6;
  --c-serologia: #34c759;
  --c-imagen: #5856d6;
  --c-pancreas: #ff6482;
  --c-default: #8e8e93;

  --radius: 22px;
  --radius-sm: 14px;
  --sidebar-w: 256px;
  --card-shadow: 0 1px 3px rgba(20, 20, 40, .05), 0 10px 26px -14px rgba(20, 20, 40, .14);
  --card-shadow-soft: 0 1px 2px rgba(20, 20, 40, .04), 0 6px 16px -12px rgba(20, 20, 40, .10);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font); color: var(--text);
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 70%, #ffeef3 100%) fixed;
  -webkit-font-smoothing: antialiased; line-height: 1.5; letter-spacing: 0;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
.icon { display: inline-block; vertical-align: middle; flex: none; }
.icon svg { display: block; width: 100%; height: 100%; }

/* ============================ layout ============================ */
.app { display: flex; min-height: 100vh; align-items: flex-start; }

/* ---------------------------- sidebar ---------------------------- */
.sidebar {
  width: var(--sidebar-w); flex: none; position: sticky; top: 0; height: 100vh;
  background: rgba(255,255,255,0.7); backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  padding: 22px 14px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand .heart { position: relative; display: inline-grid; place-items: center; width: 46px; height: 46px; color: var(--red); }
.brand .heart svg { position: relative; z-index: 1; display: block; width: 40px; height: 40px; }
/* pulso externo con la FORMA del corazón (eco que crece y se desvanece) — el corazón queda estático */
.brand .heart::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; z-index: 0; pointer-events: none;
  transform: translate(-50%, -50%) scale(1); transform-origin: center; background: linear-gradient(180deg, #ff5e7e, #ff2d55); opacity: .5;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.29 1.49 4.04 3 5.5l7 7Z' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.29 1.49 4.04 3 5.5l7 7Z' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: beat 1.9s ease-out infinite;
}
@keyframes beat {
  0% { transform: translate(-50%, -50%) scale(1); opacity: .5; }
  70% { transform: translate(-50%, -50%) scale(2.1); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(2.1); opacity: 0; }
}
.brand .bt { line-height: 1.05; }
.brand .bt b { font-size: clamp(32px, 4vw, 42px); font-weight: 800; letter-spacing: 0; display: block; line-height: 1; }
.brand .bt small { font-size: 14px; color: var(--text-3); font-weight: 600; }

.nav-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .055em; color: var(--text-3); font-weight: 700; padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px;
  font-size: 14.5px; font-weight: 550; color: var(--text); cursor: pointer; transition: .14s;
  border: none; background: none; width: 100%; text-align: left; font-family: inherit;
}
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--card); box-shadow: var(--card-shadow-soft); }
.nav-item .icon { width: 24px; height: 24px; }
.nav-item .nm { flex: 1; min-width: 0; }
.nav-item .cnt { font-size: 11px; font-weight: 700; color: var(--text-3); background: var(--bg); padding: 1px 8px; border-radius: 999px; min-width: 22px; text-align: center; }
.nav-item .cnt.has-alert { color: var(--red); background: var(--red-bg); }
.nav-item .cnt.is-historical { color: var(--text-3); font-weight: 600; }

/* ---------------------------- main ---------------------------- */
.main { flex: 1; width: 100%; min-width: 0; padding: 30px clamp(20px, 4vw, 52px) 70px; max-width: 1200px; }
.main-head .sync { color: var(--text-2); font-size: 14px; margin-top: 8px; }
.main-head .sync b { color: var(--text); font-weight: 650; }

/* ---- hero header con monitor cardiaco ---- */
.hero { padding-top: 6px; }
.hero .wordmark {
  font-size: clamp(46px, 7.6vw, 80px); font-weight: 800; letter-spacing: 0; line-height: 0.9;
  width: max-content; max-width: 100%; color: #333333;
}
.hero .beatline { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.hero .tag { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700; color: var(--red); white-space: nowrap; letter-spacing: 0; }
.hero .pdot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(255, 59, 48, .5); animation: dotpulse 1.6s ease-out infinite; }
@keyframes dotpulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, .5); }
  70% { box-shadow: 0 0 0 9px rgba(255, 59, 48, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}
.hero .ecg { flex: 1; height: 46px; min-width: 0; display: block; }
.hero .ecg .ecg-base { stroke: rgba(255, 59, 48, .18); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.hero .ecg .ecg-run { stroke: #ff2d55; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 64 480; stroke-dashoffset: 480; animation: ecg 2.6s linear infinite; filter: drop-shadow(0 0 5px rgba(255, 45, 85, .65)); }
@keyframes ecg { to { stroke-dashoffset: 0; } }
.hero .sync { margin-top: 16px; font-size: 13px; color: var(--text-3); }
@media (max-width: 560px) { .hero .beatline { flex-direction: column; align-items: flex-start; gap: 10px; } .hero .ecg { width: 100%; } }

.section { margin-top: 58px; }
.section-head { margin-bottom: 22px; }
.section-head h2 { font-size: clamp(27px, 3.5vw, 39px); font-weight: 800; letter-spacing: 0; line-height: 1.05; color: var(--text); max-width: 18ch; }
.section-head .quip { display: block; color: var(--text-3); font-size: 15.5px; font-weight: 500; margin-top: 8px; letter-spacing: 0; }

/* ---------------------------- verdict ---------------------------- */
.verdict { background: var(--card); border: none; border-radius: var(--radius); padding: 25px 27px; margin-top: 22px; position: relative; overflow: hidden; box-shadow: var(--card-shadow); }
.verdict h3 { font-size: clamp(23px, 2.8vw, 31px); font-weight: 800; letter-spacing: 0; line-height: 1.1; margin-bottom: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; color: var(--text); }
.verdict h3 .icon { width: 30px; height: 30px; color: var(--c-higado); flex: none; }
.verdict p { color: var(--text-2); font-size: 14.5px; margin-bottom: 9px; }
.verdict p:last-child { margin-bottom: 0; }
.verdict strong { color: var(--text); font-weight: 650; }
.verdict .tag { color: var(--c-higado); font-weight: 700; }

/* ---------------------------- KPI cards ---------------------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 16px; }
.kpi { position: relative; background: var(--card); border-radius: var(--radius); padding: 18px 20px 16px; transition: .16s; min-height: 168px; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--card-shadow); }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 2px 5px rgba(20,20,40,.06), 0 16px 34px -16px rgba(20,20,40,.2); }
.kpi .kpi-top { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.kpi .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.kpi .ico .icon { width: 18px; height: 18px; }
.kpi .kpi-label { font-size: 14px; color: var(--text); font-weight: 650; }
.kpi .kpi-value { font-size: 36px; font-weight: 800; letter-spacing: 0; line-height: 1; margin: 4px 0 8px; }
.kpi .kpi-value .unit { font-size: 14px; color: var(--text-3); font-weight: 600; margin-left: 5px; letter-spacing: 0; }
.kpi .kpi-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kpi .kpi-quip { font-size: 12.5px; color: var(--text-2); margin-top: auto; line-height: 1.4; }
.kpi .spark { position: absolute; right: 16px; top: 18px; }
.trend { font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 2px; }
.trend.down { color: var(--green); } .trend.up { color: var(--red); } .trend.flat { color: var(--text-3); }

/* ---------------------------- pills / dots ---------------------------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: #1a8a3a; background: var(--green-bg); }
.pill.watch { color: #b96b00; background: var(--orange-bg); }
.pill.alert { color: #c4271d; background: var(--red-bg); }
.pill.info { color: #0058b8; background: var(--blue-bg); }
.dotind { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dotind.ok { background: var(--green); } .dotind.watch { background: var(--orange); }
.dotind.alert { background: var(--red); } .dotind.info { background: var(--blue); }
.count-pill { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--text-2); }

/* ---------------------------- trend panel ---------------------------- */
.panel { background: var(--card); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--card-shadow); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 999px; border: none; background: var(--hover); color: var(--text-2); cursor: pointer; transition: .14s; font-family: inherit; }
.chip:hover { background: #e7e7ee; color: var(--text); }
.chip.active { background: var(--text); color: #fff; border-color: var(--text); }
.trend-copy { max-width: 760px; margin: -5px 0 18px; color: var(--text-3); font-size: 13px; line-height: 1.4; font-weight: 500; }
.trend-copy b { color: var(--text); font-weight: 700; }
.chart-box { position: relative; height: 360px; }
.chart-legend-note { color: var(--text-2); font-size: 12.5px; margin-top: 14px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.chart-legend-note .swatch { width: 22px; height: 10px; border-radius: 3px; display: inline-block; vertical-align: middle; margin-right: 6px; }
.chart-legend-note b { color: var(--text); font-weight: 650; }

/* ---------------------------- bento por sistema ---------------------------- */
.bento { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cat { background: var(--card); border-radius: var(--radius); overflow: hidden; scroll-margin-top: 20px; display: flex; flex-direction: column; box-shadow: var(--card-shadow); }
.cat.wide { grid-column: 1 / -1; }
.cat-head { display: flex; align-items: center; gap: 13px; padding: 18px 20px 14px; }
.cat-head .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.cat-head .ico .icon { width: 22px; height: 22px; }
.cat-head .meta { flex: 1; min-width: 0; }
.cat-head .meta h4 { font-size: 16.5px; font-weight: 750; letter-spacing: 0; }
.cat-head .meta span { font-size: 12.5px; color: var(--text-3); }
.cat-head .badges { display: flex; gap: 6px; align-items: center; }
.cat-body { padding: 4px 20px; }
.cat.wide .cat-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }

.metric { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 14px; padding: 13px 0; border-top: 1px solid var(--border); }
.metric .m-left { min-width: 0; }
.metric .m-name { font-size: 13.5px; font-weight: 650; color: var(--text); }
.metric .m-name small { color: var(--text-3); font-weight: 500; font-size: 11px; margin-left: 5px; }
.metric .m-spark { margin-top: 7px; height: 34px; }
.metric .m-spark svg { display: block; }
.metric .m-right { text-align: right; white-space: nowrap; }
.metric .m-val { font-size: 18px; font-weight: 780; letter-spacing: 0; color: var(--text); }
.metric .m-val .u { font-size: 11px; color: var(--text-3); font-weight: 600; margin-left: 2px; }
.metric .m-val .trend { font-size: 11.5px; margin-left: 5px; }
.metric .m-right .pill { margin-top: 6px; }
.metric.stale { opacity: .72; }
.stale-note { display: inline-block; margin-top: 7px; color: var(--text-3); font-size: 11px; font-weight: 650; white-space: nowrap; }
.count-pill.historical { color: var(--text-3); font-weight: 600; }

.cat-foot { margin-top: auto; padding: 6px 20px 16px; }
.see-all { width: 100%; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 12.5px; font-weight: 600; font-family: inherit; padding: 9px; border-radius: 10px; border: none; background: transparent; color: var(--text-3); cursor: pointer; transition: .14s; }
.see-all .icon { width: 12px; height: 12px; }
.see-all:hover { color: var(--text); background: var(--hover); }

/* ---------------------------- timeline ---------------------------- */
.timeline { position: relative; margin-left: 7px; padding-left: 26px; border-left: 2px solid var(--border); }
.tl-item { position: relative; padding: 2px 0 24px; }
.tl-item::before { content: ""; position: absolute; left: -34px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--accent, var(--c-default)); box-shadow: 0 0 0 3px #fff; }
.tl-date { font-size: 12px; color: var(--text-3); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.tl-card { margin-top: 8px; background: var(--card); border-radius: var(--radius-sm); padding: 15px 17px; box-shadow: var(--card-shadow-soft); }
.tl-card h5 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.tl-card p { font-size: 13.5px; color: var(--text-2); margin-bottom: 10px; }
.tl-exams { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-exams a { font-size: 12px; color: var(--text-2); background: var(--bg); border: 1px solid var(--border); padding: 4px 10px; border-radius: 8px; transition: .14s; display: inline-flex; align-items: center; gap: 4px; }
.tl-exams a:hover { color: var(--text); border-color: var(--border-strong); background: var(--card); }
.tl-exams a .icon { width: 12px; height: 12px; color: var(--text-3); }

/* ---------------------------- modal (tabla completa) ---------------------------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,20,30,.42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; z-index: 100; padding: 24px; }
.modal-overlay.open { display: flex; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--card); border-radius: 24px; max-width: 940px; width: 100%; max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(20,20,40,.4); animation: rise .2s ease; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; gap: 13px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-head .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.modal-head .ico .icon { width: 20px; height: 20px; }
.modal-head h3 { font-size: 18px; font-weight: 750; }
.modal-head .sub { font-size: 12.5px; color: var(--text-3); }
.modal-close { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--bg); color: var(--text-2); font-size: 16px; cursor: pointer; transition: .14s; }
.modal-close:hover { background: var(--hover); color: var(--text); }
.modal-body { overflow: auto; padding: 6px 8px 14px; }

/* ---------------------------- matrix table ---------------------------- */
.matrix-scroll { overflow-x: auto; }
table.matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
table.matrix th, table.matrix td { padding: 11px 16px; text-align: left; white-space: nowrap; }
table.matrix thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 700; background: var(--card-2); border-bottom: 1px solid var(--border); position: sticky; top: 0; }
table.matrix thead th.datecol { text-align: center; }
table.matrix tbody tr { border-bottom: 1px solid var(--border); }
table.matrix tbody tr:last-child { border-bottom: none; }
table.matrix tbody tr:hover { background: var(--hover); }
table.matrix td.pname { font-weight: 650; color: var(--text); position: sticky; left: 0; background: var(--card); }
table.matrix tbody tr:hover td.pname { background: var(--hover); }
table.matrix td.ref { color: var(--text-3); font-size: 12px; }
table.matrix td.cell { text-align: center; }
.cell-v { display: inline-flex; align-items: center; gap: 6px; justify-content: center; font-weight: 700; color: var(--text); }
.cell-v a.srcdot { color: var(--text-3); display: inline-flex; opacity: .55; transition: .14s; }
.cell-v a.srcdot:hover { color: var(--blue); opacity: 1; }
.cell-v a.srcdot .icon { width: 12px; height: 12px; }
.cell-empty { color: var(--border-strong); }

/* ---------------------------- footer ---------------------------- */
footer { margin-top: 50px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 12.5px; }
footer p { margin-bottom: 6px; } footer .disclaimer { font-style: italic; }
footer code { background: var(--bg); padding: 1px 6px; border-radius: 5px; font-size: 12px; }

/* ---------------------------- responsive ---------------------------- */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 20;
    border-right: none; border-bottom: 1px solid var(--border);
    display: block; overflow-x: auto; overflow-y: hidden; padding: 10px 14px;
    scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar .nav-label { display: none; }
  .sidebar nav,
  #nav-cats { display: flex; gap: 6px; align-items: center; width: max-content; min-width: 100%; }
  #nav-cats { min-width: 0; }
  .nav-item { width: auto; min-height: 40px; padding: 7px 10px; flex: none; }
  .nav-item .nm { white-space: nowrap; }
  .nav-item .icon { width: 21px; height: 21px; }
  .main { max-width: none; padding: 24px 18px 58px; }
  .section { margin-top: 46px; }
  .hero .wordmark { font-size: clamp(44px, 14vw, 68px); line-height: .95; }
  .bento { grid-template-columns: 1fr; }
  .cat.wide .cat-body { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  :root { --radius: 18px; --radius-sm: 12px; }
  body { background: linear-gradient(180deg, #ffeef3 0%, #ffffff 42%, #ffffff 100%) fixed; }
  .sidebar { padding: 8px 12px; }
  .nav-item { min-height: 38px; padding: 7px 9px; gap: 8px; font-size: 13px; }
  .nav-item .cnt { display: none; }
  .main { padding: 22px 22px 48px; }
  .hero { padding-top: 0; }
  .hero .wordmark { padding-top: 50px; }
  .hero .beatline { margin-top: 12px; }
  .hero .sync { margin-top: 12px; font-size: 12.5px; }
  .section { margin-top: 40px; }
  .section-head { margin-bottom: 16px; }
  .section-head h2 { max-width: 100%; font-size: clamp(25px, 8.5vw, 32px); }
  .section-head .quip { font-size: 14px; line-height: 1.35; }
  .verdict { margin-top: 18px; padding: 20px 18px; }
  .verdict h3 { font-size: 26px; margin-bottom: 14px; }
  .verdict p { font-size: 14px; line-height: 1.55; }
  .kpi-grid { grid-template-columns: 1fr; gap: 12px; }
  .kpi { min-height: 154px; padding: 16px; }
  .kpi .spark { right: 14px; top: 16px; transform: scale(.9); transform-origin: top right; }
  .kpi .kpi-value { font-size: 31px; padding-right: 72px; overflow-wrap: anywhere; }
  .kpi .kpi-meta { flex-wrap: wrap; }
  .panel { padding: 16px; border-radius: 18px; margin-left: 0; margin-right: 0; }
  .chips {
    flex-wrap: nowrap; overflow-x: auto; gap: 7px; margin: -2px -16px 14px; padding: 2px 16px 4px;
    scrollbar-width: none;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; font-size: 12.5px; padding: 8px 12px; }
  .trend-copy { margin: 0 0 14px; font-size: 12.5px; line-height: 1.4; }
  .chart-box { height: 255px; }
  .chart-legend-note { gap: 8px; font-size: 12px; line-height: 1.35; }
  .chart-legend-note span { max-width: 100%; }
  .cat-head { align-items: flex-start; padding: 16px 16px 12px; gap: 10px; }
  .cat-head .ico { width: 36px; height: 36px; border-radius: 10px; }
  .cat-head .badges { flex-wrap: wrap; justify-content: flex-end; max-width: 84px; }
  .cat-body { padding: 0 16px; }
  .metric { grid-template-columns: 1fr; align-items: stretch; gap: 8px; padding: 12px 0; }
  .metric .m-name { font-size: 13px; line-height: 1.25; }
  .metric .m-name small { display: block; margin: 3px 0 0; }
  .metric .m-spark { margin-top: 6px; }
  .metric .m-right { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; white-space: normal; }
  .metric .m-val { min-width: 0; font-size: 17px; overflow-wrap: anywhere; }
  .metric .m-right .pill { margin-top: 0; flex: none; }
  .cat-foot { padding: 6px 16px 14px; }
  .see-all { min-height: 40px; padding: 10px 8px; }
  .timeline { margin-left: 4px; padding-left: 20px; }
  .tl-item::before { left: -28px; }
  .tl-card { padding: 14px; }
  .tl-exams { flex-direction: column; align-items: stretch; }
  .tl-exams a { justify-content: space-between; min-height: 36px; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { width: 100%; height: 92dvh; max-height: none; border-radius: 20px 20px 0 0; }
  .modal-head { padding: 16px 14px; gap: 10px; }
  .modal-head .ico { width: 34px; height: 34px; }
  .modal-head h3 { font-size: 16px; }
  .modal-head .sub { display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .modal-close { width: 38px; height: 38px; flex: none; }
  .modal-body { padding: 0 0 10px; }
  .matrix-scroll { overflow: auto; -webkit-overflow-scrolling: touch; }
  table.matrix { min-width: 720px; font-size: 12px; }
  table.matrix th,
  table.matrix td { padding: 10px 12px; }
  table.matrix td.pname { max-width: 170px; white-space: normal; }
  table.matrix td.ref { max-width: 130px; white-space: normal; }
  footer { margin-top: 40px; font-size: 12px; }
}
