:root {
  --bg: #0d1114;
  --surface: #151b20;
  --surface-raised: #1b2329;
  --surface-muted: #202a31;
  --text: #edf4f2;
  --muted: #a9b2a2;
  --line: #323a35;
  --pfadiblau: #0e4278;
  --vagantengelb: #ffff00;
  --woelflingsgelb: #ffd208;
  --rr-rot: #971b2f;
  --vagantengelb-rgb: 255, 255, 0;
  --woelflingsgelb-rgb: 255, 210, 8;
  --rr-rot-rgb: 151, 27, 47;
  --pfadiblau-bright: #a9bbce;
  --vagantengelb-bright: #ffff80;
  --woelflingsgelb-bright: #ffe984;
  --rr-rot-bright: #d5a4ac;
  --pfadiblau-dark: #0b2341;
  --vagantengelb-dark: #847916;
  --woelflingsgelb-dark: #8b7417;
  --rr-rot-dark: #52111b;
  --lagerplatzgruen: #00b74f;
  --waldgruen: #006c55;
  --kohte: #222423;
  --glut: #e84e1b;
  --lagerfeuerorange: #ef7d00;
  --morgenkreis: #ef859d;
  --internationalerabend: #653279;
  --singekreislila: #8e7fae;
  --lagerplatzgruen-rgb: 0, 183, 79;
  --waldgruen-rgb: 0, 108, 85;
  --kohte-rgb: 34, 36, 35;
  --glut-rgb: 232, 78, 27;
  --lagerfeuerorange-rgb: 239, 125, 0;
  --morgenkreis-rgb: 239, 133, 157;
  --internationalerabend-rgb: 101, 50, 121;
  --singekreislila-rgb: 142, 127, 174;
  --brand-primary: var(--vagantengelb);
  --brand-primary-rgb: var(--vagantengelb-rgb);
  --brand-primary-bright: var(--vagantengelb-bright);
  --brand-primary-dark: var(--vagantengelb-dark);
  --brand-danger: var(--rr-rot);
  --brand-danger-rgb: var(--rr-rot-rgb);
  --brand-danger-bright: var(--rr-rot-bright);
  --brand-danger-dark: var(--rr-rot-dark);
  --brand-success: var(--lagerplatzgruen);
  --brand-success-rgb: var(--lagerplatzgruen-rgb);
  --brand-logo: var(--brand-primary);
  --logo-yellow: var(--brand-logo);
  --brand: var(--brand-primary);
  --brand-rgb: var(--brand-primary-rgb);
  --brand-strong: var(--brand-primary);
  --brand-hover: var(--brand-primary-bright);
  --brand-ink: #1b1b03;
  --edit-border: var(--brand-primary-dark);
  --edit-border-strong: var(--brand-primary-bright);
  --edit-surface: rgba(var(--brand-rgb), 0.055);
  --edit-shadow: 0 0 0 1px rgba(var(--brand-rgb), 0.18);
  --accent: var(--brand-primary-dark);
  --accent-ink: #1d1806;
  --good: var(--brand-success);
  --good-rgb: var(--brand-success-rgb);
  --warn: var(--brand-primary);
  --danger: var(--brand-danger);
  --danger-rgb: var(--brand-danger-rgb);
  --danger-strong: var(--brand-danger-bright);
  --danger-dark: var(--brand-danger-dark);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
  --workspace-pad: clamp(10px, 1.6vw, 20px);
  --workspace-pad-left: clamp(12px, 2vw, 24px);
  --context-panel-width: 40%;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow: hidden;
  background: linear-gradient(180deg, #121812 0%, var(--bg) 18rem);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

body.is-full-page-open {
  overflow: auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.app-shell {
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.topbar {
  position: relative;
  z-index: 50;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: 10px 16px;
  padding: 12px clamp(16px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
  background: rgba(21, 27, 32, 0.98);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.app-content {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
}

body.is-full-page-open .app-content,
.app-content:has(> .account-page:not([hidden])),
.app-content:has(> .auth-screen:not([hidden])) {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.panel-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(1.25rem, 1.7vw, 1.65rem);
  line-height: 1.1;
}

.brand-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex-wrap: nowrap;
  justify-self: start;
}

.site-title {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.site-title:hover,
.site-title:focus-visible {
  color: inherit;
}

.site-title:focus-visible {
  outline: 2px solid var(--brand-strong);
  outline-offset: 4px;
  border-radius: 4px;
}

.logo-word {
  color: var(--brand-logo);
}

h2 {
  margin: 0;
  font-size: 1.08rem;
}

h3 {
  margin: 0;
  font-size: 0.98rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar-actions {
  position: static;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  justify-self: end;
}

.topbar-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  column-gap: clamp(18px, 4vw, 56px);
  row-gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  justify-self: stretch;
}

.topbar-tools:has(.public-visualization-nav:not([hidden])) {
  display: grid;
  grid-template-columns: max-content max-content;
  justify-content: space-evenly;
  column-gap: clamp(32px, 8vw, 128px);
}

.public-visualization-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.public-visualization-nav .nav-item {
  width: auto;
  min-width: 92px;
  justify-content: center;
}

.timeframe-control {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 6px;
  row-gap: 2px;
}

.timeframe-compact {
  display: flex;
  align-items: center;
}

.timeframe-compact {
  gap: 3px;
}

.timeframe-value {
  width: 124px;
  max-width: 124px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand-strong);
  background: #0f1418;
  text-align: center;
  white-space: nowrap;
}

.timeframe-value:focus {
  border-color: var(--brand-primary);
  outline: 0;
}

.timeframe-slider {
  grid-column: 1 / -1;
  width: 100%;
  height: 12px;
  margin: 0;
  accent-color: var(--brand-primary);
}

.timeframe-width-buttons {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 3px;
}

.timeframe-width-buttons .icon-button {
  width: 28px;
  height: 20px;
  min-height: 20px;
  font-size: 0.7rem;
  line-height: 1;
}

.timeframe-notice {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.global-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
}

.global-search input {
  width: clamp(180px, 22vw, 280px);
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #0f1418;
}

.global-search input:focus-visible {
  outline: 2px solid var(--brand-strong);
  outline-offset: 2px;
}

.source-control,
.edit-certainty-control {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.tool-label {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.source-input-wrap {
  position: relative;
  min-width: 0;
}

.source-control input,
.edit-certainty-control select {
  width: clamp(150px, 18vw, 220px);
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand-strong);
  background: #0f1418;
}

.source-control input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.source-control input:focus-visible {
  outline: 2px solid var(--brand-strong);
  outline-offset: 2px;
}

.edit-certainty-control select {
  width: 30px;
  padding: 5px 3px 5px 8px;
  appearance: none;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.edit-certainty-control select:focus-visible {
  outline: 2px solid var(--brand-strong);
  outline-offset: 2px;
}

.global-search-results {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  left: 50%;
  display: grid;
  width: min(420px, 88vw);
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.global-search-results button {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.global-search-results button:hover,
.global-search-results button:focus-visible,
.global-search-results button.is-active {
  background: var(--surface-raised);
  outline: 0;
}

.global-search-results .global-search-create {
  border-left: 3px solid var(--brand-strong);
  background: transparent;
}

.global-search-results .global-search-create strong::before {
  content: "+ ";
  color: var(--brand-strong);
}

.global-search-results span,
.global-search-empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.global-search-empty {
  padding: 10px;
}

.button,
.nav-item {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.button {
  padding: 6px 12px;
  color: var(--brand-ink);
  background: var(--brand);
  text-decoration: none;
}

.topbar .button {
  min-height: 32px;
}

.button:hover {
  background: var(--brand-hover);
}

.button:disabled {
  cursor: not-allowed;
  color: #75837f;
  background: #20292f;
  border-color: #28343b;
}

.button-secondary {
  color: var(--brand-strong);
  background: rgba(var(--brand-rgb), 0.12);
  border-color: rgba(var(--brand-rgb), 0.28);
}

.button-secondary:hover {
  color: var(--brand-ink);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid rgba(var(--brand-rgb), 0.28);
  border-radius: 8px;
  color: var(--brand-strong);
  background: rgba(var(--brand-rgb), 0.12);
  cursor: pointer;
  line-height: 1;
}

.icon-button:hover,
.icon-button:focus-visible {
  color: var(--brand-ink);
  background: var(--brand-hover);
}

.button-subtle {
  min-height: 30px;
  padding: 5px 9px;
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
  font-size: 0.82rem;
}

.button-subtle:hover {
  color: var(--text);
  background: var(--surface-muted);
}

.back-to-top {
  position: fixed;
  right: clamp(12px, 2vw, 24px);
  bottom: clamp(12px, 2vw, 24px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 50%;
  color: var(--brand-strong);
  border-color: rgba(var(--brand-rgb), 0.38);
  background: rgba(15, 20, 24, 0.9);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
  font-size: 1.5rem;
  font-weight: 800;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  color: var(--brand-strong);
  background: var(--surface-raised);
}

.button-danger {
  color: var(--danger-strong);
  background: var(--danger);
  border-color: rgba(var(--danger-rgb), 0.72);
}

.button-danger:hover {
  color: var(--danger-strong);
  background: var(--danger-dark);
}

.button-danger.is-confirming,
.icon-button-danger.is-confirming {
  color: var(--danger-strong);
  background: var(--danger-dark);
  border-color: var(--danger-strong);
  font-weight: 800;
}

.button:focus-visible,
.nav-item:focus-visible,
.period-toggle:focus-visible {
  outline: 2px solid var(--brand-strong);
  outline-offset: 2px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.user-pill {
  gap: 6px;
}

.account-pill-action {
  display: inline-flex;
  align-items: center;
  color: var(--brand-strong);
  font-size: 0.95rem;
  line-height: 1;
  white-space: nowrap;
}

.account-pill-action:hover,
.account-pill-action:focus-visible {
  color: var(--text);
}

.version-chip {
  flex: 0 0 auto;
  color: #6f7a74;
  font-size: 0.74rem;
  text-decoration: none;
  white-space: nowrap;
}

.version-chip:hover,
.version-chip:focus-visible {
  color: var(--muted);
}

.version-chip:focus-visible {
  outline: 2px solid var(--brand-strong);
  outline-offset: 3px;
  border-radius: 4px;
}

.status-pill.is-online {
  color: #041711;
  background: var(--good);
}

.status-pill.is-warning {
  color: var(--brand-ink);
  background: var(--warn);
}

.status-pill.is-offline {
  color: var(--danger-strong);
  background: var(--danger);
}

.app-warning {
  width: min(1480px, calc(100% - clamp(28px, 5vw, 56px)));
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: center;
  margin: 10px auto 0;
  padding: 7px 12px;
  border: 1px solid rgba(var(--brand-rgb), 0.38);
  border-radius: 8px;
  color: var(--brand-strong);
  background: rgba(var(--brand-rgb), 0.12);
  line-height: 1.25;
}

.app-warning strong {
  flex: 0 0 auto;
  color: var(--brand-strong);
}

.app-warning span {
  min-width: 0;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  gap: 20px;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  padding: var(--workspace-pad) var(--workspace-pad) var(--workspace-pad) var(--workspace-pad-left);
}

.workspace.is-public {
  grid-template-columns: minmax(0, 1fr);
  padding-left: var(--workspace-pad);
}

.workspace.is-public .editor-nav,
.workspace.is-public .context-resizer,
.workspace.is-public .context-panel {
  display: none;
}

.public-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  padding: clamp(18px, 3vw, 32px) 0 8px;
  border-bottom: 1px solid var(--line);
}

.public-hero p,
.public-section-heading p,
.public-muted {
  margin: 0;
  color: var(--muted);
}

.public-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(86px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.public-stat {
  min-width: 94px;
  padding: 12px 14px;
  background: var(--surface);
}

.public-stat strong {
  display: block;
  color: var(--brand-strong);
  font-size: 1.65rem;
  line-height: 1;
}

.public-stat span {
  color: var(--muted);
  font-size: 0.78rem;
}

.public-map,
.public-grid {
  display: grid;
  gap: 14px;
}

.public-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.public-graph-tools {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.public-graph-filter {
  display: grid;
  gap: 5px;
  min-width: 190px;
}

.public-graph-filter span {
  color: var(--muted);
  font-size: 0.78rem;
}

.public-graph-filter select {
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #0f1418;
}

.public-graph {
  position: relative;
  height: var(--tree-graph-height, min(72vh, 760px));
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(var(--brand-rgb), 0.07) 1px, transparent 1px),
    linear-gradient(180deg, rgba(var(--brand-rgb), 0.05) 1px, transparent 1px),
    rgba(21, 27, 32, 0.78);
  background-size: 42px 42px;
  overflow: hidden;
}

.public-graph-layout-probe {
  position: absolute;
  inset: auto;
  left: -10000px;
  top: -10000px;
  visibility: hidden;
  pointer-events: none;
}

.public-graph .vis-navigation {
  filter: saturate(0.8);
}

.public-graph .vis-button {
  opacity: 0.72;
}

.public-graph.vis-network,
.public-graph .vis-network,
.public-graph canvas {
  width: 100% !important;
  height: 100% !important;
}

[data-tree-graph-root] .public-graph {
  min-height: 0;
}

.tree-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(var(--brand-rgb), 0.07) 1px, transparent 1px),
    linear-gradient(180deg, rgba(var(--brand-rgb), 0.05) 1px, transparent 1px),
    rgba(21, 27, 32, 0.78);
  background-size: 42px 42px;
}

.tree-node {
  display: grid;
  gap: 12px;
  min-height: 150px;
  padding: 14px;
  border: 1px solid rgba(216, 216, 90, 0.28);
  border-radius: 8px;
  background: rgba(13, 17, 20, 0.86);
}

.tree-node-top {
  display: grid;
  gap: 4px;
}

.tree-node-top span,
.tree-node-foot {
  color: var(--muted);
  font-size: 0.78rem;
}

.tree-node-top strong {
  font-size: 1.1rem;
}

.tree-node p {
  margin: 0;
  color: var(--text);
}

.tree-node-foot {
  align-self: end;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.tree-empty,
.public-chip-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tree-empty {
  grid-column: 1 / -1;
}

.tree-type-chip,
.public-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.tree-type-chip {
  color: var(--brand-strong);
}

.public-grid {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
}

.public-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.public-timeline {
  display: grid;
  gap: 8px;
}

.timeline-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item span {
  color: var(--muted);
  white-space: nowrap;
}

.auth-screen {
  width: min(860px, calc(100% - clamp(28px, 5vw, 56px)));
  max-height: calc(100% - clamp(36px, 8vw, 96px));
  overflow-y: auto;
  margin: clamp(18px, 4vw, 48px) auto;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.login-email-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 0 18px 18px;
}

.login-email-form .object-save-state {
  grid-column: 1 / -1;
}

.account-page {
  min-height: 100%;
  overflow: visible;
  padding: var(--workspace-pad) var(--workspace-pad-left);
}

.account-layout {
  display: grid;
  gap: 14px;
  width: min(920px, 100%);
  margin: 0 auto;
}

.account-toolbar {
  display: flex;
  justify-content: flex-start;
}

.account-panel {
  display: grid;
  gap: 0;
}

.account-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.account-form .form-actions,
.account-state {
  grid-column: 1 / -1;
}

.account-static-value {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 7px 0;
  color: var(--text);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.account-passkey-section {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.account-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.account-passkeys {
  display: grid;
  gap: 10px;
}

.account-passkey {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.account-passkey div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.account-passkey small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: start;
  position: sticky;
  top: var(--workspace-pad);
  z-index: 20;
  max-height: calc(100vh - var(--workspace-pad) - var(--workspace-pad));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-label {
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  color: var(--text);
  text-align: left;
  background: transparent;
}

.nav-count {
  flex: 0 0 var(--nav-count-width, 1ch);
  color: var(--brand-strong);
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.nav-visual-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  color: var(--brand-strong);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  vertical-align: middle;
}

.nav-visual-svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-visual-svg circle {
  fill: var(--surface);
}

.nav-count .nav-visual-icon {
  display: block;
  margin-inline-start: auto;
}

.nav-count:has(.nav-visual-icon) {
  flex-basis: 18px;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: var(--line);
  background: var(--surface-raised);
}

.nav-item.is-active {
  color: var(--brand-strong);
  border-color: rgba(var(--brand-rgb), 0.42);
}

.content-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  min-width: 0;
  padding-inline-end: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.context-panel {
  display: none;
  grid-template-rows: auto minmax(0, 1fr);
  position: relative;
  min-width: 0;
  overflow: hidden;
  overscroll-behavior: contain;
}

.context-panel-header {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.context-type-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.context-type-group {
  display: grid;
  gap: 8px;
  min-width: 154px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 12, 14, 0.58);
}

.context-type-group > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.context-type-toggles label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: rgba(15, 20, 24, 0.78);
  font-size: 0.78rem;
  cursor: pointer;
  user-select: none;
}

.context-type-toggles .context-type-group-toggle {
  width: fit-content;
  min-height: 0;
  padding: 0;
  border: 0;
  color: var(--text);
  font-weight: 700;
  background: transparent;
}

.context-type-toggles label:has(input:checked):not(.context-type-group-toggle) {
  color: var(--text);
  border-color: var(--line);
  background: rgba(24, 30, 35, 0.82);
}

.context-type-toggles .context-type-group-toggle.is-partial {
  color: var(--muted);
}

.context-type-toggles label.is-forced {
  cursor: default;
  pointer-events: none;
}

.context-type-toggles input {
  accent-color: var(--brand);
}

.context-type-toggles input:disabled {
  opacity: 1;
}

.context-resizer {
  display: none;
  width: 8px;
  min-width: 8px;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}

.context-resizer::before {
  content: "";
  display: block;
  width: 2px;
  height: 100%;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(var(--brand-rgb), 0.18);
}

.context-resizer:hover::before,
.context-resizer:focus-visible::before,
body.is-context-resizing .context-resizer::before {
  background: rgba(var(--brand-rgb), 0.72);
}

body.is-context-resizing {
  cursor: col-resize;
  user-select: none;
}

.context-graph {
  height: 100%;
  min-height: 0;
  overscroll-behavior: contain;
}

.workspace[data-active-view="tree"] .content-area,
.workspace[data-active-view="timeline"] .content-area {
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  align-content: stretch;
  padding-inline-end: 0;
  overflow: hidden;
  scrollbar-gutter: auto;
}

@media (min-width: 1180px) {
  .workspace[data-active-view="timeline"] {
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  }

  .workspace.is-public[data-active-view="tree"],
  .workspace.is-public[data-active-view="timeline"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace[data-active-view="timeline"] .context-resizer,
  .workspace[data-active-view="timeline"] .context-panel {
    display: none;
  }

  .workspace:not([data-active-view="tree"]):not([data-active-view="timeline"]):not([data-active-view="users"]):not([data-active-view="audit"]):not([data-active-view="log"]) {
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) 8px minmax(280px, var(--context-panel-width));
    align-items: stretch;
    column-gap: 8px;
  }

  .workspace:not([data-active-view="tree"]):not([data-active-view="timeline"]):not([data-active-view="users"]):not([data-active-view="audit"]):not([data-active-view="log"]) .context-resizer {
    display: block;
  }

  .workspace:not([data-active-view="tree"]):not([data-active-view="timeline"]):not([data-active-view="users"]):not([data-active-view="audit"]):not([data-active-view="log"]) .context-panel {
    position: relative;
    top: auto;
    display: grid;
    align-content: stretch;
    height: 100%;
    min-height: 0;
  }
}

.view {
  grid-column: 1;
  grid-row: 1;
  display: none;
}

.view.is-active {
  display: grid;
  gap: 18px;
}

#view-tree {
  min-height: 0;
}

#view-tree.is-active,
#view-timeline.is-active {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#view-tree .public-map {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
  gap: 0;
  overflow: hidden;
  position: relative;
}

#view-tree .panel-header {
  min-height: 0;
}

#view-tree .collection-heading {
  min-width: 0;
  flex: 0 1 auto;
}

#view-tree [data-tree-graph-status] {
  margin: 0;
  position: absolute;
  z-index: 6;
  top: 78px;
  left: 12px;
  max-width: min(420px, calc(100% - 24px));
  padding: 8px 10px;
  border: 1px solid rgba(var(--brand-rgb), 0.28);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(13, 17, 20, 0.88);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

#view-tree .public-graph {
  width: 100%;
  flex: 1 1 0;
  height: auto;
  min-height: 0;
  align-self: stretch;
}

#view-tree .tree-summary {
  position: absolute;
  z-index: 6;
  top: 14px;
  right: 14px;
}

#view-timeline .public-map {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
}

.visualization-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.visualization-summary span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  background: var(--surface);
}

[data-visualization-status] {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
}

.timeline-visualization {
  position: relative;
  flex: 1 1 auto;
  min-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 27, 32, 0.78);
}

.timeline-chart {
  position: relative;
  min-width: 760px;
  padding: 42px 18px 18px 180px;
}

.timeline-chart-enter,
.timeline-chart-exit {
  transition: opacity 260ms ease, transform 260ms ease;
}

.timeline-chart-enter {
  opacity: 0;
  transform: translateY(4px);
}

.timeline-chart-enter.is-active {
  opacity: 1;
  transform: translateY(0);
}

.timeline-chart-exit {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.timeline-chart-exit.is-active {
  opacity: 0;
  transform: translateY(-4px);
}

@media (prefers-reduced-motion: reduce) {
  .timeline-chart-enter,
  .timeline-chart-exit {
    transition: none;
  }
}

.timeline-axis {
  position: absolute;
  top: 14px;
  right: 18px;
  left: 180px;
  height: 24px;
  border-bottom: 1px solid var(--line);
}

.timeline-tick {
  position: absolute;
  bottom: -1px;
  height: 9px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
}

.timeline-tick span {
  position: absolute;
  top: -18px;
  transform: translateX(-50%);
}

.timeline-lane {
  position: relative;
  min-height: 46px;
  border-bottom: 1px solid rgba(50, 58, 53, 0.55);
}

.timeline-lane-label {
  position: absolute;
  right: calc(100% + 12px);
  top: 12px;
  width: 150px;
  overflow: hidden;
  color: var(--text);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-segment {
  position: absolute;
  top: 8px;
  min-width: 4px;
  height: 29px;
  overflow: hidden;
  padding: 5px 7px;
  border: 1px solid var(--brand-primary-dark);
  border-radius: 5px;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(var(--brand-rgb), 0.12);
  cursor: pointer;
}

.timeline-segment.is-leadership {
  border-color: var(--singekreislila);
  background: rgba(var(--singekreislila-rgb), 0.2);
}

.timeline-segment.is-open-start {
  border-left-style: dashed;
}

.timeline-segment.is-open-end {
  border-right-style: dashed;
}

.timeline-segment.is-open-start::before,
.timeline-segment.is-open-end::after {
  color: var(--brand-primary);
}

.timeline-segment.is-open-start::before {
  content: "‹";
}

.timeline-segment.is-open-end::after {
  content: "›";
  float: right;
}

.timeline-segment:hover,
.timeline-segment:focus-visible {
  border-color: var(--brand-primary);
  outline: 2px solid rgba(var(--brand-rgb), 0.3);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 27, 32, 0.96);
  box-shadow: var(--shadow);
}

#view-people .panel,
#view-groups .panel,
#view-group-types .panel,
#view-roles .panel,
#view-timepoints .panel,
#view-tree .panel,
#view-timeline .panel,
#view-users .panel,
#view-audit .panel,
#view-log .panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

#view-people .panel-header,
#view-groups .panel-header,
#view-group-types .panel-header,
#view-roles .panel-header,
#view-timepoints .panel-header,
#view-tree .panel-header,
#view-users .panel-header {
  padding-inline: 0;
  border-bottom: 0;
}

#view-tree .panel-header {
  position: absolute;
  z-index: 7;
  top: 12px;
  left: 12px;
  width: fit-content;
  max-width: calc(100% - 24px);
  min-height: 0;
  padding: 10px;
  border: 1px solid rgba(var(--brand-rgb), 0.26);
  border-radius: 8px;
  background: rgba(13, 17, 20, 0.88);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(10px);
}

.collection-header {
  align-items: flex-start;
  flex-wrap: wrap;
}

.collection-heading {
  display: grid;
  grid-template-columns: minmax(260px, 1fr);
  align-items: start;
  gap: 14px;
  min-width: min(100%, 620px);
  flex: 1 1 620px;
}

.collection-controls {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.collection-control {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.collection-control-wide {
  min-width: 210px;
}

.collection-control span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.collection-control input,
.collection-control select {
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #0f1418;
}

.collection-control select[multiple] {
  min-height: 74px;
}

.collection-control input:focus-visible,
.collection-control select:focus-visible {
  outline: 2px solid var(--brand-strong);
  outline-offset: 2px;
}

.collection-filter-section {
  display: grid;
  gap: 6px;
  min-width: min(100%, 320px);
}

.collection-filter-label {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.collection-sort-direction {
  color: var(--muted);
  font-weight: 700;
}

.collection-filter-controls {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

#view-tree .collection-heading {
  grid-template-columns: max-content;
  min-width: 0;
  flex: 0 1 auto;
}

#view-tree .collection-header,
#view-tree .collection-controls,
#view-tree .collection-filter-section,
#view-tree .collection-filter-controls {
  width: auto;
}

#view-tree .collection-filter-section {
  min-width: 0;
}

#view-tree .collection-control {
  min-width: 132px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.workflow-panel {
  display: grid;
  align-content: start;
  overflow: hidden;
}

.workflow-panel-wide {
  min-height: 360px;
}

.editor-tree {
  min-height: 290px;
  border-width: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
}

.list {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
}

.list-item:hover {
  background: var(--surface-raised);
}

.list-more {
  display: grid;
  place-items: center;
  padding: 12px;
}

.list-item small {
  color: var(--muted);
}

.object-list {
  gap: 12px;
  background: transparent;
}

.user-list {
  gap: 12px;
  background: transparent;
}

.change-log-list {
  gap: 1px;
  --change-log-grid-columns: minmax(13rem, 1.15fr) minmax(16rem, 1.4fr) minmax(11rem, 0.95fr) minmax(18rem, 2fr);
}

.change-log-item {
  width: 100%;
  border: 0;
  appearance: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.change-log-row {
  grid-template-columns: var(--change-log-grid-columns);
  align-items: start;
}

.change-log-header {
  position: sticky;
  z-index: 12;
  top: 0;
  display: grid;
  gap: 12px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #11181d;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.change-log-header span,
.change-log-time,
.change-log-object,
.change-log-user,
.change-log-details {
  min-width: 0;
  overflow-wrap: anywhere;
}

.change-log-time,
.change-log-details {
  color: var(--muted);
  font-size: 0.84rem;
}

.change-log-details {
  display: grid;
  gap: 2px;
  color: var(--muted);
}

.change-log-details small {
  color: var(--muted);
  font-size: 0.78rem;
}

.change-log-object.is-created {
  color: var(--good);
}

.change-log-object.is-updated {
  color: var(--text);
}

.change-log-object.is-deleted {
  color: var(--danger);
}

.change-log-user {
  color: var(--text);
  font-weight: 650;
}

.change-log-object {
  font-weight: 650;
}

.change-log-item:hover,
.change-log-item:focus-visible {
  background: var(--surface-raised);
  outline: 0;
}

.audit-list {
  gap: 1px;
  --audit-grid-columns: minmax(13rem, 1.15fr) minmax(12rem, 1fr) minmax(11rem, 0.95fr) minmax(18rem, 2fr);
}

.audit-filter-header,
.change-log-filter-header {
  min-height: 0;
  padding: 12px 18px;
}

.audit-controls,
.change-log-controls {
  justify-content: flex-start;
}

.audit-row {
  grid-template-columns: var(--audit-grid-columns);
  align-items: start;
}

.audit-header {
  position: sticky;
  z-index: 12;
  top: 0;
  display: grid;
  gap: 12px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #11181d;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.audit-header span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.audit-time,
.audit-event,
.audit-user,
.audit-details {
  min-width: 0;
  overflow-wrap: anywhere;
}

.audit-time,
.audit-details {
  color: var(--muted);
  font-size: 0.84rem;
}

.audit-user {
  color: var(--text);
  font-weight: 650;
}

.audit-event {
  color: var(--text);
  font-weight: 650;
}

.audit-event.is-login {
  color: var(--text);
}

.audit-event.is-setup {
  color: var(--good);
}

.audit-event.is-passkey {
  color: var(--text);
}

.audit-event.is-user {
  color: var(--danger);
}

.audit-event.is-deleted {
  color: var(--danger);
}

.object-list .list-item,
.user-list .list-item {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.object-list .object-item.is-editing,
.user-list .user-item.is-editing {
  border-color: var(--edit-border);
  background: linear-gradient(180deg, var(--edit-surface), var(--surface) 132px);
  box-shadow: var(--edit-shadow);
}

.object-list .list-item:not(.is-editing):hover,
.user-list .list-item:not(.is-editing):hover {
  background: var(--surface);
}

.object-list .object-item.is-editing:hover,
.user-list .user-item.is-editing:hover {
  background: linear-gradient(180deg, var(--edit-surface), var(--surface) 132px);
}

.object-item.is-clickable .object-editor,
.user-item.is-clickable .user-editor {
  cursor: default;
}

.list-section-heading {
  padding: 16px 4px 2px;
  color: var(--brand-strong);
  font-family: "Aptos Display", "Aptos", "Segoe UI Variable Display", "Segoe UI Variable", "Inter", system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
}

.object-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.object-title-row {
  position: relative;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  text-align: left;
  background: transparent;
  overflow-wrap: anywhere;
}

.object-title-row::before {
  content: "";
  position: absolute;
  inset: -7px -8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  pointer-events: auto;
}

.object-title-row > * {
  position: relative;
  z-index: 1;
}

button.object-title-row {
  cursor: pointer;
}

button.object-title-row:hover,
button.object-title-row:focus-visible {
  border-color: transparent;
  outline: 0;
  background: transparent;
}

button.object-title-row:hover::before,
button.object-title-row:focus-visible::before,
button.object-title-row.is-graph-highlighted::before {
  border-color: var(--brand);
  background: rgba(var(--brand-rgb), 0.08);
}

.object-title-text {
  flex: 1 1 auto;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.object-title-heading {
  font-family: "Aptos Display", "Aptos", "Segoe UI Variable Display", "Segoe UI Variable", "Inter", system-ui, sans-serif;
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.14;
}

.object-subtitle {
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.25;
}

.object-subtitle[hidden],
.object-property-tags[hidden],
.object-status-meta[hidden],
.object-modified[hidden],
.object-validation-meta[hidden],
.object-validation-list[hidden],
.composite-validation-list[hidden],
.composite-validation-meta[hidden] {
  display: none;
}

.object-property-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

.object-property-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid rgba(124, 135, 145, 0.36);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.72rem;
  line-height: 1.25;
  white-space: nowrap;
}

.object-status-meta {
  flex: 0 1 auto;
  min-width: 0;
  max-width: calc(100% - 14ch);
  margin-left: auto;
  display: grid;
  gap: 2px;
  overflow: hidden;
}

.object-modified,
.object-validation-meta,
.composite-validation-meta {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
}

.object-validation-meta,
.composite-validation-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(9ch, auto);
  column-gap: 8px;
}

.list-item .object-validation-meta,
.list-item .composite-validation-meta,
.list-item .object-validation-meta .validation-meta-text,
.list-item .composite-validation-meta .validation-meta-text {
  color: var(--muted);
}

.list-item .object-validation-meta .validation-meta-count,
.list-item .composite-validation-meta .validation-meta-count {
  color: var(--danger);
}

.object-modified-user {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.object-modified-date {
  flex: 0 0 auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.object-modified-separator {
  flex: 0 0 auto;
}

.validation-meta-text {
  justify-self: stretch;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  white-space: nowrap;
}

.validation-meta-count {
  justify-self: end;
  min-width: 9ch;
  color: var(--danger);
  font-variant-numeric: tabular-nums;
}

.object-validation-list,
.composite-validation-list {
  display: grid;
  gap: 2px;
  margin: 2px 0 0;
  padding: 0;
  color: var(--danger);
  font-size: 0.73rem;
  line-height: 1.25;
  list-style: none;
  text-align: right;
}

.composite-validation-list {
  flex: 0 1 auto;
  max-width: calc(100% - 14ch);
  margin-left: auto;
}

.object-validation-list li,
.composite-validation-list-item {
  display: block;
  width: 100%;
  max-width: 100%;
  justify-self: end;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  white-space: nowrap;
}

.object-field .composite-validation-list,
.object-field .composite-validation-list-item {
  color: var(--danger);
  font-size: 0.73rem;
}

.object-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.reverse-view {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.group-reverse-edit {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  align-items: start;
}

.reverse-column {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(15, 20, 24, 0.58);
}

.reverse-column strong {
  font-size: 0.82rem;
}

.reverse-column strong span {
  color: var(--brand-strong);
  font-variant-numeric: tabular-nums;
}

.reverse-column small {
  color: var(--muted);
}

.reverse-link {
  color: inherit;
  text-decoration: none;
}

.reverse-link:hover,
.reverse-link:focus-visible,
.reverse-link.is-graph-highlighted {
  color: var(--text);
  text-decoration: underline;
}

.group-reverse-field {
  align-content: start;
  align-self: start;
  gap: 10px;
}

.group-reverse-field .composite-header > span {
  color: var(--muted);
  font-size: 0.78rem;
}

.group-reverse-field .composite-header strong {
  color: var(--brand-strong);
  font-size: inherit;
  font-variant-numeric: tabular-nums;
}

.group-reverse-row {
  grid-template-columns: minmax(0, 1fr);
}

.group-reverse-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: start;
}

.group-reverse-person-link {
  align-self: start;
}

.group-reverse-empty {
  color: var(--muted);
}

.group-relation-add-slot[hidden] {
  display: none;
}

.object-create {
  border-bottom: 1px solid var(--line);
  background: var(--surface-raised);
}

.object-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 12px;
  padding: 12px 0 0;
}

.object-editor-layout {
  grid-template-columns: minmax(0, 1fr) minmax(190px, 280px);
  align-items: start;
}

.object-editor-layout.no-side {
  grid-template-columns: minmax(0, 1fr);
}

.object-editor-main,
.object-editor-relations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 12px;
  min-width: 0;
}

.object-editor-main {
  grid-column: 1;
}

.object-editor-layout.no-side .object-editor-main {
  grid-column: 1 / -1;
}

.object-editor-side {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: start;
  min-width: 0;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.object-editor-side > .source-display-field {
  min-width: 0;
}

.object-editor-side > .object-field:has(textarea) {
  grid-column: 1 / -1;
}

.object-editor-side .object-field-wide {
  grid-column: auto;
}

.object-editor-relations {
  grid-column: 1 / -1;
}

.object-editor-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.object-editor-layout > .form-actions,
.object-editor-layout > .object-save-state {
  grid-column: 1 / -1;
}

.object-create-form {
  padding: 18px;
}

.object-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.object-field-wide {
  grid-column: 1 / -1;
}

.object-field span {
  color: var(--muted);
  font-size: 0.78rem;
}

.source-display-text {
  min-height: 1.45em;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.field-label-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.field-label-main,
.field-label-action {
  color: var(--muted);
  font-size: inherit;
}

.object-field input,
.object-field select,
.object-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #0f1418;
}

.object-field select {
  cursor: pointer;
}

.reference-field {
  position: relative;
  align-content: start;
}

.reference-filter-wrap {
  position: relative;
}

.reference-filter-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: grid;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.reference-filter-result {
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.reference-filter-result:hover,
.reference-filter-result:focus-visible,
.reference-filter-result.is-active {
  background: var(--surface-raised);
  outline: 0;
}

.reference-filter-result span,
.reference-filter-empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.reference-filter-create {
  border-left: 3px solid var(--brand-strong);
  background: transparent;
}

.reference-filter-create strong::before {
  content: "+ ";
  color: var(--brand-strong);
}

.reference-filter-empty {
  padding: 9px;
}

.reference-select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 6px;
  align-items: center;
}

.reference-select-row select {
  min-width: 0;
}

.reference-link {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(15, 20, 24, 0.72);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.reference-link:hover,
.reference-link:focus-visible,
.reference-link.is-graph-highlighted {
  color: var(--text);
  border-color: var(--brand-strong);
}

.reference-filter {
  min-height: 30px !important;
  padding-block: 5px !important;
  color: var(--muted) !important;
  background: rgba(15, 20, 24, 0.72) !important;
}

.reference-filter:focus-visible {
  color: var(--text) !important;
}

.date-control {
  display: grid;
  grid-template-columns: minmax(11ch, 1fr) max-content;
  gap: 6px;
  align-items: end;
}

.date-input-field,
.date-detail-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.date-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.compact-certainty-select,
.date-certainty-select {
  width: 30px;
  min-height: 36px;
  padding: 0 3px 0 8px;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f1418;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.certainty-field {
  justify-items: start;
  width: 30px;
  max-width: 30px;
}

.period-timepoint-row,
.period-custom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 8px;
  align-items: end;
}

.period-custom-row > .date-field {
  min-width: 0;
}

.timepoint-reference-certainty {
  display: grid;
  gap: 6px;
}

.timepoint-reference-certainty select {
  width: 30px;
  min-height: 36px;
  padding: 0 3px 0 8px;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f1418;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.period-editor .date-control {
  grid-template-columns: minmax(0, 1fr);
}

.edit-certainty-control select:has(option[value="none"]:checked),
.compact-certainty-select:has(option[value="none"]:checked),
.date-certainty-select:has(option[value="none"]:checked),
.timepoint-reference-certainty select:has(option[value="none"]:checked) {
  color: var(--brand-strong);
}

.edit-certainty-control select:has(option[value="no_idea"]:checked),
.edit-certainty-control select:has(option[value="estimation_bad"]:checked),
.compact-certainty-select:has(option[value="no_idea"]:checked),
.compact-certainty-select:has(option[value="estimation_bad"]:checked),
.date-certainty-select:has(option[value="no_idea"]:checked),
.date-certainty-select:has(option[value="estimation_bad"]:checked),
.timepoint-reference-certainty select:has(option[value="no_idea"]:checked),
.timepoint-reference-certainty select:has(option[value="estimation_bad"]:checked) {
  color: var(--danger);
}

.edit-certainty-control select:has(option[value="estimation_medium"]:checked),
.edit-certainty-control select:has(option[value="estimation_good"]:checked),
.compact-certainty-select:has(option[value="estimation_medium"]:checked),
.compact-certainty-select:has(option[value="estimation_good"]:checked),
.date-certainty-select:has(option[value="estimation_medium"]:checked),
.date-certainty-select:has(option[value="estimation_good"]:checked),
.timepoint-reference-certainty select:has(option[value="estimation_medium"]:checked),
.timepoint-reference-certainty select:has(option[value="estimation_good"]:checked) {
  color: var(--lagerfeuerorange);
}

.edit-certainty-control select:has(option[value="confident"]:checked),
.edit-certainty-control select:has(option[value="set_in_stone"]:checked),
.compact-certainty-select:has(option[value="confident"]:checked),
.compact-certainty-select:has(option[value="set_in_stone"]:checked),
.date-certainty-select:has(option[value="confident"]:checked),
.date-certainty-select:has(option[value="set_in_stone"]:checked),
.timepoint-reference-certainty select:has(option[value="confident"]:checked),
.timepoint-reference-certainty select:has(option[value="set_in_stone"]:checked) {
  color: var(--good);
}

.compact-certainty-select:focus-visible,
.date-certainty-select:focus-visible {
  outline: 2px solid var(--brand-strong);
  outline-offset: 2px;
}

.timepoint-reference-certainty select:focus-visible {
  outline: 2px solid var(--brand-strong);
  outline-offset: 2px;
}

.date-detail-actions {
  display: flex;
  align-items: stretch;
}

.date-detail-row {
  display: grid;
  grid-template-columns: max-content max-content;
  gap: 6px;
  align-items: stretch;
}

.date-control.is-confirming input[data-date-control] {
  border-color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--danger);
}

.date-detail-button {
  position: relative;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  min-width: 34px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--brand-strong);
  background: #0f1418;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  overflow: hidden;
}

.date-detail-button:disabled {
  cursor: default;
}

.date-detail-button + .date-detail-button {
  margin-left: -1px;
}

.date-detail-button:first-child {
  border-radius: 6px 0 0 6px;
}

.date-detail-button:last-child {
  border-radius: 0 6px 6px 0;
}

.date-detail-button.is-included {
  color: var(--brand-strong);
  border-color: rgba(var(--brand-rgb), 0.36);
  background: rgba(var(--brand-rgb), 0.08);
}

.date-detail-button.is-preview-added {
  background: rgba(var(--good-rgb), 0.26);
  border-color: rgba(var(--good-rgb), 0.75);
}

.date-detail-button.is-preview-removed {
  color: var(--muted);
  background: rgba(var(--danger-rgb), 0.24);
  border-color: rgba(var(--danger-rgb), 0.72);
}

.date-detail-button.is-preview-added::before,
.date-detail-button.is-preview-removed::before {
  content: none;
}

.date-detail-button.is-preview-added::after {
  content: "+";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--good);
  opacity: 0.48;
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.date-detail-button.is-preview-removed::after {
  content: "x";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--danger-strong);
  opacity: 0.48;
  font-size: 2.08rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.date-detail-button:focus-visible {
  outline: 2px solid var(--brand-strong);
  outline-offset: 2px;
}

.date-detail-button.is-confirming {
  color: var(--danger-strong);
  border-color: rgba(var(--danger-rgb), 0.42);
  background: var(--danger-dark);
  box-shadow: inset 0 0 0 1px rgba(var(--danger-rgb), 0.72);
}

.date-detail-button.is-confirming::before {
  content: none;
}

@media (max-width: 640px) {
  .date-control {
    grid-template-columns: minmax(11ch, 1fr);
  }

  .date-detail-actions {
    width: 100%;
  }

  .date-detail-button {
    flex: 1 1 0;
  }
}

.object-check-field {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 36px;
}

.object-check-field input {
  width: auto;
  min-height: 0;
}

.object-field textarea {
  resize: vertical;
}

.object-field input:focus-visible,
.object-field select:focus-visible,
.object-field textarea:focus-visible {
  outline: 2px solid var(--brand-strong);
  outline-offset: 2px;
}

.object-save-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.object-save-state.is-error {
  color: var(--danger-strong);
}

.nav-feedback {
  padding: 0 10px;
  font-size: 0.76rem;
}

.composite-field {
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 20, 24, 0.7);
}

.composite-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.composite-header > span {
  color: var(--muted);
  font-size: 0.78rem;
}

.composite-list {
  display: grid;
  gap: 10px;
}

.composite-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(50, 58, 53, 0.75);
  border-radius: 8px;
  background: rgba(21, 27, 32, 0.78);
}

.composite-item:not(.is-collapsed):not(.reference-list-item):not(.group-type-fixed-item) {
  border-color: var(--edit-border);
  background: linear-gradient(180deg, var(--edit-surface), rgba(21, 27, 32, 0.82));
  box-shadow: var(--edit-shadow);
}

.composite-summary {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  text-align: left;
  background: transparent;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.composite-summary::before {
  content: "";
  position: absolute;
  inset: -5px -6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  pointer-events: auto;
}

.composite-summary > * {
  position: relative;
  z-index: 1;
}

.composite-summary-text {
  flex: 1 1 auto;
  min-width: 0;
}

.composite-validation-meta {
  flex: 0 1 auto;
  max-width: calc(100% - 14ch);
  margin-left: auto;
}

.composite-item.is-collapsed .composite-validation-list,
.composite-item:not(.is-collapsed) .composite-validation-meta {
  display: none;
}

.composite-item:not(.is-collapsed) .composite-summary {
  align-items: flex-start;
}

.composite-item.has-summary {
  grid-template-columns: minmax(0, 1fr);
}

.composite-item.has-summary.has-navigation {
  grid-template-columns: minmax(0, 1fr) max-content;
}

.composite-item.has-summary .composite-summary {
  grid-column: 1;
  grid-row: 1;
}

.relationship-group-link {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
}

.composite-item > .composite-editor {
  grid-column: 1 / -1;
}

.composite-editor-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
}

.composite-summary:hover,
.composite-summary:focus-visible {
  border-color: transparent;
  outline: 0;
  background: transparent;
}

.composite-summary:hover::before,
.composite-summary:focus-visible::before,
.composite-summary.is-graph-highlighted::before {
  border-color: var(--brand);
  background: rgba(var(--brand-rgb), 0.08);
}

.composite-item.is-collapsed .composite-editor {
  display: none;
}

.reference-list-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.group-type-fixed-item {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  padding-block: 8px;
}

.group-type-fixed-item > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.group-type-add-field {
  max-width: 360px;
}

.group-relation-add {
  background: rgba(18, 24, 29, 0.58);
}

.group-relation-add .nested-editor {
  align-items: start;
}

.nested-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  min-width: 0;
}

.nested-editor > .period-editor {
  grid-column: 1 / -1;
}

.nested-editor > .source-display-field {
  min-width: 0;
  max-width: 220px;
}

.nested-editor.is-compact {
  grid-column: 1 / -1;
}

.period-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.period-editor legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.period-editor.is-rough {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin: 0;
  padding: 12px;
  align-items: start;
}

.period-boundary {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.period-toggle {
  min-height: 0;
  padding: 0 2px;
  border: 0;
  color: var(--brand-strong);
  background: transparent;
  cursor: pointer;
  font-size: inherit;
  line-height: inherit;
  text-align: left;
  white-space: normal;
}

.period-toggle:hover {
  color: var(--text);
}

.period-save-timepoint {
  display: inline;
  width: fit-content;
  margin-top: 0;
  font-size: 0.78rem;
  line-height: inherit;
}

.icon-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  border: 1px solid rgba(var(--brand-rgb), 0.26);
  border-radius: 8px;
  color: var(--brand-strong);
  background: rgba(var(--brand-rgb), 0.08);
  cursor: pointer;
  line-height: 1;
}

.icon-button:hover {
  color: var(--brand-ink);
  background: var(--brand-hover);
}

.icon-button-danger {
  color: var(--danger-strong);
  border-color: rgba(var(--danger-rgb), 0.42);
  background: var(--danger-dark);
}

.icon-button-danger:hover {
  color: var(--danger-strong);
  background: var(--danger);
}

.add-list-button {
  justify-self: end;
}

.inline-action-feedback {
  position: absolute;
  z-index: 20;
  transform: translate(-50%, -100%);
  pointer-events: none;
  padding: 5px 8px;
  border: 1px solid rgba(var(--danger-rgb), 0.58);
  border-radius: 6px;
  max-width: min(34ch, 100%);
  color: var(--danger-strong);
  background: rgba(var(--danger-rgb), 0.32);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
  font-size: 0.78rem;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

.delete-confirm {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--danger-strong);
  font-size: 0.86rem;
}

.tag {
  align-self: start;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--accent-ink);
  background: var(--accent);
  font-size: 0.78rem;
  white-space: nowrap;
}

.status-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 1px;
  margin: 0;
  background: var(--line);
}

.status-list dt,
.status-list dd {
  margin: 0;
  padding: 12px 18px;
  background: var(--surface);
}

.status-list dt {
  color: var(--muted);
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.form-grid label,
.form-grid fieldset {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.form-grid span,
.form-grid legend {
  color: var(--muted);
  font-size: 0.84rem;
}

.form-grid input[type="text"],
.form-grid input:not([type]) {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #0f1418;
}

.form-grid input:focus-visible {
  outline: 2px solid var(--brand-strong);
  outline-offset: 2px;
}

.form-grid fieldset {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form-grid fieldset label {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  color: var(--text);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.users-create {
  align-items: start;
}

.users-permissions-field {
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.users-permissions-field legend {
  color: var(--muted);
  font-size: 0.78rem;
}

.users-permissions-field label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.users-permissions-field input[type="checkbox"] {
  width: auto;
  min-height: 0;
  padding: 0;
  accent-color: var(--brand-strong);
}

.message,
.setup-result {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-raised);
}

.global-message {
  position: fixed;
  z-index: 120;
  top: calc(var(--topbar-height, 58px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  align-self: start;
  justify-self: center;
  display: inline-block;
  width: auto;
  max-width: min(42rem, calc(100% - clamp(28px, 5vw, 56px)));
  margin: 0;
  padding: 5px 9px;
  font-size: 0.86rem;
  line-height: 1.22;
  box-shadow: var(--shadow);
}

.message.is-error {
  border-color: rgba(var(--danger-rgb), 0.5);
  color: var(--danger-strong);
  background: var(--danger-dark);
}

.message.is-good {
  border-color: rgba(var(--good-rgb), 0.5);
  color: var(--good);
  background: #14281d;
}

.setup-result {
  display: grid;
  gap: 8px;
  margin: 18px;
}

.user-setup-result {
  margin: 0 0 12px;
}

.qr-code {
  width: min(220px, 100%);
  aspect-ratio: 1;
  padding: 10px;
  border-radius: 6px;
  background: #fff;
}

.qr-code img {
  display: block;
  width: 100%;
  height: 100%;
}

.setup-result input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #0f1418;
}

.setup-url-field {
  display: grid;
  gap: 6px;
}

.setup-url-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: stretch;
  gap: 8px;
}

.setup-url-control .setup-copy-button {
  width: 38px;
  height: auto;
  min-height: 38px;
}

.setup-copy-button.is-copied {
  border-color: rgba(var(--good-rgb), 0.55);
  color: var(--good);
  background: rgba(var(--good-rgb), 0.12);
}

.setup-copy-icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-editor-side {
  grid-column: 1 / -1;
}

.user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.setup-token-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.setup-token-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 780px) {
  body {
    overflow: auto;
  }

  body.is-full-page-open {
    height: auto;
    min-height: 100dvh;
    overflow-y: auto;
  }

  body.is-full-page-open::after {
    content: "";
    display: block;
    height: calc(96px + env(safe-area-inset-bottom));
  }

  .app-shell {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  body.is-full-page-open .app-shell {
    display: block;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .app-content {
    overflow: visible;
  }

  body.is-full-page-open .app-content,
  .app-content:has(> .account-page:not([hidden])),
  .app-content:has(> .auth-screen:not([hidden])) {
    display: block;
    overflow: visible;
    overscroll-behavior: auto;
    -webkit-overflow-scrolling: auto;
  }

  .topbar {
    display: contents;
  }

  .brand-row {
    position: sticky;
    z-index: 80;
    top: 0;
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    gap: 6px 10px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(21, 27, 32, 0.98);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    order: 0;
  }

  .brand-row h1 {
    min-width: 0;
    flex: 0 1 auto;
  }

  .site-title {
    white-space: normal;
  }

  .version-chip {
    flex: 0 0 auto;
  }

  .topbar-tools {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
    width: 100%;
    padding: 8px 10px 10px;
    background: rgba(21, 27, 32, 0.98);
    row-gap: 8px;
    order: 2;
  }

  .topbar-tools:has(.public-visualization-nav:not([hidden])) {
    grid-template-columns: 1fr;
    justify-content: stretch;
    column-gap: 0;
    width: 100%;
  }

  .topbar-tools:not(:has(> :not([hidden]))) {
    display: none;
  }

  .public-visualization-nav {
    width: 100%;
  }

  .public-visualization-nav .nav-item {
    flex: 1 1 0;
    min-width: 0;
  }

  .timeframe-control {
    grid-template-columns: auto minmax(0, 1fr);
    width: 100%;
  }

  .timeframe-compact {
    min-width: 0;
    flex-wrap: wrap;
  }

  .timeframe-value {
    flex: 1 1 120px;
    width: auto;
    max-width: none;
  }

  .timeframe-clear {
    flex: 0 0 auto;
  }

  .timeframe-width-buttons {
    flex: 0 0 auto;
  }

  .visualization-summary {
    justify-content: flex-start;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  #view-people .panel-header,
  #view-groups .panel-header,
  #view-group-types .panel-header,
  #view-roles .panel-header,
  #view-timepoints .panel-header,
  #view-users .panel-header {
    min-height: 0;
    gap: 8px;
    padding-block: 4px 8px;
  }

  .topbar-actions {
    position: relative;
    justify-content: flex-start;
    width: 100%;
    padding: 8px 10px 0;
    background: rgba(21, 27, 32, 0.98);
    gap: 6px;
    order: 1;
  }

  .topbar-actions .button,
  .status-pill {
    flex: 0 0 auto;
    max-width: 100%;
  }

  .global-search,
  .source-control {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 100%;
    align-items: stretch;
    flex-wrap: wrap;
  }

  .global-search input {
    flex: 1 1 180px;
    min-width: 0;
    width: 100%;
  }

  .source-input-wrap {
    flex: 1 1 180px;
    width: 100%;
  }

  .source-control input {
    min-width: 0;
    width: 100%;
  }

  .global-search-results {
    left: 0;
    width: min(420px, calc(100vw - 32px));
    transform: none;
  }

  .collection-heading,
  .collection-controls,
  .collection-control,
  .collection-filter-section,
  .collection-filter-controls {
    width: 100%;
  }

  .collection-heading {
    grid-template-columns: 1fr;
    gap: 8px;
    min-width: 0;
    flex-basis: auto;
  }

  .collection-header,
  .collection-controls,
  .collection-filter-controls {
    gap: 8px;
  }

  .object-list,
  .user-list {
    gap: 8px;
  }

  .workspace,
  .split-layout,
  .period-editor.is-rough,
  .public-hero,
  .public-grid {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-rows: auto minmax(0, 1fr);
    height: auto;
    min-height: 0;
    overflow: visible;
    gap: 12px;
    padding: 10px;
  }

  .app-content {
    order: 3;
    width: 100%;
  }

  .content-area,
  .workspace[data-active-view="tree"] .content-area,
  .workspace[data-active-view="timeline"] .content-area {
    height: auto;
    max-height: none;
    padding-inline-end: 0;
    overflow: visible;
    scrollbar-gutter: auto;
  }

  .back-to-top {
    position: fixed;
    top: auto;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    transform: none;
  }

  .public-section-heading,
  .audit-row,
  .change-log-row,
  .timeline-item {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .public-section-heading {
    flex-direction: column;
  }

  .public-graph-tools {
    width: 100%;
    justify-content: flex-start;
  }

  .public-graph-filter {
    width: 100%;
  }

  .public-graph {
    min-height: 420px;
    height: var(--tree-graph-height, 68vh);
  }

  #view-tree.is-active,
  #view-timeline.is-active {
    height: auto;
  }

  #view-tree .public-map,
  #view-timeline .public-map {
    height: auto;
    min-height: 0;
  }

  #view-tree .panel-header,
  #view-tree [data-tree-graph-status],
  #view-tree .tree-summary {
    position: static;
    width: 100%;
    max-width: none;
  }

  #view-tree .panel-header {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  #view-tree .public-graph {
    flex: 0 0 auto;
    height: min(68dvh, 620px);
    min-height: 360px;
  }

  .timeline-visualization {
    max-height: 68dvh;
  }

  .timeline-chart {
    min-width: 640px;
    padding: 38px 12px 14px 128px;
  }

  .timeline-axis {
    right: 12px;
    left: 128px;
  }

  .timeline-lane-label {
    right: calc(100% + 10px);
    width: 108px;
  }

  .auth-screen {
    width: min(100% - 28px, 860px);
  }

  .login-email-form,
  .account-passkey {
    grid-template-columns: 1fr;
  }

  .account-page {
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
    padding-inline: 14px;
    padding-bottom: 18px;
  }

  .sidebar {
    position: static;
    top: auto;
    z-index: 20;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    background: rgba(13, 17, 20, 0.96);
  }

  .nav-group {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
  }

  .nav-label {
    display: none;
  }

  .nav-item {
    width: auto;
    white-space: nowrap;
  }
}

@media (max-width: 460px) {
  .topbar {
    padding-inline: 10px;
  }

  .brand-row {
    align-items: center;
    flex-direction: row;
    gap: 5px 9px;
    padding-inline: 10px;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .button,
  .status-pill {
    width: auto;
    justify-content: center;
  }

  .user-pill {
    min-width: 0;
    white-space: nowrap;
  }

  #currentUserName {
    min-width: 0;
    max-width: min(42vw, 12rem);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .timeframe-control {
    grid-template-columns: 1fr;
  }

  .timeframe-compact {
    width: 100%;
  }

  .icon-button {
    flex: 0 0 32px;
  }

  .sidebar {
    margin-inline: -6px;
    padding-inline: 6px;
  }

  .nav-item {
    min-height: 34px;
    padding: 8px 10px;
  }

  #view-tree .public-graph {
    height: 62dvh;
    min-height: 320px;
  }

  .timeline-chart {
    min-width: 560px;
    padding-left: 108px;
  }

  .timeline-axis {
    left: 108px;
  }

  .timeline-lane-label {
    width: 90px;
  }

  .object-editor-layout,
  .object-editor-layout.no-side {
    grid-template-columns: 1fr;
  }

  .object-editor-main,
  .object-editor-side,
  .object-editor-relations {
    grid-column: 1 / -1;
  }

  .object-editor-side {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 12px;
  }

  .list-item,
  .status-list,
  .composite-item {
    grid-template-columns: 1fr;
  }

  .object-title-row,
  .object-editor-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .object-status-meta {
    width: 100%;
    max-width: 100%;
  }
}
