/* The console's fonts, Figtree for text and Source Code Pro for data and code, ship with the framework
   (static/fonts, Latin subsets, SIL Open Font License beside each), so the console needs no internet access.
   Until they load, the system fonts show (font-display: swap): the console never waits for them. */
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/figtree-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Code Pro";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/source-code-pro-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Design tokens: light theme is the default, dark theme is opt-in via #theme-switch. */
:root {
  --font-sans: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Source Code Pro", ui-monospace, "SF Mono", Menlo, "Cascadia Mono",
    Consolas, "Liberation Mono", monospace;

  --radius: 6px;
  --gutter: 16px;
  --row-height: 36px;

  --background: #edf0f4;
  --surface: #ffffff;
  --surface-muted: #f8f9fa;
  /* diagram cards: at rest, and highlighted (pointed at, or lit with the one that is) */
  --flow-node-bg: #f8f9fa;
  --flow-node-lit: #ffffff;
  --border: #e2e5e9;
  --border-strong: #cdd2d8;
  --text-color: #14181f;
  --text-muted: #59636f;
  --text-subtle: #8b939e;
  --accent: #24579f;
  --accent-soft: #e7edf6;
  --row-hover: #e4eaf3;
  --amber: #d48a10;

  --success-text: #17663a;
  --success-bg: #e5f3ea;
  --success-dot: #22a05a;
  --warning-text: #8a5200;
  --warning-bg: #fcf0db;
  --danger-dot: #d0453a;
  --danger-text: #a52a21;
  --danger-bg: #fbe6e4;
  /* a type's kind: its icon's colour, as well as its shape (cylinder, chip, f). Tableau-style mid-tones, the
     same in both themes, clear of the state colours (green, amber, red), each 3:1 or more on the panels */
  --kind-task: #4e79a7;
  --kind-ingested: #8a817c;
  --kind-computed: #d4628f;
  /* chart marks: checked for lightness and contrast against the surface (the dataviz validator) */
  --chart-accent: #24579f;
  --chart-warn: #b87708;
  --neutral-text: #4b5563;
  --neutral-bg: #edeff2;

  --json-key: #1d5bbf;
  --json-string: #17663a;
  --json-number: #a3361b;
  --json-boolean: #6b3fa0;
  --json-null: #8b939e;

  --switch-text: "Dark";
}

/* the page itself is dark too, so no light canvas shows while a page loads (set in each page's head) */
html[data-theme="dark"],
html[data-theme="dark"] body {
  background: #080b0f;
  color-scheme: dark;
}

.theme-switch:checked ~ #admin {
  --background: #080b0f;
  --surface: #131921;
  --surface-muted: #18202a;
  --flow-node-bg: #131921;
  --flow-node-lit: #0b1015;
  --border: #232c37;
  --border-strong: #2e3845;
  --text-color: #e5e8ec;
  --text-muted: #9aa3ae;
  --text-subtle: #6a7480;
  --accent: #8aaee0;
  --accent-soft: #1a2638;
  --row-hover: #1f2b3c;
  --amber: #e9a83a;

  --success-text: #7dcf98;
  --success-bg: #142c1d;
  --success-dot: #3fbf70;
  --warning-text: #eab35a;
  --warning-bg: #33260f;
  --danger-dot: #e8635a;
  --danger-text: #f08a82;
  --danger-bg: #3a1714;
  --chart-accent: #6690d0;
  --chart-warn: #c4841a;
  --neutral-text: #b3bbc6;
  --neutral-bg: #222a34;

  --json-key: #5e9df0;
  --json-string: #7dcf98;
  --json-number: #f09b7d;
  --json-boolean: #c3a3ef;
  --json-null: #6a7480;

  --switch-text: "Light";
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "cv11" 1;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  color: var(--text-color);
  margin-top: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

pre,
code {
  font-family: var(--font-mono);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Theme switcher */
.theme-switch {
  /* Hides the checkbox */
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}

.switch-label,
.logout,
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-color);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.switch-label::before {
  content: var(--switch-text);
}

.switch-label:hover,
.logout:hover,
.btn:hover {
  background: var(--surface-muted);
  border-color: var(--text-subtle);
  text-decoration: none;
}

.btn-primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  filter: brightness(1.08);
}

/* In dark mode the accent is a light blue meant for text: primary buttons use the same pairing as
   the selected menu item (accent text on the soft accent) instead of a bright fill */
.theme-switch:checked ~ #admin .btn-primary {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.theme-switch:checked ~ #admin .btn-primary:hover {
  border-color: var(--accent);
  filter: none;
}

.btn svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.theme-switch:focus-visible ~ #admin .switch-label {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Layout */
.admin {
  display: grid;
  height: 100vh;
  grid-template-rows: 44px 1fr 24px;
  grid-template-columns: 196px 1fr;
  grid-template-areas: "header header" "nav main" "footer footer";
  z-index: 1;
  background: var(--background);
  color: var(--text-color);
}

.admin_header {
  display: flex;
  grid-area: header;
  align-items: center;
  height: 44px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

navigation-menu {
  grid-area: nav;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.admin_main {
  grid-area: main;
  padding: 20px 24px 32px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* pages use the full width; long text keeps its own measure (.page-intro) */
.admin_main > * {
  display: block;
}

/* Status bar */
footer {
  display: flex;
  grid-area: footer;
  justify-content: space-between;
  align-items: center;
  gap: var(--gutter);
  padding: 0 12px;
  color: var(--text-muted);
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 11.5px;
}

footer p {
  margin: 0;
}

.conn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-subtle);
}

.conn.connected .dot {
  background: var(--success-dot);
}

.conn.disconnected .dot {
  background: var(--danger-dot);
}

/* Header */
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 196px;
  height: 100%;
  padding: 0 16px;
  color: var(--text-color);
  border-right: 1px solid var(--border);
}

.logo:hover {
  text-decoration: none;
}

/* the Calseda mark, drawn as a mask so it takes a colour of the palette: the blue of tasks */
.logo-mark {
  display: inline-block;
  flex: none;
  width: 22px;
  height: 22px;
  background: var(--kind-task);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='5' cy='6' r='2.6'/%3E%3Ccircle cx='5' cy='20' r='2.6'/%3E%3Ccircle cx='21' cy='13' r='3.4' fill='black'/%3E%3Cpath d='M7.5 7.2C12 8.5 13 12 17.6 12.6M7.5 18.8C12 17.5 13 14 17.6 13.4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='5' cy='6' r='2.6'/%3E%3Ccircle cx='5' cy='20' r='2.6'/%3E%3Ccircle cx='21' cy='13' r='3.4' fill='black'/%3E%3Cpath d='M7.5 7.2C12 8.5 13 12 17.6 12.6M7.5 18.8C12 17.5 13 14 17.6 13.4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.logo h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.toolbar {
  display: flex;
  flex: 1;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
}

/* Navigation */
/* the button that opens the menu on narrow screens (see Responsive) */
.menu_toggle {
  display: none;
}

.menu {
  list-style-type: none;
  margin: 0;
  padding: 12px 10px;
}

.menu_item + .menu_item {
  margin-top: 2px;
}

.menu_heading {
  margin: 16px 0 6px;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-subtle);
}

.menu_link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  color: var(--text-muted);
  font-weight: 500;
  border-radius: var(--radius);
}

.menu_link svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--text-subtle);
}

.menu_link:hover {
  color: var(--text-color);
  background-color: var(--surface-muted);
  text-decoration: none;
}

.menu_link[aria-current="page"] {
  color: var(--accent);
  background-color: var(--accent-soft);
}

.menu_link[aria-current="page"] svg {
  color: var(--accent);
}

/* Page header: title or breadcrumb trail, help, actions */
.page-head {
  display: flex !important;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  margin-bottom: 16px;
}

.page-head h1,
.admin_main h1 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.admin_main h1 {
  margin-bottom: 16px;
}

.page-head h1 {
  margin-bottom: 0;
}

.admin_main h1 a {
  color: var(--accent);
  font-weight: 500;
}

.admin_main h1 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.crumb-sep {
  color: var(--text-subtle);
  font-weight: 400;
}

.page-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.section-title {
  margin: 24px 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Metric strip: a single bordered row of cells divided by hairlines */
.dashboard {
  --column-count: 2;
  display: grid;
  grid-template-columns: repeat(var(--column-count), 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard_item {
  grid-column-end: span 2;
}

/* metric cards inside a panel */
.widget > .dashboard {
  margin: 0;
  padding: 16px;
}

.dashboard_item.full {
  grid-column: 1/-1;
}

.dashboard_item.col {
  grid-column-end: span 1;
}

@media screen and (min-width: 48rem) {
  .dashboard {
    --column-count: 4;
  }

  .dashboard.five {
    --column-count: 5;
  }
}

.card {
  height: 100%;
  padding: 12px 16px 14px;
  background: var(--surface);
  color: var(--text-color);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card h3 {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.card p {
  display: block;
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.card .sub {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-subtle);
}

.card p.waiting {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
}

.card .tooltip {
  display: block;
}

.meter {
  height: 6px;
  margin-top: 10px;
  background: var(--neutral-bg);
  border-radius: 3px;
  overflow: hidden;
}

.meter > span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--success-dot);
}

.meter.warn > span {
  background: var(--amber);
}

.meter.high > span {
  background: var(--danger-dot);
}

/* Panels */
.widget {
  position: relative;
  margin-bottom: 20px;
  background: var(--surface);
  color: var(--text-color);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.panel-head .note {
  font-size: 12px;
  color: var(--text-muted);
}

.notice {
  color: var(--text-muted);
}

.panel-body {
  padding: 14px;
}

.widget-table-overlay {
  overflow-x: auto;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 0;
  font-size: 12.5px;
  color: var(--text-color);
  font-variant-numeric: tabular-nums;
}

.table th {
  height: 32px;
  padding: 0 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  height: var(--row-height);
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table td.id,
.table td.idConvention {
  font-family: var(--font-mono);
  font-size: 12px;
}

.table td.role {
  width: 1%;
}

.table td.empty {
  color: var(--text-subtle);
  cursor: default;
}

.table-striped tbody tr.row-link {
  cursor: pointer;
}

.table-striped tbody tr.row-link td {
  transition: background-color 0.08s;
}

.table-striped tbody tr.row-link:hover td {
  background-color: var(--row-hover);
}

/* Clickable rows: a chevron appears on hover */
.table th.go,
.table td.go {
  width: 1%;
  padding: 0 12px 0 0;
}

.table td.go svg {
  display: block;
  width: 14px;
  height: 14px;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.12s, transform 0.12s;
}

.table-striped tbody tr.row-link:hover td.go svg {
  opacity: 1;
  transform: none;
}


/* The row for the page being shown, e.g. the current ID in the Identifiers table */
.table tbody tr.current td {
  font-weight: 600;
}

.table-striped tbody tr.waiting td.timestamp {
  color: var(--warning-text);
}

.table-lr td,
.table-lr th {
  padding: 0.55rem;
  border-top: 1px solid var(--border);
  text-align: left;
}

.table-lr td {
  font-family: var(--font-mono);
}

/* Forms */
input,
button,
select,
optgroup,
textarea {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.form-control {
  display: block;
  width: 50%;
  height: 30px;
  padding: 0 8px;
  font-size: 13px;
  color: var(--text-color);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  outline: 0;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border-radius: 10px;
  border: 2px solid var(--background);
}

/* Data display */
.timestamp {
  font-family: var(--font-mono);
  font-size: 12px;
}

.data-view {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--surface-muted);
  padding: 12px 14px;
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
  word-wrap: break-word;
}

.version-id {
  display: block;
  padding: 6px 14px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-subtle);
}

/* Status tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border-radius: 4px;
  color: var(--neutral-text);
  background-color: var(--neutral-bg);
}

.card .tag {
  margin-top: 5px;
}

.tag-entity {
  color: var(--neutral-text);
  background: var(--neutral-bg);
}

.tag-task {
  color: var(--kind-task);
  background-color: color-mix(in srgb, var(--kind-task) 14%, transparent);
}

.string {
  color: var(--json-string);
}
.number {
  color: var(--json-number);
}
.boolean {
  color: var(--json-boolean);
}
.null {
  color: var(--json-null);
}
.key {
  color: var(--json-key);
}

.live {
  color: inherit;
}

.waiting {
  color: var(--warning-text);
}

.notice {
  padding: 12px 14px;
  color: var(--text-muted);
}

/* Data flow diagrams: stages as columns of cards, with SVG connectors (see components/flow-graph.js) */
.diagram-panel .panel-head {
  flex-wrap: wrap;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--text-muted);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend .flow-icon {
  width: 18px;
  height: 18px;
}

.legend .flow-icon svg {
  width: 12px;
  height: 12px;
}

.flow-diagram {
  overflow-x: auto;
}

.flow-diagram.hidden-diagram {
  display: none;
}

.flow-viewport {
  overflow: hidden;
}

.flow {
  position: relative;
  transform-origin: 0 0;
  display: flex;
  align-items: center;
  width: max-content;
  min-width: 100%;
  padding: 20px 24px 24px;
  box-sizing: border-box;
}

.flow-stage {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: none;
}

.flow-stage h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.flow-nodes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* the gaps take any spare width, so the diagram spans the whole panel */
.flow-gap {
  flex: 1 0 32px;
  align-self: stretch;
}

.flow-gap.decides {
  flex-basis: 52px;
}

.flow-node {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 140px;
  max-width: 240px; /* room for a computed type's destinations ("Computed → kafka, console") */
  box-sizing: border-box;
  padding: 9px 12px 9px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--flow-node-bg);
  color: var(--text-color);
  text-decoration: none;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
  transition: border-color 0.12s, box-shadow 0.12s, background-color 0.12s;
}

.flow-node:hover,
.flow.focus .flow-node.lit {
  background: var(--flow-node-lit);
}

.flow-node:hover {
  border-color: var(--text-subtle);
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.08);
  text-decoration: none;
}

.flow-node.worker {
  min-width: 160px;
  padding: 12px 14px 12px 12px;
  border-color: var(--text-muted);
  background: var(--surface-muted);
}

.flow-node.worker .flow-name {
  font-size: 14px;
}

.flow-node.unused {
  border-style: dashed;
  background: transparent;
  box-shadow: none;
}

.flow-node.unused .flow-name {
  color: var(--text-muted);
}

.flow-icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: var(--neutral-text);
  background: var(--neutral-bg);
}

.flow-icon svg {
  width: 14px;
  height: 14px;
}

/* a type's kind shows in its icon's shape and colour */
.flow-icon.task { --kind: var(--kind-task); }
.flow-icon.ingress, .flow-icon.internal { --kind: var(--kind-ingested); }
.flow-icon.egress { --kind: var(--kind-computed); }
.flow-icon.task, .flow-icon.ingress, .flow-icon.egress, .flow-icon.internal { color: var(--kind); background: color-mix(in srgb, var(--kind) 14%, transparent); }
.flow-node.worker .flow-icon.task { background: var(--surface); }

.flow-icon.unused {
  border: 1px dashed var(--text-subtle);
  background: transparent;
}

.flow-node.unused .flow-icon svg {
  color: var(--text-subtle);
}

.flow-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.flow-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.flow-sub {
  overflow: hidden;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.flow-ends {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid var(--border);
}

.flow-end {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.flow-end svg {
  flex: none;
  width: 12px;
  height: 12px;
  color: var(--text-subtle);
}

.flow-end code {
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-subtle);
  text-overflow: ellipsis;
}

.flow-wires {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
}

.flow-wires .wire {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1.5;
}

.flow-wires .wire.needs,
.flow-wires .wire.produces {
  stroke: var(--text-subtle);
  stroke-opacity: 0.7;
}

.flow-wires .wire.decides {
  stroke: var(--text-subtle);
  stroke-dasharray: 4 4;
}

.flow-wires .wire.declared {
  stroke: var(--text-subtle);
  stroke-dasharray: 2 4;
}

/* an arrowhead takes its arrow's colour */
.flow-wires marker path { fill: context-stroke; }

.flow-wires .wire-label {
  font-family: var(--font-sans);
  font-size: 11px;
  fill: var(--text-muted);
}

/* Visibility transitions (used by the loading screen) */
.hidden {
  transition: opacity 0.2s linear, margin-top 0.3s step-start,
    z-index 0.3s step-start;
  opacity: 0;
  margin-top: -100vh;
  z-index: -5 !important;
  transition-timing-function: linear, step-end, step-end;
}

/* Tooltips */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  min-width: 200px;
  max-width: 360px;
  width: max-content;
  padding: 6px 9px;
  position: absolute;
  z-index: 10;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: #14181f;
  color: #eef0f3;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: normal;
  border-radius: var(--radius);
}

.tooltip:hover .tooltiptext {
  visibility: visible;
}

.tooltip .tooltiptext.right {
  bottom: 50%;
  left: 125%;
  transform: none;
}

.tooltip .tooltiptext.left {
  bottom: 50%;
  left: auto;
  right: 125%;
  transform: none;
}

.tooltip .tooltiptext.top,
.tooltip .tooltiptext.bottom {
  top: 125%;
  bottom: auto;
}

/* Responsive: on narrow screens the sidebar becomes a menu button at the left of the header, which opens the
   same menu as a panel over the page */
@media screen and (max-width: 48rem) {
  .admin {
    grid-template-rows: 44px 1fr 24px;
    grid-template-columns: 1fr;
    grid-template-areas: "header" "main" "footer";
  }

  .admin_header {
    padding-left: 44px; /* room for the menu button */
  }

  .logo {
    width: auto;
    padding-left: 4px;
    border-right: 0;
  }

  navigation-menu {
    grid-area: header;
    justify-self: start;
    position: relative;
    z-index: 20;
    width: 44px;
    height: 44px;
    background: none;
    border-right: 0;
    overflow: visible;
  }

  .menu_toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
  }

  .menu_toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
  }

  .menu_toggle:hover,
  navigation-menu[open] .menu_toggle {
    color: var(--text-color);
  }

  .navbar {
    display: none;
  }

  navigation-menu[open] .navbar {
    display: block;
    position: absolute;
    top: 44px;
    left: 0;
    width: min(280px, 85vw);
    max-height: calc(100vh - 44px - 24px);
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 var(--radius) 0;
    box-shadow: 0 12px 32px rgb(0 0 0 / 0.18);
  }

  .admin_main {
    padding: 16px;
  }
}

/* ═══════════════════════════════════════════════════════════
   Help — inline explanations and hover text
   ═══════════════════════════════════════════════════════════ */

/* Text with a description: hovering it shows the floating help panel */
.has-help {
  cursor: help;
  text-decoration: underline dotted var(--text-subtle);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Inside tables and chips the hover cue would be noise; the cursor is enough */
.table td .has-help,
.has-help:has(> .chip),
.has-help:has(> .type-ref) {
  text-decoration: none;
}

.table tr.row-link .has-help {
  cursor: inherit;
}

.page-intro {
  max-width: 90ch;
  margin: -8px 0 16px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

.page-intro strong {
  color: var(--text-color);
  font-weight: 600;
}

/* Floating help panel — one shared element, positioned by help-panel.js */
.help-panel {
  position: fixed;
  z-index: 10000;
  max-width: 380px;
  padding: 10px 12px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.12s ease, visibility 0.12s;
  pointer-events: none;
  background: var(--surface, #fff);
  color: var(--text-color, #14181f);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.55;
  border: 1px solid var(--border-strong, #cdd2d8);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(10, 14, 20, 0.14);
}

.help-panel.visible {
  visibility: visible;
  opacity: 1;
}

.help-panel p {
  margin: 0 0 6px;
}

.help-panel p:last-child {
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════
   YAML descriptions — type summaries, description cells, chips
   ═══════════════════════════════════════════════════════════ */

.cell-desc.missing {
  color: var(--text-subtle);
  font-style: italic;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 20px;
  margin: 0;
  padding: 14px 16px;
}

.facts:empty {
  display: none;
}

.fact {
  display: contents;
}

.fact dt {
  font-size: 12px;
  font-weight: 500;
  line-height: 22px;
  color: var(--text-muted);
}

.fact dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 0;
  min-height: 22px;
}

.fact code {
  padding: 1px 6px;
  font-size: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.fact-note {
  font-size: 12.5px;
  color: var(--text-muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  margin: 1px 4px 1px 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 11px;
}

.chip:hover {
  text-decoration: none;
  filter: brightness(0.96);
}

/* Description cells: one line, full text on hover */
.table td.description {
  width: 50%;
  max-width: 0;
  white-space: nowrap;
}

.cell-desc {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

.table td.needs,
.table td.produces,
.table td.types {
  white-space: normal;
  padding-top: 6px;
  padding-bottom: 6px;
}

/* Type and adapter names: a role icon and the name. Icon colours match the worker data flow diagram. */
.type-ref {
  display: inline-flex;
  vertical-align: middle;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--text-color);
  white-space: nowrap;
}

.type-ref svg {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--text-subtle);
}

a.type-ref:hover {
  text-decoration: none;
}

a.type-ref:hover span {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.type-ref svg { color: var(--text-muted); }
.type-ref.task svg { color: var(--kind-task); }
.type-ref.ingress svg, .type-ref.internal svg { color: var(--kind-ingested); }
.type-ref.egress svg { color: var(--kind-computed); }

.type-refs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

/* Panel heading icon: says what kind of thing the panel lists */
.panel-icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  color: var(--neutral-text);
  background: var(--neutral-bg);
}

.panel-icon svg {
  width: 14px;
  height: 14px;
}

.panel-icon.task { --kind: var(--kind-task); }
.panel-icon.ingress, .panel-icon.internal { --kind: var(--kind-ingested); }
.panel-icon.egress { --kind: var(--kind-computed); }
.panel-icon.adapter { --kind: var(--neutral-text); }
.panel-icon.task, .panel-icon.ingress, .panel-icon.egress, .panel-icon.internal, .panel-icon.adapter { color: var(--kind); background: color-mix(in srgb, var(--kind) 14%, transparent); }

/* Page title icon, in the colour of the page's section */
#page_container h1 {
  position: relative;
  padding-left: 40px;
}

#page_container h1::before,
#page_container h1::after {
  content: "";
  position: absolute;
  top: 50%;
}

#page_container h1::before {
  left: 0;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  border-radius: 7px;
  background: var(--section-bg);
}

#page_container h1::after {
  left: 6px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  background: var(--section-color);
  -webkit-mask: var(--section-icon) center / contain no-repeat;
  mask: var(--section-icon) center / contain no-repeat;
}

#page_container[data-section="compute"] {
  --section-color: var(--kind-task);
  --section-bg: color-mix(in srgb, var(--kind-task) 14%, transparent);
  --section-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='8' height='8' rx='1.5'/%3E%3Cpath d='M6.5 1.5v2M9.5 1.5v2M6.5 12.5v2M9.5 12.5v2M1.5 6.5h2M1.5 9.5h2M12.5 6.5h2M12.5 9.5h2'/%3E%3C/svg%3E");
}

#page_container[data-section="entities"] {
  --section-color: var(--kind-ingested);
  --section-bg: color-mix(in srgb, var(--kind-ingested) 14%, transparent);
  --section-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='8' cy='3.5' rx='5.5' ry='2'/%3E%3Cpath d='M2.5 3.5v9c0 1.1 2.5 2 5.5 2s5.5-.9 5.5-2v-9M2.5 8c0 1.1 2.5 2 5.5 2s5.5-.9 5.5-2'/%3E%3C/svg%3E");
}


/* Connect an agent (components/connect-agent.js) */
.connect-client {
  margin-bottom: 18px;
}

.connect-client h3 {
  margin: 0 0 2px;
  font-size: 14px;
}

.connect-client p,
.connect-note {
  margin: 0 0 8px;
  color: var(--text-muted);
}

.code-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.code-row pre {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow-x: auto;
  white-space: pre;
}

/* ---- one page per entity: where it comes from, its value, its connections (no accent bars) */
.tag-kind { background: var(--neutral-bg); color: var(--neutral-text); margin-left: 0.5rem; vertical-align: middle; }
.card .age { display: block; color: var(--text-subtle); font-size: 0.85em; margin-top: 0.25rem; }
.toggle-line { display: inline-flex; gap: 0.4rem; align-items: center; color: var(--text-muted); font-size: 0.9em; cursor: pointer; }
.missing { color: var(--text-subtle); }

/* Tables keep their column widths as data arrives: laid out from the set widths, not from the content,
   so a ticking price, age or value doesn't move every column. Text too long for its column ends in an
   ellipsis (the full text is in the cell's title). */
.table-fixed { table-layout: fixed; min-width: 640px; }
.table-fixed col.go { width: 40px; }
.table-fixed td { overflow: hidden; text-overflow: ellipsis; }

/* Pointing at a card in a diagram picks out its arrows and neighbours */
.flow .wire, .flow .flow-node { transition: opacity 0.12s; }
.flow.focus .wire:not(.lit) { opacity: 0.08; }
.flow.focus .flow-node:not(.lit) { opacity: 0.4; }
.flow.focus .wire.lit { stroke-width: 2; }

/* the app map has many arrows between columns: give them room */
.type-map .flow-gap { flex-basis: 72px; }

/* ---- State and activity (components/status.js). Colour means state: green up to date, amber waiting,
   red failed, grey idle. Zero counts and idle rows stay quiet, so colour always asks for a look. */
.tone-ok { --tone-text: var(--success-text); --tone-bg: var(--success-bg); --tone-dot: var(--success-dot); }
.tone-wait { --tone-text: var(--warning-text); --tone-bg: var(--warning-bg); --tone-dot: var(--amber); }
.tone-fail { --tone-text: var(--danger-text); --tone-bg: var(--danger-bg); --tone-dot: var(--danger-dot); }
.tone-idle { --tone-text: var(--text-muted); --tone-bg: var(--neutral-bg); --tone-dot: var(--text-subtle); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 11px;
  color: var(--tone-text);
  background: var(--tone-bg);
}

.pill::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tone-dot);
}

.count { font-variant-numeric: tabular-nums; }
.count.zero { color: var(--text-subtle); }
.count.tone-ok, .count.tone-wait, .count.tone-fail { color: var(--tone-text); font-weight: 600; }
.table th.workers, .table td.workers { text-align: right; }

/* a task type's workers: one bar split by state, problems spelt out beside it */
.health-summary { display: inline-flex; align-items: center; gap: 10px; width: 100%; }
.health-bar {
  display: flex;
  flex: 0 0 120px;
  gap: 2px;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--neutral-bg);
}
.health-bar > span { background: var(--tone-dot); }
.health-text { font-size: 12px; color: var(--text-muted); }
.health-text .tone-wait, .health-text .tone-fail { color: var(--tone-text); font-weight: 600; }

/* ages fade as values get older; the exact time is on hover */
.age-text { font-variant-numeric: tabular-nums; }
.age-text.fresh { color: var(--text-color); font-weight: 500; }
.age-text.recent { color: var(--text-muted); }
.age-text.stale { color: var(--text-subtle); }
.age-text.tone-wait { color: var(--warning-text); }

/* rows with nothing going on step back */
.table tbody tr.idle td { color: var(--text-subtle); }
.table tbody tr.idle td .type-ref svg { opacity: 0.5; }

/* a row whose value just changed is tinted for a moment */
@keyframes row-flash-a { from { background-color: color-mix(in srgb, var(--accent-soft) 70%, transparent); } to { background-color: transparent; } }
@keyframes row-flash-b { from { background-color: color-mix(in srgb, var(--accent-soft) 70%, transparent); } to { background-color: transparent; } }
.table tbody tr.flash-a td { animation: row-flash-a 0.9s ease-out; }
.table tbody tr.flash-b td { animation: row-flash-b 0.9s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .table tbody tr.flash-a td, .table tbody tr.flash-b td { animation: none; }
}

/* a panel's explanation, behind a small ⓘ beside its title */
.has-help:has(> .help-icon) { text-decoration: none; }
.help-icon { display: inline-flex; color: var(--text-subtle); cursor: help; }
.help-icon svg { width: 14px; height: 14px; }
.help-icon:hover, .help-icon:focus-visible { color: var(--text-muted); }

/* map arrows take the colour of the kind of box they leave; pointing at a box brings its arrows forward */
.flow-wires .wire.from-ingress, .flow-wires .wire.from-internal { stroke: var(--kind-ingested); }
.flow-wires .wire.from-task { stroke: var(--kind-task); }
.flow-wires .wire.from-egress { stroke: var(--kind-computed); }
.flow.focus .wire.lit { stroke-opacity: 1; }

/* the Workers page's verdict in a sentence, under the title and its pill */
.summary-line { margin: -6px 0 10px; font-size: 15px; font-weight: 500; color: var(--text-color); }
.summary-line .tone-wait, .summary-line .tone-fail { color: var(--tone-text); font-weight: 600; }
#page_container h1 .pill { margin-left: 4px; font-size: 12px; }

/* a few figures in a line or two: label, then value */
.figures { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 0; padding: 4px 16px 16px; }
.figure { display: flex; align-items: baseline; gap: 8px; }
.figure dt { font-size: 12px; color: var(--text-muted); }
.figure dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.figure dd .muted, .figure dd .missing { font-weight: 400; }
.figure dd .tone-wait, .figure dd .tone-fail { color: var(--tone-text); }
.figure dd .age-text.recent, .figure dd .age-text.stale { color: inherit; }

/* a panel that starts closed, its title line acting as the toggle */
details.quiet-section > summary { cursor: pointer; list-style: none; }
details.quiet-section > summary::-webkit-details-marker { display: none; }
details.quiet-section > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-right: 1.5px solid var(--text-subtle);
  border-bottom: 1.5px solid var(--text-subtle);
  transform: rotate(-45deg);
  transition: transform 0.12s;
}
details.quiet-section[open] > summary::after { transform: rotate(45deg); }
details.quiet-section > summary:hover { background: var(--row-hover); }

/* An entity's page opens with the answer: is it there, how fresh, what its worker is doing */
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin: -4px 0 14px; }
.status-item { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); }
.status-item .age-text.fresh { color: var(--text-color); }
.muted { color: var(--text-muted); }


/* a section of a page that starts closed: its title is the toggle */
details.section { margin: 4px 0 20px; }
details.section > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 8px 0;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  color: var(--text-color);
}
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--text-subtle);
  border-bottom: 1.5px solid var(--text-subtle);
  transform: rotate(-45deg);
  transition: transform 0.12s;
}
details.section[open] > summary::before { transform: rotate(45deg); }
details.section > summary .note { font-weight: 400; color: var(--text-muted); }
details.section > summary:hover { color: var(--accent); }

/* ---- Charts of the metric history (components/charts.js, metric-history.js). One measure per chart; colour
   only for state (red, amber) or, for a plain measure, the accent. Text stays in text colours. */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px 28px; padding: 4px 16px 16px; }
.chart { margin: 0; min-width: 0; }
.chart figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; }
.chart-summary { font-weight: 400; color: var(--text-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-plot { position: relative; padding-top: 16px; }
.chart-plot svg { display: block; width: 100%; height: 96px; overflow: visible; touch-action: none; }
.chart-y { position: absolute; top: 0; left: 0; font-size: 11px; line-height: 14px; color: var(--text-subtle); }
.chart-x { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.chart .chart-rule { stroke: var(--border); stroke-width: 1; }
.chart .chart-base { stroke: var(--border-strong); stroke-width: 1; }
.chart .chart-col { fill: var(--chart-accent); rx: 1; }
.chart .chart-col.tone-wait { fill: var(--chart-warn); }
.chart .chart-col.tone-fail { fill: var(--danger-dot); }
.chart .chart-line { fill: none; stroke: var(--chart-accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .chart-band { fill: var(--chart-accent); fill-opacity: 0.12; stroke: none; }
.chart .chart-crosshair { stroke: var(--text-subtle); stroke-width: 1; visibility: hidden; }
.chart-tip {
  position: absolute;
  top: 16px;
  transform: translate(-50%, calc(-100% - 6px));
  visibility: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 9px;
  font-size: 11.5px;
  white-space: nowrap;
  pointer-events: none;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.18);
  z-index: 5;
}
.chart-tip strong { color: var(--text-color); font-size: 12.5px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the time span switch in a panel's title line */
.segmented { display: inline-flex; margin-left: auto; padding: 2px; gap: 2px; background: var(--neutral-bg); border-radius: var(--radius); }
.segmented button {
  height: 24px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.segmented button.on { color: var(--text-color); background: var(--surface); font-weight: 500; }
.metric-history .notice { padding: 4px 16px 16px; }
details.quiet-section .metric-history { border: 0; margin: 0; }

/* a task type's last hour on the Workers page: one cell a minute, in its worst state's colour */
.health-strip { display: flex; gap: 1px; width: 100%; height: 14px; }
.health-strip .cell { flex: 1; min-width: 1px; border-radius: 1px; background: var(--tone-dot); cursor: help; }
.health-strip .cell.tone-none { background: var(--neutral-bg); }
.health-strip .cell.tone-ok { opacity: 0.55; }
/* a span switch keeps the last charts, faded, until the new span's history arrives */
.metric-history.loading .chart-grid { opacity: 0.45; transition: opacity 0.15s; }

/* ---- An entity's value (entity-details.js): the data on a surface of its own, each field under a quiet
   label, each value styled by what it is. Numbers and codes in the data font, with digits of equal width. */
.value-surface { padding: 16px; background: var(--surface-muted); }
.value-list { display: grid; grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr); gap: 10px 32px; margin: 0; }
.vl-row, .vl-block { display: contents; }
.value-list dt { font-size: 12px; line-height: 20px; color: var(--text-muted); }
.value-list dd { margin: 0; min-width: 0; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text-color); overflow-wrap: anywhere; }
.vl-block dt { grid-column: 1 / -1; margin-top: 10px; margin-bottom: -4px; font-weight: 500; color: var(--text-color); }
.vl-block dd { grid-column: 1 / -1; }
.value-list .value-list { padding-left: 0; }

.v-number, .v-code, .v-time { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.v-none { font-weight: 400; color: var(--text-subtle); }
.v-age { margin-left: 10px; font-family: var(--font-sans); font-size: 12px; font-weight: 400; color: var(--text-subtle); }
.v-url { font-weight: 400; overflow-wrap: anywhere; }
.v-json { font-size: 12px; font-weight: 400; color: var(--text-muted); overflow-wrap: anywhere; }
.v-items { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; }
.value-single { font-size: 16px; font-weight: 500; }

/* a list of records inside a value: a compact table sized to its content, number columns right-aligned */
.value-subtable-wrap { overflow-x: auto; }
.value-subtable { border-collapse: collapse; font-size: 13px; font-weight: 400; }
.value-subtable th {
  padding: 0 28px 6px 0;
  font-size: 11.5px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-strong);
}
.value-subtable td { padding: 7px 28px 7px 0; white-space: nowrap; border-bottom: 1px solid var(--border); }
.value-subtable tbody tr:last-child td { border-bottom: 0; }
.value-subtable .num { text-align: right; }
.value-subtable th:last-child, .value-subtable td:last-child { padding-right: 0; }
.value-subtable .v { font-weight: 400; }

/* on a narrow screen a value's labels sit above their values */
@media (max-width: 600px) {
  .value-list { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .value-list dd { margin-bottom: 10px; }
  .vl-block dt { margin-bottom: 4px; }
}
