/* Kidney Navigator /app: the trend chart (REQ-3634, 2026-11-17). Styles only.
   Rollback: delete this file and its <link> in kn-app.html. Colours come from the app's own
   variables, so contrast mode and the large-text sizes carry through. Every control is 48px or taller. */
.kn-tr {
  border-width: 2px;
}
.kn-tr .kn-tr-seg {
  margin-top: 8px;
}
.kn-tr .kn-tr-seg button {
  min-height: 48px;
  transition:
    transform 100ms ease-out,
    background-color 150ms ease,
    color 150ms ease;
}
.kn-tr .kn-tr-seg button:active {
  transform: scale(0.97);
}
.kn-tr-readout {
  margin-top: 14px;
  min-height: 5rem;
}
.kn-tr-big {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.kn-tr-unit {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}
.kn-tr-when {
  color: var(--muted);
  font-size: 1rem;
  margin-top: 4px;
}
.kn-tr-chg {
  margin: 4px 0 0;
}
.kn-tr-plot {
  margin-top: 14px;
  border-radius: 12px;
  touch-action: pan-y;
  cursor: crosshair;
  -webkit-user-select: none;
  user-select: none;
}
.kn-tr-plot:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}
.kn-tr-svg {
  display: block;
  max-width: 100%;
  overflow: visible;
}
.kn-tr-grid {
  stroke: var(--line);
  stroke-width: 1.5;
}
.kn-tr-ax {
  fill: var(--muted);
  font-variant-numeric: tabular-nums;
}
.kn-tr-lab {
  fill: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  paint-order: stroke;
  stroke: var(--card);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.kn-tr-ln {
  fill: none;
  stroke-width: 3.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.kn-tr-ln.kn-tr-a {
  stroke: var(--blue);
}
.kn-tr-ln.kn-tr-b {
  stroke: var(--navy);
  /* Not color alone: the bottom-number line is dashed, its dots are squares, its label has a square. */
  stroke-dasharray: 14 8;
}
.kn-tr-dot {
  stroke: none;
}
.kn-tr-dot.kn-tr-a {
  fill: var(--blue);
}
.kn-tr-dot.kn-tr-b {
  fill: var(--navy);
}
.kn-tr-la {
  fill: var(--blue);
}
.kn-tr-lb {
  fill: var(--navy);
}
.kn-tr-avg {
  fill: none;
  stroke: var(--muted);
  stroke-width: 2.5;
  stroke-dasharray: 2 7;
  stroke-linecap: round;
}
.kn-tr-key {
  white-space: nowrap;
}
.kn-tr-key svg {
  vertical-align: middle;
}
.kn-tr-cur line {
  stroke: var(--ink);
  stroke-width: 2;
}
.kn-tr-ca {
  fill: var(--card);
  stroke: var(--blue);
  stroke-width: 3.5;
}
.kn-tr-cb {
  fill: var(--card);
  stroke: var(--navy);
  stroke-width: 3.5;
}
.kn-tr-sum {
  margin: 10px 0 0;
}
.kn-tr-note {
  margin: 14px 0 0;
}
.kn-tr-tbl {
  margin-top: 14px;
  border-top: 1.5px solid var(--line);
  padding-top: 4px;
}
.kn-tr-tbl summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  color: var(--navy);
}
.kn-tr-scroll {
  max-height: 20rem;
  overflow: auto;
  border-radius: 8px;
}
.kn-tr-tbl table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.kn-tr-tbl th,
.kn-tr-tbl td {
  text-align: left;
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  font-weight: 500;
}
.kn-tr-tbl thead th {
  font-weight: 700;
  color: var(--navy);
  border-top: 0;
}
/* The old small chart on this tab repeats this one; the table underneath it stays. */
body:has(#kn-trend) #kn-g-hist svg.kn-g-chart {
  display: none;
}
/* One moment of motion: the line draws in when a metric or range is picked. */
@media (prefers-reduced-motion: no-preference) {
  .kn-tr-draw {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: kn-tr-draw 700ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }
  @keyframes kn-tr-draw {
    to {
      stroke-dashoffset: 0;
    }
  }
}
html.contrast .kn-tr {
  border-color: #000;
}
html.contrast .kn-tr-ln {
  stroke-width: 4.5;
}
html.contrast .kn-tr-ln.kn-tr-a,
html.contrast .kn-tr-ln.kn-tr-b {
  stroke: #000;
}
html.contrast .kn-tr-ln.kn-tr-b {
  stroke-dasharray: 10 6;
}
html.contrast .kn-tr-grid {
  stroke: #767676;
}
html.contrast .kn-tr-ax,
html.contrast .kn-tr-avg {
  fill: #000;
}
html.contrast .kn-tr-avg {
  stroke: #000;
  fill: none;
}
html.contrast .kn-tr-dot.kn-tr-a,
html.contrast .kn-tr-dot.kn-tr-b,
html.contrast .kn-tr-la,
html.contrast .kn-tr-lb {
  fill: #000;
}
@media (max-width: 480px) {
  .kn-tr-big {
    font-size: 2.4rem;
  }
}

/* Read by screen readers (latest, change, lowest, highest, range); not drawn. */
.kn-tr-srtext {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.kn-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 20px;
  margin: 0 auto;
  padding: 0 20px;
  max-width: 760px;
}
.kn-legal a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
