/* ---------- dashboard ---------- */
/* The greeting is the one place framed in the whole flag: blue outside, then pink,
   then a white (dark mode: dark) center for the text. */
.hero {
  margin: 10px;
  padding: 22px 20px;
  border-radius: 28px;
  background: var(--surface);
  border: 10px solid var(--flag-pink);
  box-shadow: 0 0 0 10px var(--flag-blue);
}
.hero-kicker {
  margin: 0;
  color: var(--text-2);
  font-weight: 550;
}
.hero-value {
  margin: 4px 0;
  font-size: clamp(2rem, 7vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.hero-value small {
  font-size: 0.45em;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0;
}
.hero-value-sm {
  font-size: 1.5rem;
}
.hero-sub {
  margin: 0;
  color: var(--muted);
}
.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 760px) {
  .tiles {
    grid-template-columns: repeat(4, 1fr);
  }
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--white-fill);
  border: 2px solid var(--line);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
  min-width: 0;
}
a.tile:hover {
  transform: translateY(-3px) rotate(-0.6deg);
}
a.tile:nth-child(even):hover {
  transform: translateY(-3px) rotate(0.6deg);
}
/* Tiles take turns in the flag's colors; labels and notes use the tile's own ink. */
.tile:nth-child(3n + 1):not(.tile-empty):not(.tile-warn) {
  background: var(--flag-blue);
  border-color: var(--flag-blue);
  color: var(--on-blue);
}
.tile:nth-child(3n + 2):not(.tile-empty):not(.tile-warn) {
  background: var(--flag-pink);
  border-color: var(--flag-pink);
  color: var(--on-pink);
}
.tile:nth-child(3n + 1):not(.tile-empty):not(.tile-warn) :is(.tile-label, .tile-sub),
.tile:nth-child(3n + 2):not(.tile-empty):not(.tile-warn) :is(.tile-label, .tile-sub) {
  color: inherit;
  font-weight: 600;
}
.tile-label {
  font-size: 0.8rem;
  color: var(--text-2);
  font-weight: 550;
}
.tile-value {
  font-size: 1.25rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.tile-sub {
  font-size: 0.78rem;
  color: var(--muted);
}
.tile-warn {
  border-color: var(--warn);
  background: var(--warn-soft);
}
.tile-warn .tile-value {
  color: var(--warn);
}
/* An empty tile reads as a gentle prompt, not a missing number. */
.tile-empty {
  border-style: dashed;
  border-color: var(--border-strong);
  background: transparent;
  box-shadow: none;
}
.tile-empty .tile-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}
.dashboard > .section-title + .tiles {
  margin-top: 10px;
}
.hero-greeting {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--accent);
}
.hero-milestone {
  display: inline-flex;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  align-items: center;
  gap: 6px;
  margin: 12px 0 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--flag-blue);
  color: var(--on-blue);
  font-size: 0.88rem;
  font-weight: 600;
}
.hero-start {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  max-width: 520px;
}
.hero-start input {
  flex: 1 1 180px;
  width: auto;
}
.hero-start .hint {
  margin: 0;
}
.lab-values-wrap {
  container-type: inline-size;
  margin-top: 12px;
}
.lab-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  /* Equal rows, so a box without a range pill matches the ones with one. */
  grid-auto-rows: 1fr;
  gap: 10px;
}
.lab-values[data-n='1'] {
  grid-template-columns: minmax(0, 1fr);
}
.lab-values[data-n='2'] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.lab-values[data-n='3'] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
/* Too narrow for 4 (or 3) across: two balanced columns. */
@container (max-width: 520px) {
  .lab-values[data-n='4'] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@container (max-width: 340px) {
  .lab-values[data-n='3'] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.lab-value {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
}
/* Kept so the other results stay in their spots (see lab tiles). */
.lab-value-none {
  background: none;
  border: 1.5px dashed var(--border);
}
.lab-name {
  font-size: 0.8rem;
  color: var(--text-2);
  font-weight: 550;
}
.lab-num {
  font-size: 1.35rem;
  font-weight: 700;
}
.lab-unit {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}
.regimen h3 {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--text-2);
}
/* On its own card (no lab results beside it). */
.card > .regimen:first-child h3 {
  margin-top: 0;
}
.mini-title {
  font-size: 0.9rem;
  margin: 0 0 4px;
}
.insights {
  display: grid;
  gap: 10px;
}
@media (min-width: 900px) {
  .insights {
    grid-template-columns: 1fr 1fr;
  }
}
.insight {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--info);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.insight-attention {
  border-left-color: var(--warn);
}
.insight-ok {
  border-left-color: var(--ok);
}
.insight-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.insight-head h3 {
  margin: 0 0 6px;
  font-size: 0.98rem;
}
.insight-badge {
  display: inline-flex;
  color: var(--info);
  margin-top: 1px;
}
.insight-attention .insight-badge {
  color: var(--warn);
}
.insight-ok .insight-badge {
  color: var(--ok);
}
.insight p {
  color: var(--text-2);
  font-size: 0.92rem;
}
/* claims & citations */
.claim {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 0.88rem;
}
.claim-compact {
  padding: 0;
  background: none;
  font-size: 0.82rem;
}
.claim-compact summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
}
.claim-compact summary::-webkit-details-marker {
  display: none;
}
.claim-compact summary::after {
  content: '';
  width: 6px;
  height: 6px;
  margin-left: 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s;
}
.claim-compact[open] summary::after {
  transform: translateY(1px) rotate(-135deg);
}
.claim-compact summary:hover {
  color: var(--text);
}
.claim-compact[open] {
  padding: 4px 12px 10px;
  border-radius: 10px;
  background: var(--surface-2);
}
.claim-compact[open] summary {
  margin-bottom: 4px;
}
.claim-text {
  display: block;
  margin: 0 0 4px;
  color: var(--text-2);
}
q.claim-text {
  font-style: italic;
}
.claim-src {
  font-size: 0.8rem;
}
.report-other {
  margin-top: 20px;
}
/* Claims sharing one source line. */
.claim-src + .claim-text {
  margin-top: 12px;
}
.cites {
  display: inline;
}
.cite {
  display: inline-block;
  margin-right: 8px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}
.cite-loc {
  color: var(--muted);
}
.disclaimer {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 28px !important;
}
/* Centered on the first line of text (14px icon, 1.5 × 0.8rem line). */
.disclaimer > svg {
  flex: none;
  margin-top: calc((1.2rem - 14px) / 2);
}
.callout {
  display: flex;
  gap: 6px;
  align-items: center;
  background: var(--accent-soft);
  padding: 8px 12px;
  border-radius: 10px;
}

/* ---------- tables ---------- */
.table-scroll {
  /* Positioned so absolutely positioned children (e.g. .sr-only headers) stay inside
     the scroll box instead of widening the page. */
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.table th,
.table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th {
  font-weight: 600;
  color: var(--text-2);
  font-size: 0.8rem;
}
.table th.num,
.table td.num {
  text-align: right;
  white-space: nowrap;
}
.row-reached td:first-child {
  font-weight: 650;
}
.row-reached {
  background: var(--accent-soft);
}
.row-actions {
  white-space: nowrap;
  text-align: right;
}
.notes-cell {
  max-width: 220px;
  color: var(--text-2);
}
.footnotes {
  font-size: 0.8rem;
  color: var(--text-2);
  padding-left: 22px;
}
.kv {
  display: grid;
  gap: 6px 16px;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  margin: 10px 0;
}
.kv-wide {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.kv dt {
  font-size: 0.78rem;
  color: var(--muted);
}
.kv dd {
  margin: 0;
  font-weight: 550;
}
/* An entry's labeled facts (factList): who changed a regimen, which lab, when results came back. */
.facts {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
/* Labeled like the Notes and Questions headings that often follow them. */
.facts dt {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.fact-aside {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}
.timeline {
  list-style: none;
  padding: 0;
  margin: 8px 0;
}
.timeline li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.bra {
  font-size: 1.1rem;
}

