/* database.css · P29, Quorum: the layout of the cluster page and the
   fuzzer on the design system's tokens. The buttons, select, segmented
   controls, switches, fields, banner, badges, properties, progress and table
   are the design system's; this file places them and draws what a database
   page has that the design system does not: the disk's flushed share, the
   B+tree's pages and the legend of the drawing. Every value is a token. */

.q { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; background: var(--paper); overflow: hidden; }
.q-stage { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; padding: 12px 16px 16px; overflow: auto; }
.q-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.q-run, .q-clock { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.q-seed { width: 140px; }
.q-seed-label { padding-left: 8px; color: var(--ink-3); font-size: var(--fs-12); line-height: var(--lh-12); }
.q-seed > input { font-variant-numeric: tabular-nums; }
.q-cluster { display: block; width: 100%; height: 420px; min-height: 320px; border-radius: var(--r-contain); background: var(--ground); box-shadow: inset 0 0 0 var(--px) var(--line-2); touch-action: manipulation; }
.q-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--ink-3); font-size: var(--fs-11); line-height: var(--lh-11); }
.q-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.q-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.q-legend-log b { width: 7px; height: 7px; background: var(--blue-500); }
.q-legend-log.q-open b { background: transparent; box-shadow: inset 0 0 0 1.2px var(--blue-500); }
.q-faults { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.q-faults > [data-r="option"] { margin-left: 8px; }

.q-history { display: flex; flex-direction: column; gap: 6px; }
.q-history-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.q-history-head h2 { margin: 0; font-size: var(--fs-13); line-height: var(--lh-13); font-weight: var(--fw-550); color: var(--ink); }
.q-stats { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.q-timeline { display: block; width: 100%; height: 132px; border-radius: var(--r-value); background: var(--ground); box-shadow: inset 0 0 0 var(--px) var(--line-2); cursor: col-resize; }
.q-op { margin: 0; min-height: var(--lh-12); font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.q-history-foot { display: flex; flex-wrap: wrap; gap: 16px; }

/* the selected node */
.q-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; padding: 16px; overflow: auto; background: var(--ground); box-shadow: inset var(--px) 0 0 var(--line-2); }
.q-node-head { display: flex; align-items: center; gap: 8px; }
.q-node-head h2 { margin: 0; font-size: var(--fs-16); line-height: var(--lh-16); font-weight: var(--fw-550); color: var(--ink); }
.q-props { display: grid; gap: 2px; margin-top: 8px; }
.q-props [data-part="value"] { font-variant-numeric: tabular-nums; }
.q-h { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 6px; font-size: var(--fs-12); line-height: var(--lh-12); font-weight: var(--fw-550); color: var(--ink-2); }
.q-sub { font-weight: var(--fw-450); color: var(--ink-3); }
.q-disk { display: grid; gap: 6px; }
.q-file { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 2px 8px; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.q-file > span:last-child { grid-column: 2; color: var(--ink-3); }
.q-bar { position: relative; height: 6px; border-radius: var(--r-press); background: var(--orange-300); overflow: hidden; }
.q-bar > i { position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--green-500); }
.q-note { margin: 8px 0 0; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-3); }
.q-tree { display: flex; flex-direction: column; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.q-tree-row { display: flex; justify-content: center; gap: 4px; min-width: max-content; }
.q-page { padding: 2px 5px; border-radius: var(--r-key); background: var(--raised); box-shadow: inset 0 0 0 var(--px) var(--line-3); font-size: var(--fs-11); line-height: var(--lh-11); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.q-page.q-leaf { background: var(--paper); }
.q-client { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; box-shadow: 0 calc(-1 * var(--px)) 0 var(--line-2); }
.q-client-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.q-client-acts { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 -4px; }
.q-values { margin: 0; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: pre; }
.q-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* the fuzzer */
.q-fuzz { flex: 1; min-height: 0; overflow: auto; padding: 24px 24px 40px; background: var(--paper); }
.q-fuzz-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; max-width: 1100px; margin-bottom: 16px; }
.q-fuzz-head h1 { margin: 0 0 6px; font-size: var(--fs-20); line-height: var(--lh-20); font-weight: var(--fw-550); color: var(--ink); }
.q-fuzz-head p { max-width: 640px; margin: 0; font-size: var(--fs-13); line-height: var(--lh-13); color: var(--ink-2); }
.q-fuzz-acts { display: flex; align-items: center; gap: 8px; }
.q-fuzz [data-part="table"] { max-width: 1100px; }
.q-fuzz td [data-r="progress"] { width: 140px; margin-bottom: 4px; }
.q-count { font-size: var(--fs-11); line-height: var(--lh-11); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.q-fuzz-sum { max-width: 1100px; margin: 12px 0 0; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-3); font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .q { grid-template-columns: minmax(0, 1fr); overflow: auto; }
  .q-stage { overflow: visible; }
  .q-side { box-shadow: inset 0 var(--px) 0 var(--line-2); overflow: visible; }
  .q-cluster { height: 340px; }
}
