/* ---- Preflight (generated via encre-css) ---- */
*, ::after, ::before, ::backdrop, ::file-selector-button {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid;
}

::before, ::after {
  --en-content: '';
}

html, :host {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  font-family: "Helvetica Neue", Helvetica, Arial, ui-sans-serif, system-ui, sans-serif;
  font-feature-settings: normal;
  font-variation-settings: normal;
  -webkit-tap-highlight-color: transparent;
}

hr {
  height: 0;
  color: inherit;
  border-top-width: 1px;
}

abbr:where([title]) {
  -webkit-text-decoration: underline dotted;
  text-decoration: underline dotted;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

a {
  color: inherit;
  -webkit-text-decoration: inherit;
  text-decoration: inherit;
}

b, strong {
  font-weight: bolder;
}

code, kbd, samp, pre {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-feature-settings: normal;
  font-variation-settings: normal;
  font-size: 1em;
}

small {
  font-size: 80%;
}

sub, sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

table {
  text-indent: 0;
  border-color: inherit;
  border-collapse: collapse;
}

:-moz-focusring {
  outline: auto;
}

progress {
  vertical-align: baseline;
}

summary {
  display: list-item;
}

ol, ul, menu {
  list-style: none;
}

img, svg, video, canvas, audio, iframe, embed, object {
  display: block;
  vertical-align: middle;
}

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

button, input, select, optgroup, textarea, ::file-selector-button {
  font: inherit;
  font-feature-settings: inherit;
  font-variation-settings: inherit;
  letter-spacing: inherit;
  color: inherit;
  border-radius: 0;
  background-color: transparent;
  opacity: 1;
}

:where(select:is([multiple], [size])) optgroup {
  font-weight: bolder;
}

:where(select:is([multiple], [size])) optgroup option {
  padding-inline-start: 20px;
}

::file-selector-button {
  margin-inline-end: 4px;
}

::placeholder {
  opacity: 1;
}

@supports (not (-webkit-appearance: -apple-pay-button)) /* Not Safari */ or (contain-intrinsic-size: 1px) /* Safari 17+ */ {
  ::placeholder {
    color: color-mix(in oklab, currentcolor 50%, transparent);
  }
}

textarea {
  resize: vertical;
}

::-webkit-search-decoration {
  -webkit-appearance: none;
}

::-webkit-date-and-time-value {
  min-height: 1lh;
  text-align: inherit;
}

::-webkit-datetime-edit {
  display: inline-flex;
}

::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
  padding-block: 0;
}

:-moz-ui-invalid {
  box-shadow: none;
}

button, input:where([type='button'], [type='reset'], [type='submit']), ::file-selector-button {
  appearance: button;
}

::-webkit-inner-spin-button, ::-webkit-outer-spin-button {
  height: auto;
}

[hidden]:where(:not([hidden='until-found'])) {
  display: none !important;
}

*, ::before, ::after, ::backdrop, ::-webkit-backdrop {
  --en-border-spacing-x: 0;
  --en-border-spacing-y: 0;
  --en-translate-x: 0;
  --en-translate-y: 0;
  --en-translate-z: 0;
  --en-rotate-x: 0;
  --en-rotate-y: 0;
  --en-rotate-z: 0;
  --en-skew-x: 0;
  --en-skew-y: 0;
  --en-scale-x: 1;
  --en-scale-y: 1;
  --en-scale-z: 1;
  --en-pan-x: ;
  --en-pan-y: ;
  --en-pinch-zoom: ;
  --en-scroll-snap-strictness: proximity;
  --en-ordinal: ;
  --en-slashed-zero: ;
  --en-numeric-figure: ;
  --en-numeric-spacing: ;
  --en-numeric-fraction: ;
  --en-ring-inset: ;
  --en-ring-offset-width: 0px;
  --en-ring-offset-color: #fff;
  --en-ring-color: currentColor;
  --en-ring-offset-shadow: 0 0 #0000;
  --en-ring-shadow: 0 0 #0000;
  --en-shadow: 0 0 #0000;
  --en-shadow-colored: 0 0 #0000;
  --en-blur: ;
  --en-brightness: ;
  --en-contrast: ;
  --en-grayscale: ;
  --en-hue-rotate: ;
  --en-invert: ;
  --en-saturate: ;
  --en-sepia: ;
  --en-drop-shadow: ;
  --en-backdrop-blur: ;
  --en-backdrop-brightness: ;
  --en-backdrop-contrast: ;
  --en-backdrop-grayscale: ;
  --en-backdrop-hue-rotate: ;
  --en-backdrop-invert: ;
  --en-backdrop-opacity: ;
  --en-backdrop-saturate: ;
  --en-backdrop-sepia: ;
}
/* ---- Tokens + skin (standard.css) ---- */
/* ============================================================
   standard.css — the standard-ui skin. As little as possible:
   flat surfaces, 1px lines, pill controls in rounded containers, ink for emphasis, blue for the main action, green for on, red for errors.
   Two layers: TOKENS (one --std-* vocabulary, registered as the
   utility colors too — see build-helper's TOKENS) + COMPONENTS
   (rules keyed off std-* classes and ARIA state hooks).

   Phones and touch screens are part of every component, not a layer on
   top. Three questions, each asked by its own media query:
   - Width: `@media (max-width: 767px)` is "narrow", the one breakpoint.
     768px is encre's `md`, so a component and an app's `md:` utilities
     flip together; NARROW_MAX_PX in Rust and build-helper says the same,
     and a test keeps all three equal. Wide-only skin classes
     (std-wide-*) use the matching `@media (min-width: 768px)`.
   - Pointer: `@media (pointer: coarse)` (a finger) grows tap targets to
     44px, the explicitly small ones to 36px. A mouse keeps desktop sizes.
   - Hover: every :hover rule sits inside `@media (hover: hover)`. A touch
     browser keeps :hover on whatever was tapped last, so an ungated hover
     style sticks. A test fails on an ungated one.
   No page is ever wider than the viewport: content that can't fit (a
   table, a tab row, a long segmented control) scrolls inside its own box.
   ============================================================ */

/* ---- Tokens ------------------------------------------------------------- */
/* The ONE color vocabulary. Every name here is also an encre-css color
   (build-helper TOKENS registers `<name>` -> var(--std-<name>)), so the
   utilities are bg-background, text-foreground, border-border, bg-primary, … — the same
   words as the skin. Add a token in both places. */
:root {
  --std-background:             #ffffff;                        /* the page, and the fill of a focused field */
  --std-foreground:             #0a0a0a;                        /* text, and the solid fill of a checked box */
  --std-muted:                  #f5f5f5;                        /* the grey of filled controls, hover and selection */
  --std-muted-foreground:       #6b6b6b;                        /* grey text */
  --std-card:                   #ffffff;                        /* a surface that floats: lighter than the page in both themes */
  --std-border:                 #dcdcdc;                        /* hairlines */
  --std-primary:                oklch(0.626 0.205 254.947);     /* the blue: the main action only */
  --std-primary-foreground:     #ffffff;                        /* text on it */
  --std-primary-soft:           #e6f0ff;                        /* a tint of it */
  --std-success:                oklch(0.62 0.17 148);           /* the green: on, done, healthy */
  --std-success-foreground:     #ffffff;                        /* text on it */
  --std-success-soft:           #e6f6ea;                        /* a tint of it */
  --std-destructive:            #d0021b;                        /* the red: errors only */
  --std-destructive-foreground: #ffffff;                        /* text on it */
  --std-destructive-soft:       #fdecea;                        /* a tint of it */
  /* Not a color: the one elevation, for paper that floats. The depth is
     drawn inside the surface (a lit top lip, a shaded foot, a faint rim),
     so it is relative to the fill and the same value serves light and
     dark; only a short drop shadow lands on the page. */
  --std-shadow-raised: inset 0 1px 0 rgb(255 255 255 / 0.25), inset 0 -2px 0 rgb(0 0 0 / 0.16), inset 0 0 0 1px rgb(0 0 0 / 0.1), 0 1px 2px 0 rgb(0 0 0 / 0.22);
  /* Raised, held down: the lip and foot swap for a shade under the top
     edge and the drop shadow goes, so the surface sits in the page. */
  --std-shadow-pressed: inset 0 2px 3px 0 rgb(0 0 0 / 0.22), inset 0 0 0 1px rgb(0 0 0 / 0.12);
  /* Not colors: the radius ladder (see Corners). */
  --std-radius-sm:     0.25rem;
  --std-radius-md:     0.5rem;
  --std-radius-lg:     1rem;
  --std-radius-xl:     1.5rem;
  --std-radius-pill:   9999px;
  color-scheme: light;
}

/* Dark palette. Two triggers, one value set:
   - `.dark` on <html>, written by use_theme() once the wasm mounts (and the
     selector encre's `dark:` variant is configured to emit), and
   - the OS preference, for the paint BEFORE the wasm mounts, unless the
     hook has already pinned `.light`.
   CSS can't share a declaration block between a selector and a media query,
   so the values are spelled out twice; keep them in sync. */
.dark {
  --std-background:             #1c1c1c;
  --std-foreground:             #f2f2f2;
  --std-muted:                  #272727;
  --std-muted-foreground:       #9a9a9a;
  --std-card:                   #3a3a3a;
  --std-border:                 #363636;
  --std-primary:                oklch(0.68 0.173 253.301);
  --std-primary-foreground:     #ffffff;
  --std-primary-soft:           #16294a;
  --std-success:                oklch(0.64 0.16 150);
  --std-success-foreground:     #ffffff;
  --std-success-soft:           #15301f;
  --std-destructive:            #ff4d4d;
  --std-destructive-foreground: #ffffff;
  --std-destructive-soft:       #3a1715;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --std-background:             #1c1c1c;
    --std-foreground:             #f2f2f2;
    --std-muted:                  #272727;
    --std-muted-foreground:       #9a9a9a;
    --std-card:                   #3a3a3a;
    --std-border:                 #363636;
    --std-primary:                oklch(0.68 0.173 253.301);
    --std-primary-foreground:     #ffffff;
    --std-primary-soft:           #16294a;
    --std-success:                oklch(0.64 0.16 150);
    --std-success-foreground:     #ffffff;
    --std-success-soft:           #15301f;
    --std-destructive:            #ff4d4d;
    --std-destructive-foreground: #ffffff;
    --std-destructive-soft:       #3a1715;
    color-scheme: dark;
  }
}

/* ---- Base --------------------------------------------------------------- */
/* Corners. Nothing is square. Controls are pills or circles: everything
   you press, pick or type in. Containers take a step of the radius ladder,
   which is in rem on the 4px grid like every other size: sm 4px (a box
   too small for more), md 8px, lg 16px (cards: Panel, Notice,
   Textarea, Table), xl 24px (the Dialog, which floats above them). A box
   nested in a rounded one takes the outer radius minus the padding
   between them, or the next step down.
   One declaration rounds the whole page: every box takes --std-radius,
   a registered property that does not inherit and starts at 0, so a round
   box's children stay square unless they opt in themselves. It is
   !important so no utility or UA stylesheet (Safari's search fields, iOS
   buttons) can round or square a box behind the system's back. */
@property --std-radius { syntax: "<length>+"; inherits: false; initial-value: 0px; }
*, ::before, ::after { border-radius: var(--std-radius) !important; }
.std-button,
.std-icon-button,
.std-input,
.std-segmented,
.std-segmented-item,
.std-tab,
.std-nav-item,
.std-nav-link,
.std-switch,
.std-switch::after,
.std-badge,
.std-select-option,
.std-progress { --std-radius: var(--std-radius-pill); }
.std-check-box { --std-radius: var(--std-radius-sm); }
.std-tooltip { --std-radius: var(--std-radius-md); }
.std-panel,
.std-notice,
.std-select-list,
.std-table-wrap,
.std-explorer,
.std-textarea { --std-radius: var(--std-radius-lg); }
.std-dialog { --std-radius: var(--std-radius-xl); }
/* An app's own box (an image, a canvas overlay, a list frame) takes a step
   of the same ladder with one of these; there is no other way to round
   app markup, so it cannot leave the ladder. */
.std-round-sm { --std-radius: var(--std-radius-sm); }
.std-round-md { --std-radius: var(--std-radius-md); }
.std-round-lg { --std-radius: var(--std-radius-lg); }
.std-round-xl { --std-radius: var(--std-radius-xl); }
.std-round-pill { --std-radius: var(--std-radius-pill); }
/* The narrow dialog is a sheet on the bottom edge: only its top is round. */
@media (max-width: 767px) {
  .std-dialog { --std-radius: var(--std-radius-xl) var(--std-radius-xl) 0px 0px; }
}

html {
  background-color: var(--std-background);
  color: var(--std-foreground);
}
body {
  min-height: 100vh;
  min-height: 100dvh;
  font-size: 0.875rem;
  line-height: 1.5;
  background-color: var(--std-background);
  color: var(--std-foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background-color: var(--std-foreground); color: var(--std-background); }

/* ---- Layout ------------------------------------------------------------- */
.std-stack { display: flex; }
.std-row { flex-direction: row; }
.std-column { flex-direction: column; }
.std-wrap { flex-wrap: wrap; }
.std-grid { display: grid; }
.std-cols-1 { grid-template-columns: minmax(0, 1fr); }
.std-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.std-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.std-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.std-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.std-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
/* The gap ladder (Gap::Xs–Xl = 1/2/4/6/8 on the 4px grid). */
.std-gap-xs { gap: 0.25rem; }
.std-gap-sm { gap: 0.5rem; }
.std-gap-md { gap: 1rem; }
.std-gap-lg { gap: 1.5rem; }
.std-gap-xl { gap: 2rem; }
.std-align-start { align-items: flex-start; }
.std-align-center { align-items: center; }
.std-align-end { align-items: flex-end; }
.std-align-baseline { align-items: baseline; }
.std-justify-center { justify-content: center; }
.std-justify-end { justify-content: flex-end; }
.std-justify-between { justify-content: space-between; }
/* Responsive<T> props: the bare class is the narrow value, the std-wide-*
   class (emitted only when the wide value differs) takes over from 768px. */
@media (min-width: 768px) {
  .std-wide-row { flex-direction: row; }
  .std-wide-column { flex-direction: column; }
  .std-wide-gap-none { gap: 0; }
  .std-wide-gap-xs { gap: 0.25rem; }
  .std-wide-gap-sm { gap: 0.5rem; }
  .std-wide-gap-md { gap: 1rem; }
  .std-wide-gap-lg { gap: 1.5rem; }
  .std-wide-gap-xl { gap: 2rem; }
  .std-wide-cols-1 { grid-template-columns: minmax(0, 1fr); }
  .std-wide-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .std-wide-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .std-wide-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .std-wide-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .std-wide-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.std-divider { flex: none; border: 0; height: 1px; width: 100%; background-color: var(--std-border); }
.std-divider-vertical { flex: none; border: 0; width: 1px; height: auto; align-self: stretch; background-color: var(--std-border); }

/* ---- Shell -------------------------------------------------------------- */
.std-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.std-shell-header {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 3.5rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--std-border);
}
.std-shell-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
/* The title text truncates instead of pushing the aside off a phone. It
   is a block (ellipsis needs one), so a mark in the title (an app icon)
   sits inline beside the text. */
.std-shell-title-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.std-shell-title-text > :is(img, svg) { display: inline-block; vertical-align: middle; margin-right: 0.625rem; }
.std-shell-nav { display: flex; align-items: center; gap: 0.25rem; }
.std-shell-aside { flex: none; display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
/* The bar is a row under the header for the HeaderItems placed there at
   the current width (typically what the header has no room for on a
   phone). The Shell hides it at a width where nothing is placed in it. */
.std-shell-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--std-border);
}
.std-shell-item { flex: none; display: flex; align-items: center; min-width: 0; }
.std-shell-item:last-child { margin-left: auto; }
.std-shell-grow { flex: 1 1 0%; }
.std-shell-main { flex: 1 1 0%; min-height: 0; overflow: auto; }
.std-shell-content { width: 100%; max-width: 72rem; margin: 0 auto; padding: 2.5rem 1.5rem; }
/* Narrow: the header keeps title + aside on its first row; the nav wraps
   to a second, full-bleed row that scrolls sideways. */
@media (max-width: 767px) {
  .std-shell-header {
    flex-wrap: wrap;
    height: auto;
    column-gap: 1rem;
    row-gap: 0;
    padding: 0 1rem;
  }
  .std-shell-title,
  .std-shell-aside { height: 3.5rem; }
  .std-shell-title { flex: 1 1 0%; }
  .std-shell-nav {
    order: 1;
    flex: 0 0 calc(100% + 2rem);
    min-height: 2.75rem;
    margin: 0 -1rem;
    padding: 0 1rem;
    gap: 1.25rem;
    overflow-x: auto;
    scrollbar-width: none;
    border-top: 1px solid var(--std-border);
  }
  .std-shell-nav > * { flex: none; }
  .std-shell-bar { padding: 0.75rem 1rem; }
  .std-shell-content { padding: 1.5rem 1rem; }
}

/* ---- Nav list ----------------------------------------------------------- */
.std-nav { display: flex; flex-direction: column; gap: 0.125rem; }
.std-nav-item {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  text-align: left;
  color: var(--std-muted-foreground);
  cursor: pointer;
}
@media (hover: hover) {
  .std-nav-item:hover { color: var(--std-foreground); background-color: var(--std-muted); }
}
.std-nav-item[aria-current="page"] {
  background-color: var(--std-muted);
  color: var(--std-foreground);
  font-weight: 600;
}
/* NavForm::Select: the entries as a Select in a row of its own. A NavList
   whose form differs by width renders both and hides one (Visibility). */
.std-nav-select { flex: none; padding: 0.75rem 1rem; border-bottom: 1px solid var(--std-border); }
@media (pointer: coarse) {
  .std-nav-item { min-height: 2.75rem; }
}

/* Router links for the shell's nav row (NavLink, feature `router`): text
   that sits in a pill while its route is active. leptos_router's
   <A> writes aria-current="page"; that is the hook. */
.std-nav-link {
  padding: 0.25rem 0.75rem;
  color: var(--std-muted-foreground);
  font-weight: 500;
  white-space: nowrap;
}
@media (hover: hover) {
  .std-nav-link:hover { color: var(--std-foreground); background-color: var(--std-muted); }
}
.std-nav-link[aria-current="page"] { color: var(--std-foreground); background-color: var(--std-muted); }
@media (pointer: coarse) {
  .std-nav-link { min-width: 2.75rem; padding: 0.75rem; text-align: center; }
}

/* ---- Button ------------------------------------------------------------- */
.std-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex: none;
  border: 1px solid transparent;
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
}
/* Pills read larger than boxes of the same height, so the ladder sits a
   step below the input height (20/24/32/40/48). A finger still
   gets the touch floors below. */
.std-button-xs { height: 1.25rem; padding: 0 0.5rem; font-size: 0.6875rem; }
.std-button-sm { height: 1.5rem; padding: 0 0.625rem; font-size: 0.75rem; }
.std-button-md { height: 2rem; padding: 0 0.75rem; font-size: 0.875rem; }
.std-button-lg { height: 2.5rem; padding: 0 1.25rem; font-size: 0.875rem; }
.std-button-xl { height: 3rem; padding: 0 1.5rem; font-size: 1rem; }

.std-button-primary {
  background-color: var(--std-primary);
  border-color: transparent;
  color: var(--std-primary-foreground);
  box-shadow: var(--std-shadow-raised);
}
@media (hover: hover) {
  .std-button-primary:hover { background-color: color-mix(in oklab, var(--std-primary) 88%, black); }
}
.std-button-primary:active { background-color: color-mix(in oklab, var(--std-primary) 88%, black); }
/* Destructive is Primary in red: the action that deletes or can't be
   undone, raised the same way. */
.std-button-destructive {
  background-color: var(--std-destructive);
  border-color: transparent;
  color: var(--std-destructive-foreground);
  box-shadow: var(--std-shadow-raised);
}
@media (hover: hover) {
  .std-button-destructive:hover { background-color: color-mix(in oklab, var(--std-destructive) 88%, black); }
}
.std-button-destructive:active { background-color: color-mix(in oklab, var(--std-destructive) 88%, black); }
/* Three ranks of button: Primary is a raised blue fill (the one main
   action), Secondary a raised grey fill (the normal actions), Ghost
   (below) bare text until hovered, and flat. */
.std-button-secondary {
  background-color: var(--std-muted);
  color: var(--std-foreground);
  box-shadow: var(--std-shadow-raised);
}
/* Pressed goes darker than the fill in both modes (the hover wash,
   `line`, is lighter than `panel` in dark). */
.std-button-secondary:active { background-color: color-mix(in oklab, var(--std-muted) 88%, black); }
@media (hover: hover) {
  .std-button-secondary:hover { background-color: var(--std-border); }
}
/* A raised button has no border, so the lit lip in the shadow sits on its
   true top edge instead of a pixel inside it. */
.std-button-primary,
.std-button-destructive,
.std-button-secondary { border-width: 0; }
/* Held down, a raised button sinks: the pressed shadow, one pixel lower.
   It sinks at once and nothing eases, like every other state change here,
   but it comes back up late: the resting look waits out a delay, so a
   quick tap, whose :active lasts a frame or two, still shows as a press.
   The fill is left out so hovering is not delayed with it. */
.std-button-primary,
.std-button-destructive,
.std-button-secondary {
  transition-property: box-shadow, transform;
  transition-duration: 0s;
  transition-delay: 80ms;
}
.std-button-primary:active,
.std-button-destructive:active,
.std-button-secondary:active {
  box-shadow: var(--std-shadow-pressed);
  transform: translateY(1px);
  transition-delay: 0s;
}
.std-button-ghost { background-color: transparent; color: var(--std-foreground); }
.std-button-ghost:active { background-color: var(--std-muted); }
@media (hover: hover) {
  .std-button-ghost:hover { background-color: var(--std-muted); }
}
.std-button:disabled { opacity: 0.4; pointer-events: none; }
/* ButtonWidth, a Responsive prop: Full spans the container (a primary
   action at the foot of a phone form). */
.std-button-full { width: 100%; }
@media (min-width: 768px) {
  .std-wide-button-auto { width: auto; }
  .std-wide-button-full { width: 100%; }
}
/* IconButton: a square that only carries a glyph. Its size is the skin's
   alone (the component takes no class), so no caller can shrink a target
   below the touch floor. */
.std-icon-button {
  display: inline-grid;
  place-content: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid transparent;
  background-color: transparent;
  color: var(--std-muted-foreground);
  cursor: pointer;
}
.std-icon-button:active { color: var(--std-foreground); background-color: var(--std-muted); }
@media (hover: hover) {
  .std-icon-button:hover { color: var(--std-foreground); background-color: var(--std-muted); }
}
.std-icon-button:disabled { opacity: 0.4; pointer-events: none; }
@media (pointer: coarse) {
  .std-button-lg { height: 2.75rem; min-width: 2.75rem; }
  .std-button-md { height: 2.75rem; min-width: 2.75rem; }
  .std-button-sm { height: 2.25rem; min-width: 2.25rem; }
  .std-button-xs { height: 2.25rem; min-width: 2.25rem; }
  .std-icon-button { width: 2.75rem; height: 2.75rem; }
}

/* ---- Text input --------------------------------------------------------- */
.std-input {
  display: block;
  width: 100%;
  height: 2.25rem;
  padding: 0 0.875rem;
  background-color: var(--std-muted);
  border: 1px solid transparent;
  color: var(--std-foreground);
}
.std-textarea { height: auto; min-height: 5rem; padding: 0.5rem 0.75rem; resize: vertical; }
/* The drag handle is one line: a 60deg arc with round ends, concentric with
   the lg corner and centred on its diagonal. It is drawn in the field's own
   background, on a 2rem square at the corner: a conic wedge of grip colour,
   a ring cut out of it by painting the well colour inside and outside the
   ring, and a dot on each end. The centre is the corner's own circle (the
   radius less the 1px border, measured from the padding box). The native
   grip is made transparent but still takes the drag. Firefox cannot style
   the resizer, so it keeps its own grip and draws no arc. */
@supports selector(::-webkit-resizer) {
  .std-textarea {
    --std-well: var(--std-muted);
    --std-grip: var(--std-muted-foreground);
    --std-grip-c: calc(100% - var(--std-radius-lg) + 1px);
    --std-grip-r: 0.5625rem;
    background-image:
      radial-gradient(circle at calc(var(--std-grip-c) + var(--std-grip-r) * 0.9659) calc(var(--std-grip-c) + var(--std-grip-r) * 0.2588), var(--std-grip) 1px, transparent 1.5px),
      radial-gradient(circle at calc(var(--std-grip-c) + var(--std-grip-r) * 0.2588) calc(var(--std-grip-c) + var(--std-grip-r) * 0.9659), var(--std-grip) 1px, transparent 1.5px),
      radial-gradient(circle at var(--std-grip-c) var(--std-grip-c), var(--std-well) calc(var(--std-grip-r) - 1.5px), transparent calc(var(--std-grip-r) - 1px) calc(var(--std-grip-r) + 1px), var(--std-well) calc(var(--std-grip-r) + 1.5px)),
      conic-gradient(at var(--std-grip-c) var(--std-grip-c), transparent 105deg, var(--std-grip) 105deg 165deg, transparent 165deg);
    background-size: 2rem 2rem;
    background-position: right bottom;
    background-repeat: no-repeat;
  }
  .std-textarea:focus { --std-well: var(--std-background); }
  .std-textarea::-webkit-resizer { background: transparent; }
  @media (hover: hover) {
    .std-textarea:hover { --std-grip: var(--std-foreground); }
  }
}
.std-input::placeholder { color: var(--std-muted-foreground); opacity: 1; }
@media (hover: hover) {
  .std-input:hover { border-color: var(--std-border); }
}
/* A field is a grey well; focus lifts it to paper inside an ink ring. */
.std-input:focus {
  outline: none;
  background-color: var(--std-background);
  border-color: var(--std-foreground);
  box-shadow: inset 0 0 0 1px var(--std-foreground);
}
.std-input:disabled { opacity: 0.4; cursor: not-allowed; }
/* On a finger: 44px tall, and 16px text, below which iOS Safari zooms
   the page on focus. */
@media (pointer: coarse) {
  .std-input { font-size: 1rem; }
  .std-input:not(.std-textarea) { height: 2.75rem; }
}
/* Number inputs drop the browser's spin arrows: values are typed, and the
   arrows crowd a narrow box. */
.std-input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.std-input[type="number"]::-webkit-inner-spin-button,
.std-input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Select: the input box with room on the right for the chevron, which the
   wrap draws (below) so the native control and the trigger share one. */
.std-select {
  appearance: none;
  padding-right: 2.25rem;
  cursor: pointer;
}
.std-select option { background-color: var(--std-background); color: var(--std-foreground); }
/* Select draws both controls and the pointer picks one. A finger gets the
   native <select>, whose OS picker beats any list on a small touch screen.
   A mouse gets the trigger, a button that looks the same and opens the
   system's own list: a floating card of pill rows. */
.std-select-wrap { position: relative; }
/* The chevron is one plain stroke, an url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 6.5l3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat mask (round caps and joins,
   like the checkbox tick) painted in a token so it relights with the
   theme. It points up while the list is open, flipped at once like every
   state change here, and sinks a pixel with the control when pressed. */
.std-select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.75rem;
  width: 1rem;
  height: 1rem;
  margin-top: -0.5rem;
  background-color: var(--std-muted-foreground);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 6.5l3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 6.5l3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}
.std-select-wrap:has(.std-select:active)::after { transform: translateY(1px); }
.std-select-wrap:has(.std-select-trigger[data-state="open"])::after { transform: translateY(1px) scaleY(-1); }
.std-select-wrap:has(.std-select:disabled)::after { opacity: 0.4; }
.std-select-trigger { display: none; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (pointer: fine) {
  .std-select-native { display: none; }
  .std-select-trigger { display: block; }
}
/* A select is pressed, not typed in, so it is not a well: it is raised
   like a Secondary button (same fill, shadow, hover, press and tap hold),
   and stays pressed in while its list is open. Focus draws no ring. */
.std-select,
.std-select:focus {
  border-width: 0;
  background-color: var(--std-muted);
  box-shadow: var(--std-shadow-raised);
  transition-property: box-shadow, transform;
  transition-duration: 0s;
  transition-delay: 80ms;
}
@media (hover: hover) {
  .std-select:hover { background-color: var(--std-border); }
}
.std-select:active,
.std-select-trigger[data-state="open"] {
  background-color: color-mix(in oklab, var(--std-muted) 88%, black);
  box-shadow: var(--std-shadow-pressed);
  transform: translateY(1px);
  transition-delay: 0s;
}
/* The backdrop is invisible: it only catches the click or scroll that
   dismisses the list. Both sit above a dialog, which a select may be in. */
.std-select-backdrop { position: fixed; inset: 0; z-index: 110; }
/* A Tooltip is a small card over everything, placed by the component above
   its trigger (below when the trigger is near the top) and kept inside the
   viewport. A hover shows it after a beat, so passing over does nothing; a
   tap pins it at once, and the next tap anywhere (the backdrop) lets go. */
.std-tooltip-trigger { display: inline-flex; }
.std-tooltip-backdrop { position: fixed; inset: 0; z-index: 112; }
.std-tooltip {
  position: fixed;
  z-index: 113;
  width: max-content;
  max-width: min(20rem, calc(100vw - 1rem));
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: var(--std-foreground);
  overflow-wrap: anywhere;
  pointer-events: none;
  background-color: var(--std-card);
  border: 1px solid var(--std-border);
  box-shadow: 0 0.5rem 1.5rem -0.25rem rgb(0 0 0 / 0.25);
  animation: std-tooltip-in 120ms ease-out 400ms both;
}
.std-tooltip[data-state="pinned"] { animation-delay: 0ms; }
@keyframes std-tooltip-in { from { opacity: 0; } to { opacity: 1; } }
.std-select-list {
  position: fixed;
  z-index: 111;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.25rem;
  overflow-y: auto;
  background-color: var(--std-card);
  border: 1px solid var(--std-border);
  /* Not the raised shadow: a card this far off the page casts a longer,
     softer one, and has no pressed edge to light. */
  box-shadow: 0 0.5rem 1.5rem -0.25rem rgb(0 0 0 / 0.25);
}
.std-select-option {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2rem;
  padding: 0 0.75rem;
  white-space: nowrap;
  cursor: pointer;
}
/* The highlight follows the mouse or the arrow keys, whichever moved last,
   so it is a state hook and not :hover. */
.std-select-option[data-active] { background-color: var(--std-muted); }
.std-select-option[aria-selected="true"] { font-weight: 500; }
.std-select-option[aria-selected="true"]::after {
  content: "";
  flex: none;
  width: 0.375rem;
  height: 0.375rem;
  --std-radius: var(--std-radius-pill);
  background-color: var(--std-foreground);
}

/* ---- Field -------------------------------------------------------------- */
.std-field { display: flex; flex-direction: column; gap: 0.375rem; }
.std-field-label {
  font-size: 0.75rem;
  font-weight: 500;
}
.std-field-hint { font-size: 0.75rem; color: var(--std-muted-foreground); }
.std-field-error { font-size: 0.75rem; color: var(--std-destructive); }
.std-field-invalid .std-input { border-color: var(--std-destructive); }

/* ---- Checkbox / switch ------- ----------------------------------------- */
/* vertical-align: middle because the label's baseline is the box's, and
   an empty box (unchecked, no ::after) has its baseline at its bottom edge:
   on a text line or in a table cell the box would jump with its state. */
.std-check { display: inline-flex; align-items: center; gap: 0.5rem; vertical-align: middle; cursor: pointer; user-select: none; }
.std-check-box {
  appearance: none;
  flex: none;
  display: grid;
  place-content: center;
  width: 1rem;
  height: 1rem;
  margin: 0;
  background-color: var(--std-background);
  border: 1.5px solid var(--std-muted-foreground);
  cursor: pointer;
}
@media (hover: hover) {
  .std-check-box:hover { border-color: var(--std-muted-foreground); }
}
/* Checked is a solid ink box; the mark is cut from paper. The tick
   and the dash are SVG masks (round caps and joins, which borders can't
   draw), painted in a token so they relight with the theme. */
.std-check-box:checked,
.std-check-box:indeterminate { background-color: var(--std-foreground); border-color: var(--std-foreground); }
.std-check-box::after {
  content: "";
  width: 1rem;
  height: 1rem;
  background-color: var(--std-background);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8.5l2.75 2.75L12 5.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8.5l2.75 2.75L12 5.5'/%3E%3C/svg%3E") center / contain no-repeat;
  display: none;
}
.std-check-box:checked::after,
.std-check-box:indeterminate::after { display: block; }
/* Mixed state (a select-all over a partly selected list): a dash instead
   of the tick. It wins over :checked, as browsers draw it. */
.std-check-box:indeterminate::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4.5 8h7'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4.5 8h7'/%3E%3C/svg%3E");
}
.std-check-box:disabled { opacity: 0.4; cursor: not-allowed; }
/* On a finger the whole label row is the target; the box keeps its size. */
@media (pointer: coarse) {
  .std-check { min-height: 2.75rem; min-width: 2.75rem; }
}

/* Switch: a pill track, a round thumb. State is aria-checked, which the
   component writes. Off is a grey track, on is the success green; the thumb is
   the `raised` fill in both, never black, so its lip and foot show. It has the buttons' depth: the track is a
   channel cut into the page (the pressed shadow), the thumb a raised
   button sliding in it. */
.std-switch {
  position: relative;
  flex: none;
  width: 2.25rem;
  height: 1.25rem;
  /* The grey of quiet text: lifted toward white: a mid grey under the
     white knob in light, a pale grey under the dark knob in dark. */
  background-color: color-mix(in oklab, var(--std-muted-foreground), white 35%);
  box-shadow: var(--std-shadow-pressed);
  cursor: pointer;
}
.std-switch::after {
  content: "";
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1rem;
  height: 1rem;
  background-color: var(--std-card);
  box-shadow: var(--std-shadow-raised);
}
.std-switch[aria-checked="true"] { background-color: var(--std-success); }
.std-switch[aria-checked="true"]::after { transform: translateX(1rem); }
.std-switch:disabled { opacity: 0.4; cursor: not-allowed; }
/* Only the switch itself flips it; its text beside it is not a target. On
   a finger the switch keeps its size and an invisible margin around it
   takes the tap, out to the 44px floor. */
.std-switch-row { cursor: default; }
@media (pointer: coarse) {
  .std-switch::before { content: ""; position: absolute; inset: -0.75rem -0.25rem; }
}

/* ---- Segmented ---------------------------------------------------------- */
.std-segmented {
  display: inline-flex;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 0.125rem;
  padding: 0.125rem;
  background-color: var(--std-muted);
}
.std-segmented-item {
  flex: none;
  white-space: nowrap;
  height: 1.75rem;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--std-foreground);
  cursor: pointer;
}
@media (hover: hover) {
  .std-segmented-item:hover { background-color: var(--std-border); }
}
/* The chosen segment is a raised surface sitting in the grey track. */
.std-segmented-item[aria-pressed="true"] {
  background-color: var(--std-card);
  box-shadow: var(--std-shadow-raised);
}
@media (hover: hover) {
  .std-segmented-item[aria-pressed="true"]:hover { background-color: var(--std-card); }
}
@media (pointer: coarse) {
  .std-segmented-item { height: 2.25rem; }
}

/* ---- Tabs --------------------------------------------------------------- */
/* The row scrolls sideways inside its own box when the tabs don't fit.
   The selected tab sits in a pill; there is no baseline. */
.std-tabs {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.std-tab {
  flex: none;
  white-space: nowrap;
  padding: 0.375rem 0.75rem;
  color: var(--std-muted-foreground);
  font-weight: 500;
  cursor: pointer;
}
@media (hover: hover) {
  .std-tab:hover { color: var(--std-foreground); background-color: var(--std-muted); }
}
.std-tab[aria-selected="true"] { color: var(--std-foreground); background-color: var(--std-muted); }
@media (pointer: coarse) {
  .std-tab { min-height: 2.75rem; min-width: 2.75rem; }
}

/* ---- Panel -------------------------------------------------------------- */
/* overflow: clip keeps a full-bleed child (a table, a hovered row) inside
   the round corners without making the panel a scroll box. */
.std-panel { border: 1px solid var(--std-border); background-color: var(--std-background); overflow: clip; }
.std-panel-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--std-border);
}
.std-panel-title {
  font-size: 0.8125rem;
  font-weight: 600;
}
.std-panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.std-panel-body { padding: 1rem; }

/* ---- Badge -------------------------------------------------------------- */
.std-badge {
  display: inline-flex;
  align-items: center;
  height: 1.25rem;
  padding: 0 0.5rem;
  border: 1px solid transparent;
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
}
.std-badge-neutral { background-color: var(--std-muted); color: var(--std-foreground); }
.std-badge-accent { background-color: var(--std-foreground); border-color: transparent; color: var(--std-background); }
.std-badge-subtle { border-color: var(--std-border); color: var(--std-muted-foreground); }
.std-badge-success { background-color: var(--std-success); border-color: transparent; color: var(--std-success-foreground); }

/* ---- Notice ------------------------------------------------------------- */
/* A notice is a flat tinted fill, no edge: muted for the default tone,
   the destructive tint for an alert, whose title takes the red. */
.std-notice {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  background-color: var(--std-muted);
}
.std-notice-alert { background-color: var(--std-destructive-soft); }
.std-notice-title { font-weight: 600; }
.std-notice-alert .std-notice-title { color: var(--std-destructive); }

/* ---- Progress ----------------------------------------------------------- */
.std-progress { width: 100%; height: 0.25rem; background-color: var(--std-border); overflow: hidden; }
.std-progress-fill { height: 100%; background-color: var(--std-foreground); }
/* Below the caller's danger threshold (a low battery) the fill is the
   alert red. */
.std-progress-danger { background-color: var(--std-destructive); }

/* ---- Properties --------------------------------------------------------- */
/* Key/value rows: a two-column grid, labels in the field-label voice. */
.std-properties {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 1.5rem;
  row-gap: 0.5rem;
  align-items: baseline;
}
.std-property-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--std-muted-foreground);
}
.std-property-value { min-width: 0; overflow-wrap: anywhere; }
/* Narrow: max-content labels would eat the row, so each label sits over
   its value. */
@media (max-width: 767px) {
  .std-properties { grid-template-columns: minmax(0, 1fr); row-gap: 0.125rem; }
  .std-property-label:not(:first-child) { margin-top: 0.5rem; }
}
.std-property-mono {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.75rem;
  word-break: break-all;
}

/* ---- Query explorer ----------------------------------------------------- */
/* QueryExplorer (feature xsql) is one card, not a stack of components:
   the SQL editor, a standard Textarea well inset in the card (md corners,
   the lg card less its padding, and its own ring on focus), then, with no
   rule between them, one toolbar (what is being queried, the status, then
   the connection glyph beside Run), then the error or the result table,
   each split from the band above by a 1px rule. The table gives up its
   own frame and corners to the card, which clips it. The result table is
   bounded so that its rows scroll under a fixed head, the Table's own
   scroller. On a phone the toolbar wraps: the table name, the glyph and
   Run hold the first line and the status drops below. */
.std-explorer {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--std-border);
  background-color: var(--std-background);
  overflow: clip;
}
/* The toolbar names what is being queried, "Querying TABLE orders", the
   table as SQL would, in mono, each followed by a round "i" that opens
   its details: the size, the columns and their types, and SELECT *. */
.std-explorer-querying {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.375rem;
  min-width: 0;
  font-size: 0.875rem;
  color: var(--std-muted-foreground);
}
.std-explorer-table-name { font-family: var(--font-mono, ui-monospace, monospace); color: var(--std-foreground); }
.std-explorer-info { width: 1.25rem; padding: 0; font-family: Georgia, serif; font-style: italic; font-weight: 700; }
@media (pointer: coarse) {
  .std-explorer-info { width: 2.25rem; }
}
.std-explorer-column-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1.5rem;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.8125rem;
}
.std-explorer-column-name { color: var(--std-foreground); }
.std-explorer-column-type { color: var(--std-muted-foreground); }
.std-explorer-editor { display: flex; flex-direction: column; padding: 0.75rem 0.75rem 0; }
/* The query box starts one line tall and grows with what is typed, up to a
   screenful; past that it scrolls. A browser without field-sizing keeps
   the drag handle instead. */
.std-explorer-sql {
  --std-radius: var(--std-radius-md);
  field-sizing: content;
  min-height: 0;
  max-height: 20rem;
  padding: 0.75rem;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.875rem;
  line-height: 1.5;
}
@supports (field-sizing: content) {
  .std-explorer-sql { resize: none; background-image: none; }
}
@media (pointer: coarse) {
  .std-explorer-sql { font-size: 1rem; }
}
.std-explorer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
}
/* The connection is a glyph alone just left of Run: the joined plug
   (codicon debug-connected), green while the source answers and grey while
   it is first reached, or the parted plug (debug-disconnect) in red once it
   fails; its title says which, or why. */
.std-explorer-bar > .std-tooltip-trigger { margin-left: auto; }
.std-explorer-connection {
  display: inline-flex;
  align-items: center;
  color: var(--std-muted-foreground);
}
.std-explorer-connection > svg { flex: none; }
.std-explorer-connected > svg { color: var(--std-success); }
.std-explorer-disconnected > svg { color: var(--std-destructive); }
.std-explorer-status { flex: 1 1 auto; font-size: 0.875rem; color: var(--std-muted-foreground); }
/* The error is a band of the card, not a card inside it: the Notice keeps
   its tint and drops its frame, corners and glow. */
.std-explorer-error { border-top: 1px solid var(--std-border); }
.std-explorer-error > .std-notice { --std-radius: 0px; }
.std-explorer .std-explorer-table { --std-radius: 0px; max-height: 28rem; border-width: 1px 0 0; }
/* The rule under the toolbar is twice the hairline, so where the query
   ends reads apart from the single rules of the table head below it. */
.std-explorer-bar + .std-explorer-error,
.std-explorer-bar + .std-explorer-table { border-top-width: 2px; }
.std-explorer-null { color: var(--std-muted-foreground); font-style: italic; }

/* ---- Collapsible -------------------------------------------------------- */
/* The trigger is a full-width row led by a disclosure triangle, so it reads
   as expandable rather than as a label; the caller dresses the rest. The
   triangle is drawn like the table-sort marker, points right while closed
   and turns down on open, in step with the content. The content opens on a
   one-row grid whose track goes 0fr to 1fr, so nothing is measured. */
.std-collapsible-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.std-collapsible-trigger::before {
  content: "";
  flex: none;
  width: 0.375rem;
  height: 0.375rem;
  margin: 0 0.125rem;
  border: solid var(--std-muted-foreground);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(-45deg);
  transition: transform 200ms;
}
@media (hover: hover) {
  .std-collapsible-trigger:hover::before { border-color: var(--std-foreground); }
}
@media (pointer: coarse) {
  .std-collapsible-trigger { min-height: 2.75rem; }
}
.std-collapsible-trigger[data-state="open"]::before { transform: rotate(45deg); }
.std-collapsible-content { display: grid; overflow: hidden; transition: grid-template-rows 200ms; }
.std-collapsible-content[data-state="closed"] { grid-template-rows: 0fr; }
.std-collapsible-content[data-state="open"] { grid-template-rows: 1fr; }
.std-collapsible-inner { min-height: 0; }

/* ---- Table -------------------------------------------------------------- */
/* A table is a grid, not a table layout, so that only its rows scroll.
   The head and the body are both subgrids of the table's columns: they
   line up, but the body is its own scroller, so a wrap with a bounded
   height (the caller's) gets the browser's own scrollbar beside the rows
   alone, and the head neither moves nor bounces. The wrap still scrolls
   sideways when the columns outgrow it. The column count comes in inline
   from the component, one for each side of the breakpoint, since a column
   can be hidden on one. The wrap is the table's frame: a 1px line with
   the card corners, which its scrolling clips the rows to. The last row
   leaves its own rule off so the frame is the only line under it. */
.std-table-wrap { display: flex; flex-direction: column; width: 100%; overflow-x: auto; border: 1px solid var(--std-border); }
.std-table {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--std-table-cols-narrow, 1), auto);
  grid-template-rows: auto minmax(0, 1fr);
  font-variant-numeric: tabular-nums;
}
@media (min-width: 768px) {
  .std-table { grid-template-columns: repeat(var(--std-table-cols-wide, 1), auto); }
}
.std-table > thead,
.std-table > tbody,
.std-table tr { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; }
/* Sideways scrolling is the wrap's job: where scrollbars take room, the
   body's own would otherwise turn up for the width its vertical bar took.
   The rows rubber-band at their ends; the head is outside the scroller so
   it stays put, and contain keeps the overscroll from scrolling the page. */
.std-table > tbody { min-height: 0; overflow: hidden auto; align-content: start; overscroll-behavior: contain; }
.std-table-head,
.std-table-cell { display: block; align-content: center; padding: 0.5rem 0.75rem; text-align: left; white-space: nowrap; }
/* The rule under the head is an inset shadow so it does not add to the
   head's height. */
.std-table-head {
  background-color: var(--std-background);
  box-shadow: inset 0 -1px 0 var(--std-border);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--std-muted-foreground);
}
.std-table-cell { border-bottom: 1px solid var(--std-border); }
.std-table-row:last-child > .std-table-cell { border-bottom-width: 0; }
/* Every other row carries half the muted tint, so a long row reads across;
   hover and selection, the full tint, come after it and win. */
.std-table-row:nth-child(even) > .std-table-cell { background-color: color-mix(in oklab, var(--std-muted) 50%, var(--std-background)); }
@media (hover: hover) {
  .std-table-row:hover > .std-table-cell { background-color: var(--std-muted); }
}
/* Clickable rows (Table's on_row_click) say so with the pointer; the
   selected row (row_selected, as aria-selected) takes the panel tint,
   the system's selection color, and keeps it under hover. */
.std-table-row-clickable { cursor: pointer; }
.std-table-row[aria-selected="true"] > .std-table-cell { background-color: var(--std-muted); }
@media (hover: hover) {
  .std-table-row[aria-selected="true"]:hover > .std-table-cell { background-color: var(--std-muted); }
}

.std-table-right { text-align: right; }
.std-table-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: inherit;
  color: inherit;
  cursor: pointer;
}
@media (hover: hover) {
  .std-table-sort:hover { color: var(--std-foreground); }
}
@media (pointer: coarse) {
  .std-table-sort { min-height: 2.75rem; min-width: 2.75rem; }
}
/* The sort marker: a small triangle, ink while active. */
.std-table-sort::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 0.25rem solid transparent;
  border-right: 0.25rem solid transparent;
  border-bottom: 0.3125rem solid var(--std-border);
}
.std-table-head[aria-sort] { color: var(--std-foreground); }
.std-table-head[aria-sort] .std-table-sort::after { border-bottom-color: var(--std-foreground); }
.std-table-head[aria-sort="descending"] .std-table-sort::after { transform: rotate(180deg); }

/* ---- Dialog ------------------------------------------------------------- */
.std-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background-color: rgb(0 0 0 / 0.5);
}
.dark .std-dialog-backdrop { background-color: rgb(0 0 0 / 0.7); }
.std-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 100;
  transform: translate(-50%, -50%);
  width: calc(100% - 2rem);
  max-width: 28rem;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: 1.5rem;
  background-color: var(--std-background);
  border: 1px solid var(--std-border);
}
/* The close control is an IconButton pinned to the corner. */
.std-dialog-close { position: absolute; top: 0.75rem; right: 0.75rem; }
.std-dialog-body { display: flex; flex-direction: column; gap: 1.25rem; }
.std-dialog-header { display: flex; flex-direction: column; gap: 0.375rem; padding-right: 2rem; }
.std-dialog-title { font-size: 1rem; font-weight: 600; line-height: 1.25; }
.std-dialog-description { color: var(--std-muted-foreground); }
.std-dialog-footer { display: flex; justify-content: flex-end; gap: 0.5rem; }
/* Narrow: a bottom sheet. Full width, pinned to the bottom edge, its body
   scrolling under a 1rem gap at the top; the footer stacks full-width
   buttons with the last (the primary, by convention) on top. */
@media (max-width: 767px) {
  .std-dialog {
    top: auto;
    bottom: 0;
    left: 0;
    transform: none;
    width: 100%;
    max-width: none;
    padding: 1.25rem 1rem;
    border-width: 1px 0 0;
  }
  .std-dialog-footer { flex-direction: column-reverse; }
  .std-dialog-footer > * { width: 100%; }
}
/* While a dialog is open the shell's scroller freezes, so the page under
   the backdrop can't drift. */
body:has(.std-dialog) .std-shell-main { overflow: hidden; }


/* ---- Map ---------------------------------------------------------------- */
/* OsmMap (feature `map`, src/map/). The pane is a rounded box with a 1px
   hairline, like every container; it clips its tiles to that corner. Tiles
   are drawn on a canvas; the muted filter pulls the cartography toward the
   system's greys so the colored markers read as the foreground. */
.std-map {
  --std-radius: var(--std-radius-lg);
  position: relative;
  user-select: none;
  overflow: hidden;
  border: 1px solid var(--std-border);
  cursor: grab;
  touch-action: none;
}
.std-map.std-map-dragging { cursor: grabbing; }

/* The pane looks at a globe. Behind the tiles sits its disc: the page
   colour is space, the disc is the grey a tile shows before it loads (and
   the polar caps, which Mercator tiles never cover). Once the globe is
   bigger than the pane the disc just fills it. Its size and place come in
   inline from the camera. */
.std-map-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--std-background);
}
.std-map-globe {
  --std-radius: var(--std-radius-pill);
  position: absolute;
  background-color: var(--std-muted);
  box-shadow: 0 0 0 1px var(--std-border);
}
.std-map-globe.std-map-globe-flat { --std-radius: 0px; inset: 0; box-shadow: none; }

.std-map-layer {
  position: absolute;
  top: 0;
  left: 0;
}

/* Tiles are drawn on one canvas under the paths layer (src/raster.rs:
   each frame draws, per tile cell, the best tile it has decoded, warped
   onto the globe), so nothing here times or stacks tiles. The muted filter
   applies to the whole canvas. */
.std-map-tiles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: grayscale(0.75) contrast(0.95);
}
.dark .std-map-tiles { filter: grayscale(0.8) invert(0.92) hue-rotate(180deg) brightness(0.9) contrast(0.9); }
@media (prefers-color-scheme: dark) {
  :root:not(.light) .std-map-tiles { filter: grayscale(0.8) invert(0.92) hue-rotate(180deg) brightness(0.9) contrast(0.9); }
}
/* Unmuted layers (photographic imagery) skip the filter entirely. */
.std-map-tiles.std-map-unmuted,
.dark .std-map-tiles.std-map-unmuted { filter: none; }
@media (prefers-color-scheme: dark) {
  :root:not(.light) .std-map-tiles.std-map-unmuted { filter: none; }
}

/* Markers, lines and stops sit in pane pixels: the component reprojects
   each onto the globe every frame and hides what is on the far side. The
   layers and their 1px svgs pass pointer events through to the pane; each
   marker group catches them for picking and its <title> tooltip. Fills
   default to ink and outlines are ink or paper so everything relights
   with the theme; an app's color comes in as an inline fill. */
.std-map-overlay { pointer-events: none; }
.std-map-markers,
.std-map-paths {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: visible;
  pointer-events: none;
}
.std-map-markers g,
.std-map-paths g { pointer-events: auto; }
/* A marker is one shape: a disc, or with a heading a disc drawn out to a
   point toward it, outlined in paper so it reads on any tile. */
.std-map-marker { fill: var(--std-foreground); stroke: var(--std-background); stroke-width: 1.5; stroke-linejoin: round; }
.std-map-dot { fill: var(--std-background); stroke: var(--std-foreground); stroke-width: 1; }
/* Selection is the accent, the system's one selection color. */
.std-map-selected .std-map-marker { stroke: var(--std-foreground); stroke-width: 2.5; }
.std-map-selected .std-map-dot { stroke: var(--std-foreground); stroke-width: 2; }

/* Invisible hit targets: a little slop on a mouse, 44px on a finger. Both
   are rendered; CSS shows the one for the pointer. */
.std-map-hit,
.std-map-hit-coarse { fill: transparent; stroke: none; }
.std-map-hit-coarse { display: none; }
@media (pointer: coarse) {
  .std-map-hit { display: none; }
  .std-map-hit-coarse { display: inline; }
}

/* The callout over a picked marker or dot: a paper label on a hairline,
   above the point (below it near the top edge). */
.std-map-callout {
  position: absolute;
  z-index: 15;
  max-width: 16rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--std-foreground);
  background-color: var(--std-background);
  border: 1px solid var(--std-border);
  --std-radius: var(--std-radius-sm);
  transform: translate(-50%, -100%);
  cursor: default;
}
.std-map-callout.std-map-callout-below { transform: translate(-50%, 0); }
.std-map-callout.std-map-callout-hidden { display: none; }

/* Controls: a column of raised round Secondary buttons in the bottom
   right corner, clear of the attribution plaque. Each is the same raised
   grey circle as any other Secondary button, so they read as buttons over
   the tiles and sink when pressed. */
.std-map-controls {
  position: absolute;
  right: 0.75rem;
  bottom: 2.25rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.std-map-controls .std-map-control {
  width: 2.25rem;
  height: 2.25rem;
  min-width: 0;
  padding: 0;
}
.std-map-control svg { width: 0.875rem; height: 0.875rem; }
/* On a finger the controls are 44px circles, like every touch target. */
@media (pointer: coarse) {
  .std-map-controls .std-map-control { width: 2.75rem; height: 2.75rem; }
}

/* The layer picker: a Select in the top right corner. */
.std-map-layers {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 20;
}
.std-map-layers .std-map-layer-select { width: 7rem; }

/* Attribution: a small paper label seated into the pane's corner. */
.std-map-attribution {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 0.125rem 1rem 0.125rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  --std-radius: var(--std-radius-md) 0px 0px 0px;
  background-color: var(--std-background);
  border-top: 1px solid var(--std-border);
  border-left: 1px solid var(--std-border);
}
.std-map-attribution a { color: var(--std-muted-foreground); text-decoration: none; }
@media (hover: hover) {
  .std-map-attribution a:hover { color: var(--std-foreground); text-decoration: underline; }
}

/* Each line sits on a paper casing so it stays legible over imagery;
   width and color come in inline. */
.std-map-paths path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.std-map-casing { stroke: var(--std-background); stroke-opacity: 0.7; }
.std-map-line { stroke: var(--std-foreground); stroke-opacity: 0.75; }
.std-map-dashed { stroke-dasharray: 6 5; }

/* ---- Visibility --------------------------------------------------------- */
/* Responsive<Visibility>: a part hidden at one width. Last in the file so
   it outranks the display of the component rule it hides. `Visible` wraps
   arbitrary markup in a box that takes no layout of its own. */
.std-visible { display: contents; }
@media (max-width: 767px) {
  .std-hidden-narrow { display: none; }
}
@media (min-width: 768px) {
  .std-hidden-wide { display: none; }
}
