/* Pipelet Edge-Verwaltung: the pages of the relay in the design of the portal of the Edge.
 *
 * The portal follows ElevenLabs UI (shadcn/ui new-york, base colour neutral, Geist and Geist Mono, Lucide icons,
 * the Pipelet mark at the top of the sidebar). The contract values below are those of
 * assets/web/static/css/tokens.css (light) and assets/web/static/css/themes/eleven-labs.css (dark); the test
 * design::tests of this crate binds them to those files. The geometry follows layout.css and components.css of
 * the portal: sidebar of 16 rem, header of 48 px, cards of 14 px radius, tables in a frame of 10 px, buttons of
 * 8 px. A state is never colour alone: symbol, word and the tone of the symbol.
 */

@font-face { font-family: 'Geist'; src: url('/_static/geist-1.9.2-var.woff2') format('woff2'); font-style: normal; font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('/_static/geist-mono-1.9.2-var.woff2') format('woff2'); font-style: normal; font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light;
  --font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-family-mono: "Geist Mono", ui-monospace, monospace;

  /* contract (stage A), light */
  --radius: 0.625rem;
  --background: #ffffff;
  --foreground: #0a0a0a;
  --card: #ffffff;
  --card-foreground: #0a0a0a;
  --primary: #171717;
  --primary-foreground: #fafafa;
  --secondary: #f5f5f5;
  --secondary-foreground: #171717;
  --muted: #f5f5f5;
  --muted-foreground: #737373;
  --accent: #f5f5f5;
  --accent-foreground: #171717;
  --destructive: #e7000b;
  --border: #e5e5e5;
  --input: #e5e5e5;
  --ring: #a1a1a1;
  --chart-2: #2b7fff;
  --sidebar: #fafafa;
  --sidebar-foreground: #0a0a0a;
  --sidebar-accent: #f5f5f5;
  --sidebar-accent-foreground: #171717;
  --sidebar-border: #e5e5e5;

  /* extensions (stage C) */
  --status-ok: #008236;
  --status-warn: #bb4d00;
  --muted-50: #f5f5f580;
  --ring-50: #a1a1a180;
  --button-primary-bg-hover: #2e2e2e;
  --button-secondary-bg: var(--background);
  --button-secondary-bg-hover: var(--accent);

  --radius-md: 0.5rem;
  --radius-lg: var(--radius);
  --radius-xl: 0.875rem;
  --radius-full: 624.9375rem;
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);

  --header-height: 3rem;
  --sidebar-width: 16rem;
  --logo-height: 1.75rem;
  --logo-width: calc(var(--logo-height) * 64 / 122.1);
  --content-max: 100rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    /* contract (stage A), dark */
    --background: #0a0a0a;
    --foreground: #fafafa;
    --card: #171717;
    --card-foreground: #fafafa;
    --primary: #e5e5e5;
    --primary-foreground: #171717;
    --secondary: #262626;
    --secondary-foreground: #fafafa;
    --muted: #262626;
    --muted-foreground: #a1a1a1;
    --accent: #404040;
    --accent-foreground: #fafafa;
    --destructive: #ff6467;
    --border: #ffffff1a;
    --input: #ffffff26;
    --ring: #737373;
    --chart-2: #2b7fff;
    --sidebar: #171717;
    --sidebar-foreground: #fafafa;
    --sidebar-accent: #262626;
    --sidebar-accent-foreground: #fafafa;
    --sidebar-border: #ffffff1a;
    /* extensions (stage C), dark */
    --status-ok: #00c950;
    --status-warn: #fe9a00;
    --muted-50: #26262680;
    --ring-50: #73737380;
    --button-primary-bg-hover: #cfcfcf;
    --button-secondary-bg: #151515;
    --button-secondary-bg-hover: #1c1c1c;
  }
}

/* ------------------------------------------------------------------ base */

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

html {
  min-height: 100%;
  font-family: var(--font-family);
  font-size: 100%;
  line-height: 1.25rem;
  color: var(--foreground);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-size: 0.875rem;
  font-weight: 400;
}

h1,
h2,
h3 {
  margin: 0 0 0.75rem;
  letter-spacing: -0.025em;
}

h1 {
  font-size: 1.875rem;
  line-height: 2.375rem;
  font-weight: 500;
}

h2 {
  font-size: 1.25rem;
  line-height: 2rem;
  font-weight: 600;
}

p {
  margin: 0 0 0.75rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

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

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

code {
  font-size: 0.75rem;
  overflow-wrap: break-word;
}

dl,
dd {
  margin: 0;
}

svg {
  vertical-align: middle;
}

.muted {
  color: var(--muted-foreground);
}

.small {
  font-size: 0.75rem;
  line-height: 1rem;
}

.nowrap {
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: 1rem;
  z-index: 300;
  padding: 0.5rem 1rem;
  background: var(--card);
  color: var(--foreground);
  border-radius: 0.375rem;
  box-shadow: var(--shadow-sm);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.icon {
  width: 1rem;
  height: 1rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------------------------------------------ brand */

.app-brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.5rem;
  color: var(--foreground);
  text-decoration: none;
}

.brand-logo {
  flex: none;
  width: var(--logo-width);
  height: var(--logo-height);
}

.app-brand-name {
  font-size: 1.125rem;
  line-height: 1.5rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ frame: sidebar, header, main */

.app-frame {
  min-height: 100vh;
}

.app-inset {
  min-width: 0;
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  color: var(--sidebar-foreground);
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-header {
  display: flex;
  align-items: center;
  min-height: var(--header-height);
  padding-inline: 1rem;
}

.sidebar-nav {
  flex: 1 1 auto;
  padding: 0 0.5rem 0.5rem;
}

.sidebar-group-label {
  display: flex;
  align-items: center;
  min-height: 2rem;
  margin: 0;
  padding-inline: 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-menu-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
  min-height: 2rem;
  padding-inline: 0.5rem;
  border-radius: var(--radius-md);
  color: var(--sidebar-foreground);
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-decoration: none;
}

.sidebar-menu-button:hover {
  background: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground);
}

.sidebar-menu-button[aria-current] {
  background: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground);
  font-weight: 500;
}

.sidebar-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* a collapsible entry with its submenu (the documentation): rows of 28 px on a line below the middle of the icon
   of the entry, as nav.sidebar of the portal */
.sidebar-collapsible > summary {
  list-style: none;
  cursor: pointer;
}

.sidebar-collapsible > summary::-webkit-details-marker {
  display: none;
}

.sidebar-chevron {
  margin-inline-start: auto;
  color: var(--muted-foreground);
  transition: transform 120ms cubic-bezier(0.2, 0, 0, 1);
}

.sidebar-collapsible[open] > summary .sidebar-chevron {
  transform: rotate(90deg);
}

.sidebar-menu-sub {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  list-style: none;
  margin: 0 0 0 calc(0.5rem + 0.5rem);
  padding: 0.125rem 0 0.125rem 0.5rem;
  border-inline-start: 1px solid var(--sidebar-border);
}

.sidebar-menu-sub-button {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 1.75rem;
  padding-inline: 0.5rem;
  border-radius: var(--radius-md);
  color: var(--sidebar-foreground);
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-decoration: none;
}

.sidebar-menu-sub-button:hover {
  background: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground);
}

.sidebar-menu-sub-button[aria-current] {
  background: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground);
  font-weight: 500;
}

.sidebar-menu-badge {
  flex: none;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--sidebar-border);
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--muted-foreground);
}

.sidebar-footer a {
  color: var(--muted-foreground);
}

.app-topbar {
  position: relative;
  z-index: 100;
  background: var(--background);
  border-bottom: 1px solid var(--border);
}

.app-topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  min-height: var(--header-height);
  padding: 0.25rem 1rem;
}

.crumbs-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.375rem;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted-foreground);
  overflow-wrap: anywhere;
}

.crumbs-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
}

.crumbs-separator {
  width: 0.875rem;
  height: 0.875rem;
}

.crumbs-link {
  color: var(--muted-foreground);
  text-decoration: none;
}

.crumbs-link:hover {
  color: var(--foreground);
  text-decoration: underline;
}

.crumbs-page {
  color: var(--foreground);
}

.topbar-meta {
  margin-inline-start: auto;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.app-main {
  min-width: 0;
  max-width: var(--content-max);
  padding: 1rem 1rem 2rem;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.page-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.page-title h1 {
  margin: 0;
  overflow-wrap: anywhere;
}

.page-lead {
  margin: -0.75rem 0 1.5rem;
  max-width: 48rem;
  color: var(--muted-foreground);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

@media (min-width: 64em) {
  .app-frame {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    align-items: start;
  }

  .app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-bottom: 0;
    border-inline-end: 1px solid var(--sidebar-border);
  }

  .app-topbar {
    position: sticky;
    top: 0;
  }

  .app-topbar-inner {
    padding-inline: 2rem;
  }

  .app-main {
    padding: 1.5rem 2rem 2.625rem;
  }
}

/* ------------------------------------------------------------------ plain pages (messages) */

.app-header {
  border-bottom: 1px solid var(--border);
}

.app-header-inner {
  display: flex;
  align-items: center;
  min-height: var(--header-height);
  padding-inline: 1.5rem;
}

.plain-main {
  display: flex;
  justify-content: center;
  padding: 2.625rem 1rem;
}

.plain-card {
  width: 100%;
  max-width: 32rem;
  padding: 1.5rem;
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.plain-card h1 {
  font-size: 1.25rem;
  line-height: 2rem;
  font-weight: 600;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  vertical-align: middle;
  min-height: 2.25rem;
  padding: calc((2.25rem - 1.25rem) / 2 - 1px) 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms cubic-bezier(0.2, 0, 0, 1);
}

.button:focus-visible {
  box-shadow: 0 0 0 3px var(--ring-50);
}

.button-small {
  min-height: 2rem;
  padding: calc((2rem - 1.25rem) / 2 - 1px) 0.75rem;
}

.button-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.button-primary:hover {
  background: var(--button-primary-bg-hover);
}

.button-secondary {
  background: var(--button-secondary-bg);
  color: var(--foreground);
  border-color: var(--input);
  box-shadow: var(--shadow-xs);
}

.button-secondary:hover {
  background: var(--button-secondary-bg-hover);
}

/* ------------------------------------------------------------------ key figures */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  min-width: 0;
}

.kpi-card-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-weight: 500;
  color: var(--muted-foreground);
}

.kpi-card-label .icon {
  color: var(--foreground);
}

.stat-value {
  margin: 0;
  font-size: 1.875rem;
  line-height: 2.375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.kpi-facts {
  display: grid;
  gap: 0.25rem;
  margin: 0;
}

.kpi-fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.kpi-fact dt {
  color: var(--muted-foreground);
}

.kpi-fact dd {
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ panels and facts */

.panel {
  margin-bottom: 1.5rem;
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 1rem 1rem 0;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 600;
  letter-spacing: normal;
}

.panel-note {
  margin: 0;
  color: var(--muted-foreground);
}

.panel-content {
  padding: 1rem;
}

.panel-grid {
  display: grid;
  gap: 0 1.5rem;
}

@media (min-width: 64em) {
  .panel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.facts-list {
  display: grid;
  gap: 0.25rem;
  margin: 0;
}

.facts-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 0.75rem;
  padding-block: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.facts-row:last-child {
  border-bottom: 0;
}

.facts-row > dt {
  min-width: 0;
  color: var(--muted-foreground);
}

.facts-row > dd {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.empty {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted-foreground);
}

/* ------------------------------------------------------------------ tables */

.table-wrap {
  position: relative;
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.panel-content > .table-wrap {
  margin: 0;
}

/* a value never breaks from its unit and an identifier never at its hyphens: a table too wide for its frame
   scrolls in it */
.table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.table th,
.table td {
  text-align: start;
  vertical-align: top;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
}

.table thead th {
  padding-block: 0.75rem;
  background: var(--muted);
  color: var(--foreground);
  font-weight: 500;
  white-space: nowrap;
}

.table tbody th {
  font-weight: 500;
}

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

.table tbody tr:hover th,
.table tbody tr:hover td {
  background: var(--muted-50);
}

.table .number {
  text-align: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cell-note {
  display: block;
  max-width: 14rem;
  margin-top: 0.125rem;
  white-space: normal;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--muted-foreground);
  font-weight: 400;
}

.actions-cell {
  white-space: nowrap;
  text-align: end;
}

@media (max-width: 64em) {
  .table th,
  .table td {
    padding-inline: 0.5rem;
  }
}

/* ------------------------------------------------------------------ states */

.state {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--foreground);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  white-space: nowrap;
}

.state-icon {
  width: 0.75rem;
  height: 0.75rem;
  color: var(--muted-foreground);
}

.state-ok .state-icon {
  color: var(--status-ok);
}

.state-warning .state-icon {
  color: var(--status-warn);
}

.state-critical .state-icon {
  color: var(--destructive);
}

.state-active .state-icon {
  color: var(--chart-2);
}

.tone-warning {
  color: var(--status-warn);
}

/* ------------------------------------------------------------------ documentation */

.doc .panel-content {
  padding: 1.5rem;
}

.doc h2 {
  margin: 2rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 1.25rem;
  line-height: 2rem;
  font-weight: 600;
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

.doc h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 600;
  letter-spacing: normal;
}

.doc p,
.doc ul,
.doc ol {
  max-width: 52rem;
  margin: 0 0 0.75rem;
}

.doc ul,
.doc ol {
  padding-inline-start: 1.5rem;
}

.doc li + li {
  margin-top: 0.25rem;
}

.doc .page-lead {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  line-height: 1.5rem;
}

.doc code {
  padding: 0.0625rem 0.25rem;
  background: var(--muted);
  border-radius: 0.25rem;
}

.doc .table-wrap {
  margin: 0 0 1rem;
}

/* the tables of a text wrap like the text */
.doc .table {
  white-space: normal;
}

.doc .table code {
  white-space: nowrap;
}

pre.code {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-family-mono);
  font-size: 0.75rem;
  line-height: 1.25rem;
  white-space: pre;
}

.doc-toc {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--muted-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.doc-toc-title {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.doc-toc ol {
  max-width: none;
  margin: 0;
}

@media (min-width: 64em) {
  .doc-toc ol {
    columns: 2;
    column-gap: 2.5rem;
  }
}

/* ------------------------------------------------------------------ accounts: sign-in, forms, tenants */

/* the signed-in person at the right of the header (after "Stand …" on the pages that reload) */
.topbar-account {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-inline-start: auto;
}

.topbar-meta + .topbar-account {
  margin-inline-start: 0.75rem;
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.topbar-name {
  overflow: hidden;
  max-width: 16rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-role {
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  line-height: 1.25rem;
  color: var(--muted-foreground);
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.5rem;
}

.button-ghost {
  background: transparent;
  color: var(--foreground);
}

.button-ghost:hover {
  background: var(--accent);
}

.button-destructive {
  background: var(--destructive);
  color: #ffffff;
  border-color: var(--destructive);
}

.button-destructive:hover {
  opacity: 0.9;
}

/* the card of the sign-in */
.auth-card {
  max-width: 28rem;
}

.auth-card p {
  margin: 0 0 1rem;
}

.form {
  margin: 0;
}

.fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  max-width: 28rem;
  margin-bottom: 1rem;
}

.field-label {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
}

.field-hint {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--muted-foreground);
}

.field-error {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--destructive);
}

.input {
  width: 100%;
  height: 2.25rem;
  padding: 0.25rem 0.75rem;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--foreground);
  background: transparent;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.input:focus,
.input:focus-visible {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px var(--ring-50);
}

.input[aria-invalid="true"] {
  border-color: var(--destructive);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.form > .form-actions {
  margin-bottom: 1.5rem;
}

.check-list {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.check-row:hover {
  background: var(--accent);
}

.check {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--primary);
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.alert > .icon {
  flex: none;
  margin-top: 0.125rem;
}

.alert-success > .icon {
  color: var(--status-ok);
}

.alert-error {
  border-color: var(--destructive);
}

.alert-error > .icon {
  color: var(--destructive);
}

.alert-warning {
  border-color: var(--status-warn);
}

.alert-warning > .icon {
  color: var(--status-warn);
}

/* the file of an upload: a native control in the frame of the inputs */
input[type="file"].input {
  height: auto;
  padding: 0.375rem 0.75rem;
}

/* the state of an Edge from an old report or a disconnected one, as the other values */
.muted .state {
  color: var(--muted-foreground);
}

/* the Edges of a tenant */
.chip-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.chip {
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  line-height: 1.25rem;
  color: var(--foreground);
  text-decoration: none;
}

.chip:hover {
  background: var(--accent);
}

/* exceptions of Edges without a key on the page „Releases“: a chip without a link, its form beside it */
.exception-list {
  display: grid;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.exception-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

span.chip:hover {
  background: transparent;
}

/* a removal behind a second click, without a script */
.danger-zone {
  margin-top: 1.5rem;
}

.danger-zone > summary {
  list-style: none;
}

.danger-zone > summary::-webkit-details-marker {
  display: none;
}

.danger-zone-body {
  margin-top: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--destructive);
  border-radius: var(--radius-lg);
}

.danger-zone-body p {
  margin: 0 0 0.75rem;
}

.danger-zone-inline {
  display: inline-block;
  margin-top: 0;
}

.danger-zone-inline > .danger-zone-body {
  padding: 0.5rem;
}
