/* ===================================================================
   prfd dashboard.
   A proper product UI, not a scaffold: layered elevation, a real
   logomark, solid-fill primary actions, tabular numerics, and a
   deliberate type scale. Same tokens as the marketing site's hue
   family so the product still reads as the brand.
   No framework: this is forms and tables, and a build step would be
   machinery the problem does not need.
   =================================================================== */

:root {
  /* Light theme. Neutrals carry a faint cool-blue cast rather than true
     gray, which is what makes a light dashboard read as "designed" rather
     than "default browser chrome." */
  --bg:           #f6f7fa;
  --bg-elev:      #eef1f5;
  --bg-card:      #ffffff;
  --bg-sunken:    #f1f3f7;
  --border:       #e3e6ec;
  --border-bright:#ced3dc;

  --text:         #11141a;
  --text-muted:   #5b6273;
  --text-faint:   #8a90a0;

  /* The marketing site's #5eead4 is tuned for a near-black background and
     fails contrast on white, so the product uses a deeper, desaturated
     teal from the same hue family. accent-strong is for text/icons on a
     light fill; accent is the fill itself. */
  --accent:         #0d9488;
  --accent-strong:  #0b7c72;
  --accent-dim:     rgba(13, 148, 136, 0.10);
  --accent-border:  rgba(13, 148, 136, 0.32);

  --good:         #0d9488;
  --good-dim:     rgba(13, 148, 136, 0.10);
  --warn:         #b45309;
  --warn-dim:     rgba(180, 83, 9, 0.10);
  --bad:          #c2321f;
  --bad-dim:      rgba(194, 50, 31, 0.09);
  --info:         #2563eb;
  --info-dim:     rgba(37, 99, 235, 0.09);

  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 8px;
  --text-body:    #262b35;

  /* Layered elevation. Two shadows stacked -- a tight contact shadow plus a
     soft ambient one -- is what separates a "card with a border" from a
     surface that looks lifted. Used on cards, tiles, and popovers. */
  --shadow-xs: 0 1px 2px rgba(17, 20, 26, 0.04);
  --shadow-sm: 0 1px 2px rgba(17, 20, 26, 0.04), 0 4px 10px -4px rgba(17, 20, 26, 0.06);
  --shadow-md: 0 2px 4px rgba(17, 20, 26, 0.04), 0 12px 24px -8px rgba(17, 20, 26, 0.10);
  --shadow-ring: 0 0 0 3px var(--accent-dim);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -0.022em; line-height: 1.2; font-weight: 650; }
h1 { font-size: 26px; letter-spacing: -0.026em; }
h2 { font-size: 18px; font-weight: 620; }
h3 { font-size: 14.5px; font-weight: 620; }
p { margin: 0 0 14px; }
code, .mono { font-family: var(--mono); font-feature-settings: 'tnum' 1; }
::selection { background: var(--accent-dim); color: var(--text); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 22px;
  padding: 0 24px; height: 58px;
  background: rgba(246, 247, 250, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-weight: 700; font-size: 14.5px;
  letter-spacing: -0.015em; color: var(--text);
}
/* The logomark: a small sealed signet rather than a bare status dot --
   a rounded square with a soft gradient fill and a checkmark drawn
   entirely in CSS (two bars, no image asset). */
.brand-dot {
  position: relative;
  width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
  background: linear-gradient(155deg, #14b8a6, var(--accent-strong));
  box-shadow: 0 1px 1px rgba(11, 124, 114, 0.25), inset 0 1px 0 rgba(255,255,255,0.25);
}
.brand-dot::after {
  content: '';
  position: absolute; left: 50%; top: 48%;
  width: 8px; height: 5px;
  margin: -2px 0 0 -4.5px;
  border-left: 1.6px solid #fff; border-bottom: 1.6px solid #fff;
  transform: rotate(-45deg);
  opacity: 0.95;
}
.topnav { display: flex; gap: 2px; margin-left: 10px; flex: 1; overflow-x: auto; }
.topnav a {
  padding: 7px 12px; border-radius: var(--radius-sm); font-size: 13.5px;
  font-weight: 500; color: var(--text-muted); white-space: nowrap;
  transition: background 140ms, color 140ms;
}
.topnav a:hover { color: var(--text); background: var(--bg-sunken); }
.topnav a.on { color: var(--accent-strong); background: var(--accent-dim); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.who { font-size: 13px; color: var(--text-faint); font-weight: 500; }

/* account switcher: a select, because a dropdown menu for 1-3 items is
   needless interaction design */
.switcher select {
  font: inherit; font-size: 13px; font-weight: 500; color: var(--text-muted);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 26px 6px 10px; cursor: pointer;
  box-shadow: var(--shadow-xs);
  /* A company name should not be able to push the sign-out button off the
     sticky bar. It ellipses past this width instead; the full name is on
     the select's own title tooltip. */
  max-width: 180px;
  background-position: right 9px center;
}

/* ---------- layout ---------- */
.wrap { max-width: 1060px; margin: 0 auto; padding: 32px 24px 80px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-head .sub { color: var(--text-muted); font-size: 14.5px; margin: 7px 0 0; max-width: 62ch; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

/* ---------- cards ---------- */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: 13px; }

/* A card that is itself a link (the demo index) gets a lift on hover, same
   elevation language as everything else, just promoted on interaction. */
a.card { display: block; transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-bright); }

/* ---------- outcome tiles: what the product caught, not API counters ---- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tile {
  position: relative;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 19px 20px 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.tile::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2.5px;
  background: var(--border);
}
.tile.good::before { background: linear-gradient(90deg, var(--good), #2dd4bf); }
.tile.warn::before { background: linear-gradient(90deg, var(--warn), #f59e0b); }
.tile.bad::before  { background: linear-gradient(90deg, var(--bad), #ef4444); }
.tile .n {
  font-family: var(--mono); font-size: 29px; font-weight: 600; letter-spacing: -0.02em;
  font-feature-settings: 'tnum' 1;
}
.tile .k { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; font-weight: 500; }
.tile.good .n { color: var(--good); }
.tile.warn .n { color: var(--warn); }
.tile.bad  .n { color: var(--bad); }

/* ---------- quota meter ---------- */
.meter { margin-top: 14px; }
.meter + .meter { margin-top: 18px; }
.meter-top { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 7px; }
.meter-top .muted { font-family: var(--mono); font-size: 12.5px; }
.meter-track { height: 6px; border-radius: 99px; background: var(--bg-sunken); overflow: hidden; }
.meter-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #0ea5e9); border-radius: 99px; transition: width 300ms ease; }
.meter-fill.warn { background: linear-gradient(90deg, var(--warn), #f59e0b); }
.meter-fill.bad  { background: linear-gradient(90deg, var(--bad), #ef4444); }

/* ---------- buttons ----------
   Primary is a solid fill, not a tinted ghost: that single change is most
   of the distance between "internal tool" and "product." */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 13.5px; font-weight: 560;
  padding: 8px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-bright); background: var(--bg-card);
  color: var(--text); cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color 140ms, box-shadow 140ms, transform 140ms, background 140ms;
}
.btn:hover { border-color: var(--text-faint); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-ring); }
.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  border-color: var(--accent-strong); color: #fff;
  box-shadow: 0 1px 1px rgba(11,124,114,0.15), 0 4px 10px -4px rgba(11,124,114,0.45);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #0f9c8f, #086158);
  border-color: #086158;
  box-shadow: 0 1px 1px rgba(11,124,114,0.2), 0 6px 14px -4px rgba(11,124,114,0.55);
}
.btn-danger { color: var(--bad); border-color: rgba(194, 50, 31, 0.30); background: transparent; box-shadow: none; }
.btn-danger:hover { background: var(--bad-dim); border-color: rgba(194, 50, 31, 0.55); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 560; margin-bottom: 6px; color: var(--text); }
.hint { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; font-weight: 400; line-height: 1.5; }
input[type="text"], input[type="email"], input[type="password"], input[type="file"], select, textarea {
  font: inherit; font-size: 14.5px; width: 100%;
  padding: 10px 13px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  transition: border-color 140ms, box-shadow 140ms;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--shadow-ring);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
.field { margin-bottom: 16px; }

/* ---------- selects ----------
   The browser's default <select> is a flat, un-stylable-interior control
   that ends up looking like nothing else on the page. This keeps the
   native listbox (fast, accessible, keyboard-driven on every platform)
   but owns everything CSS actually reaches: the closed-state chrome, the
   chevron, focus, hover, and -- the part that matters most here --
   truncation. A select too narrow for its selected option now ellipses
   cleanly instead of overflowing or wrapping.

   Content lives in the templates, not here: a couple of selects used to
   cram a full sentence into the option text (a trigger's name plus its
   entire description on one line), which no CSS truncation makes
   readable. Those were shortened to a short name, with the description
   moved to a hint line below the select. See flows.html. */
select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 34px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 3.2L9 1' fill='none' stroke='%235b6273' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
select:hover { border-color: var(--border-bright); }
select:disabled { cursor: not-allowed; opacity: 0.55; background-color: var(--bg-sunken); }
/* A select sitting inline next to other controls (a filter bar, an
   invite-role picker) rather than filling its own form row. Width hugs
   content up to a cap -- "Member" does not stretch to the form's full
   measure -- and a long value still ellipses rather than blowing out
   the row it sits in. */
select.select-inline {
  width: auto; max-width: 220px; min-width: 112px;
  padding: 7px 30px 7px 12px; font-size: 13.5px;
  background-position: right 11px center;
}
.checks { display: flex; gap: 18px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; margin: 0; color: var(--text); }
.check input { width: auto; }
.radios { display: flex; gap: 10px; }
.radio-card {
  flex: 1; display: block; cursor: pointer; margin: 0;
  padding: 13px 15px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border);
  font-weight: 400; transition: border-color 140ms, background 140ms;
}
.radio-card:hover { border-color: var(--border-bright); }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-dim); box-shadow: var(--shadow-ring); }
.radio-card .t { font-weight: 620; font-size: 14px; display: block; margin-bottom: 2px; }
.radio-card .d { font-size: 12.5px; color: var(--text-muted); }
.radio-card input { width: auto; margin-right: 7px; }

.route-chip {
  padding: 3px 9px; border-radius: 6px;
  background: var(--bg-sunken); color: var(--text-muted);
}

/* ---------- notices ---------- */
.notice {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; border-radius: var(--radius); font-size: 14px;
  border: 1px solid var(--border); background: var(--bg-card); margin-bottom: 18px;
  box-shadow: var(--shadow-xs);
}
.notice::before {
  content: ''; flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%;
  margin-top: 6px; background: var(--text-faint);
}
.notice-bad  { border-color: rgba(194, 50, 31, 0.24); background: var(--bad-dim); color: #8d2315; }
.notice-bad::before  { background: var(--bad); }
.notice-warn { border-color: rgba(180, 83, 9, 0.22); background: var(--warn-dim); color: #7c3c06; }
.notice-warn::before { background: var(--warn); }
.notice-good { border-color: rgba(13, 148, 136, 0.24); background: var(--accent-dim); color: #0b6b62; }
.notice-good::before { background: var(--good); }
.notice a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; font-family: var(--mono); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-faint);
  font-weight: 600; padding: 0 14px 11px; white-space: nowrap;
}
tbody td { padding: 13px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
tbody tr { transition: background 100ms; }
tbody tr:hover td { background: var(--bg-sunken); }
.table-wrap { overflow-x: auto; margin: 0 -26px -24px; padding: 0 10px 8px; }

/* ---------- key/value rows ----------
   Label on the left, value on the right, with a hairline between rows. */
.kv { display: flex; flex-direction: column; }
.kv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 11px 0;
  font-size: 14px;
  border-top: 1px solid var(--border);
}
.kv-row:first-child { border-top: 0; padding-top: 2px; }
.kv-row:last-child { padding-bottom: 2px; }
.kv-row .k { color: var(--text-muted); flex: 0 0 auto; font-weight: 500; }
.kv-row .v {
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 500;
}
.kv-row .v.mono { font-size: 13px; color: var(--text-muted); font-weight: 400; }
.kv-note { font-size: 12.5px; color: var(--text-faint); margin: 16px 0 0; line-height: 1.6; }

/* ---------- pills / status chips ----------
   Solid soft fill, no border, no bullet -- a status badge rather than a
   decorated label. */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--sans); font-size: 12px; font-weight: 620; letter-spacing: -0.005em;
  padding: 3px 10px; border-radius: 99px;
  background: var(--bg-sunken); color: var(--text-muted);
}
.pill-good { color: var(--good); background: var(--good-dim); }
.pill-warn { color: var(--warn); background: var(--warn-dim); }
.pill-bad  { color: var(--bad);  background: var(--bad-dim); }
.pill-muted { color: var(--text-faint); background: var(--bg-sunken); }
.pill::before { display: none; }

/* ---------- code blocks, with a copy button ----------
   A faint cool tint distinct from both the page and the card, the way a
   docs site marks "this is a terminal, not prose." */
.code {
  position: relative; font-family: var(--mono); font-size: 12.5px; line-height: 1.75;
  background: #f3f5f9; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 15px 52px 15px 16px; overflow-x: auto; white-space: pre;
  color: #2b303a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
.code .cm { color: var(--text-faint); }
.code .str { color: var(--accent-strong); }
.copy {
  position: absolute; top: 9px; right: 9px;
  font: inherit; font-family: var(--sans); font-size: 11px; font-weight: 560;
  padding: 4px 9px; border-radius: 6px; cursor: pointer;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted);
  box-shadow: var(--shadow-xs);
  transition: color 140ms, border-color 140ms;
}
.copy:hover { color: var(--text); border-color: var(--border-bright); }
.copy.done { color: var(--accent-strong); border-color: var(--accent-border); }

/* ---------- the reveal-once secret ---------- */
.secret {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; word-break: break-all;
  padding: 13px 15px; border-radius: var(--radius-sm);
  background: var(--accent-dim); border: 1px dashed var(--accent-border);
  color: var(--accent-strong);
}

/* ---------- empty states: the most important screens in the product ---- */
.empty { text-align: center; padding: 46px 24px; }
.empty .ico {
  font-size: 22px; margin: 0 auto 16px; width: 52px; height: 52px;
  display: grid; place-items: center; border-radius: 14px;
  background: var(--accent-dim);
}
.empty h2 { margin-bottom: 8px; }
.empty p { color: var(--text-muted); max-width: 46ch; margin: 0 auto 20px; }

/* ---------- numbered quickstart ---------- */
.steps { counter-reset: step; }
.step { position: relative; padding-left: 46px; padding-bottom: 28px; }
.step:last-child { padding-bottom: 0; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -2px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 12.5px; font-weight: 600;
  background: var(--accent-dim); color: var(--accent-strong);
  border: 1px solid var(--accent-border);
}
.step::after {
  content: ''; position: absolute; left: 13.5px; top: 32px; bottom: 4px;
  width: 1px; background: var(--border);
}
.step:last-child::after { display: none; }
.step h3 { margin-bottom: 7px; }
.step > p { font-size: 14px; color: var(--text-muted); }

/* ---------- centred auth pages ---------- */
body:has(.auth) {
  background: radial-gradient(ellipse 80% 55% at 50% -8%, rgba(13,148,136,0.07), transparent 60%),
              var(--bg);
}
.auth { max-width: 408px; margin: 0 auto; padding: 76px 24px 60px; }
.auth-head { text-align: center; margin-bottom: 30px; }
.auth-head .brand { justify-content: center; margin-bottom: 22px; font-size: 16px; }
.auth-head .brand .brand-dot { width: 24px; height: 24px; border-radius: 7px; }
.auth-head .brand .brand-dot::after { width: 9px; height: 6px; margin: -2px 0 0 -5px; border-width: 1.8px; }
.auth-head h1 { font-size: 23px; }
.auth-head p { color: var(--text-muted); font-size: 14.5px; margin: 8px 0 0; }
.auth-alt { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-muted); }
.auth-alt a { color: var(--accent-strong); font-weight: 560; }
.tagline {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-faint);
  text-align: center; margin-top: 44px; letter-spacing: 0.02em;
}

@media (max-width: 820px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .topnav { overflow-x: auto; }
  .who { display: none; }
}

/* ---------- sleek custom dropdown ----------
   Progressive enhancement over a real <select>: the select stays in the
   DOM (name, required, onchange untouched) and is the thing that actually
   submits, so this is presentation only. Visually hidden rather than
   display:none so it is still reachable; see flows.html for the JS and
   why the native select is kept as the no-JS fallback. */
.sleek { position: relative; display: inline-block; width: 100%; }
.sleek-native {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
}
.sleek-trigger {
  width: 100%; text-align: left; font: inherit; font-size: 14.5px;
  padding: 10px 34px 10px 13px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: border-color 140ms, box-shadow 140ms;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 3.2L9 1' fill='none' stroke='%235b6273' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
.sleek-trigger.is-placeholder { color: var(--text-faint); }
.sleek-trigger:hover { border-color: var(--border-bright); }
.sleek-trigger:focus-visible, .sleek-trigger.is-open {
  outline: none; border-color: var(--accent); box-shadow: var(--shadow-ring);
}
.sleek-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  max-height: 320px; overflow-y: auto;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  padding: 5px;
}
.sleek-option {
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
  transition: background 100ms;
}
.sleek-option:hover, .sleek-option:focus { background: var(--bg-sunken); outline: none; }
.sleek-option.is-selected { background: var(--accent-dim); }
.sleek-option.is-selected .sleek-option-label { color: var(--accent-strong); font-weight: 600; }
.sleek-option-label { font-size: 14px; color: var(--text); }
.sleek-option-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }

/* ---------- flow canvas ----------
   Rules read left to right as a sentence. A free-form node graph would demo
   better and be worse to use for the rules people actually need. */
.flow { padding: 18px 0; border-top: 1px solid var(--border); }
.flow:first-of-type { border-top: 0; padding-top: 4px; }
.flow-off { opacity: 0.55; }
.flow-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.flow-canvas {
  display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap;
  padding: 16px; border-radius: var(--radius-sm);
  background: var(--bg-sunken); border: 1px solid var(--border);
}
.node {
  flex: 1; min-width: 180px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.node-when { border-left: 3px solid var(--accent); }
.node-if   { border-left: 3px solid var(--warn); }
.node-then { border-left: 3px solid var(--info); }
.node-k {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 5px;
}
.node-v { font-size: 13.5px; line-height: 1.5; }
.arrow { display: grid; place-items: center; color: var(--text-faint); font-size: 16px; }

.builder { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 6px 0 4px; }
.builder-step {
  padding: 16px; border-radius: var(--radius-sm);
  background: var(--bg-sunken); border: 1px solid var(--border);
}
.builder-k {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--accent-strong); margin-bottom: 10px;
}
@media (max-width: 900px) {
  .builder { grid-template-columns: 1fr; }
  .arrow { display: none; }
}

/* ---------- trend chart: inline bars, no charting library ---------- */
.chart { display: flex; align-items: flex-end; gap: 5px; height: 110px; margin: 6px 0 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; }
.chart .bar { background: var(--accent); border-radius: 2px 2px 0 0; min-height: 2px; opacity: 0.9; }
.chart .bar-flag { background: var(--warn); border-radius: 2px 2px 0 0; }
.chart .col:hover .bar { opacity: 1; }
.chart-x { display: flex; gap: 5px; }
.chart-x span { flex: 1; text-align: center; font-size: 10px; color: var(--text-faint); white-space: nowrap; overflow: hidden; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

/* ---------- raw JSON panel ---------- */
details.raw { margin-top: 14px; }
details.raw summary {
  cursor: pointer; font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--text-muted); padding: 7px 0; list-style: none;
}
details.raw summary::-webkit-details-marker { display: none; }
details.raw summary:hover { color: var(--accent-strong); }
details.raw .jt-root {
  margin: 8px 0 0; padding: 14px; overflow-x: auto;
  font-family: var(--mono); font-size: 12px; line-height: 1.7;
  background: #f3f5f9; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: #2b303a;
}

/* ---------- JSON tree (the raw-log viewer) ----------
   What a non-developer forwards to an engineer during an incident. A flat
   JSON.stringify dump is accurate and unreadable past a screenful; this
   gives every object and array its own disclosure triangle, colours keys
   and values by type the way a devtools console or a log viewer does, and
   shows a count on a closed node so you know what's inside before you
   open it. Collapsed past two levels deep by default so a payload with
   many usage events or many signals opens readable, not as one long
   scroll. */
.jt-node { display: block; }
.jt-node > summary {
  cursor: pointer; list-style: none; color: var(--text-faint);
  display: inline;
}
.jt-node > summary::-webkit-details-marker { display: none; }
.jt-node > summary::before {
  content: '▸'; display: inline-block; width: 13px; margin-left: -13px;
  color: var(--text-faint); transition: transform 120ms;
}
.jt-node[open] > summary::before { transform: rotate(90deg); }
.jt-node > summary:hover::before { color: var(--accent-strong); }
.jt-count {
  color: var(--text-faint); font-size: 10.5px; margin: 0 2px;
  font-family: var(--sans); font-style: normal;
}
.jt-node:not([open]) .jt-count { display: inline; }
.jt-node[open] .jt-count { display: none; }
.jt-node .jt-body { margin-left: 20px; }
.jt-row { position: relative; }
.jt-close { color: var(--text-faint); }
.jt-key { color: #7c3aed; }
.jt-colon, .jt-comma { color: var(--text-faint); }
.jt-val.jt-str  { color: var(--accent-strong); }
.jt-val.jt-num  { color: var(--info); }
.jt-val.jt-bool { color: var(--warn); font-weight: 600; }
.jt-val.jt-null { color: var(--text-faint); font-style: italic; }
.jt-empty { color: var(--text-faint); }
