/* Lab notes demo: runs on the left, the documents Kelvin makes from them on the right. */

.kd-notes { container-type: inline-size; }
.kd-notes [hidden] { display: none !important; }

.kd-notes-frame {
  display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 1.4em; align-items: center;
  aspect-ratio: 4 / 3; padding: 1.5em; overflow: hidden;
  font: 400 clamp(11px, 2.05cqw, 14px) / 1.45 var(--font);
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: 16px;
}

/* the week's runs */
.kd-notes-runs { display: grid; gap: 0.55em; align-content: center; }
.kd-notes-head { margin-bottom: 0.3em; font: 500 0.85em/1.3 var(--mono); color: var(--text-3); }
.kd-notes-run {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 0.6em;
  padding: 0.6em 0.8em; border: 1px solid var(--line); border-radius: 0.7em; background: var(--panel);
  opacity: 0; transform: translateY(0.4em); transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.kd-notes-run.on { opacity: 1; transform: none; }
.kd-notes-ok { grid-row: 1 / 3; align-self: center; width: 0.55em; height: 0.55em; border-radius: 50%; background: var(--ok); }
.kd-notes-run b { font: 500 0.95em/1.4 var(--mono); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd-notes-run span:not(.kd-notes-ok) { grid-column: 2; font-size: 0.85em; color: var(--text-3); }
.kd-notes-run time { grid-column: 3; grid-row: 1; font-size: 0.85em; color: var(--text-3); font-variant-numeric: tabular-nums; }
.kd-notes-ask {
  justify-self: end; margin-top: 0.4em; max-width: 92%; padding: 0.6em 0.9em; border-radius: 1.1em;
  background: #1c2836; color: var(--text); font-size: 0.95em;
  opacity: 0; transform: translateY(0.4em); transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.kd-notes-ask.on { opacity: 1; transform: none; }

/* the documents */
.kd-notes-right { display: grid; gap: 1em; }
.kd-notes-stack { position: relative; aspect-ratio: 16 / 11; }
.kd-notes-doc {
  position: absolute; left: 6%; right: 6%; top: 8%; bottom: 8%; display: flex; flex-direction: column; gap: 0.35em;
  padding: 0.9em 1em; border-radius: 0.6em; overflow: hidden;
  background: #f6f8fb; color: #14202c; box-shadow: 0 0.8em 2em rgba(0, 0, 0, 0.45);
  opacity: 0; transform: translateY(1.2em) scale(0.96);
  transition: opacity 0.5s var(--ease), transform 0.7s var(--ease);
}
.kd-notes-stack.on .kd-notes-doc { opacity: 1; transform: none; }
.kd-notes-doc.note { background: #e8f2fc; }
.kd-notes-doc.report { background: #ffffff; }
.kd-notes-stack.fan .kd-notes-doc.note { transform: translate(-7%, 7%) rotate(-6deg); }
.kd-notes-stack.fan .kd-notes-doc.report { transform: translate(-2%, 3%) rotate(-2deg); }
.kd-notes-stack.fan .kd-notes-doc.slide { transform: translate(5%, -4%) rotate(2deg); }
.kd-notes-title { font-weight: 600; font-size: 0.92em; line-height: 1.25; }
.kd-notes-sub { font-size: 0.75em; color: #566578; }
.kd-notes-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.15fr 1fr; gap: 0.6em; align-items: center; }
.kd-notes-body ul { margin: 0; padding-left: 1.1em; font-size: 0.72em; line-height: 1.5; color: #3c4a58; }
.kd-notes-plot { width: 100%; height: auto; overflow: visible; }
.kd-notes-plot .ax { stroke: #b8c5d3; stroke-width: 1; fill: none; }
.kd-notes-plot .ln { stroke: #2f6fb0; stroke-width: 1.8; fill: none; stroke-linejoin: round; }
.kd-notes-plot.thin { width: 70%; margin: 0.2em 0; }
.kd-notes-doc i { display: block; height: 0.42em; border-radius: 1em; background: #d9e1ea; }
.kd-notes-doc i.short { width: 62%; }

.kd-notes-files { display: flex; flex-wrap: wrap; gap: 0.45em; justify-content: center; opacity: 0; transition: opacity 0.5s var(--ease); }
.kd-notes-files.on { opacity: 1; }
.kd-notes-files span {
  padding: 0.3em 0.75em; border-radius: 999px; border: 1px solid var(--line-hi);
  font: 400 0.8em/1.3 var(--mono); color: var(--text-2);
}

@container (max-width: 520px) {
  .kd-notes-frame { grid-template-columns: minmax(0, 1fr); aspect-ratio: auto; gap: 1.2em; font-size: clamp(11px, 3.4cqw, 13px); }
}

@media (prefers-reduced-motion: reduce) {
  .kd-notes *, .kd-notes *::before, .kd-notes *::after { transition: none !important; animation: none !important; }
}
