/* MD_FILE_VERSION: 1.0.004 | CHANGED: 2026-04-10 17-46-32 */
/* Copyright Information
 * =====================
 * Copyright (c) 2026, The Scripps Research Institute
 * Developed by Dr. Gennadii Grabovyi
 */

.md-health-card{
  width:min(1360px, calc(100vw - 34px));
  max-height:min(92vh, 980px);
  display:flex;
  flex-direction:column;
  background:var(--panel);
  border:1px solid var(--line-dark);
  border-radius:16px;
  box-shadow:0 26px 70px rgba(15,23,42,0.28);
  overflow:hidden;
}

.md-health-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:16px 18px 14px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg, rgba(15,23,42,0.03), rgba(15,23,42,0));
}

.md-health-title-wrap{
  min-width:0;
  flex:1 1 auto;
}

.md-health-title-row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.md-health-title{
  font-size:20px;
  font-weight:700;
  letter-spacing:0.01em;
}

.md-health-meta{
  margin-top:6px;
  color:var(--muted);
  font-size:13px;
  line-height:1.4;
  word-break:break-word;
}

.md-health-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
  flex:0 0 auto;
}

.md-health-body{
  flex:1 1 auto;
  overflow:auto;
  padding:16px 18px 18px;
  display:flex;
  flex-direction:column;
  gap:16px;
}

.md-health-section{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.md-health-section-title{
  font-size:13px;
  font-weight:700;
  letter-spacing:0.06em;
  text-transform:uppercase;
  color:var(--muted);
}

.md-health-summary-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
  gap:10px;
}

.md-health-summary-card{
  border:1px solid var(--line-dark);
  border-radius:12px;
  background:var(--panel);
  padding:12px 13px;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.md-health-summary-label{
  font-size:12px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:0.05em;
}

.md-health-summary-value{
  font-size:16px;
  font-weight:700;
  word-break:break-word;
}

.md-health-summary-sub{
  font-size:12px;
  color:var(--muted);
  line-height:1.35;
}

.md-health-findings{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.md-health-finding{
  border:1px solid var(--line-dark);
  border-radius:12px;
  background:var(--panel);
  padding:10px 12px;
  display:flex;
  align-items:flex-start;
  gap:10px;
}

.md-health-finding-text{
  flex:1 1 auto;
  font-size:13px;
  line-height:1.45;
}

.md-health-sections{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.md-health-details{
  border:1px solid var(--line-dark);
  border-radius:14px;
  background:var(--panel);
  overflow:hidden;
}

.md-health-details > summary{
  list-style:none;
  cursor:pointer;
  padding:12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:rgba(15,23,42,0.035);
}

.md-health-details > summary::-webkit-details-marker{
  display:none;
}

.md-health-details[open] > summary{
  border-bottom:1px solid var(--line);
}

.md-health-details-body{
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:12px;
}

.md-health-details-title{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.md-health-details-label{
  font-size:15px;
  font-weight:700;
}

.md-health-details-sub{
  font-size:12px;
  color:var(--muted);
  line-height:1.35;
}

.md-health-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:24px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid transparent;
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}

.md-health-chip-healthy{
  color:#166534;
  background:rgba(220,252,231,0.9);
  border-color:rgba(34,197,94,0.28);
}

.md-health-chip-warning{
  color:#92400e;
  background:rgba(254,243,199,0.95);
  border-color:rgba(245,158,11,0.32);
}

.md-health-chip-error{
  color:#991b1b;
  background:rgba(254,226,226,0.95);
  border-color:rgba(239,68,68,0.28);
}

.md-health-chip-info,
.md-health-chip-unknown{
  color:#1d4ed8;
  background:rgba(219,234,254,0.95);
  border-color:rgba(59,130,246,0.28);
}

.md-health-kv{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
  gap:10px;
}

.md-health-kv-item{
  border:1px solid var(--line);
  border-radius:10px;
  padding:10px 12px;
  background:rgba(15,23,42,0.02);
}

.md-health-kv-key{
  font-size:12px;
  font-weight:700;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:0.05em;
}

.md-health-kv-value{
  margin-top:5px;
  font-size:13px;
  line-height:1.45;
  word-break:break-word;
}

.md-health-table-wrap{
  overflow:auto;
  border:1px solid var(--line-dark);
  border-radius:12px;
}

.md-health-table{
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}

.md-health-table thead th{
  position:sticky;
  top:0;
  z-index:1;
  background:var(--md-filter-values-hdr-bg);
  color:var(--md-filter-values-hdr-fg);
  padding:9px 10px;
  border-bottom:1px solid var(--line-dark);
  text-align:left;
  white-space:nowrap;
}

.md-health-table tbody td{
  padding:9px 10px;
  border-bottom:1px solid rgba(15,23,42,0.08);
  vertical-align:top;
  line-height:1.4;
}

.md-health-table tbody tr:nth-child(even) td{
  background:rgba(15,23,42,0.025);
}

.md-health-table thead th[data-md-sort-col]{
  cursor:pointer;
  user-select:none;
}
.md-health-table thead th[data-md-sort-col]:hover{
  filter:brightness(0.93);
}
.md-health-table thead th[data-md-sort-col]::after{
  content:' \2195';
  opacity:0.28;
  font-size:10px;
}
.md-health-table thead th[data-md-sort-dir="asc"]::after{
  content:' \2191';
  opacity:0.72;
}
.md-health-table thead th[data-md-sort-dir="desc"]::after{
  content:' \2193';
  opacity:0.72;
}

.md-health-row-error td{
  background:rgba(254,226,226,0.55)!important;
}
.md-health-row-warning td{
  background:rgba(254,243,199,0.65)!important;
}

.md-health-problems-box{
  margin-bottom:12px;
  padding:4px 14px 12px;
  border:1px solid rgba(239,68,68,0.32);
  border-radius:10px;
  background:rgba(254,226,226,0.18);
}
.md-health-problems-title{
  font-size:13px;
  font-weight:700;
  color:#991b1b;
  margin:10px 0 8px;
}

.md-health-mono{
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  word-break:break-word;
}

.md-health-pre{
  margin:0;
  padding:12px 13px;
  border:1px solid var(--line-dark);
  border-radius:12px;
  background:rgba(15,23,42,0.045);
  color:var(--fg);
  font-size:12px;
  line-height:1.45;
  white-space:pre-wrap;
  word-break:break-word;
  max-height:420px;
  overflow:auto;
}

.md-health-note{
  font-size:12px;
  color:var(--muted);
  line-height:1.45;
}

.md-health-empty{
  border:1px dashed var(--line-dark);
  border-radius:12px;
  padding:16px;
  color:var(--muted);
  font-size:13px;
}

.md-health-inline-list{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.md-health-inline-list .md-health-chip{
  min-height:22px;
}

.md-health-log-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.md-health-log-toggle-group,
.md-health-log-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.md-health-log-meta-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.md-health-log-stream{
  border:1px solid var(--line-dark);
  border-radius:12px;
  background:rgba(15,23,42,0.045);
  max-height:320px;
  overflow:auto;
}

.md-health-log-line{
  padding:8px 12px;
  border-bottom:1px solid rgba(15,23,42,0.08);
  font-size:12px;
  line-height:1.45;
  white-space:pre-wrap;
  word-break:break-word;
}

.md-health-log-line:nth-child(even){
  background:rgba(15,23,42,0.025);
}

.md-health-log-line:last-child{
  border-bottom:none;
}

.md-health-usage-summary{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
  gap:10px;
}

.md-health-usage-summary-item{
  border:1px solid var(--line-dark);
  border-radius:8px;
  background:rgba(15,23,42,0.025);
  padding:10px 12px;
}

.md-health-usage-summary-key{
  font-size:12px;
  font-weight:700;
  color:var(--muted);
  text-transform:uppercase;
}

.md-health-usage-summary-value{
  margin-top:6px;
  font-size:13px;
  line-height:1.45;
  word-break:break-word;
}

.md-health-usage-graphs{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(320px, 1fr));
  gap:12px;
}

.md-health-usage-graph-card{
  border:1px solid var(--line-dark);
  border-radius:8px;
  background:rgba(15,23,42,0.02);
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.md-health-usage-graph-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  flex-wrap:wrap;
}

.md-health-usage-graph-title{
  font-size:14px;
  font-weight:700;
}

.md-health-usage-graph-value{
  margin-top:4px;
  font-size:22px;
  font-weight:700;
}

.md-health-usage-graph-stats{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:12px;
}

.md-health-usage-graph-scroll{
  overflow-x:auto;
  overflow-y:hidden;
  border:1px solid var(--line-dark);
  border-radius:8px;
  background:rgba(255,255,255,0.55);
}

.md-health-usage-graph-canvas{
  min-width:100%;
  height:210px;
}

.md-health-usage-graph-svg{
  width:100%;
  height:100%;
  display:block;
}

.md-health-usage-grid-line{
  stroke:rgba(15,23,42,0.12);
  stroke-width:1;
}

.md-health-usage-grid-label{
  fill:var(--muted);
  font-size:11px;
}

.md-health-usage-graph-foot{
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:12px;
}

.md-health-usage-graph-detail{
  border-top:1px solid var(--line);
  padding-top:10px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.md-health-usage-thread-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  color:var(--muted);
  font-size:12px;
}

.md-health-usage-thread-meta > span{
  display:inline-flex;
  align-items:center;
  padding:4px 8px;
  border:1px solid var(--line);
  border-radius:8px;
  background:rgba(15,23,42,0.025);
}

.md-health-usage-thread-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(150px, 1fr));
  gap:8px;
  max-height:240px;
  overflow:auto;
  padding-right:2px;
}

.md-health-usage-thread-item{
  border:1px solid var(--line);
  border-radius:8px;
  background:rgba(15,23,42,0.025);
  padding:8px 10px;
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
}

.md-health-usage-thread-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.md-health-usage-thread-label{
  font-size:12px;
  font-weight:700;
}

.md-health-usage-thread-value{
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
}

.md-health-usage-thread-bar{
  height:8px;
  border-radius:999px;
  background:rgba(15,23,42,0.08);
  overflow:hidden;
}

.md-health-usage-thread-bar > span{
  display:block;
  height:100%;
  border-radius:999px;
  background:#0f766e;
}

.md-health-usage-table-wrap{
  overflow:auto;
  border:1px solid var(--line-dark);
  border-radius:8px;
}

.md-health-usage-table{
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}

.md-health-usage-table thead th{
  position:sticky;
  top:0;
  z-index:1;
  background:var(--md-filter-values-hdr-bg);
  color:var(--md-filter-values-hdr-fg);
  border-bottom:1px solid var(--line-dark);
  padding:0;
  text-align:left;
  white-space:nowrap;
}

.md-health-usage-table tbody td{
  padding:10px 12px;
  border-bottom:1px solid rgba(15,23,42,0.08);
  vertical-align:top;
}

.md-health-usage-table tbody tr:nth-child(even) td{
  background:rgba(15,23,42,0.025);
}

.md-health-usage-sort{
  width:100%;
  border:none;
  background:transparent;
  color:inherit;
  text-align:left;
  font:inherit;
  padding:9px 10px;
  display:flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
}

.md-health-usage-sort-state{
  font-size:10px;
  font-weight:700;
  color:inherit;
  opacity:0.78;
}

.md-health-usage-user,
.md-health-usage-primary{
  font-size:13px;
  font-weight:700;
}

.md-health-usage-cell-sub{
  margin-top:4px;
  color:var(--muted);
  line-height:1.35;
}

:root[data-theme="dark"] .md-health-card{
  box-shadow:0 26px 70px rgba(0,0,0,0.42);
}

:root[data-theme="dark"] .md-health-header{
  background:linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
}

:root[data-theme="dark"] .md-health-summary-card,
:root[data-theme="dark"] .md-health-finding,
:root[data-theme="dark"] .md-health-details,
:root[data-theme="dark"] .md-health-table-wrap,
:root[data-theme="dark"] .md-health-pre{
  background:#1f232d;
}

:root[data-theme="dark"] .md-health-details > summary{
  background:rgba(255,255,255,0.03);
}

:root[data-theme="dark"] .md-health-kv-item{
  background:rgba(255,255,255,0.025);
}

:root[data-theme="dark"] .md-health-table tbody td{
  border-bottom:1px solid rgba(255,255,255,0.08);
}

:root[data-theme="dark"] .md-health-table tbody tr:nth-child(even) td{
  background:rgba(255,255,255,0.03);
}

:root[data-theme="dark"] .md-health-row-error td{
  background:rgba(127,29,29,0.38)!important;
}
:root[data-theme="dark"] .md-health-row-warning td{
  background:rgba(120,53,15,0.38)!important;
}
:root[data-theme="dark"] .md-health-problems-box{
  background:rgba(127,29,29,0.18);
  border-color:rgba(239,68,68,0.28);
}
:root[data-theme="dark"] .md-health-problems-title{
  color:#f87171;
}

:root[data-theme="dark"] .md-health-log-stream{
  background:rgba(255,255,255,0.03);
}

:root[data-theme="dark"] .md-health-usage-summary-item,
:root[data-theme="dark"] .md-health-usage-graph-card{
  background:rgba(255,255,255,0.025);
}

:root[data-theme="dark"] .md-health-usage-graph-scroll{
  background:rgba(255,255,255,0.03);
}

:root[data-theme="dark"] .md-health-usage-graph-detail{
  border-top-color:rgba(255,255,255,0.12);
}

:root[data-theme="dark"] .md-health-usage-grid-line{
  stroke:rgba(255,255,255,0.12);
}

:root[data-theme="dark"] .md-health-usage-thread-meta > span,
:root[data-theme="dark"] .md-health-usage-thread-item{
  background:rgba(255,255,255,0.03);
  border-color:rgba(255,255,255,0.08);
}

:root[data-theme="dark"] .md-health-usage-thread-bar{
  background:rgba(255,255,255,0.08);
}

:root[data-theme="dark"] .md-health-usage-table tbody td{
  border-bottom:1px solid rgba(255,255,255,0.08);
}

:root[data-theme="dark"] .md-health-usage-table tbody tr:nth-child(even) td{
  background:rgba(255,255,255,0.03);
}

:root[data-theme="dark"] .md-health-log-line{
  border-bottom:1px solid rgba(255,255,255,0.08);
}

:root[data-theme="dark"] .md-health-log-line:nth-child(even){
  background:rgba(255,255,255,0.03);
}

@media (max-width: 960px){
  .md-health-card{
    width:min(100vw, calc(100vw - 18px));
    max-height:min(96vh, 980px);
    border-radius:14px;
  }

  .md-health-header{
    padding:14px 14px 12px;
    flex-direction:column;
  }

  .md-health-actions{
    width:100%;
    justify-content:flex-start;
  }

  .md-health-body{
    padding:14px;
  }

  .md-health-usage-graphs{
    grid-template-columns:1fr;
  }
}
