/* slonbase dashboard: a developer tool, neutral and GitHub-like in light and dark. Tokens first, then components. */

/* Type, in the manner of IBM's and JetBrains' tools: two families, shipped with the dashboard under
   the SIL Open Font Licence (see fonts/).
   - IBM Plex Sans (variable in weight and width): the interface, in its normal width. Titles use
     its condensed width at semibold, in capitals with open tracking (.display below).
   - JetBrains Mono (variable): data. Small-capital labels over sections and columns, ids,
     collection names, figures and code. */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 700;
  font-stretch: 75% 100%;
  src: url("./fonts/ibm-plex-sans-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: "IBM Plex Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 700;
  font-stretch: 75% 100%;
  src: url("./fonts/ibm-plex-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("./fonts/jetbrains-mono-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: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("./fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Tokens: warm paper and stone neutrals, one muted sage accent (overridable from the settings),
   earthy status colors, and eight desaturated tones for glyphs and select values. Surfaces are
   told apart by soft shadows and hairlines rather than heavy borders. */
:root {
  /* every page has the same width and gutters (the data grid alone goes edge to edge) */
  --page-max: 1440px;
  --page-pad: 32px 40px 72px;
  --accent: #4f7a6c;
  --accent-strong: color-mix(in srgb, var(--accent), black 18%);
  --accent-soft: color-mix(in srgb, var(--accent), transparent 89%);
  --accent-ring: color-mix(in srgb, var(--accent), transparent 72%);

  /* three layers: the page is a soft grey, cards and inputs sit on it in white, and wells
     (table heads, code, bars) step back down */
  --canvas: #eff2f5;
  --canvas-2: #e7ebf0;
  --sidebar: #e8ecf0;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --raised: #ffffff;
  --ink: #1f2328;
  --ink-2: #31373d;
  --ink-3: #4b535c;
  --muted: #59636e;
  --faint: #5d6670;
  /* coloured text (chips, statuses, links) is mixed this much with the ink, so it reads at
     4.5:1 or more on its own tint and on every surface (WCAG AA) */
  --text-mix: 41%;
  --line: #e1e6eb;
  --line-2: #d1d9e0;
  --hover: rgba(129, 139, 152, 0.12);
  --press: rgba(129, 139, 152, 0.2);
  --primary: var(--accent);
  --primary-ink: #ffffff;

  --ok: #4f8a68;
  --warn: #ad7d36;
  --danger: #b5544f;
  --info: #5a7ca3;
  --ok-soft: color-mix(in srgb, var(--ok), transparent 89%);
  --warn-soft: color-mix(in srgb, var(--warn), transparent 89%);
  --danger-soft: color-mix(in srgb, var(--danger), transparent 90%);
  --info-soft: color-mix(in srgb, var(--info), transparent 90%);

  --tone-1: #5b8174; /* sage */
  --tone-2: #5f7593; /* slate */
  --tone-3: #7c8452; /* olive */
  --tone-4: #ad8542; /* ochre */
  --tone-5: #b06a50; /* terracotta */
  --tone-6: #9d6582; /* mauve */
  --tone-7: #7a6b9c; /* heather */
  --tone-8: #4d8287; /* teal */

  --shadow-1: 0 1px 2px rgba(31, 35, 40, 0.08), 0 0 0 0 transparent;
  --shadow-2: 0 8px 24px rgba(140, 149, 159, 0.2), 0 0 0 1px var(--line-2);
  --shadow-3: 0 16px 48px rgba(140, 149, 159, 0.3), 0 0 0 1px var(--line-2);

  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 10px;
  --r-pill: 999px;
  /* controls (buttons, fields, switches, segmented): flat, 8px */
  --r-ctl: 8px;
  --r-ctl-sm: 7px;
  --r-ctl-lg: 10px;

  --font: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* titles: Plex condensed, semibold, capitals */
  --font-display: var(--font);
  --display-stretch: 85%;
  --display-weight: 600;
  --display-track: 0.035em;
  /* small capitals over sections, columns and figures */
  --font-label: var(--mono);

  /* one scale: every size in the dashboard is one of these */
  --text-2xs: 11px;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 25px;
  --text-3xl: 30px;
  /* and weights (a variable font, so the in-betweens are real cuts) */
  --w-regular: 400;
  --w-book: 430;
  --w-medium: 500;
  --w-semibold: 600;
  --w-bold: 650;
  /* tracking: tighter as text grows, looser for small capitals */
  --track-display: -0.012em;
  --track-title: -0.014em;
  --track-tight: -0.006em;
  --track-caps: 0.07em;

  --ease: cubic-bezier(0.25, 0.8, 0.25, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-glide: var(--ease-out);
  /* motion is short and only says what changed: nothing springs, bounces or blurs */
  --t-fast: 90ms;
  --t-med: 140ms;
  --t-slow: 200ms;

  /* the sidebar, and the bar above the page on small screens (none on large ones) */
  --side-w: 256px;
  /* the status bar along the bottom of the page */
  --status-h: 26px;
  --side-w-folded: 68px;
  --header-h: 0px;
  color-scheme: light;
  /* checkboxes, radios and sliders (native controls), selected text: the installation's accent */
  accent-color: var(--primary);
}

:root[data-theme="dark"] {
  /* cool ink neutrals in GitHub's manner: surfaces told apart by hairlines, not shadows */
  --accent: #6fc2a2;
  --accent-strong: color-mix(in srgb, var(--accent), white 14%);
  --accent-soft: color-mix(in srgb, var(--accent), transparent 86%);
  --accent-ring: color-mix(in srgb, var(--accent), transparent 55%);

  /* the page is the darkest layer after the sidebar; cards and inputs are lifted off it, and
     table heads and code a step lighter again */
  --canvas: #0b0f14;
  --canvas-2: #080b10;
  --sidebar: #010409;
  --surface: #161d28;
  --surface-2: #1f2733;
  --raised: #1f2733;
  --ink: #f0f6fc;
  --ink-2: #d1d9e0;
  --ink-3: #b2bac4;
  --muted: #9198a1;
  --faint: #8b929b;
  --text-mix: 0%;
  --line: #2a313c;
  --line-2: #3d444d;
  --hover: rgba(101, 108, 118, 0.16);
  --press: rgba(101, 108, 118, 0.26);
  --primary: color-mix(in srgb, var(--accent), #0d1117 52%);
  --primary-ink: #ffffff;

  --ok: #3fb950;
  --warn: #d29922;
  --danger: #f85149;
  --info: #4493f8;

  --tone-1: #7cc7ab;
  --tone-2: #8fb2e8;
  --tone-3: #b6c27a;
  --tone-4: #e0b25f;
  --tone-5: #f0957a;
  --tone-6: #e597c0;
  --tone-7: #b6a2ef;
  --tone-8: #6cc5d0;

  --shadow-1: 0 0 transparent;
  --shadow-2: 0 8px 24px rgba(1, 4, 9, 0.55), 0 0 0 1px var(--line-2);
  --shadow-3: 0 16px 48px rgba(1, 4, 9, 0.7), 0 0 0 1px var(--line-2);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  font-family: var(--font);
  font-size: var(--text-base);
  font-weight: var(--w-regular);
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "calt";
  font-kerning: normal;
  font-synthesis: none;
}
#app {
  min-height: 100%;
}
a {
  color: color-mix(in srgb, var(--accent), var(--ink) var(--text-mix));
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
::selection {
  background: var(--accent-ring);
}
code,
kbd,
pre,
.mono {
  font-family: var(--mono);
  font-size: 0.86em;
  font-weight: var(--w-regular);
  font-variant-ligatures: none;
  /* code reads as typed: no programming ligatures (!= stays !=), a slashed zero */
  font-feature-settings: "calt" 0, "liga" 0, "zero";
  letter-spacing: 0;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: var(--w-semibold);
  letter-spacing: var(--track-title);
  line-height: 1.25;
  color: var(--ink);
  text-wrap: balance;
}
h1 {
/* titles: condensed capitals */
  font-family: var(--font-display);
  font-stretch: var(--display-stretch);
  font-size: 26px;
  font-weight: var(--display-weight);
  letter-spacing: var(--display-track);
  text-transform: uppercase;
  line-height: 1.15;
}
h2 {
  font-size: var(--text-lg);
}
h3 {
  font-size: var(--text-md);
  letter-spacing: var(--track-tight);
}
h4 {
  font-size: var(--text-base);
  letter-spacing: var(--track-tight);
}
p {
  margin: 0;
  text-wrap: pretty;
}
b,
strong {
  font-weight: var(--w-semibold);
}
.num,
table,
.kv,
.stat-value {
  font-variant-numeric: tabular-nums;
}

.icon {
  flex: none;
  display: inline-block;
  vertical-align: middle;
}
.muted {
  color: var(--muted);
}
.faint {
  color: var(--faint);
}
.small {
  font-size: var(--text-sm);
  line-height: 1.5;
}
.tiny {
  font-size: var(--text-xs);
  line-height: 1.45;
}
.nowrap {
  white-space: nowrap;
}
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.grow {
  flex: 1 1 auto;
  min-width: 0;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.row.wrap {
  flex-wrap: wrap;
}
.row.top {
  align-items: flex-start;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stack.tight {
  gap: 8px;
}
.stack.loose {
  gap: 20px;
}
.spacer {
  flex: 1;
}
.mobile-only {
  display: none;
}
@media (max-width: 920px) {
  .mobile-only {
    display: block;
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.span-all {
  grid-column: 1 / -1;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.split-2-1 {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 14px;
}
.split-main-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 14px;
  align-items: start;
}
@media (max-width: 860px) {
  .split-2-1,
  .split-main-side,
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ------------------------------------------------------------------ motion (quiet) */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes sheet {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes shimmer {
  from {
    background-position: -320px 0;
  }
  to {
    background-position: 320px 0;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes breathe {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}
@keyframes flash {
  0% {
    background: var(--accent-soft);
  }
  100% {
    background: transparent;
  }
}
@keyframes shake {
  20%,
  60% {
    transform: translateX(-4px);
  }
  40%,
  80% {
    transform: translateX(4px);
  }
}

.enter {
  animation: fade var(--t-slow) ease backwards;
}
.fade-in {
  animation: fade var(--t-med) ease backwards;
}
.shake {
  animation: shake 0.36s;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* ------------------------------------------------------------------ buttons */

/* Buttons: flat. A solid fill, a hairline border, a colour change on hover and a darker press;
   no gradient, shadow or bevel. One set of variables per kind, so the themes and an
   installation's accent only change colours. */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-line: var(--line-2);
  --btn-hover: color-mix(in srgb, var(--btn-bg), var(--ink) 4%);
  --btn-press: color-mix(in srgb, var(--btn-bg), var(--ink) 8%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-ctl);
  border: 1px solid var(--btn-line);
  background-color: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font);
  font-weight: var(--w-medium);
  font-size: var(--text-sm);
  letter-spacing: -0.003em;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  position: relative;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-med) var(--ease);
}
.btn .icon {
  opacity: 0.8;
}
.btn:hover {
  background-color: var(--btn-hover);
  text-decoration: none;
}
.btn:active {
  background-color: var(--btn-press);
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.btn[disabled],
.btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}
:root[data-theme="dark"] .btn {
  --btn-bg: #212830;
  --btn-hover: #2a313b;
  --btn-press: #303845;
}
.btn.primary {
  --btn-bg: var(--primary);
  --btn-fg: var(--primary-ink);
  --btn-line: color-mix(in srgb, var(--primary), black 16%);
  --btn-hover: color-mix(in srgb, var(--primary), white 9%);
  --btn-press: color-mix(in srgb, var(--primary), black 8%);
}
:root[data-theme="dark"] .btn.primary {
  --btn-bg: var(--primary);
  --btn-line: color-mix(in srgb, var(--accent), transparent 55%);
  --btn-hover: color-mix(in srgb, var(--primary), var(--accent) 14%);
  --btn-press: color-mix(in srgb, var(--primary), var(--accent) 6%);
}
.btn.primary .icon {
  opacity: 1;
}
.btn.ghost {
  --btn-bg: transparent;
  --btn-line: transparent;
  --btn-hover: var(--hover);
  --btn-press: var(--press);
  color: var(--ink-2);
}
:root[data-theme="dark"] .btn.ghost {
  --btn-bg: transparent;
  --btn-hover: var(--hover);
  --btn-press: var(--press);
}
.btn.danger {
  --btn-bg: var(--danger);
  --btn-fg: #fff;
  --btn-line: color-mix(in srgb, var(--danger), black 16%);
  --btn-hover: color-mix(in srgb, var(--danger), white 8%);
  --btn-press: color-mix(in srgb, var(--danger), black 10%);
}
:root[data-theme="dark"] .btn.danger {
  /* the colour on its own text, solid only on hover */
  --btn-bg: #212830;
  --btn-fg: var(--danger);
  --btn-line: var(--line-2);
  --btn-hover: #b62324;
  --btn-press: #a40e26;
}
:root[data-theme="dark"] .btn.danger:hover {
  color: #fff;
  border-color: transparent;
}
.btn.danger-ghost {
  --btn-bg: transparent;
  --btn-line: transparent;
  --btn-hover: var(--danger-soft);
  --btn-press: color-mix(in srgb, var(--danger), transparent 80%);
  color: color-mix(in srgb, var(--danger), var(--ink) var(--text-mix));
}
:root[data-theme="dark"] .btn.danger-ghost {
  --btn-bg: transparent;
  --btn-hover: var(--danger-soft);
  --btn-press: color-mix(in srgb, var(--danger), transparent 80%);
}
.btn.sm {
  height: 30px;
  padding: 0 11px;
  font-size: var(--text-sm);
  gap: 6px;
  border-radius: var(--r-ctl-sm);
}
.btn.xs {
  height: 26px;
  padding: 0 9px;
  font-size: var(--text-xs);
  gap: 5px;
  border-radius: 7px;
}
.btn.lg {
  height: 42px;
  padding: 0 20px;
  font-size: var(--text-base);
  border-radius: var(--r-ctl-lg);
}
.btn.block {
  width: 100%;
}
.btn.icon-only {
  width: 34px;
  padding: 0;
}
.btn.sm.icon-only {
  width: 30px;
}
.btn.xs.icon-only {
  width: 26px;
}
.btn .spinner {
  position: absolute;
}
.btn.loading > :not(.spinner) {
  opacity: 0;
}
.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.75s linear infinite;
  opacity: 0.75;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-ctl-sm);
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color var(--t-fast), color var(--t-fast), box-shadow var(--t-med) var(--ease);
}
.icon-btn:hover {
  background: var(--hover);
  color: var(--ink);
}
.icon-btn:active {
  background: var(--press);
}
.icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.icon-btn.sm {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

/* ------------------------------------------------------------------ forms */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field > .label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
  color: var(--ink-2);
}
.field > .label .req {
  color: var(--muted);
}
.field .help {
  font-size: var(--text-xs);
  color: var(--muted);
}
.field .error {
  font-size: var(--text-xs);
  color: color-mix(in srgb, var(--danger), var(--ink) var(--text-mix));
  animation: fade var(--t-med) ease;
}

.input {
  width: 100%;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: var(--r-ctl);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-med) var(--ease), background-color var(--t-fast);
}
.input::placeholder {
  color: var(--faint);
}
.input:hover {
  border-color: color-mix(in srgb, var(--line-2), var(--ink) 12%);
}
.input:focus,
.input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.input.invalid {
  border-color: var(--danger);
}
.input.invalid:focus {
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.input[disabled],
.input[readonly] {
  background: var(--surface-2);
  color: var(--muted);
}
textarea.input {
  resize: vertical;
  min-height: 80px;
  line-height: 1.55;
}
textarea.input.code,
.input.code {
  font-family: var(--mono);
  font-feature-settings: "calt" 0, "liga" 0, "zero";
  font-size: var(--text-sm);
}
select.input {
  appearance: none;
  padding-right: 34px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.switch .track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--line-2), var(--ink) 14%);
  transition: background var(--t-med), box-shadow var(--t-med) var(--ease);
  flex: none;
}
.switch .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--t-med) var(--ease-out);
}
.switch input:checked + .track {
  background: var(--accent);
}
.switch input:checked + .track .knob {
  transform: translateX(16px);
}
.switch input:focus-visible + .track {
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.switch input:disabled + .track {
  opacity: 0.5;
}
.switch .switch-label {
  font-weight: var(--w-book);
}

/* Checkboxes and radios: the tick of the project page, as a control. Round-cornered, a soft
   accent fill when on, and the mark drawn in with a short pop. Native inputs and the custom
   .check (the table's select-all) share it. */
input[type="checkbox"]:not([role="switch"]),
input[type="radio"],
.check {
  --box: 18px;
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  flex: none;
  width: var(--box);
  height: var(--box);
  margin: 0;
  padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--line-2), var(--ink) 22%);
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent-strong);
  cursor: pointer;
  transition: background-color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-med) var(--ease);
}
input[type="radio"] {
  border-radius: 50%;
}
input[type="checkbox"]:not([role="switch"]):hover,
input[type="radio"]:hover,
.check:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
input[type="checkbox"]:not([role="switch"]):checked,
input[type="checkbox"]:not([role="switch"]):indeterminate,
input[type="radio"]:checked,
.check.on,
.check.partial {
  background: var(--accent-soft);
  border-color: var(--accent);
}
input[type="checkbox"]:not([role="switch"])::after,
input[type="radio"]::after {
  content: "";
  width: 12px;
  height: 12px;
  background: currentColor;
  transform: scale(0);
  transition: transform var(--t-med) var(--ease-out);
  -webkit-mask: var(--mark) center / contain no-repeat;
  mask: var(--mark) center / contain no-repeat;
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
input[type="checkbox"]:not([role="switch"]):indeterminate::after {
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.4' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
}
input[type="radio"]::after {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  -webkit-mask: none;
  mask: none;
}
input[type="checkbox"]:not([role="switch"]):checked::after,
input[type="checkbox"]:not([role="switch"]):indeterminate::after,
input[type="radio"]:checked::after {
  transform: scale(1);
}
input[type="checkbox"]:not([role="switch"]):focus-visible,
input[type="radio"]:focus-visible,
.check:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}
input[type="checkbox"]:not([role="switch"]):disabled,
input[type="radio"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.check .icon {
  stroke-width: 3.4;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity var(--t-fast), transform var(--t-med) var(--ease-out);
}
.check.on .icon,
.check.partial .icon {
  opacity: 1;
  transform: none;
}

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--canvas-2);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  position: relative;
  /* as wide as its buttons, never narrower (a narrow column used to leave the last one outside) */
  width: max-content;
  max-width: 100%;
}
.seg > button {
  flex: none;
  white-space: nowrap;
}
.seg button {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  padding: 5px 13px;
  border-radius: var(--r-ctl-sm);
  font-size: var(--text-sm);
  font-weight: var(--w-semibold);
  color: var(--muted);
  cursor: pointer;
  transition: color var(--t-med);
}
.seg button:hover {
  color: var(--ink-2);
}
.seg button.on {
  color: var(--ink);
}
.seg button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.seg .seg-thumb {
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  border-radius: var(--r-ctl-sm);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line-2);
  transition: left 420ms var(--ease-glide), width 420ms var(--ease-glide);
}
:root[data-theme="dark"] .seg .seg-thumb {
  background: #2a313b;
  box-shadow: 0 0 0 1px var(--line-2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-2);
  font-size: var(--text-xs);
  font-weight: var(--w-medium);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip.accent,
.chip.ok,
.chip.warn,
.chip.danger,
.chip.info,
.chip.tone {
  border-color: color-mix(in srgb, var(--c), transparent 74%);
  background: color-mix(in srgb, var(--c), transparent 90%);
  color: color-mix(in srgb, var(--c), var(--ink) var(--text-mix));
}
.chip.accent {
  --c: var(--accent);
}
.chip.ok {
  --c: var(--ok);
}
.chip.warn {
  --c: var(--warn);
}
.chip.danger {
  --c: var(--danger);
}
.chip.info {
  --c: var(--info);
}
.chip.tone {
  --c: var(--tone-1);
}
.chip.outline {
  color: var(--ink-3);
  background: var(--surface-2);
}
.chip button {
  border: 0;
  background: none;
  padding: 0;
  margin-right: -3px;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  display: grid;
}
.chip button:hover {
  opacity: 1;
}
.chip.selectable {
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.chip.selectable:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}
.chip.selectable.accent {
  background: color-mix(in srgb, var(--accent), transparent 86%);
}

.kbd {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line-2);
  font-size: var(--text-2xs);
  font-family: var(--mono);
  font-feature-settings: "calt" 0, "liga" 0, "zero";
  font-weight: var(--w-medium);
  color: var(--muted);
  background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--line-2);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
  background: var(--faint);
}
.dot.ok {
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}
.dot.warn {
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-soft);
}
.dot.danger {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.dot.live {
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
  animation: breathe 2.4s ease-in-out infinite;
}

/* ------------------------------------------------------------------ cards */

.card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.card {
  border-color: var(--line-2);
}
.card.pad {
  padding: 18px;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 {
  font-family: var(--font-display);
  font-stretch: var(--display-stretch);
  font-size: var(--text-sm);
  font-weight: var(--display-weight);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.card-body {
  padding: 18px;
}
.card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.section-title {
  font-family: var(--font-label);
  font-size: var(--text-2xs);
  font-weight: var(--w-medium);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  font-feature-settings: "case";
  color: var(--muted);
}

/* shown on every page while the server runs in development mode */
.dev-banner {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 16px;
  font-size: var(--text-sm);
  color: var(--ink);
  background: var(--warn-soft);
  border-bottom: 1px solid color-mix(in srgb, var(--warn), transparent 60%);
}

.callout {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: var(--text-sm);
}
.callout > .icon {
  color: color-mix(in srgb, var(--info), var(--ink) var(--text-mix));
  margin-top: 1px;
}
.callout.warn > .icon {
  color: color-mix(in srgb, var(--warn), var(--ink) var(--text-mix));
}
.callout.danger {
  border-color: color-mix(in srgb, var(--danger), transparent 70%);
}
.callout.danger > .icon {
  color: color-mix(in srgb, var(--danger), var(--ink) var(--text-mix));
}
.callout.ok > .icon {
  color: color-mix(in srgb, var(--ok), var(--ink) var(--text-mix));
}

.skeleton {
  border-radius: var(--r-xs);
  background: linear-gradient(90deg, var(--canvas-2) 0, color-mix(in srgb, var(--canvas-2), var(--surface) 55%) 120px, var(--canvas-2) 240px);
  background-size: 640px 100%;
  animation: shimmer 1.4s linear infinite;
  min-height: 10px;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 48px 24px;
  color: var(--muted);
  animation: fade var(--t-slow) ease;
}
.empty .empty-art {
  width: 44px;
  height: 44px;
  border-radius: var(--r-lg);
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-3);
  margin-bottom: 4px;
}
.empty h3 {
  font-size: var(--text-md);
  font-weight: var(--w-semibold);
  color: var(--ink);
}

/* ------------------------------------------------------------------ shell */

/* the sidebar on the left (sections, collections, theme, account), the page on the right */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  transition: grid-template-columns var(--t-slow) var(--ease-out);
}
.app.collapsed {
  grid-template-columns: var(--side-w-folded) minmax(0, 1fr);
}
.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.app-page {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px 12px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  overflow: hidden;
  z-index: 50;
}
.side-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 8px 6px;
}
.side-top .brand {
  flex: 1;
  min-width: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font);
  font-stretch: 100%;
  font-size: 16px;
  font-weight: var(--w-bold);
  letter-spacing: -0.02em;
  text-transform: none;
  line-height: 1;
}
.brand:hover {
  text-decoration: none;
}
.brand .brand-name b {
  font-weight: 400;
  color: var(--muted);
}
.side-fold {
  color: var(--faint);
}
.side-project:empty {
  display: none;
}
.side-project {
  padding: 0 2px 6px;
}
.side-project .menu-anchor,
.side-project .project-switch {
  width: 100%;
  max-width: none;
  margin: 0;
}

.side-search {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  margin: 0 0 8px;
  padding: 0 8px 0 11px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--faint);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: border-color var(--t-fast), color var(--t-fast);
}
.side-search:hover {
  border-color: var(--line-2);
  color: var(--muted);
}
.side-search .grow {
  text-align: left;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.side-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 36px;
  padding: 0 11px;
  border-radius: var(--r-md);
  color: var(--ink-3);
  font-weight: var(--w-medium);
  font-size: var(--text-sm);
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.side-link:hover {
  background: var(--hover);
  color: var(--ink);
  text-decoration: none;
}
.side-link .icon {
  flex: none;
  color: var(--faint);
  transition: color var(--t-fast);
}
.side-link:hover .icon {
  color: var(--ink-3);
}
.side-link.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}
.side-link.on .icon {
  color: color-mix(in srgb, var(--accent), var(--ink) var(--text-mix));
}

/* collections: the rest of the height, scrolling on its own */
.side-collections {
  flex: 1;
  min-height: 0;
  overflow: auto;
  margin: 0 -6px;
  padding: 10px 6px 6px;
  scrollbar-width: thin;
}
.tree-head {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 4px 0 11px;
}
.tree-filter {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  margin: 2px 0 6px;
  padding: 0 9px;
  border-radius: var(--r-sm);
  background: var(--hover);
  color: var(--faint);
}
.tree-filter input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
}
.tree-group + .tree-group {
  margin-top: 6px;
}
.tree-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 26px;
  padding: 0 4px 0 11px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: var(--text-2xs);
  font-weight: var(--w-semibold);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  cursor: pointer;
}
.tree-group-title .icon {
  transition: transform var(--t-med) var(--ease);
}
.tree-group-title.closed .icon {
  transform: rotate(-90deg);
}
.tree-count {
  font-weight: var(--w-medium);
  letter-spacing: 0;
  color: var(--faint);
}
.tree-items {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.coll-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 9px;
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: var(--w-book);
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.coll-item:hover {
  background: var(--hover);
  text-decoration: none;
  color: var(--ink);
}
.coll-item.on {
  background: color-mix(in srgb, var(--accent), transparent 85%);
  color: var(--ink);
  font-weight: var(--w-medium);
}
.coll-glyph {
  width: 22px;
  height: 22px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: var(--text-2xs);
  font-weight: var(--w-bold);
  --c: var(--ink-3);
  color: color-mix(in srgb, var(--c), var(--ink) var(--text-mix));
  background: color-mix(in srgb, var(--c), transparent 86%);
  flex: none;
  text-transform: uppercase;
}

.side-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.theme-switch {
  display: flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--r-md);
  background: var(--hover);
}
.theme-switch button {
  flex: 1;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.theme-switch button:hover {
  color: var(--ink);
}
.theme-switch button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}
.side-foot .menu-anchor {
  display: flex;
}
.side-user {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 8px 0 5px;
  border: 0;
  border-radius: var(--r-md);
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: var(--text-sm);
  text-align: left;
  cursor: pointer;
}
.side-user:hover {
  background: var(--hover);
}
.side-user .icon {
  color: var(--faint);
}
.avatar {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: var(--w-semibold);
  font-size: var(--text-2xs);
  color: var(--accent-strong);
  background: var(--accent-soft);
}
.menu.up {
  transform-origin: bottom left;
}

/* folded to icons (desktop): labels hidden, names in tooltips */
.app.collapsed .sidebar {
  padding-left: 10px;
  padding-right: 10px;
}
.app.collapsed .side-label,
.app.collapsed .side-project,
.app.collapsed .tree-head,
.app.collapsed .tree-filter,
.app.collapsed .tree-group-title {
  display: none;
}
.app.collapsed .side-top {
  flex-direction: column;
  padding: 2px 0 8px;
}
.app.collapsed .side-top .brand {
  flex: none;
}
.app.collapsed .side-search,
.app.collapsed .side-link,
.app.collapsed .coll-item,
.app.collapsed .side-user {
  justify-content: center;
  padding: 0;
}
.app.collapsed .theme-switch {
  flex-direction: column;
}
.app.collapsed .side-link[data-tip]:hover::after,
.app.collapsed .coll-item[data-tip]:hover::after,
.app.collapsed .side-search[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 9px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--canvas);
  font-size: var(--text-xs);
  font-weight: var(--w-medium);
  white-space: nowrap;
  pointer-events: none;
  z-index: 60;
}
.app.collapsed .sidebar,
.app.collapsed .side-collections {
  overflow: visible;
}
.app.collapsed .coll-item,
.app.collapsed .side-search {
  position: relative;
}

/* the bar above the page, and the sidebar as a drawer, on small screens */
.mobile-bar {
  display: none;
}
.side-scrim {
  display: none;
}

.page {
  flex: 1;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--page-pad);
}
/* a form-like page or panel inside the standard page */
.page-narrow {
  max-width: 900px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 26px;
}
.page-head .eyebrow {
  font-family: var(--font-label);
  font-size: var(--text-2xs);
  font-weight: var(--w-medium);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 920px) {
  :root {
    --header-h: 52px;
  }
  .app,
  .app.collapsed {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 86vw);
    transform: translateX(-102%);
    transition: transform var(--t-slow) var(--ease-out);
    box-shadow: var(--shadow-3);
  }
  .sidebar.open {
    transform: none;
  }
  .side-fold {
    display: none;
  }
  .app.collapsed .side-label,
  .app.collapsed .side-project,
  .app.collapsed .tree-head,
  .app.collapsed .tree-group-title {
    display: revert;
  }
  .side-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: color-mix(in srgb, var(--ink), transparent 70%);
    animation: fade var(--t-med) ease;
  }
  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    background: color-mix(in srgb, var(--canvas), transparent 10%);
    backdrop-filter: saturate(1.3) blur(12px);
    -webkit-backdrop-filter: saturate(1.3) blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .page {
    padding: 22px 16px 56px;
  }
}

/* ------------------------------------------------------------------ data workspace */

.workspace {
  display: flex;
  min-height: calc(100vh - var(--header-h) - var(--status-h));
  width: 100%;
}
.workspace-main {
  flex: 1;
  min-width: 0;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--page-pad);
}
@media (max-width: 920px) {
  .workspace-main {
    padding: 22px 16px 56px;
  }
}

.coll-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.coll-header h1 {
  font-family: var(--mono);
  font-stretch: normal;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-transform: none;
}
.coll-header .coll-glyph {
  width: 44px;
  height: 44px;
  border-radius: var(--r-lg);
  font-size: var(--text-lg);
}

/* tabs: a segmented row of pills, the active one raised */
.tabs {
  display: inline-flex;
  max-width: 100%;
  gap: 2px;
  padding: 4px;
  margin-bottom: 22px;
  border-radius: var(--r-lg);
  background: var(--canvas-2);
  position: relative;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs a,
.tabs button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  border-radius: var(--r-md);
  color: var(--muted);
  font-weight: var(--w-medium);
  font-size: var(--text-sm);
  border: 0;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--t-fast);
}
.tabs a:hover,
.tabs button:hover {
  color: var(--ink);
  text-decoration: none;
}
.tabs .on {
  color: var(--ink);
}
.tabs .on > .icon {
  color: color-mix(in srgb, var(--accent), var(--ink) var(--text-mix));
}
.tabs .tab-ink {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  height: auto;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: left var(--t-slow) var(--ease-out), width var(--t-slow) var(--ease-out);
}
.tabs .badge {
  font-size: var(--text-2xs);
  min-width: 18px;
  height: 17px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--hover);
  display: inline-grid;
  place-items: center;
  color: var(--muted);
}

/* ------------------------------------------------------------------ data grid */

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.filter-box {
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 4px 0 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--surface);
  transition: border-color var(--t-fast), box-shadow var(--t-med);
}
.filter-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.filter-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font-family: var(--mono);
  font-feature-settings: "calt" 0, "liga" 0, "zero";
  font-size: var(--text-sm);
}
.filter-box > .icon {
  color: var(--faint);
}

.grid-wrap {
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  overflow: auto;
  max-height: calc(100vh - 300px - var(--status-h));
  min-height: 160px;
}
table.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}
table.grid th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: color-mix(in srgb, var(--surface), transparent 8%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-align: left;
  font-family: var(--font-label);
  font-weight: var(--w-medium);
  font-size: var(--text-2xs);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 12px;
  height: 40px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  user-select: none;
}
table.grid th.sortable {
  cursor: pointer;
}
table.grid th.sortable:hover {
  color: var(--ink);
}
table.grid th .th {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
table.grid th .th .icon {
  opacity: 0.6;
}
table.grid th .th .sort-ind {
  color: var(--ink);
  opacity: 1;
}
table.grid td {
  padding: 0 12px;
  height: 48px;
  border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 35%);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background var(--t-fast);
}
table.grid tbody tr {
  cursor: pointer;
  animation: fade var(--t-med) ease backwards;
  animation-delay: calc(var(--i, 0) * 10ms);
}
table.grid tbody tr:last-child td {
  border-bottom: 0;
}
table.grid tbody tr:hover td {
  background: color-mix(in srgb, var(--accent), transparent 95%);
}
table.grid tbody tr.selected td {
  background: var(--accent-soft);
}
/* long pages draw the rows in view (records.js): no entrance, and spacers for the rest */
table.grid.windowed tbody tr {
  animation: none;
}
table.grid tbody tr.spacer {
  cursor: default;
  animation: none;
}
table.grid tbody tr.spacer td {
  padding: 0;
  border: 0;
  background: none;
}
table.grid tbody tr.flash td {
  animation: flash 1.4s ease;
}
table.grid tbody tr:last-child td {
  border-bottom: 0;
}
table.grid .col-check {
  width: 40px;
  padding-right: 0;
}
table.grid .col-actions {
  width: 40px;
  text-align: right;
}
.cell-id {
  font-family: var(--mono);
  font-feature-settings: "calt" 0, "liga" 0, "zero";
  font-size: var(--text-xs);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cell-bool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cell-json {
  font-family: var(--mono);
  font-feature-settings: "calt" 0, "liga" 0, "zero";
  font-size: var(--text-xs);
  color: var(--muted);
}
.thumbs {
  display: flex;
  gap: 4px;
}
.thumb {
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--canvas-2);
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  flex: none;
}

.bulkbar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 16px;
  border-radius: var(--r-lg);
  background: var(--raised);
  border: 1px solid var(--line-2);
  color: var(--ink);
  box-shadow: var(--shadow-3);
  animation: rise var(--t-slow) var(--ease-out);
}

.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: var(--text-sm);
}
.pager .pages {
  display: flex;
  gap: 2px;
}
.pager .pages button {
  min-width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-weight: var(--w-medium);
  font-variant-numeric: tabular-nums;
  transition: background var(--t-fast), color var(--t-fast);
}
.pager .pages button:hover {
  background: var(--hover);
  color: var(--ink);
}
.pager .pages button.on {
  color: color-mix(in srgb, var(--accent), var(--ink) var(--text-mix));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent), transparent 70%);
  background: var(--accent-soft);
}

/* ------------------------------------------------------------------ overlays */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: color-mix(in srgb, var(--canvas), transparent 25%);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 7vh 16px 24px;
  overflow: auto;
  animation: fade var(--t-med) ease;
}
.backdrop.closing {
  animation: fade var(--t-med) ease reverse forwards;
}
.sheet {
  width: 100%;
  max-width: 620px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
  animation: sheet var(--t-slow) var(--ease-out);
  display: flex;
  flex-direction: column;
  max-height: 86vh;
}
.backdrop.closing .sheet {
  animation: sheet var(--t-med) var(--ease-out) reverse forwards;
}
.sheet.wide {
  max-width: 1020px;
}
.sheet.mid {
  max-width: 800px;
}
.sheet.narrow {
  max-width: 440px;
}
/* a form inside a sheet passes the height on, so the body scrolls */
.sheet > form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
/* a drawer from the right (the record editor): the page stays in view beside it */
.backdrop.at-side {
  justify-content: flex-end;
  align-items: stretch;
  padding: 10px;
  background: color-mix(in srgb, var(--ink), transparent 82%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.sheet.drawer {
  max-width: min(880px, 100%);
  max-height: none;
  height: 100%;
  border-radius: var(--r-xl);
  animation: drawer var(--t-slow) var(--ease-out);
}
.backdrop.closing .sheet.drawer {
  animation: drawer var(--t-med) var(--ease-out) reverse forwards;
}
@keyframes drawer {
  from {
    opacity: 0;
    transform: translateX(32px);
  }
}
.sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.sheet-head h2 {
  font-size: var(--text-lg);
  font-weight: var(--w-semibold);
  letter-spacing: var(--track-title);
  line-height: 1.25;
}
.sheet-body {
  padding: 20px;
  overflow: auto;
  flex: 1;
}
.sheet-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}

.record-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
.record-layout .record-fields {
  padding: 20px;
  overflow: auto;
}
.record-layout .record-meta {
  border-left: 1px solid var(--line);
  padding: 20px 18px;
  background: var(--surface-2);
  overflow: auto;
}
@media (max-width: 860px) {
  .record-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .record-layout .record-meta {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
}
.meta-item .k {
  font-size: var(--text-2xs);
  color: var(--faint);
  font-weight: var(--w-semibold);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
}

.menu {
  position: absolute;
  z-index: 90;
  min-width: 200px;
  padding: 4px;
  border-radius: var(--r-lg);
  background: var(--raised);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-3);
  animation: pop var(--t-med) var(--ease-out);
  transform-origin: top right;
}
.menu button,
.menu a {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  text-align: left;
  color: var(--ink-2);
  cursor: pointer;
  font-size: var(--text-sm);
}
.menu button:hover,
.menu a:hover {
  background: var(--hover);
  color: var(--ink);
  text-decoration: none;
}
.menu .danger {
  color: color-mix(in srgb, var(--danger), var(--ink) var(--text-mix));
}
.menu .danger:hover {
  background: var(--danger-soft);
  color: color-mix(in srgb, var(--danger), var(--ink) var(--text-mix));
}
.menu hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 4px;
}
.menu-anchor {
  position: relative;
  display: inline-flex;
}

.palette {
  width: 100%;
  max-width: 580px;
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
  animation: sheet var(--t-slow) var(--ease-out);
  overflow: hidden;
}
.palette-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.palette-input input {
  flex: 1;
  border: 0;
  outline: 0;
  background: none;
  font-size: var(--text-md);
  color: var(--ink);
}
.palette-list {
  max-height: 380px;
  overflow: auto;
  padding: 6px;
}
.palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--ink-2);
}
.palette-item.on {
  background: var(--hover);
  color: var(--ink);
  box-shadow: inset 2px 0 0 var(--accent);
}
.palette-item .hint {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--faint);
}

.toasts {
  position: fixed;
  z-index: 120;
  left: 50%;
  top: calc(var(--header-h) + 12px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 7px 8px 7px 12px;
  border-radius: var(--r-lg);
  background: var(--raised);
  border: 1px solid var(--line-2);
  color: var(--ink);
  box-shadow: var(--shadow-3);
  font-weight: var(--w-book);
  font-size: var(--text-sm);
  animation: drop var(--t-slow) var(--ease-out);
  max-width: min(560px, 92vw);
}
.toast.leaving {
  animation: drop var(--t-med) var(--ease-out) reverse forwards;
}
.toast .toast-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: none;
}
.toast.ok .toast-icon {
  color: color-mix(in srgb, var(--ok), var(--ink) var(--text-mix));
}
.toast.error .toast-icon {
  color: color-mix(in srgb, var(--danger), var(--ink) var(--text-mix));
}
.toast.info .toast-icon {
  color: color-mix(in srgb, var(--info), var(--ink) var(--text-mix));
}
.toast button {
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: inherit;
  border-radius: var(--r-sm);
  height: 24px;
  padding: 0 8px;
  cursor: pointer;
  font-weight: var(--w-medium);
  font-size: var(--text-xs);
}

.tip {
  position: relative;
}
.tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translate(-50%, 2px);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--canvas);
  font-size: var(--text-xs);
  font-weight: var(--w-book);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast), transform var(--t-med) var(--ease);
  z-index: 100;
}
.tip:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
  transition-delay: 400ms;
}

/* ------------------------------------------------------------------ sign-in */

/* two halves: a warm panel with what slonbase is, and the form */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.auth-art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 12px;
  padding: 40px 44px;
  border-radius: var(--r-xl);
  border: 1px solid #30363d;
  overflow: hidden;
  color: #e6edf3;
  background: #0d1117;
}
/* a faint grid, like a table, fading out */
.auth-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(70% 70% at 30% 30%, black, transparent);
  -webkit-mask-image: radial-gradient(70% 70% at 30% 30%, black, transparent);
  pointer-events: none;
}
.auth-art > * {
  position: relative;
}
.auth-art-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font);
  font-stretch: 100%;
  font-size: 18px;
  font-weight: var(--w-bold);
  letter-spacing: -0.02em;
  text-transform: none;
  line-height: 1;
}
.auth-art-brand .brand-name b {
  font-weight: 400;
  color: rgba(245, 241, 232, 0.7);
}
.auth-art-copy h2 {
  max-width: 440px;
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-stretch: var(--display-stretch);
  font-size: 36px;
  font-weight: var(--display-weight);
  letter-spacing: var(--display-track);
  text-transform: uppercase;
  line-height: 1.08;
  color: #fbf8f1;
}
.auth-art-copy ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: rgba(245, 241, 232, 0.86);
}
.auth-art-copy li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-art-copy li .icon {
  flex: none;
  padding: 6px;
  width: 30px;
  height: 30px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.1);
}
.auth-art-foot {
  font-size: var(--text-xs);
  color: #9198a1;
}
.auth-art-foot .c-prompt {
  color: #3fb950;
  margin-right: 4px;
}
.auth-form {
  width: 100%;
  max-width: 380px;
  margin: auto;
  padding: 40px 20px;
  animation: rise var(--t-slow) var(--ease-out);
}
@media (max-width: 880px) {
  .auth-page {
    grid-template-columns: minmax(0, 1fr);
  }
  .auth-art {
    display: none;
  }
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.auth-foot {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: var(--text-xs);
}

/* ------------------------------------------------------------------ overview */

.stat {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  transition: border-color var(--t-fast);
}
.stat .stat-value {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat .stat-icon {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  --c: var(--accent);
  color: color-mix(in srgb, var(--c), var(--ink) var(--text-mix));
  background: color-mix(in srgb, var(--c), transparent 89%);
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 130px;
  padding-top: 10px;
}
.bars .bar {
  flex: 1;
  min-width: 3px;
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(to top, color-mix(in srgb, var(--accent), transparent 45%), color-mix(in srgb, var(--accent), transparent 8%));
  opacity: 0.9;
  transform-origin: bottom;
  animation-delay: calc(var(--i, 0) * 8ms);
  position: relative;
  transition: opacity var(--t-fast), background var(--t-fast);
}
.bars .bar:hover {
  opacity: 1;
  background: var(--accent-strong);
}
.bars .bar.zero {
  background: var(--line-2);
  opacity: 1;
}

/* the hero: greeting and actions, with the day's traffic beside them */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 32px;
  padding: 30px 32px;
  margin-bottom: 18px;
  overflow: hidden;
  background:
    radial-gradient(600px 260px at 100% 0%, color-mix(in srgb, var(--accent), transparent 90%), transparent 70%) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(var(--line), var(--line)) border-box;
}
.hero h1 {
  font-size: 32px;
  margin: 6px 0 8px;
}
.hero p {
  margin: 0 0 10px;
  max-width: 440px;
}
.hero .endpoint {
  margin-bottom: 22px;
}
.hero .eyebrow {
  font-family: var(--font-label);
  font-size: var(--text-2xs);
  font-weight: var(--w-medium);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.hero-actions {
  gap: 8px;
}
.hero-chart {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.hero-chart-head {
  align-items: flex-end;
  margin-bottom: 8px;
}
.hero-total {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 1060px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 24px;
  }
}

.area-chart {
  position: relative;
  height: 170px;
}
.area-chart svg {
  position: absolute;
  inset: 0 0 20px 0;
  width: 100%;
  height: calc(100% - 20px);
  overflow: visible;
}
.area-cols {
  position: absolute;
  inset: 0 0 20px 0;
  display: flex;
}
.area-cols span {
  flex: 1;
  border-radius: var(--r-xs);
  transition: background var(--t-fast);
}
.area-cols span.on {
  background: linear-gradient(to top, color-mix(in srgb, var(--accent), transparent 86%), transparent);
}
.area-tip {
  position: absolute;
  top: -6px;
  transform: translateX(-50%);
  padding: 4px 9px;
  border-radius: var(--r-sm);
  background: var(--raised);
  box-shadow: var(--shadow-2);
  font-size: var(--text-xs);
  white-space: nowrap;
  pointer-events: none;
}
.area-axis {
  position: absolute;
  inset: auto 0 0 0;
  justify-content: space-between;
}

/* four tiles: what's stored and how it's doing */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.metric {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  padding: 16px 18px;
  color: inherit;
}
.metric:hover {
  text-decoration: none;
  border-color: var(--line-2);
}
.metric-icon {
  grid-row: span 2;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  color: var(--c, var(--accent));
  background: color-mix(in srgb, var(--c, var(--accent)), transparent 88%);
}
.metric-label {
  font-family: var(--font-label);
  font-size: var(--text-2xs);
  font-weight: var(--w-medium);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--muted);
}
.metric-value {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 1060px) {
  .overview-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* collections ranked by their records, with a bar for their share */
.coll-rows {
  display: flex;
  flex-direction: column;
  padding: 6px;
  /* many collections scroll inside the card instead of making the page long */
  max-height: 440px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.coll-filter {
  padding: 8px 10px 0;
}
.coll-row {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) minmax(80px, 1.2fr) 80px auto;
  align-items: center;
  gap: 14px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: var(--ink);
  transition: background var(--t-fast);
}
.coll-row:hover {
  background: var(--hover);
  text-decoration: none;
}
.coll-row-name {
  min-width: 0;
  font-weight: var(--w-medium);
}
.coll-row-bar {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--hover);
  overflow: hidden;
}
.coll-row-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: color-mix(in srgb, var(--accent), transparent 40%);
  transform-origin: left;
}
.coll-row-count {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.checklist {
  display: flex;
  flex-direction: column;
  padding: 6px;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--r-md);
  color: var(--ink);
}
a.check-row:hover {
  background: var(--hover);
  text-decoration: none;
}
.check-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  --c: var(--ok);
  color: color-mix(in srgb, var(--c), var(--ink) var(--text-mix));
  background: color-mix(in srgb, var(--c), transparent 86%);
}
.check-dot.warn {
  --c: var(--warn);
}
.check-dot.danger {
  --c: var(--danger);
}

/* ------------------------------------------------------------------ schema editor */

.field-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color var(--t-fast), box-shadow var(--t-med);
}
.field-card:hover {
  border-color: var(--line-2);
}
.field-card.open {
  border-color: var(--line-2);
  box-shadow: var(--shadow-2);
}
.field-card.removed {
  opacity: 0.55;
}
.field-card.removed .field-name-input {
  text-decoration: line-through;
}
.field-card.dragging {
  opacity: 0.4;
}
.field-card.drop-target {
  box-shadow: 0 -2px 0 0 var(--accent);
}
.field-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
}
.field-type-badge {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  --c: var(--accent);
  background: color-mix(in srgb, var(--c), transparent 90%);
  border: 1px solid color-mix(in srgb, var(--c), transparent 80%);
  color: color-mix(in srgb, var(--c), var(--ink) var(--text-mix));
  flex: none;
}
.field-name-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: 0;
  font-weight: var(--w-medium);
  font-family: var(--mono);
  font-feature-settings: "calt" 0, "liga" 0, "zero";
  font-size: var(--text-sm);
  padding: 5px 8px;
  border-radius: var(--r-sm);
  transition: background var(--t-fast), box-shadow var(--t-fast);
}
.field-name-input:hover {
  background: var(--hover);
}
.field-name-input:focus {
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--accent-ring);
}
.field-card-body {
  padding: 4px 14px 16px 48px;
  animation: fade var(--t-med) ease;
}
.drag-handle {
  cursor: grab;
  color: var(--faint);
  display: grid;
}
.drag-handle:active {
  cursor: grabbing;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}
.type-tile {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.type-tile:hover {
  border-color: var(--ink-3);
  background: var(--surface-2);
}

.rule-card {
  padding: 14px 16px;
}
.rule-editor {
  font-family: var(--mono);
  font-feature-settings: "calt" 0, "liga" 0, "zero";
  font-size: var(--text-sm);
  min-height: 44px;
}
.rule-locked {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  border: 1px dashed var(--line-2);
  color: var(--muted);
  background: var(--surface-2);
  font-size: var(--text-sm);
}

.endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--t-fast);
}
.endpoint:hover,
.endpoint.open {
  border-color: var(--line-2);
}
.method {
  font-family: var(--mono);
  font-feature-settings: "calt" 0, "liga" 0, "zero";
  font-size: var(--text-2xs);
  font-weight: var(--w-semibold);
  padding: 2px 6px;
  border-radius: var(--r-xs);
  min-width: 52px;
  text-align: center;
  letter-spacing: 0.03em;
  --c: var(--ink-3);
  border: 1px solid color-mix(in srgb, var(--c), transparent 74%);
  background: color-mix(in srgb, var(--c), transparent 90%);
  color: color-mix(in srgb, var(--c), var(--ink) var(--text-mix));
}
.method.GET {
  --c: var(--info);
}
.method.POST {
  --c: var(--ok);
}
.method.PATCH,
.method.PUT {
  --c: var(--warn);
}
.method.DELETE {
  --c: var(--danger);
}

pre.code {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-family: var(--mono);
  font-feature-settings: "calt" 0, "liga" 0, "zero";
  font-size: var(--text-sm);
  line-height: 1.6;
  overflow: auto;
  position: relative;
}

/* ------------------------------------------------------------------ uploads & pickers */

.dropzone {
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.dropzone.over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.file-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.file-tile {
  position: relative;
  width: 90px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  overflow: hidden;
  animation: pop var(--t-med) var(--ease-out);
}
.file-tile .preview {
  width: 100%;
  height: 68px;
  object-fit: cover;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--canvas-2);
}
.file-tile .name {
  font-size: var(--text-2xs);
  padding: 4px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-tile .remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: var(--r-xs);
  border: 0;
  background: rgba(20, 20, 24, 0.65);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t-fast);
}
.file-tile:hover .remove {
  opacity: 1;
}
.file-tile.new {
  border-color: var(--ok);
}
.file-tile.gone {
  opacity: 0.4;
}

.picker-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 340px;
  overflow: auto;
}
.picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast);
}
.picker-item:hover {
  background: var(--hover);
}
.picker-item.on {
  background: var(--accent-soft);
}

.status-2 {
  color: color-mix(in srgb, var(--ok), var(--ink) var(--text-mix));
}
.status-3 {
  color: color-mix(in srgb, var(--info), var(--ink) var(--text-mix));
}
.status-4 {
  color: color-mix(in srgb, var(--warn), var(--ink) var(--text-mix));
}
.status-5 {
  color: color-mix(in srgb, var(--danger), var(--ink) var(--text-mix));
}

.settings-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.settings-nav {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.settings-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-md);
  color: var(--ink-3);
  font-weight: var(--w-book);
  transition: background var(--t-fast), color var(--t-fast);
}
.settings-nav a:hover {
  background: var(--hover);
  color: var(--ink);
  text-decoration: none;
}
.settings-nav a.on {
  background: var(--surface);
  color: var(--ink);
  font-weight: var(--w-medium);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-1);
}
.settings-nav a.on .icon {
  color: color-mix(in srgb, var(--accent), var(--ink) var(--text-mix));
}
@media (max-width: 860px) {
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .settings-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
  }
}

.savebar {
  position: sticky;
  bottom: 18px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 8px 8px 8px 16px;
  border-radius: var(--r-lg);
  background: var(--raised);
  border: 1px solid var(--line-2);
  color: var(--ink);
  box-shadow: var(--shadow-3);
  animation: rise var(--t-slow) var(--ease-out);
}

.sql-grid td {
  font-family: var(--mono);
  font-feature-settings: "calt" 0, "liga" 0, "zero";
  font-size: var(--text-xs);
}
.copy-ok {
  color: var(--ok) !important;
}
.swatch {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: box-shadow var(--t-fast);
}
.swatch:hover {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 0 0 2px var(--surface), 0 0 0 3px var(--line-2);
}
.swatch.on {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink-2);
}
/* the custom color: a round well with a conic hint that any color works */
.swatch-custom {
  appearance: none;
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #b06a50, #ad8542, #7c8452, #4f7a6c, #5f7593, #7a6b9c, #9d6582, #b06a50);
  cursor: pointer;
  overflow: hidden;
}
.swatch-custom::-webkit-color-swatch-wrapper {
  padding: 5px;
}
.swatch-custom::-webkit-color-swatch {
  border: 0;
  border-radius: 50%;
}
.swatch-custom::-moz-color-swatch {
  border: 0;
  border-radius: 50%;
}

.map-preview {
  position: relative;
  height: 160px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--canvas-2);
}
.map-preview img {
  position: absolute;
  left: 0;
  top: 0;
  width: 256px;
  height: 256px;
  filter: grayscale(0.85) contrast(0.95);
}
:root[data-theme="dark"] .map-preview img {
  filter: grayscale(1) invert(0.9) contrast(0.9);
}
.map-pin {
  position: absolute;
  left: 160px;
  top: 80px;
  transform: translate(-50%, -100%);
  color: var(--ink);
}
.map-credit {
  position: absolute;
  right: 6px;
  bottom: 4px;
  font-size: 10px;
  color: #555;
  background: rgba(255, 255, 255, 0.75);
  padding: 0 4px;
  border-radius: 3px;
}
.card-head:last-child {
  border-bottom: 0;
}

/* ------------------------------------------------------------------ projects */

.project-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  max-width: 200px;
  margin-left: 4px;
  padding: 0 8px 0 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.project-switch:hover,
.project-switch.on {
  border-color: var(--line-2);
  background: var(--surface-2);
}
.project-switch-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}
.project-dot.main {
  background: var(--faint);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.project-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 190px;
  animation-delay: calc(var(--i, 0) * 30ms);
}
.project-glyph {
  width: 36px;
  height: 36px;
  font-size: var(--text-md);
  text-transform: uppercase;
}
.project-name {
  display: block;
  color: var(--ink);
  font-weight: var(--w-semibold);
  font-size: var(--text-md);
}
.project-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  margin: 0;
}
.project-facts dt {
  color: var(--muted);
}
.project-facts dd {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.truncate {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.btn:hover {
  text-decoration: none;
}
.auth-brand .chip {
  margin-left: 4px;
}

@media (max-width: 760px) {
  .project-switch {
    max-width: 120px;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------ health */

.health-tile .stat-value {
  font-size: var(--text-2xl);
}
.spark {
  width: 100%;
  height: 32px;
  margin-top: 6px;
  overflow: visible;
}
.spark-empty {
  height: 32px;
  margin-top: 6px;
  border-bottom: 1px dashed var(--line);
}
.spark-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.spark-area {
  fill: var(--accent-soft);
  stroke: none;
}
.meter {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--canvas-2);
  overflow: hidden;
  margin-top: 10px;
}
.meter-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width var(--t-slow) var(--ease-out);
}
.meter-fill.warn {
  background: var(--warn);
}
.checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.check-item {
  --c: var(--ok);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  border: 1px solid color-mix(in srgb, var(--c), transparent 78%);
  background: color-mix(in srgb, var(--c), transparent 94%);
  animation-delay: calc(var(--i, 0) * 40ms);
}
.check-item.warn {
  --c: var(--warn);
}
.check-item.danger {
  --c: var(--danger);
}
.check-item.info {
  --c: var(--info);
}
.check-item.compact {
  padding: 6px 12px;
  align-items: center;
  border-color: transparent;
  background: none;
}
.check-item .check-icon {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--c), var(--ink) var(--text-mix));
  background: color-mix(in srgb, var(--c), transparent 86%);
}
.check-item.compact .check-icon {
  width: 20px;
  height: 20px;
}
.check-title {
  font-weight: var(--w-semibold);
  font-size: var(--text-base);
}
.check-item .btn {
  flex: none;
  align-self: center;
}
.kv {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: var(--text-sm);
  padding: 3px 0;
}
.kv .kv-value {
  margin-left: auto;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.instances {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}
.instance {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  min-width: 0;
  animation-delay: calc(var(--i, 0) * 40ms);
}
.instance.current {
  border-color: var(--accent-ring);
}
.instance.gone {
  opacity: 0.65;
  border-style: dashed;
}

/* ------------------------------------------------------------------ diagram */

.dg-page {
  height: calc(100vh - var(--header-h) - var(--status-h));
  display: flex;
  flex-direction: column;
  min-height: 420px;
}
.dg-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: relative;
  z-index: 5;
}
.dg-title-block {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-right: 6px;
}
.dg-title-block h1 {
  font-family: var(--mono);
  font-stretch: normal;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-transform: none;
  margin: 0;
}
.dg-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 300px;
  max-width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md, 9px);
  background: var(--canvas);
  color: var(--faint);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.dg-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.dg-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
}
.dg-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg, 12px);
  background: var(--surface);
  box-shadow: var(--shadow-3);
  z-index: 30;
}
.dg-result {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: var(--text-sm);
  text-align: left;
  cursor: pointer;
}
.dg-result .icon {
  color: var(--faint);
}
.dg-result.on,
.dg-result:hover {
  background: var(--hover);
  color: var(--ink);
}
.dg-canvas {
  position: relative;
  flex: 1;
  overflow: hidden;
  cursor: default;
  touch-action: none;
  user-select: none;
  background-color: var(--canvas);
  background-image: radial-gradient(circle, color-mix(in srgb, var(--ink), transparent 82%) var(--dot-size, 1px), transparent calc(var(--dot-size, 1px) + 0.4px));
  background-size: var(--grid, 22px) var(--grid, 22px);
  background-position: var(--gx, 0) var(--gy, 0);
}
.dg-canvas.panning {
  cursor: grabbing;
}
.dg-svg {
  display: block;
  position: absolute;
  inset: 0;
}
.dg-svg .icon {
  overflow: visible;
}
.dg-tooltip {
  position: absolute;
  transform: translate(-50%, calc(-100% - 14px));
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
  font-size: var(--text-sm);
  white-space: nowrap;
  pointer-events: none;
  z-index: 8;
  animation: fade 0.12s ease both;
}
.dg-legend {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 6px 0 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface), transparent 6%);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-2);
  font-size: var(--text-xs);
  color: var(--muted);
  white-space: nowrap;
  z-index: 6;
}
.dg-legend > span:not(.dg-legend-sep):not(.tip) {
  margin-right: 8px;
}
.dg-legend-svg {
  flex: none;
}
.dg-legend-sep {
  width: 1px;
  height: 16px;
  background: var(--line);
}
.dg-legend .tip {
  display: inline-flex;
  padding: 4px;
}
.dg-legend .icon-btn {
  width: 24px;
  height: 24px;
}
.dg-legend-toggle {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 6;
  box-shadow: var(--shadow-1);
}
.dg-corner {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 6;
}
.dg-minimap {
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface), transparent 6%);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-2);
  cursor: pointer;
}
.dg-minimap-view {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.2;
}
.dg-zoom {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
}
.dg-zoom .icon-btn {
  width: 30px;
  height: 30px;
}
.dg-zoom-value {
  min-width: 52px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.dg-zoom-value:hover {
  background: var(--hover);
}
.dg-zoom-sep {
  width: 1px;
  height: 18px;
  margin: 0 3px;
  background: var(--line);
}
.dg-inspector {
  position: absolute;
  top: 16px;
  right: 16px;
  max-height: calc(100% - 212px);
  width: 300px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  user-select: text;
  box-shadow: var(--shadow-3);
  z-index: 7;
  animation: dg-slide 0.24s var(--ease-out, ease) both;
}
@keyframes dg-slide {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
}
.dg-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.dg-facts > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  border-radius: 9px;
  background: var(--surface-2);
}
.dg-facts b {
  font-size: var(--text-lg);
  font-weight: var(--w-bold);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.dg-facts span {
  font-size: var(--text-2xs);
  color: var(--muted);
}
.dg-section {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dg-section .section-title {
  margin-bottom: 4px;
}
.dg-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: var(--text-sm);
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.dg-link:hover:not(:disabled) {
  background: var(--hover);
  color: var(--ink);
}
.dg-link:disabled {
  cursor: default;
  opacity: 0.6;
}
.dg-rules {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dg-rule {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  padding: 2px 0;
}
@media (max-width: 760px) {
  .dg-inspector {
    left: 12px;
    right: 12px;
    width: auto;
    top: auto;
    bottom: 12px;
    max-height: 55%;
  }
  .dg-minimap,
  .dg-legend {
    display: none;
  }
  .dg-search {
    width: 100%;
    order: 5;
  }
}
@media (max-width: 1080px) {
  .dg-legend {
    display: none;
  }
}

/* ------------------------------------------------------------------ motion */

/* Only what helps you follow a change: overlays and menus fade in (with a 4px rise for the
   ones that open from somewhere), a toast's time runs out, a live dot pulses, a changed row
   flashes once. Nothing on hover moves. */
.page-head h1 {
  font-size: 28px;
}
.menu {
  animation: drop var(--t-med) var(--ease-out);
}
.toast {
  position: relative;
  overflow: hidden;
  animation: rise var(--t-slow) var(--ease-out);
}
.toast::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.18;
  transform-origin: left;
  animation: life var(--life, 3600ms) linear forwards;
}
@keyframes life {
  to {
    transform: scaleX(0);
  }
}
.backdrop {
  animation: fade var(--t-med) ease;
}
.sheet,
.palette {
  animation: rise var(--t-slow) var(--ease-out);
}
.field > .label {
  transition: color var(--t-fast);
}
.field:focus-within > .label {
  color: var(--ink);
}

/* dark: selections are a lighter fill with a hairline, as on GitHub, and overlays dim to black */
.side-link.on,
.tabs .tab-ink,
.seg .seg-thumb,
.theme-switch button.on {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
:root[data-theme="dark"] .side-link.on,
:root[data-theme="dark"] .tabs .tab-ink,
:root[data-theme="dark"] .seg .seg-thumb,
:root[data-theme="dark"] .theme-switch button.on {
  background: #212830;
}
.side-link.on::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
:root[data-theme="dark"] .backdrop.at-side {
  background: rgba(1, 4, 9, 0.55);
}
:root[data-theme="dark"] .sheet,
:root[data-theme="dark"] .menu,
:root[data-theme="dark"] .palette {
  border-color: var(--line-2);
}

/* sign in: the wordmark as in the sidebar, a display title, and the form arriving in steps */
.auth-brand {
  font-family: var(--font);
  font-stretch: 100%;
  font-size: 17px;
  font-weight: var(--w-bold);
  letter-spacing: -0.02em;
  text-transform: none;
  line-height: 1;
}
.auth-brand .brand-name b {
  font-weight: 400;
  color: var(--muted);
}
.auth-form h1 {
  font-size: 32px;
}

/* a page whose module is loading (lazy() in core.js) */
.page-loading {
  display: grid;
  place-items: center;
  min-height: 40vh;
}
.page-loading .spinner {
  opacity: 0;
  animation: fade var(--t-med) ease 0.15s forwards, spin 0.8s linear infinite;
}

/* a view query's preview (data.js): fields as chips, then a few rows */
.view-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}
.view-preview table.grid td {
  height: 38px;
}

/* ------------------------------------------------------------------ developer surfaces */

/* the status bar: connection, database, version and API base, as in an editor */
.statusbar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--status-h);
  padding: 0 14px;
  border-top: 1px solid var(--line-2);
  background: var(--sidebar);
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--text-2xs);
  white-space: nowrap;
  overflow: hidden;
}
.statusbar .sb-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.statusbar .sb-item.ok {
  color: color-mix(in srgb, var(--ok), var(--ink) var(--text-mix));
}
.statusbar .sb-item.bad {
  color: color-mix(in srgb, var(--danger), var(--ink) var(--text-mix));
}
.statusbar .sb-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.statusbar .sb-sep {
  width: 1px;
  height: 12px;
  background: var(--line-2);
}
.statusbar a {
  color: inherit;
}
.statusbar a:hover {
  color: var(--ink);
}
@media (max-width: 720px) {
  .statusbar .sb-wide {
    display: none;
  }
}

/* the API endpoint, ready to copy */
.endpoint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  height: 32px;
  padding: 0 4px 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--ink-2);
}
.endpoint .endpoint-method {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--accent), var(--ink) var(--text-mix));
}
.endpoint .endpoint-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* sign-in: the SDK at work, in an editor window */
.code-window {
  max-width: 500px;
  border: 1px solid #30363d;
  border-radius: var(--r-lg);
  background: #010409;
  overflow: hidden;
}
.code-window-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-bottom: 1px solid #30363d;
  background: #151b23;
  color: #9198a1;
  font-family: var(--mono);
  font-size: var(--text-2xs);
}
.code-window-bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3d444d;
}
.code-window-bar span {
  margin-left: 8px;
}
.code-window pre {
  margin: 0;
  padding: 14px 16px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #e6edf3;
  white-space: pre;
  overflow: hidden;
}
.code-window .c-cm {
  color: #9198a1;
}
.code-window .c-kw {
  color: #ff7b72;
}
.code-window .c-str {
  color: #a5d6ff;
}
.code-window .c-fn {
  color: #d2a8ff;
}
.code-window .c-prompt {
  color: #3fb950;
}

/* ------------------------------------------------------------------ SQL console */

.sql-mode {
  gap: 10px;
  align-self: center;
}
.sql-mode .chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.sql-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
@media (max-width: 960px) {
  .sql-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* the side: tables and their columns, or the history */
.sql-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - var(--status-h) - 32px);
  min-height: 320px;
}
.sql-side-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
}
.sql-side-tabs button {
  height: 28px;
  border-radius: var(--r-sm);
  font-size: var(--text-xs);
  font-weight: var(--w-medium);
  color: var(--muted);
}
.sql-side-tabs button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
:root[data-theme="dark"] .sql-side-tabs button.on {
  background: #212830;
}
.sql-schema {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.sql-schema .tree-filter {
  margin: 0 0 6px;
}
.sql-schema-list,
.sql-history {
  overflow: auto;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sql-table-row {
  display: flex;
  align-items: center;
  gap: 2px;
}
.sql-table-row .icon-btn {
  opacity: 0;
}
.sql-table-row:hover .icon-btn,
.sql-table-row .icon-btn:focus-visible {
  opacity: 1;
}
.sql-table-toggle {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 6px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: var(--text-xs);
  text-align: left;
  cursor: pointer;
}
.sql-table-toggle:hover,
.sql-column:hover,
.sql-history-item:hover {
  background: var(--hover);
}
.sql-table-toggle > .icon {
  color: var(--faint);
}
.sql-columns {
  display: flex;
  flex-direction: column;
  margin: 0 0 4px 20px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}
.sql-column {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 24px;
  padding: 0 6px;
  border: 0;
  border-radius: var(--r-xs);
  background: none;
  color: var(--ink-3);
  font-size: var(--text-2xs);
  cursor: pointer;
  text-align: left;
}
.sql-column .faint {
  flex: none;
}
.sql-history-item {
  display: block;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  text-align: left;
  cursor: pointer;
  color: var(--ink-2);
}
.sql-history-item code {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--text-2xs);
  white-space: pre-wrap;
  word-break: break-word;
}

/* the editor: line numbers, and a textarea over its own highlighted copy */
.sql-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.sql-editor-card {
  overflow: hidden;
}
.sql-editor {
  display: flex;
  height: 260px;
  min-height: 140px;
  max-height: 70vh;
  resize: vertical;
  overflow: hidden;
  background: var(--surface);
  --sql-font: 500 13px/20px var(--mono);
}
.sql-gutter {
  flex: none;
  min-width: 44px;
  padding: 12px 10px 12px 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--faint);
  font: var(--sql-font);
  font-size: 11.5px;
  text-align: right;
  user-select: none;
}
.sql-gutter-error {
  color: color-mix(in srgb, var(--danger), var(--ink) var(--text-mix));
  font-weight: 700;
  background: var(--danger-soft);
  margin-right: -10px;
  padding-right: 10px;
}
.sql-code {
  position: relative;
  flex: 1;
  min-width: 0;
}
.sql-code pre,
.sql-code textarea {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  font: var(--sql-font);
  font-feature-settings: "calt" 0, "liga" 0, "zero";
  letter-spacing: 0;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}
.sql-code pre {
  color: var(--ink);
  pointer-events: none;
  overflow: hidden;
}
.sql-code textarea {
  resize: none;
  background: transparent;
  color: transparent;
  caret-color: var(--ink);
  outline: none;
}
.sql-code textarea::selection {
  background: var(--accent-ring);
  color: transparent;
}
.sx-kw {
  color: color-mix(in srgb, var(--tone-7), var(--ink) var(--text-mix));
  font-weight: 600;
}
.sx-str {
  color: color-mix(in srgb, var(--tone-1), var(--ink) var(--text-mix));
}
.sx-id {
  color: color-mix(in srgb, var(--tone-2), var(--ink) var(--text-mix));
}
.sx-num {
  color: color-mix(in srgb, var(--tone-4), var(--ink) var(--text-mix));
}
.sx-fn {
  color: color-mix(in srgb, var(--tone-8), var(--ink) var(--text-mix));
}
.sx-cm {
  color: var(--faint);
  font-style: normal;
}
.sx-param {
  color: color-mix(in srgb, var(--tone-5), var(--ink) var(--text-mix));
}
.sql-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.sql-limit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sql-limit select {
  width: auto;
  min-height: 28px;
  height: 28px;
  padding: 0 8px;
  font-family: var(--mono);
  font-size: var(--text-xs);
}
.sql-over {
  color: color-mix(in srgb, var(--danger), var(--ink) var(--text-mix));
}
@media (max-width: 760px) {
  .sql-keys {
    display: none;
  }
}

/* results */
.sql-results {
  overflow: hidden;
}
.sql-results-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 10px 6px 14px;
  border-bottom: 1px solid var(--line);
}
.sql-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
}
.sql-status.ok {
  color: color-mix(in srgb, var(--ok), var(--ink) var(--text-mix));
}
.sql-status.bad {
  color: color-mix(in srgb, var(--danger), var(--ink) var(--text-mix));
}
.sql-error {
  padding: 12px 14px;
  border-left: 3px solid var(--danger);
  background: var(--danger-soft);
}
.sql-error pre {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: var(--text-xs);
  white-space: pre-wrap;
  color: var(--ink);
}
.sql-results-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 14px;
  color: var(--muted);
  font-size: var(--text-sm);
}
.sql-grid-wrap {
  overflow: auto;
  max-height: calc(100vh - 220px - var(--status-h));
  min-height: 120px;
}
.sql-grid th {
  background: var(--surface-2);
}
.sql-grid td {
  max-width: 420px;
  height: 32px;
  padding: 0 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-right: 1px solid var(--line);
  cursor: cell;
}
.sql-grid td.on {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.sql-grid .sql-null {
  color: var(--faint);
  font-style: normal;
}
.sql-grid .sql-rownum {
  width: 1%;
  padding: 0 10px;
  text-align: right;
  color: var(--faint);
  background: var(--surface-2);
  cursor: default;
}
.sql-grid th .sql-type {
  margin-left: 6px;
  color: var(--faint);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.sql-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.sql-cell-ref {
  flex: none;
  font-size: var(--text-2xs);
  color: var(--muted);
}
.sql-cell-value {
  flex: 1;
  min-width: 0;
  max-height: 120px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: var(--text-xs);
}

/* ------------------------------------------------------------------ the command center */

.cc-head-actions {
  gap: 8px;
  align-self: center;
}
.cc-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: var(--w-medium);
  cursor: pointer;
}
.cc-live.on {
  color: color-mix(in srgb, var(--ok), var(--ink) var(--text-mix));
}
.cc-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
}
.cc-live.on .cc-live-dot {
  background: var(--ok);
  animation: breathe 2.4s ease-in-out infinite;
}

/* fleet totals */
.cc-tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
@media (max-width: 1200px) {
  .cc-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .cc-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.cc-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  min-width: 0;
  border-top: 2px solid var(--line-2);
}
.cc-tile.ok {
  border-top-color: var(--ok);
}
.cc-tile.warn {
  border-top-color: var(--warn);
}
.cc-tile.danger {
  border-top-color: var(--danger);
}
.cc-tile-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* traffic and shares */
.cc-overview {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 1100px) {
  .cc-overview {
    grid-template-columns: minmax(0, 1fr);
  }
}
.cc-chart {
  position: relative;
  width: 100%;
}
.cc-chart svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.cc-gridline {
  stroke: var(--line);
  stroke-dasharray: 3 4;
  vector-effect: non-scaling-stroke;
}
.cc-cursor {
  stroke: var(--line-2);
  vector-effect: non-scaling-stroke;
}
.cc-chart-max {
  position: absolute;
  top: -2px;
  left: 0;
}
.cc-chart-cols {
  position: absolute;
  inset: 0;
  display: flex;
}
.cc-chart-cols span {
  flex: 1;
}
.cc-tip {
  position: absolute;
  top: 8px;
  transform: translateX(12px);
  min-width: 170px;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--raised);
  box-shadow: var(--shadow-2);
  pointer-events: none;
  z-index: 3;
  font-size: var(--text-xs);
}
.cc-tip.left {
  transform: translateX(calc(-100% - 12px));
}
.cc-tip-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
}
.cc-tip-row i,
.cc-legend-item i,
.cc-split-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: none;
}
.cc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 12px;
}
.cc-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: none;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: var(--text-2xs);
  cursor: pointer;
}
.cc-legend-item.off {
  color: var(--faint);
  text-decoration: line-through;
}
.cc-legend-item.off i {
  opacity: 0.3;
}
.cc-split {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.cc-split-bar {
  display: flex;
  gap: 2px;
  height: 10px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--canvas-2);
}
.cc-split-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: var(--text-2xs);
  color: var(--muted);
}
.cc-split-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.cc-split-legend b {
  color: var(--ink-2);
  font-weight: 500;
}

/* the installations */
.cc-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.cc-search {
  width: 320px;
  max-width: 100%;
  margin: 0;
  height: 32px;
}
.cc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px;
}
.cc-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px 16px;
  border-top: 3px solid var(--cc);
  min-width: 0;
}
.cc-card.down {
  border-top-style: dashed;
}
.cc-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.cc-card-head .chip,
.cc-card-head .menu-anchor {
  flex: none;
}
.cc-card-head .coll-glyph {
  width: 30px;
  height: 30px;
  flex: none;
}
.cc-card-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-family: var(--mono);
  font-size: var(--text-md);
  font-weight: 600;
  cursor: pointer;
}
.cc-card-name:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cc-server {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  font-size: var(--text-2xs);
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cc-server.external {
  color: color-mix(in srgb, var(--info), var(--ink) var(--text-mix));
}
.cc-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 5px;
  display: inline-block;
}
.chip .cc-dot {
  vertical-align: 1px;
}
.cc-card-alert {
  padding: 6px 8px;
  border-radius: var(--r-xs);
  background: var(--warn-soft);
  color: var(--ink-2);
}
.cc-card-live {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
}
.cc-spark {
  flex: 1;
  min-width: 0;
  height: 38px;
}
.cc-card-rate {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}
.cc-card-rate b {
  font-size: 20px;
  font-weight: 500;
}
.cc-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cc-stats dt {
  font-family: var(--font-label);
  font-size: 10px;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--muted);
}
.cc-stats dd {
  margin: 2px 0 0;
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}
.cc-stats .bad dd,
.cc-bad {
  color: color-mix(in srgb, var(--danger), var(--ink) var(--text-mix));
  font-weight: 600;
}
.cc-res {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cc-res-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.cc-meter {
  height: 5px;
  border-radius: 3px;
  background: var(--canvas-2);
  overflow: hidden;
}
.cc-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--cc, var(--accent));
}
.cc-meter span.hot {
  background: var(--warn);
}
.cc-cfgs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cc-cfg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 6px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-xs);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
}
.cc-cfg.on {
  border-style: solid;
  color: var(--ink-2);
}
.cc-cfg.on .icon {
  color: color-mix(in srgb, var(--ok), var(--ink) var(--text-mix));
}

/* the table */
.cc-table-wrap {
  overflow: auto;
}
.cc-th {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
.cc-row {
  cursor: pointer;
}
.cc-row td.num {
  text-align: right;
}
.cc-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}
.cc-table .cc-spark {
  height: 26px;
  width: 120px;
}

/* the drawer */
.cc-drawer {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cc-drawer .tabs {
  margin-bottom: 0;
}
.cc-drawer-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.cc-drawer-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--cc);
}
.cc-drawer-stats b {
  font-family: var(--mono);
  font-size: var(--text-md);
  font-weight: 500;
}
.cc-hours {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 70px;
}
.cc-hours span {
  flex: 1;
  border-radius: 2px 2px 0 0;
  opacity: 0.85;
}
.cc-facts {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0;
  font-size: var(--text-sm);
}
.cc-facts dt {
  color: var(--muted);
}
.cc-facts dd {
  margin: 0;
  min-width: 0;
  word-break: break-word;
}
.cc-settings section {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.cc-settings-foot {
  position: sticky;
  bottom: -20px;
  padding: 12px 0;
  background: var(--raised);
}
@media (max-width: 700px) {
  .cc-drawer-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ------------------------------------------------------------------ accents

   The named accents (Settings → Application). Each has a light and a dark tone, both readable
   as text on the theme's surfaces and under white on buttons. Set on the root by boot.js (from
   the installation's settings) or on any element, such as a preview, which then gets its own
   accent and the tokens made from it. */
[data-accent] {
  --accent-strong: color-mix(in srgb, var(--accent), black 18%);
  --accent-soft: color-mix(in srgb, var(--accent), transparent 89%);
  --accent-ring: color-mix(in srgb, var(--accent), transparent 72%);
  --primary: var(--accent);
}
[data-theme="dark"] [data-accent],
[data-theme="dark"][data-accent] {
  --accent-strong: color-mix(in srgb, var(--accent), white 14%);
  --accent-soft: color-mix(in srgb, var(--accent), transparent 86%);
  --accent-ring: color-mix(in srgb, var(--accent), transparent 55%);
  --primary: color-mix(in srgb, var(--accent), #0d1117 52%);
}
[data-accent="sage"] {
  --accent: #4f7a6c;
}
[data-accent="slate"] {
  --accent: #4f6478;
}
[data-accent="mauve"] {
  --accent: #7a5f86;
}
[data-accent="clay"] {
  --accent: #a2553b;
}
[data-accent="sand"] {
  --accent: #85693a;
}
[data-accent="teal"] {
  --accent: #1f7676;
}
[data-accent="ocean"] {
  --accent: #1f63a8;
}
[data-accent="indigo"] {
  --accent: #4c4fb3;
}
[data-accent="rose"] {
  --accent: #a8405e;
}
[data-accent="forest"] {
  --accent: #2f6b3f;
}
[data-accent="amber"] {
  --accent: #8f5c0e;
}
[data-accent="plum"] {
  --accent: #7d3b72;
}
[data-accent="graphite"] {
  --accent: #4b5563;
}
[data-theme="dark"] [data-accent="sage"],
[data-theme="dark"][data-accent="sage"] {
  --accent: #6fc2a2;
}
[data-theme="dark"] [data-accent="slate"],
[data-theme="dark"][data-accent="slate"] {
  --accent: #8fb0cc;
}
[data-theme="dark"] [data-accent="mauve"],
[data-theme="dark"][data-accent="mauve"] {
  --accent: #c3a3d0;
}
[data-theme="dark"] [data-accent="clay"],
[data-theme="dark"][data-accent="clay"] {
  --accent: #e59a7d;
}
[data-theme="dark"] [data-accent="sand"],
[data-theme="dark"][data-accent="sand"] {
  --accent: #d6b67a;
}
[data-theme="dark"] [data-accent="teal"],
[data-theme="dark"][data-accent="teal"] {
  --accent: #5cc8c4;
}
[data-theme="dark"] [data-accent="ocean"],
[data-theme="dark"][data-accent="ocean"] {
  --accent: #6aa9ec;
}
[data-theme="dark"] [data-accent="indigo"],
[data-theme="dark"][data-accent="indigo"] {
  --accent: #9b9ff0;
}
[data-theme="dark"] [data-accent="rose"],
[data-theme="dark"][data-accent="rose"] {
  --accent: #ec8fa8;
}
[data-theme="dark"] [data-accent="forest"],
[data-theme="dark"][data-accent="forest"] {
  --accent: #74c38a;
}
[data-theme="dark"] [data-accent="amber"],
[data-theme="dark"][data-accent="amber"] {
  --accent: #e8ad4f;
}
[data-theme="dark"] [data-accent="plum"],
[data-theme="dark"][data-accent="plum"] {
  --accent: #d38cc6;
}
[data-theme="dark"] [data-accent="graphite"],
[data-theme="dark"][data-accent="graphite"] {
  --accent: #aab3bf;
}

/* ------------------------------------------------------------------ branding */

/* the installation's own logo and name (Settings → Branding) */
.brand-logo {
  flex: none;
  width: auto;
  max-width: 132px;
  object-fit: contain;
}
.brand-custom {
  display: inline-block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  font-weight: var(--w-bold);
  letter-spacing: -0.01em;
}
.pre-line {
  white-space: pre-line;
}

/* the sign-in page's layouts (Settings → Login screen) */
.auth-logo {
  height: 32px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}
.auth-page.layout-centered,
.auth-page.layout-minimal {
  grid-template-columns: minmax(0, 1fr);
  background-color: var(--canvas-2);
}
.auth-page.layout-minimal {
  background-color: var(--canvas);
}
.auth-page.layout-centered .auth-form {
  max-width: 420px;
  padding: 36px 34px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-2);
}
.auth-page.bg-grid {
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: center;
}
.auth-page.bg-image {
  background-size: cover;
  background-position: center;
}
.auth-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: var(--text-xs);
}
.auth-powered {
  font-size: var(--text-xs);
  color: var(--faint);
}
.auth-powered b {
  font-weight: 400;
}
/* the live preview in the settings: the page drawn small */
.auth-page.preview {
  min-height: 100%;
  height: 100%;
}
.auth-page.preview .auth-form {
  animation: none;
}

/* ------------------------------------------------------------------ settings (2.0) */

.settings-group + .settings-group {
  margin-top: 14px;
}
.settings-group-label {
  padding: 4px 10px 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.unsaved-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warn);
  flex: none;
}
@media (max-width: 860px) {
  .settings-group {
    display: flex;
    gap: 2px;
  }
  .settings-group + .settings-group {
    margin-top: 0;
  }
  .settings-group-label {
    display: none;
  }
  .settings-nav a {
    white-space: nowrap;
  }
}
.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.label-pad {
  padding-top: 24px;
}

/* color mode cards, each with a small drawing of the dashboard */
.mode-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.mode-card:hover {
  border-color: var(--line-2);
}
.mode-card.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.mode-card-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 2px 2px;
}
.mode-card-check {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
}
.mode-art {
  display: flex;
  height: 92px;
  overflow: hidden;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}
.mode-art-half {
  flex: 1;
  display: flex;
  --art-bg: #ffffff;
  --art-side: #f6f8fa;
  --art-line: #d0d7de;
  --art-ink: #1f2328;
  background: var(--art-bg);
}
.mode-art-half.dark {
  --art-bg: #0d1117;
  --art-side: #010409;
  --art-line: #30363d;
  --art-ink: #e6edf3;
}
.mode-art-side {
  width: 26%;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--art-side);
  border-right: 1px solid var(--art-line);
}
.mode-art-side i,
.mode-art-main i {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: var(--art-line);
}
.mode-art-side i:first-child {
  background: var(--accent);
  opacity: 0.8;
}
.mode-art-main {
  flex: 1;
  padding: 9px 9px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mode-art-main b {
  display: block;
  width: 55%;
  height: 7px;
  border-radius: 2px;
  background: var(--art-ink);
  opacity: 0.85;
}
.mode-art-main i:nth-of-type(2) {
  width: 70%;
}
.mode-art-main span {
  margin-top: auto;
  width: 34%;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
}

/* named accents */
.accent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 8px;
}
.accent-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.accent-card:hover {
  border-color: var(--line-2);
}
.accent-card.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.accent-dot,
.accent-color {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.accent-color {
  position: relative;
  overflow: hidden;
  background: conic-gradient(#d1495b, #edae49, #66a182, #00798c, #30638e, #8e5572, #d1495b);
}
.accent-color input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.accent-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.accent-text .tiny {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* the little preview: a few components in the chosen accent */
.appearance-preview {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--canvas-2);
}
.appearance-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}
.appearance-preview-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.appearance-preview a {
  color: color-mix(in srgb, var(--accent), var(--ink) var(--text-mix));
}
.appearance-preview-input {
  display: flex;
  align-items: center;
  max-width: 320px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-ring);
  font-size: var(--text-sm);
}
.appearance-preview-input .caret {
  width: 1px;
  height: 15px;
  margin-left: 2px;
  background: var(--ink);
}
.appearance-preview-rows {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
  font-size: var(--text-sm);
}
.appearance-preview-rows > div {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 7px 12px;
  border-top: 1px solid var(--line);
}
.appearance-preview-rows > div:first-child {
  border-top: 0;
}
.appearance-preview-rows > div.on {
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}

/* branding: roles and the image library */
.brand-roles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.brand-role {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.brand-role-preview {
  display: grid;
  place-items: center;
  height: 84px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #ffffff;
}
.brand-role-preview.dark {
  background: #0d1117;
  border-color: #30363d;
}
.brand-role-preview img {
  max-width: 70%;
  max-height: 46px;
  object-fit: contain;
}
.dropzone {
  align-items: center;
  text-align: center;
  padding: 22px 12px;
  gap: 4px;
  cursor: pointer;
  color: var(--ink-3);
}
.dropzone:hover {
  border-color: var(--accent);
}
.dropzone.busy {
  opacity: 0.7;
  pointer-events: none;
}
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.asset-tile {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
}
.asset-thumb {
  display: grid;
  place-items: center;
  height: 110px;
  border-bottom: 1px solid var(--line);
}
.asset-thumb img {
  max-width: 80%;
  max-height: 84px;
  object-fit: contain;
}
.checker {
  background-color: var(--surface-2);
  background-image: linear-gradient(45deg, var(--line) 25%, transparent 25%), linear-gradient(-45deg, var(--line) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--line) 75%), linear-gradient(-45deg, transparent 75%, var(--line) 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
}
.asset-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px 4px;
  min-width: 0;
}
.asset-name {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: var(--w-medium);
  text-align: left;
  cursor: text;
}
.asset-actions {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  padding: 0 6px 6px;
}
@media (max-width: 900px) {
  .mode-cards,
  .brand-roles {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* the sign-in page designer: settings beside a live preview */
.login-designer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 20px;
  align-items: start;
}
.login-preview-wrap {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.login-preview {
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--canvas);
  box-shadow: var(--shadow-1);
}
/* the page at 1280px wide, drawn at the preview's width */
.login-preview-scale {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1280px;
  height: 880px;
  transform: scale(var(--preview-scale, 0.42));
  transform-origin: 0 0;
  pointer-events: none;
}
/* a form on its own is drawn closer: the card is most of what there is to see */
.login-preview.layout-minimal .login-preview-scale,
.login-preview.layout-centered .login-preview-scale {
  width: 700px;
  height: 481px;
  transform: scale(calc(var(--preview-scale, 0.42) * 1.8286));
}
.preview-input {
  display: flex;
  align-items: center;
  color: var(--faint);
}
@media (max-width: 1180px) {
  .login-designer {
    grid-template-columns: minmax(0, 1fr);
  }
  .login-preview-wrap {
    position: static;
  }
}
/* a folded sidebar shows the logo's left part (its mark, usually) */
.app.collapsed .brand-logo {
  max-width: 30px;
  object-fit: cover;
  object-position: left center;
}

/* ------------------------------------------------------------------ settings tables and operations */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
table.table th {
  padding: 8px 12px;
  text-align: left;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--canvas-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.table td select.input {
  min-width: 118px;
}
.tz-select {
  width: auto;
  min-width: 260px;
  max-width: 100%;
}
table.table td {
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
table.table tbody tr:first-child td {
  border-top: 0;
}
table.table .num {
  text-align: right;
  white-space: nowrap;
}
table.table tr.on td {
  background: var(--accent-soft);
}
.runs-table tbody tr {
  cursor: default;
}
.runs-table tr.row-error {
  cursor: pointer;
}
.runs-table tr.row-error td:first-child {
  box-shadow: inset 2px 0 0 var(--danger);
}
.run-detail {
  margin-top: 4px;
  max-height: 2.6em;
  overflow: hidden;
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: color-mix(in srgb, var(--danger), var(--ink) var(--text-mix));
  white-space: pre-wrap;
  word-break: break-word;
}
.run-detail.open {
  max-height: none;
}
.row.end {
  justify-content: flex-end;
}
.row.tight {
  gap: 6px;
}
.danger-text {
  color: color-mix(in srgb, var(--danger), var(--ink) var(--text-mix));
}
.card-warn {
  border-color: color-mix(in srgb, var(--warn), transparent 40%);
}
.backup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.backup-lock {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: var(--r-md);
  color: var(--warn);
  background: color-mix(in srgb, var(--warn), transparent 88%);
}
.backup-lock.on {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok), transparent 88%);
}
.storage-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.storage-facts code {
  max-width: 100%;
}
.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 6px;
}
.pick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-ctl);
  background: var(--surface);
  cursor: pointer;
  min-width: 0;
  transition: border-color var(--t-fast), background-color var(--t-fast), box-shadow var(--t-med) var(--ease);
}
.pick:hover {
  border-color: var(--accent);
}
.pick > .ellipsis {
  flex: 1;
}
.pick.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.pick:focus-within {
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.pick input:focus-visible {
  box-shadow: none;
}
.diff-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.diff-add {
  color: color-mix(in srgb, var(--ok), var(--ink) var(--text-mix));
}
.diff-change {
  color: color-mix(in srgb, var(--warn), var(--ink) var(--text-mix));
}
.diff-remove {
  color: color-mix(in srgb, var(--danger), var(--ink) var(--text-mix));
}

/* ------------------------------------------------------------------ mail designer */

.mail-designer {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.mail-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 760px;
  overflow: auto;
}
.mail-group {
  margin-top: 10px;
}
.mail-group-label {
  padding: 2px 8px 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.mail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--r-md);
  background: none;
  color: var(--ink-3);
  font: inherit;
  font-size: var(--text-sm);
  text-align: left;
  cursor: pointer;
}
.mail-item:hover {
  background: var(--hover);
  color: var(--ink);
}
.mail-item.on {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: var(--w-medium);
}
/* the editor, and below it the preview, as wide as the editor: an email needs the room */
.mail-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.mail-editor textarea.code {
  font-size: 12.5px;
  line-height: 1.55;
}
.placeholder-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.placeholder-chips .chip {
  cursor: pointer;
}
.mail-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mail-preview-bar {
  display: flex;
  align-items: center;
}
.mail-preview-subject {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: var(--text-sm);
}
.mail-preview-frame {
  display: flex;
  justify-content: center;
  height: 720px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #f6f8fa;
  overflow: hidden;
}
.mail-preview-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}
.mail-preview-frame.mobile iframe {
  width: 375px;
  border-left: 1px solid #d0d7de;
  border-right: 1px solid #d0d7de;
}
.mail-preview-frame .empty {
  align-self: center;
}
@media (max-width: 1240px) {
  .mail-editor {
    grid-template-columns: minmax(0, 1fr);
  }
  .mail-preview {
    position: static;
  }
}
@media (max-width: 860px) {
  .mail-designer {
    grid-template-columns: minmax(0, 1fr);
  }
  .mail-list {
    max-height: 240px;
  }
}
.or-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--faint);
  font-size: var(--text-xs);
}
.or-line::before,
.or-line::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ------------------------------------------------------------------ team */

.role-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.role-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: start;
  padding: 11px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-ctl);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--t-fast), background-color var(--t-fast), box-shadow var(--t-med) var(--ease);
}
.role-option:hover {
  border-color: var(--accent);
}
.role-option input {
  grid-row: 1 / span 2;
  margin-top: 1px;
}
.role-option input:focus-visible {
  box-shadow: none;
}
.role-option.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.role-option:focus-within {
  box-shadow: 0 0 0 3px var(--accent-ring);
}
/* the table of roles: what each can do, ticks in the columns that can, your own role's column
   tinted */
.perm-table thead th.perm-role {
  text-align: center;
  min-width: 84px;
}
.perm-you {
  display: block;
  margin-top: 1px;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}
.perm-table tbody th[scope="row"] {
  padding: 9px 12px;
  text-align: left;
  font: inherit;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
  background: transparent;
  border-top: 1px solid var(--line);
  white-space: normal;
}
.perm-table .perm-group th {
  padding: 6px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}
.perm-table tbody tr.perm-group:first-child th {
  border-top: 0;
}
.perm-detail {
  display: block;
  margin-top: 1px;
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--muted);
}
.perm-cell {
  text-align: center;
  vertical-align: middle;
  color: var(--faint);
}
.perm-cell.yes {
  color: color-mix(in srgb, var(--accent), var(--ink) var(--text-mix));
}
.perm-cell .icon {
  vertical-align: -3px;
}
.perm-picker {
  display: none;
  margin-bottom: 12px;
}
.perm-picker .small {
  margin-top: 6px;
}
/* a phone shows one role's column, the one picked above the table */
@media (max-width: 720px) {
  .perm-picker {
    display: block;
  }
  .perm-table thead th.perm-role .perm-you {
    display: none;
  }
  .perm-table[data-pick="viewer"] .r-developer,
  .perm-table[data-pick="viewer"] .r-admin,
  .perm-table[data-pick="viewer"] .r-owner,
  .perm-table[data-pick="developer"] .r-viewer,
  .perm-table[data-pick="developer"] .r-admin,
  .perm-table[data-pick="developer"] .r-owner,
  .perm-table[data-pick="admin"] .r-viewer,
  .perm-table[data-pick="admin"] .r-developer,
  .perm-table[data-pick="admin"] .r-owner,
  .perm-table[data-pick="owner"] .r-viewer,
  .perm-table[data-pick="owner"] .r-developer,
  .perm-table[data-pick="owner"] .r-admin {
    display: none;
  }
  .perm-table thead th.perm-role {
    min-width: 72px;
  }
}
.perm-table td.me {
  background: var(--accent-soft);
}
.perm-table thead th.me {
  background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--canvas-2);
  color: var(--ink);
}
.key-secret {
  padding: 8px 10px;
  border-radius: var(--r-md);
  background: var(--canvas-2);
  word-break: break-all;
}
.app-users {
  display: grid;
  gap: 10px;
}
.app-user-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}


/* a card in its own accent tint keeps its caption readable on it */
.accent-card .tiny.muted {
  color: var(--ink-3);
}

/* automations: the steps of one, and a template next to its preview */
.step-card > .card-head {
  align-items: flex-start;
}
.step-card > .card-head .grid-2 {
  gap: 10px;
}
.template-frame {
  height: 420px;
}
.tab-body {
  margin-top: 16px;
}
@media (max-width: 900px) {
  .template-edit {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------ data: the collections */

a.section-title {
  text-decoration: none;
}
a.section-title:hover {
  color: var(--ink);
}
.coll-back {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 8px;
  color: var(--muted);
  text-decoration: none;
}
.coll-back:hover {
  color: var(--ink);
}
.coll-search {
  max-width: 320px;
  margin: 0 0 14px;
}
.coll-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--ink);
  font: inherit;
}
.coll-section {
  margin-bottom: 22px;
}
.coll-section-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 2px 2px;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: var(--font-label);
  font-size: var(--text-2xs);
  font-weight: var(--w-semibold);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  cursor: pointer;
}
.coll-section-title:hover {
  color: var(--ink);
}
.coll-section-title.closed .icon {
  transform: rotate(-90deg);
}
.coll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.coll-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  animation: rise var(--t-slow) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 20ms);
}
.coll-card:hover {
  border-color: color-mix(in srgb, var(--accent), transparent 55%);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
.coll-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.coll-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.coll-card-name {
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: var(--w-semibold);
}
.coll-card-stats {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.coll-card-num {
  font-size: var(--text-lg);
  font-weight: var(--w-semibold);
  font-variant-numeric: tabular-nums;
}
.coll-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
@media (prefers-reduced-motion: reduce) {
  .coll-card {
    animation: none;
    transition: none;
  }
  .coll-card:hover {
    transform: none;
  }
}
