/* Alchemy and Observatory. Monochrome by default; colour only carries data or state. */

/* ── Alchemy ── */
.lab-cols { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.lab-cols > div { min-width: 0; }
.lab-sec > summary { padding: 6px 0; border-top: 1px solid var(--line); }
.lab-sec[open] > summary { margin-bottom: 10px; }
.lab-card { border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 12px; padding: 8px 12px 10px; min-width: 0; }
.lab-card > legend { font-weight: 600; font-size: 0.85rem; padding: 0 6px; }
.lab-cols h4, .lab-grapher h4 { font-size: 0.8rem; color: var(--muted); margin: 14px 0 6px; }
.lab-small { font-size: 0.85rem; }
.lab-cap { font-size: 0.8rem; font-weight: 600; margin: 10px 0 4px; }
.lab-cap > span { font-weight: 400; }
.lab-plot { height: 150px; touch-action: auto; }
.lab-plot.short { height: 92px; margin-bottom: 8px; }
.lab-bars { height: 96px; cursor: crosshair; }
.lab-barsed { margin: 0 0 10px; }
.lab-barsed .row { margin-top: 6px; }
.lab-scroll { overflow: auto; max-height: 16rem; }
.lab-rows { margin: 0 0 10px; }
.lab-rows table input.num, .lab-scroll table input.num { width: 6em; }
.lab-rows > button { margin-top: 6px; }
.lab-full { flex: 1 1 100%; min-width: 0; }
.lab-verdict { position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 2px 0 6px; }
.lab-cols .list > li > .grow { flex-basis: 6rem; }
.lab-status { font-size: 0.85rem; color: var(--muted); margin: 6px 0 0; min-height: 1.2em; }
/* A left rule and the word "Caution" carry the meaning; the colour only supports it. */
.lab-caution { border-left: 3px solid var(--warn); padding: 4px 0 4px 10px; margin: 6px 0 10px; font-size: 0.85rem; }
.lab-caution ul { margin: 4px 0 0; padding-left: 1.2em; }
.lab-proposal:not(:empty) { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border: 1px solid var(--ink); border-radius: var(--radius); padding: 8px 10px; margin: 0 0 20px; }
.lab-proposal .grow { flex: 1 1 12rem; }
:root:not([data-mode="explorer"]) .lab-explorer, :root[data-mode="architect"] .lab-not-architect { display: none !important; }

.lab-keys { position: relative; display: flex; height: 112px; touch-action: none; user-select: none; -webkit-user-select: none; margin-bottom: 4px; }
.lab-key { flex: 1 1 0; min-width: 0; min-height: 0; padding: 0 0 4px; border-radius: 0 0 3px 3px; background: var(--panel); border: 1px solid var(--ink); margin-right: -1px; display: flex; align-items: flex-end; justify-content: center; font-size: 0.7rem; color: var(--muted); touch-action: none; }
.lab-key.black { position: absolute; top: 0; width: 4.2%; height: 62%; transform: translateX(-50%); background: var(--ink); color: var(--bg); z-index: 1; margin: 0; }
/* Pressed keys change shape (inset bar) as well as tone. */
.lab-key[aria-pressed="true"] { background: var(--soft); box-shadow: inset 0 -8px 0 var(--accent); }
.lab-key.black[aria-pressed="true"] { background: var(--muted); }
.lab-key:focus-visible { z-index: 2; outline-offset: -3px; }

.lab-xy { position: relative; width: min(100%, 12rem); aspect-ratio: 1; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); touch-action: none; margin: 0 0 10px; cursor: crosshair; }
.lab-xy::before, .lab-xy::after { content: ""; position: absolute; background: var(--line); }
.lab-xy::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.lab-xy::after { top: 50%; left: 0; right: 0; height: 1px; }
.lab-xy > i { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--ink); z-index: 1; }

.lab-graph { overflow: auto; height: 420px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 8px; }
.lab-graph-inner { position: relative; width: 1460px; height: 780px; }
.lab-wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.lab-node { position: absolute; width: 132px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--bg); font-size: 0.8rem; }
.lab-node.sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.lab-node-head { display: block; width: calc(100% - 26px); text-align: left; border: 0; border-radius: 0; background: none; padding: 4px 6px; min-height: 1.9rem; font-weight: 600; cursor: grab; touch-action: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-node.sel .lab-node-head::before { content: "● "; }
.lab-node-x { position: absolute; right: 0; top: 0; min-height: 1.9rem; width: 26px; padding: 0; }
.lab-ports { display: flex; justify-content: space-between; gap: 4px; padding: 2px 0 4px; border-top: 1px solid var(--line); }
.lab-ports > div { display: flex; flex-direction: column; gap: 2px; }
.lab-ports > div:last-child { align-items: flex-end; }
.lab-port { min-height: 1.5rem; padding: 0 6px; font-size: 0.72rem; border-radius: 0 999px 999px 0; border-left: 0; touch-action: none; }
.lab-port.out { border-radius: 999px 0 0 999px; border-left: 1px solid var(--line); border-right: 0; cursor: crosshair; }
.lab-port.out[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.lab-port.out[aria-pressed="true"]::after { content: " →"; }

.lab-heat th, .lab-heat td { white-space: nowrap; }
.lab-heat td { min-width: 3.4em; }

/* ── Observatory ── */
.obs-chips h4 { font-size: 0.8rem; color: var(--muted); margin: 10px 0 6px; }
.obs-one { display: none; }
.obs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); gap: 20px; }
.obs-tile { min-width: 0; }
.obs-tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.obs-tile-head h4 { font-size: 0.9rem; }
.obs-cv { height: 210px; touch-action: auto; }
.obs-about { font-size: 0.8rem; margin: 4px 0 0; }
.obs-read { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; font-variant-numeric: tabular-nums; }
.obs-read dt { color: var(--muted); font-size: 0.8rem; }
.obs-read dd { margin: 0; font-weight: 600; min-width: 5.5em; }
.obs-quality { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-bottom: 12px; }
.obs-quality .field { margin: 0; grid-template-columns: auto auto; }
.obs-full { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column; padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); gap: 8px; }
.obs-full .obs-cv.big { flex: 1 1 auto; height: auto; min-height: 0; }
.obs-full-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.obs-full-bar .grow { flex: 1 1 8rem; font-weight: 600; }
.obs-transport { display: flex; align-items: center; gap: 8px; }
.obs-transport[hidden] { display: none; }
.obs-wide { min-width: 4.5rem; padding: 0 0.8em; }
@media (max-width: 700px) {
  .obs-chips { display: none; }
  .obs-one { display: block; }
  .obs-cv { height: 240px; }
  .lab-key.black { width: 5.4%; }
}
