/* FRANK on the Lab271 design system. lab271/ holds the generated tokens and web kit,
   copied unchanged; this file only composes them. Fonts: the token stack names
   TT Interphases but the licensed binaries are not shipped (fallbacks apply). */
@import "lab271/colors.css";
@import "lab271/typography.css";
@import "lab271/spacing.css";
@import "lab271/shape.css";
@import "lab271/motion.css";
@import "lab271/base.css";
@import "lab271/lab271-ui.css";

* { box-sizing: border-box; }
:focus-visible { outline: 2px solid var(--c-tq); outline-offset: 2px; }
.mono { font-family: var(--lab-type-family-mono); }
.bs { color: var(--c-tq-text); }

/* header: title + mono eyebrow, the beam rule is the surface's one device */
header {
  display: flex; flex-wrap: wrap; gap: var(--lab-space-2); align-items: flex-end; justify-content: space-between;
  padding: var(--lab-space-3) var(--lab-space-4) var(--lab-space-2);
}
.brand .lab-eyebrow { display: block; margin-bottom: 4px; }
.brand h1 {
  margin: 0; font-size: var(--lab-type-size-h2); font-weight: 900;
  letter-spacing: var(--lab-type-tracking-tight); line-height: var(--lab-type-leading-display);
}
#auth { display: flex; flex-wrap: wrap; gap: var(--lab-space-1); align-items: center; flex: 1 1 320px; justify-content: flex-end; }
#auth .lab-input { flex: 1 1 200px; max-width: 320px; }
.beam { display: flex; align-items: center; height: 8px; padding: 0 var(--lab-space-4); }
.beam::before { content: ""; flex: 1; height: 2px; background: var(--c-text); }
.beam svg { flex: none; display: block; }
.beam rect { fill: var(--c-text); }
.beam rect.a { fill: var(--c-tq); }

/* tabs: lab-nav, the selected tab earns the backslash */
.lab-nav { padding: 0 var(--lab-space-4); overflow-x: auto; }
.lab-nav button { background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap; transition: color var(--motion-fast) var(--motion-ease); }
.lab-nav button[aria-selected="true"] { color: var(--c-tq-text); }
.lab-nav button[aria-selected="true"]::before { content: "\\ "; }

main { padding: var(--lab-space-3) var(--lab-space-4) var(--lab-space-5); }
select.lab-input { width: auto; padding-right: 8px; }
textarea.lab-input { font-family: var(--lab-type-family-mono); font-size: 13px; line-height: 1.6; }
.lab-btn { height: 40px; padding: 0 18px; }
.row { display: flex; flex-wrap: wrap; gap: var(--lab-space-1); align-items: center; margin: 12px 0; }
.row .lab-input:not(select) { flex: 1 1 220px; min-width: 0; width: auto; }
.row label { display: inline-flex; gap: var(--lab-space-1); align-items: center; }
.note, .row label { font-family: var(--lab-type-family-mono); font-size: var(--lab-type-size-small); color: var(--c-muted); }
p.note { max-width: 72ch; }
.note code { color: var(--c-text); }
.pill { font-size: 11px; }

/* statistics */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: var(--lab-space-2) 0; }
.tile, .card {
  background: var(--c-canvas); border: 1px solid var(--c-border); min-width: 0;
  border-radius: var(--lab-shape-radius-card) var(--lab-shape-radius-card) var(--lab-shape-radius-card) 0;
}
/* the straight corner rotates across siblings */
.tile:nth-child(4n+2), .card:nth-child(4n+2) { border-radius: 0 var(--lab-shape-radius-card) var(--lab-shape-radius-card) var(--lab-shape-radius-card); }
.tile:nth-child(4n+3), .card:nth-child(4n+3) { border-radius: var(--lab-shape-radius-card) 0 var(--lab-shape-radius-card) var(--lab-shape-radius-card); }
.tile:nth-child(4n+4), .card:nth-child(4n+4) { border-radius: var(--lab-shape-radius-card) var(--lab-shape-radius-card) 0 var(--lab-shape-radius-card); }
.tile { padding: var(--lab-space-2) 20px; }
.tile .v { font-size: 30px; font-weight: 900; letter-spacing: var(--lab-type-tracking-tight); font-variant-numeric: tabular-nums; }
.tile .k { font-family: var(--lab-type-family-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--c-muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--lab-space-2); }
.card { padding: 18px 20px; }
.card h3 { margin: 0 0 10px; font-family: var(--lab-type-family-mono); font-weight: 400; font-size: 11px; letter-spacing: 0.08em; color: var(--c-tq-text); }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; font-size: var(--lab-type-size-small); margin: 6px 0; }
.bar .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .n { font-family: var(--lab-type-family-mono); font-variant-numeric: tabular-nums; color: var(--c-muted); }
.bar .track { grid-column: 1 / -1; height: 6px; background: var(--c-panel); border-radius: 3px; }
.bar .fill { height: 100%; background: var(--c-tq); border-radius: 3px; }

/* tables: lab-table, compact for data */
.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: var(--lab-type-size-small); }
th {
  font-family: var(--lab-type-family-mono); font-weight: 400; font-size: 11px; letter-spacing: 0.08em;
  color: var(--c-muted); text-align: left; padding: 0 16px 8px 0; border-bottom: 1px solid var(--c-text); white-space: nowrap;
}
td { padding: 8px 16px 8px 0; border-bottom: 1px solid var(--c-border); white-space: nowrap; }
td.num { text-align: right; font-family: var(--lab-type-family-mono); font-variant-numeric: tabular-nums; }

.error { font-family: var(--lab-type-family-mono); font-size: var(--lab-type-size-small); }
.error::before { content: "error \\ "; color: var(--c-tq-text); }
code { font-family: var(--lab-type-family-mono); font-size: 13px; }

/* footer: the co-brand lockup is the required endorsement */
footer {
  display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between;
  margin: 0 var(--lab-space-4); padding: 18px 0 22px; border-top: 1px solid var(--c-border);
  font-family: var(--lab-type-family-mono); font-size: 12px; color: var(--c-muted);
}
footer img { height: 34px; width: auto; display: block; }
.on-dark, [data-theme="dark"] .on-light { display: none; }
[data-theme="dark"] .on-dark { display: block; }

@media (max-width: 640px) {
  header, .beam, .lab-nav, main { padding-left: var(--lab-space-2); padding-right: var(--lab-space-2); }
  footer { margin: 0 var(--lab-space-2); }
  .lab-nav { gap: 18px; }
}

/* explore: filter chips, clickable rows, the sliding detail pane */
.chips:empty { display: none; }
.chip {
  display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px;
  border: 1px solid var(--c-border); border-radius: 99px; background: var(--c-canvas);
  color: var(--c-text); font-family: var(--lab-type-family-mono); font-size: 12px; cursor: pointer;
}
.chip::after { content: "×"; color: var(--c-muted); }
tr.go { cursor: pointer; }
tr.go:hover td { background: var(--c-panel); }
.link { background: none; border: 0; padding: 0; color: var(--c-tq-text); cursor: pointer; font: inherit; text-align: left; }
.link:hover { text-decoration: underline; }
.bar .label.link { color: inherit; }
.pane {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); z-index: 10;
  background: var(--c-canvas); border-left: 1px solid var(--c-border);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12); overflow-y: auto;
  padding: var(--lab-space-2) var(--lab-space-3) var(--lab-space-4);
  transform: translateX(100%); visibility: hidden;
  transition: transform var(--motion-fast) var(--motion-ease), visibility 0s linear var(--motion-fast);
}
.pane.open { transform: none; visibility: visible; transition: transform var(--motion-fast) var(--motion-ease); }
.pane-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.pane h2 { margin: 0 0 4px; font-size: var(--lab-type-size-h3, 20px); overflow-wrap: anywhere; }
.pane .kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.pane .kpis .tile { padding: 10px 14px; }
.pane .kpis .tile .v { font-size: 22px; }
.pane h3 { margin: 18px 0 6px; font-family: var(--lab-type-family-mono); font-weight: 400; font-size: 11px; letter-spacing: 0.08em; color: var(--c-tq-text); }
.spark { display: block; width: 100%; height: 48px; }
.spark rect { fill: var(--c-tq); }
.spark rect.zero { fill: var(--c-border); }
@media (max-width: 640px) { .pane { width: 100%; padding: var(--lab-space-2); } }

/* about: the annotated example. One turquoise ramp, public lightest to
   partner strongest (an order, not categories); every line also names its
   status, so the colour is never the only cue. */
main section h2 { margin: var(--lab-space-3) 0 6px; font-size: var(--lab-type-size-h3, 20px); }
main section h2:first-child { margin-top: 0; }
.card p { margin: 0; font-size: var(--lab-type-size-small); }
.chips-static { gap: 8px; }
.mark { padding: 2px 10px 2px 8px; font-family: var(--lab-type-family-mono); font-size: 12px; border-left: 4px solid; }
.mark-public { border-color: color-mix(in srgb, var(--c-tq) 25%, transparent); }
.mark-observer { border-color: color-mix(in srgb, var(--c-tq) 45%, transparent); }
.mark-contributor { border-color: color-mix(in srgb, var(--c-tq) 70%, transparent); }
.mark-partner { border-color: var(--c-tq); }
.mark-never { border-left-style: dashed; border-color: var(--c-muted); color: var(--c-muted); }
pre.yaml, pre.curl {
  margin: 12px 0 0; padding: 12px 0; overflow-x: auto; background: var(--c-panel);
  font-family: var(--lab-type-family-mono); font-size: 13px; line-height: 1.7;
}
pre.curl { padding: 10px 14px; white-space: pre; }
.y-line { display: flex; gap: 0; padding: 0 14px 0 10px; border-left: 4px solid transparent; white-space: pre; }
.y-code { white-space: pre; }
.rec-head { display: flex; align-items: center; gap: 8px; margin: 18px 0 0; }
.pane .rec-head h3 { margin: 0 auto 0 0; }
.y-line.mark-never .y-val { text-decoration: line-through; }
.y-mark { margin-left: auto; padding-left: 24px; color: var(--c-muted); font-size: 11px; }
.y-key { color: var(--c-text); font-weight: 700; }
.y-val { color: var(--c-tq-text-soft); }
.y-num, .y-bool { color: var(--c-violet); }
.y-str { color: var(--c-tq-text-soft); }
.y-time { color: var(--c-cobalt); }
.y-id { color: var(--c-magenta); }
.y-dash, .y-com { color: var(--c-muted); }

/* api: one card per endpoint */
.api-tag { margin: var(--lab-space-3) 0 8px; font-family: var(--lab-type-family-mono); font-weight: 400; font-size: 12px; color: var(--c-tq-text); }
.endpoint { margin: 0 0 12px; }
.endpoint > p { margin: 6px 0 0; }
.endpoint-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.endpoint-head code { font-size: 14px; overflow-wrap: anywhere; }
.method { font-family: var(--lab-type-family-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--c-tq-text); }
.pill.locked { opacity: 0.5; }
#pane-body > .lab-btn:first-child { margin-bottom: 8px; }

/* live (#186): rows that arrived since the previous poll */
tr.fresh td { background: color-mix(in srgb, var(--c-tq) 14%, transparent); }
@media (prefers-reduced-motion: no-preference) {
  tr.fresh td { animation: fresh 15s ease-out forwards; }
  @keyframes fresh { from { background: color-mix(in srgb, var(--c-tq) 30%, transparent); } }
}

/* #192: common infrastructure is shown, greyed; #193: what lists say */
tr.common td { color: var(--c-muted); }
tr.common td .label { color: var(--c-muted); }
p.listed-reference { color: var(--c-text); }
.badge {
  margin-left: 6px; padding: 0 6px; border: 1px solid var(--c-tq); border-radius: 8px;
  font-family: var(--lab-type-family-mono); font-size: 11px; color: var(--c-tq-text);
}
