/* The Portal is a tool, so it is drawn tighter than the front page, but it speaks in the front page's scale: the same faces, one step down. Six sizes carry every screen,
   and nothing reads below 12px.

     title    32px  display   a page's name
     section  20px  display   a panel's name
     body     15px  body      what is read: rows, names, sentences
     small    13.5px body     what is read second: hints, table cells, captions
     meta     12px  mono      labels, tags, units, ids, commands
     figure   28px  display   a number that is the point of its place                                  */

.cp {
  --t-title: 32px; --t-section: 20px; --t-body: 15px; --t-small: 13.5px; --t-meta: 12px; --t-figure: 28px;
  font: 400 var(--t-body)/1.5 var(--body);
}
.cp h1, .cp h2, .cp h3 { font-family: var(--display); letter-spacing: -.02em; line-height: 1.2; font-weight: 500; }
.cp h1 { font-size: var(--t-title); letter-spacing: -.03em; } .cp h2 { font-size: var(--t-section); } .cp h3 { font-size: var(--t-body); }
.cp .lbl { font-size: var(--t-meta); letter-spacing: .12em; }
.cp .num, .cp .mn { font: 500 var(--t-small)/1.3 var(--mono); font-variant-numeric: tabular-nums; }
.cp .big { font: 500 var(--t-figure)/1.1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* the viewport is the cockpit: the bar, then a frame that fills what is left and scrolls inside its panes */
.frame { height: calc(100vh - var(--bar-h)); height: calc(100dvh - var(--bar-h)); display: flex; overflow: hidden; }
.pane { min-width: 0; min-height: 0; overflow: auto; }

/* a panel: a head on a hairline and a body */
.panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--th-hair-2); background: var(--th-bg); transition: border-color .15s ease; }
.panel:hover { border-color: var(--th-hair); }
.ph { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px; border-bottom: 1px solid var(--th-hair-2); }
.ph h2 { flex: 1; display: flex; align-items: center; gap: 8px; }
.ph .l { font: 500 var(--t-meta)/1 var(--mono); color: var(--th-fg-3); letter-spacing: .1em; }
.ph .x { font: 400 var(--t-small)/1 var(--display); color: var(--th-fg-3); cursor: pointer; transition: color .15s ease; }
.ph .x:hover { color: var(--th-fg); }
.pb { padding: 16px 18px 18px; min-height: 0; overflow: auto; }
.pb.flush { padding: 0; }

/* a figure and what it is, side by side */
.kvs { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; align-items: baseline; }
.kvs dt { color: var(--th-fg-3); font-size: var(--t-small); white-space: nowrap; } .kvs dd { margin: 0; color: var(--th-fg); text-align: right; font: 500 var(--t-small)/1.4 var(--mono); }
.dl { display: grid; grid-template-columns: 9.5rem 1fr; gap: 8px 18px; font-size: var(--t-body); } .dl dt { color: var(--th-fg-3); } .dl dd { margin: 0; }

/* the dense table */
table.d { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
table.d th { position: sticky; top: 0; z-index: 1; padding: 10px 16px 10px 0; text-align: left; font: 500 var(--t-meta)/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--th-fg-3); background: var(--th-bg); border-bottom: 1px solid var(--th-hair); white-space: nowrap; cursor: default; }
table.d th:first-child, table.d td:first-child { padding-left: 18px; }
table.d th.s { cursor: pointer; } table.d th.s:hover { color: var(--th-fg); }
table.d td { padding: 11px 16px 11px 0; border-bottom: 1px solid var(--th-hair-2); color: var(--th-fg-2); vertical-align: middle; white-space: nowrap; }
table.d td:first-child { color: var(--th-fg); font-weight: 500; }
table.d td.r, table.d th.r { text-align: right; } table.d td:last-child, table.d th:last-child { padding-right: 18px; }
table.d tr.row { cursor: pointer; transition: background-color .12s ease; } table.d tr.row:hover td { background: rgb(var(--th-fg-rgb) / .04); }
table.d tr.sel td { background: rgb(var(--th-fg-rgb) / .07); }
table.d tr.dim td { opacity: .55; }
table.d select.in { width: auto; min-width: 5.6rem; padding: 2px 16px 2px 0; font-size: var(--t-small); }
table.d .mono { font-family: var(--mono); font-size: var(--t-meta); }

.tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--th-hair-2); overflow-x: auto; }
.tabs button { padding: 12px 12px 11px; font: 400 var(--t-body)/1 var(--display); color: var(--th-fg-3); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .12s ease, border-color .12s ease; white-space: nowrap; }
.tabs button:hover { color: var(--th-fg); } .tabs button[aria-selected="true"] { color: var(--th-fg); border-bottom-color: var(--th-fg); }
.tabs button .n { margin-left: 6px; font: 500 var(--t-meta)/1 var(--mono); color: var(--th-fg-3); }
.tabs .sp { flex: 1; }

.mini { display: grid; grid-template-columns: 8rem 1fr auto; gap: 14px; align-items: center; padding: 6px 0; font-size: var(--t-small); color: var(--th-fg-2); }
.mini .gauge { height: 4px; } .mini b { font: 500 var(--t-small)/1 var(--mono); color: var(--th-fg); min-width: 5.5rem; text-align: right; font-weight: 500; }
.gauge.warn i { background: var(--th-cost-prov); } .gauge.mid i { background: var(--pa); }
.hint { font-size: var(--t-small); color: var(--th-fg-3); line-height: 1.55; }

.btn.xs { font-size: var(--t-small); padding-bottom: 2px; }
.cp .btn { font-size: var(--t-body); }
.cp .in { font-size: var(--t-body); padding: 7px 0; }
.cp .chips button { font-size: var(--t-small); }
.tag { font: 500 var(--t-meta)/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--th-fg-3); }
.tag.warn { color: var(--th-cost-prov); } .tag.ok { color: var(--th-cost-drift); }
.sw { display: inline-flex; gap: 14px; align-items: center; } .sw button { padding: 1px 0; font: 400 var(--t-small)/1.2 var(--display); color: var(--th-fg-3); border-bottom: 1px solid transparent; } .sw button[aria-pressed="true"] { color: var(--th-fg); border-bottom-color: var(--th-fg); }
.logbox { overflow: auto; padding: 10px 18px; font: 500 var(--t-meta)/1.7 var(--mono); color: var(--th-fg-2); }
.logbox div { white-space: nowrap; animation: fade .3s ease both; } .logbox .WARN { color: var(--pa); } .logbox .ERROR { color: var(--th-cost-prov); } .logbox .t { color: var(--th-fg-3); margin-right: 10px; } .logbox .f { color: var(--th-fg); margin-right: 10px; }
.resp { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--th-hair-2); font: 500 var(--t-meta)/1.6 var(--mono); color: var(--th-fg-2); white-space: pre-wrap; animation: rise .3s var(--ease) both; } .resp b { color: var(--th-fg); }
.dns { padding: 10px 12px; border: 1px solid var(--th-hair-2); font: 500 var(--t-meta)/1.6 var(--mono); color: var(--th-fg-2); }
.hist { list-style: none; margin: 0; padding: 0; } .hist li { display: flex; gap: 14px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--th-hair-2); font-size: var(--t-small); color: var(--th-fg-2); } .hist li b { font: 500 var(--t-meta)/1 var(--mono); color: var(--th-fg); min-width: 2.8rem; } .hist li .grow { flex: 1; }
.cp .modal { font-size: var(--t-body); } .cp .modal h3 { font-size: var(--t-section); }
.live { animation: tick .5s ease; } @keyframes tick { 0% { opacity: .35; } 100% { opacity: 1; } }
@media (max-width: 900px) { .frame { flex-direction: column; height: auto; overflow: visible; } }
