:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  --radius-small: 4px;
  --radius-medium: 6px;
  --radius-large: 8px;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 8%);
  --shadow-2: 0 8px 24px rgb(0 0 0 / 16%);
  --status-ok: #006A52;
  --status-ok-soft: #D9EEE7;
  --status-warn: #6B5100;
  --status-warn-soft: #F3E8C8;
  --status-danger: #9C3D27;
  --status-danger-soft: #F4DDD7;
  --status-info: #075F8F;
  --status-info-soft: #D9EAF3;
  --surface2: var(--surface-2);
  --accent-ink: var(--interactive);
  --accent-fill: var(--command);
  --accent-soft: var(--interactive-soft);
  --on-accent: var(--on-command);
  --ok: var(--status-ok);
  --warn: var(--status-warn);
  --danger: var(--status-danger);
  --drawer-backdrop: color-mix(in srgb, var(--bg) 78%, transparent);
}

/* ШПК is a bounded document view: unit navigation scrolls the complete grouped
   establishment, while ordinary registries retain windowed server pages. */
.shpk-layout {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(36rem, 3fr) minmax(20rem, 1.4fr);
  align-items: start;
  gap: 1rem;
}

.shpk-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--surface);
  overflow: clip;
}

.shpk-panel > h2 {
  margin: 0;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface2);
  font-size: 1rem;
}

.unit-catalogue,
.shpk-profile {
  position: sticky;
  top: 4.5rem;
  max-height: calc(100vh - 6rem);
  overflow: auto;
}

.unit-tree,
.unit-tree ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.unit-tree ul {
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}

.unit-tree summary,
.unit-tree > li > a,
.unit-tree > li > button,
.unit-tree ul > li > a,
.unit-tree ul > li > button {
  min-height: 44px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.unit-tree summary {
  cursor: pointer;
}

.unit-tree a,
.unit-tree button {
  min-height: 44px;
  width: 100%;
  padding: .5rem .75rem;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.unit-tree a:hover,
.unit-tree a:focus-visible,
.unit-tree button:hover,
.unit-tree button:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.shpk-document .table-frame {
  max-height: calc(100vh - 10rem);
}

.shpk-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.position-group {
  scroll-margin-top: 7rem;
}

.position-group__heading th,
.position-group--loading th {
  height: 44px;
  border-top: 2px solid var(--line-strong);
  background: var(--accent-soft);
  color: var(--accent-ink);
  text-align: left;
}

.position-select {
  min-height: 44px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: .18em;
  cursor: pointer;
}

.shpk-profile {
  padding-bottom: 1rem;
}

.shpk-profile > :not(h2) {
  margin-right: 1rem;
  margin-left: 1rem;
}

.shpk-profile .profile-grid {
  grid-template-columns: minmax(0, 1fr);
}

.occupant-card {
  margin-top: 1rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-ink);
  border-radius: var(--radius-small);
  background: var(--surface2);
}

.unit-dictionary {
  grid-template-columns: minmax(16rem, 1fr) minmax(24rem, 2fr);
}

@media (max-width: 79.999rem) {
  .shpk-layout {
    grid-template-columns: minmax(13rem, 1fr) minmax(30rem, 3fr);
  }

  .shpk-profile {
    position: static;
    grid-column: 1 / -1;
    max-height: none;
  }
}

@media (max-width: 63.999rem) {
  .shpk-layout,
  .unit-dictionary {
    grid-template-columns: minmax(0, 1fr);
  }

  .unit-catalogue,
  .shpk-profile,
  .shpk-document .table-frame {
    position: static;
    max-height: none;
  }
}

@media (max-width: 47.999rem) {
  .shpk-table .position-group__heading,
  .shpk-table .position-group--loading tr {
    display: table-row;
  }

  .shpk-table .position-group__heading th,
  .shpk-table .position-group--loading th {
    display: table-cell;
    white-space: normal;
  }
}

html[data-theme="dark"] {
  --status-ok: #78C7AD;
  --status-ok-soft: #17362D;
  --status-warn: #D8B66A;
  --status-warn-soft: #392F19;
  --status-danger: #D99787;
  --status-danger-soft: #40241F;
  --status-info: #82B9D2;
  --status-info-soft: #172F3B;
}

/* GENERATED THEME TOKENS BEGIN (scripts/generate_theme_tokens.py) */
html[data-theme="light"][data-accent="command"] {
  color-scheme: light;
  --bg: #F5F4F0;
  --surface: #FBFAF8;
  --surface-2: #ECEAE4;
  --surface-3: #FFFFFF;
  --text: #1F1D1A;
  --muted: #565149;
  --line: #D9D5CC;
  --line-strong: #8F887E;
  --command: #3D362C;
  --command-hover: #332C22;
  --on-command: #FFFFFF;
  --interactive: #514B42;
  --interactive-soft: #EEEDEB;
  --selection: #9A8D79;
  --on-selection: #1F1D1A;
  --focus: #B45F1B;
}

html[data-theme="dark"][data-accent="command"] {
  color-scheme: dark;
  --bg: #131416;
  --surface: #1B1D20;
  --surface-2: #33363A;
  --surface-3: #4A4E53;
  --text: #F3F1EB;
  --muted: #B8B4AC;
  --line: #45484D;
  --line-strong: #83878C;
  --command: #C9B896;
  --command-hover: #D6C7A8;
  --on-command: #1A1815;
  --interactive: #D4C5AB;
  --interactive-soft: #2A2D31;
  --selection: #6B6862;
  --on-selection: #F3F1EB;
  --focus: #E2A05E;
}

html[data-theme="light"][data-accent="briefing"] {
  color-scheme: light;
  --bg: #F7F5F0;
  --surface: #FFFFFC;
  --surface-2: #EFECE6;
  --surface-3: #FFFFFF;
  --text: #23211E;
  --muted: #5D5851;
  --line: #DCD7CE;
  --line-strong: #918A80;
  --command: #464039;
  --command-hover: #3B362F;
  --on-command: #FFFFFF;
  --interactive: #625749;
  --interactive-soft: #F2F1EC;
  --selection: #9F9078;
  --on-selection: #23211E;
  --focus: #B1672B;
}

html[data-theme="dark"][data-accent="briefing"] {
  color-scheme: dark;
  --bg: #151413;
  --surface: #1D1C1A;
  --surface-2: #363430;
  --surface-3: #4E4B45;
  --text: #F5F0E7;
  --muted: #C0B7AA;
  --line: #474440;
  --line-strong: #87837C;
  --command: #CDBFA2;
  --command-hover: #DACDB2;
  --on-command: #201B17;
  --interactive: #E3C79E;
  --interactive-soft: #2C2A27;
  --selection: #6E6B66;
  --on-selection: #F5F0E7;
  --focus: #E0A05F;
}

html[data-theme="light"][data-accent="operations"] {
  color-scheme: light;
  --bg: #F3F4F2;
  --surface: #FBFCFA;
  --surface-2: #E8EBE8;
  --surface-3: #FFFFFF;
  --text: #1B201E;
  --muted: #515A56;
  --line: #D1D6D2;
  --line-strong: #7F8984;
  --command: #303A37;
  --command-hover: #26302D;
  --on-command: #FFFFFF;
  --interactive: #3E6258;
  --interactive-soft: #EDF0EE;
  --selection: #7F9186;
  --on-selection: #1B201E;
  --focus: #A6652E;
}

html[data-theme="dark"][data-accent="operations"] {
  color-scheme: dark;
  --bg: #131515;
  --surface: #1B1E1D;
  --surface-2: #333736;
  --surface-3: #4A4F4D;
  --text: #EFF2ED;
  --muted: #AFB9B4;
  --line: #444947;
  --line-strong: #7F8583;
  --command: #B0C0A8;
  --command-hover: #BFCCB8;
  --on-command: #1A1C18;
  --interactive: #B8C8B0;
  --interactive-soft: #2A2E2D;
  --selection: #666B69;
  --on-selection: #EFF2ED;
  --focus: #DAA05F;
}

html[data-theme="contrast"] {
  color-scheme: light;
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F2F2F2;
  --surface-3: #FFFFFF;
  --text: #000000;
  --muted: #2B2B2B;
  --line: #000000;
  --line-strong: #000000;
  --command: #1A1A1A;
  --command-hover: #000000;
  --on-command: #FFFFFF;
  --interactive: #00366B;
  --interactive-soft: #E8F0FB;
  --selection: #00366B;
  --on-selection: #FFFFFF;
  --focus: #8A4A00;
}

html:not([data-theme="contrast"]) .access {
  color-scheme: dark;
  color: var(--text);
  --bg: #131416;
  --surface: #1B1D20;
  --surface-2: #33363A;
  --surface-3: #4A4E53;
  --text: #F3F1EB;
  --muted: #B8B4AC;
  --line: #45484D;
  --line-strong: #83878C;
  --command: #C9B896;
  --command-hover: #D6C7A8;
  --on-command: #1A1815;
  --interactive: #D4C5AB;
  --interactive-soft: #2A2D31;
  --selection: #6B6862;
  --on-selection: #F3F1EB;
  --focus: #E2A05E;
  --status-ok: #78C7AD;
  --status-ok-soft: #17362D;
  --status-warn: #D8B66A;
  --status-warn-soft: #392F19;
  --status-danger: #D99787;
  --status-danger-soft: #40241F;
  --status-info: #82B9D2;
  --status-info-soft: #172F3B;
}
/* GENERATED THEME TOKENS END */

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-width: 20rem;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.55 Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
}

a {
  color: var(--accent-ink);
  text-underline-offset: .18em;
}

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border-right: 1px solid var(--line);
  background: var(--surface2);
}

.sidebar-header {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.sidebar-header .identity {
  min-width: 0;
  flex: 1;
}

.sidebar .identity-copy {
  min-width: 0;
}

.sidebar .identity-name,
.sidebar .identity-short {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar .identity-short {
  white-space: normal;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: 1rem 0;
  /* Scroll the links when they outgrow the viewport, keeping the header and the
     account block pinned. min-height is required: a flex item defaults to
     min-height:auto, which refuses to shrink below its content, so the sidebar would
     grow past 100vh and clip the last links instead of ever scrolling. */
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar-nav a {
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: .375rem .625rem;
  border: 1px solid transparent;
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  border-radius: var(--radius-small);
  transition: border-color .18s ease, background .18s ease, color .18s ease,
    transform .18s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus-visible,
.sidebar-nav a[aria-current="page"] {
  border-color: var(--accent-ink);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.sidebar-nav a[aria-current="page"] {
  border-left: 3px solid var(--interactive);
  font-weight: 800;
}

.sidebar-nav a:hover {
  transform: translateX(2px);
}

.sidebar-nav__group {
  margin: .875rem .625rem .125rem;
}

.sidebar-nav__group:first-child {
  margin-top: 0;
}

.sidebar-user {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.sidebar-user__name,
.sidebar-user__login {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user__name {
  font-weight: 700;
}

.sidebar-user__login {
  margin-top: .125rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sidebar-user .header-form {
  margin-top: .5rem;
}

.workspace {
  min-width: 0;
}

.app-header {
  min-height: 3.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  padding: .5rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(10px);
}

.app-header--public {
  display: flex;
  justify-content: flex-start;
}

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

.app-header__unit {
  display: block;
  overflow: hidden;
  font-weight: 700;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
}

.app-header__actions:empty {
  display: none;
}

.identity {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  color: inherit;
  text-decoration: none;
}

.identity-emblem {
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  object-fit: contain;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--surface2);
}

.identity-emblem--text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-ink);
  font-family: ui-monospace, monospace;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.identity-copy {
  display: inline-flex;
  flex-direction: column;
  gap: .125rem;
}

.identity-name {
  font-weight: 700;
  letter-spacing: -.01em;
}

.identity-short,
.eyebrow {
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: .6875rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.nav-toggle,
.drawer-close,
.drawer-backdrop {
  display: none;
}

.icon-button {
  /* Touch minimums are in px on purpose. They were 2.75rem, which was 44px only while
     the root stayed at the browser's 16px default; setting the root to 15px silently
     shrank every one of them to 41px without changing a single rule. A fingertip is
     not a typographic unit. */
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.icon-button:hover {
  border-color: var(--accent-ink);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.icon-button svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: square;
  stroke-width: 1.75;
}

.page-shell {
  /* Tables and the detail panel use the whole width. A 75rem cap left 236px of empty
     gutter on either side of a 1920px screen, which costs roughly two columns of a
     roster that people scroll horizontally. A measure limit is right for prose and
     wrong for a grid of 241 people. */
  width: 100%;
  padding: 1.5rem;
}

/* Forms are the exception: a field is not easier to fill because it is 1600px wide. */
.page-shell--measure {
  width: min(100%, 60rem);
  margin: 0 auto;
}

.page-heading,
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

h1,
h2,
h3 {
  color: var(--text);
  letter-spacing: -.02em;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.eyebrow {
  margin: 0 0 .375rem;
}

.record-count,
.pagination-summary {
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.heading-metrics {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: .25rem;
}

.toolbar {
  display: flex;
  gap: .5rem;
  margin-bottom: .75rem;
}

.search-field {
  flex: 1;
}

input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  padding: .375rem .5rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--surface-3);
  color: var(--text);
  font: inherit;
  transition: border-color .18s ease, background .18s ease;
}

input[type="hidden"] {
  display: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

input[readonly],
textarea[readonly] {
  background: var(--surface-2);
}

textarea {
  min-height: 4.5rem;
  resize: vertical;
}

input[type="checkbox"] {
  width: 1rem;
  min-height: 1rem;
  margin: .0625rem 0 0;
  accent-color: var(--accent-ink);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--muted);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

[aria-invalid="true"] {
  border-color: var(--danger);
  border-width: 2px;
}

.button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .3125rem .75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--surface2);
  color: var(--text);
  font: 700 .75rem/1.2 ui-monospace, monospace;
  letter-spacing: .08em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease,
    transform .18s ease;
}

.button:hover {
  border-color: var(--accent-ink);
  background: var(--accent-soft);
  color: var(--accent-ink);
  transform: translateY(-1px);
}

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

.button--primary:hover {
  border-color: var(--command-hover);
  background: var(--command-hover);
  color: var(--on-command);
}

.button--danger {
  border-color: var(--danger);
  background: var(--surface2);
  color: var(--danger);
}

.button--danger:hover {
  border-color: var(--danger);
  background: var(--surface2);
  color: var(--danger);
}

.button--quiet {
  border-color: transparent;
  background: transparent;
}

.button--disabled {
  border-color: var(--line);
  background: var(--surface2);
  color: var(--muted);
  cursor: default;
  opacity: .7;
}

.button--disabled:hover {
  border-color: var(--line);
  background: var(--surface2);
  color: var(--muted);
  transform: none;
}

.table-frame {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  text-align: left;
}

th {
  height: 40px;
  padding: .375rem .625rem;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface2);
  color: var(--text);
  font-family: ui-monospace, monospace;
  font-size: .6875rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}

th a {
  color: inherit;
  text-decoration: none;
}

th a:hover {
  color: var(--accent-ink);
}

.sort-marker {
  padding-left: .3125rem;
  color: var(--accent-ink);
}

td {
  height: 40px;
  padding: .3125rem .625rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody tr {
  transition: background .18s ease;
}

tbody tr td {
  transition: border-color .18s ease;
}

tbody tr:hover {
  background: var(--accent-soft);
}

tbody tr:hover td {
  border-bottom-color: var(--accent-ink);
}

tbody tr[aria-selected="true"] {
  background: var(--selection);
  color: var(--on-selection);
}

tbody tr[aria-selected="true"] > * {
  background: var(--selection);
  color: var(--on-selection);
}

tbody tr[aria-selected="true"] > :first-child {
  border-left: 3px solid var(--interactive);
}

tbody tr[aria-selected="true"] .row-link {
  color: var(--on-selection);
}

.row-link {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.row-link:hover {
  color: var(--accent-ink);
  text-decoration: underline;
}

.empty-cell {
  height: 4rem;
  color: var(--muted);
  text-align: center;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-top: .75rem;
}

.pagination-actions {
  display: flex;
  gap: .5rem;
}

.mobile-sort {
  display: none;
}

.alert {
  margin: 0 0 1rem;
  padding: .75rem 1rem;
  border: 1px solid var(--danger);
  border-left-width: 3px;
  border-radius: var(--radius-small);
  background: var(--status-danger-soft);
  color: var(--danger);
}

.alert--success {
  border-color: var(--ok);
  background: var(--status-ok-soft);
  color: var(--ok);
}

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

.alert--info {
  border-color: var(--status-info);
  background: var(--status-info-soft);
  color: var(--status-info);
}

/* Login — the access gateway layout.

   Composition follows the shared miljo.tech access page: a rule-bordered topbar, a
   split hero with an oversized display title beside a bordered card, and a footer.
   Every colour is a theme token, so the same structure holds in all six themes; the
   reference page hard-codes the light `command` palette, which is where these token
   values come from in the first place.

   Small print uses --muted rather than a lighter tertiary ink. The reference has one,
   but adding a seventh colour would mean seven unverified values across the theme
   matrix for a barely visible difference — --muted is already contrast-checked
   everywhere, and erring darker only helps. */
.access {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--bg);
}

.access__shell {
  width: min(70rem, 92vw);
  margin-inline: auto;
}

.access__topbar {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.access__identity {
  display: flex;
  align-items: center;
  gap: .8rem;
  font-weight: 700;
}

/* The system wordmark. Deliberately NOT a rotated square: the rhombus is the
   brigade's own device (445 in a diamond) and the product does not borrow it. The
   left edge accent is the same stroke the application draws on a selected row. */
.access__wordmark {
  border-left: 3px solid var(--command);
  padding-left: .625rem;
  color: var(--command);
  font-size: .8125rem;
  font-weight: 800;
  letter-spacing: .24em;
  text-transform: uppercase;
}

/* The gate scene, shared with the desktop client: the painted depth grid receding
   to a horizon at mid-height, drawn from theme tokens — one design for every theme,
   crisp at any size, and legible behind transparent widgets by construction (the
   ground never strays further from bg than the surface-2 blend). Behind everything,
   takes no clicks, and high contrast removes it outright. */
.access {
  position: relative;
}

.access__map {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg,
    var(--bg) 0%,
    color-mix(in srgb, var(--bg) 45%, var(--surface-2)) 50%,
    var(--bg) 100%);
}

.access__map svg {
  width: 100%;
  height: 100%;
  display: block;
}

.access__shell {
  position: relative;
}

html[data-theme="contrast"] .access__map {
  display: none;
}

.access__status {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  color: var(--muted);
  font-size: .75rem;
  text-transform: uppercase;
  /* The topbar's right end floats over the scene's brightest window; the chip keeps
     the connection words legible on any frame of it. */
  padding: .25rem .625rem;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-radius: var(--radius-small);
}

.access__dot {
  width: .4375rem;
  height: .4375rem;
  border-radius: 50%;
  background: var(--status-ok);
}

/* The terminal's accessibility switch, next to the connection words. */
.access__contrast {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--text);
  font-size: .75rem;
  text-transform: uppercase;
  cursor: pointer;
  padding: .25rem .625rem;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-radius: var(--radius-small);
}

.access__contrast input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--command);
}

.access__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26rem;
  align-items: center;
  gap: clamp(3rem, 8vw, 7rem);
  padding: 3.5rem 0;
}

.access__intro {
  position: relative;
}

/* Behind the heading, never over it: -1 keeps it under the text, and the low opacity
   keeps it from competing for attention. */
.access__glyph {
  position: absolute;
  z-index: -1;
  top: -1.625rem;
  right: 6%;
  width: min(13.75rem, 38%);
  color: var(--command);
  opacity: .08;
}

.access__eyebrow {
  margin: 0;
  color: var(--muted);
  font: 700 .75rem/1.4 ui-monospace, monospace;
  text-transform: uppercase;
}

.access__title {
  margin: 1rem 0 1.375rem;
  font-size: clamp(3.25rem, 7vw, 5.5rem);
  line-height: .9;
  letter-spacing: -.05em;
  text-transform: uppercase;
}

.access__title small {
  display: block;
  margin: 0 0 1rem .1875rem;
  color: var(--muted);
  font-size: clamp(.8125rem, 1.5vw, 1.125rem);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: .06em;
}

.access__lede {
  max-width: 37.5rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
}

.access__chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.access__chip {
  padding: .4375rem .625rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--muted);
  font: 650 .6875rem/1 ui-monospace, monospace;
  text-transform: uppercase;
}

/* Bordered, not raised: the shared design rule keeps shadows for drawers, dialogs and
   menus. The accent bar gives the card its prominence instead. */
/* No pane, no fill: the sign-in form stands directly on the gate's drawn ground,
   exactly as the desktop gate's fields do. The ground is token-derived and safe for
   full-ink text by construction, so the card is only a layout container with the
   amber accent tab keeping the form's visual anchor. */
.access__card {
  position: relative;
  padding: 2rem;
  background: transparent;
}

.access__card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 2rem;
  width: 4rem;
  height: 3px;
  background: var(--focus);
}

.access__card-title {
  margin: .75rem 0 .4375rem;
  font-size: 1.75rem;
  letter-spacing: -.025em;
}

.access__card-lede {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.access__card label {
  display: block;
  margin: 1.0625rem 0 .4375rem;
  color: var(--text);
  font-size: .875rem;
  font-weight: 650;
}

.access__card input {
  width: 100%;
  height: 3.125rem;
  padding: 0 .875rem;
  border: 1px solid color-mix(in srgb, var(--line-strong) 82%, transparent);
  border-radius: var(--radius-medium);
  /* Transparent on purpose: the scene behind the glass is the field's ground, the
     same way the desktop gate's fields are etched into the pane. */
  background: transparent;
  color: var(--text);
  font: inherit;
  transition: border-color .12s, box-shadow .12s;
}

.access__card input::placeholder {
  /* Full ink: the pane's transparency leaves no safe margin for a dimmed grey; the
     wording is what tells a hint from typed input. */
  color: var(--text);
  opacity: 1;
}

.access__card input:hover {
  border-color: var(--command);
}

/* Focus matches the desktop gate exactly: the border itself firms to the focus
   token, no outer outline — the two clients' fields must read as one control. */
.access__card input:focus-visible {
  outline: none;
  border: 2px solid var(--focus);
  padding: 0 calc(.875rem - 1px);
}

/* The browser paints remembered credentials with its own opaque highlight, which
   reads as "the transparent field never shipped". Overridden hard: the gate's
   ground is the field's background, autofilled or not. */
.access__card input:autofill {
  background-color: transparent !important;
  background-image: none !important;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text);
  filter: none;
}

.access__submit {
  width: 100%;
  height: 3rem;
  margin-top: 1.375rem;
  border: 1px solid var(--command);
  border-radius: var(--radius-medium);
  background: var(--command);
  color: var(--on-command);
  font: 750 .875rem/1 ui-monospace, monospace;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .12s;
}

.access__submit:hover {
  background: var(--command-hover);
}

.access__submit:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.access__notice {
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: .75rem;
}

.access__notice strong {
  color: var(--text);
}

.access__footer {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .75rem;
}

@media (max-width: 53rem) {
  .access__layout {
    grid-template-columns: 1fr;
    gap: 2.375rem;
    padding: 2.875rem 0;
  }

  .access__card {
    width: min(31.25rem, 100%);
  }
}

@media (max-width: 35rem) {
  .access__identity strong {
    display: none;
  }

  .access__glyph {
    display: none;
  }

  .access__card {
    padding: 1.75rem 1.375rem;
  }

  .access__footer {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: .1875rem;
  }
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.form-stack label {
  margin-top: .25rem;
  color: var(--text);
  font-weight: 700;
}

.form-stack .button {
  width: 100%;
  margin-top: .75rem;
}

.header-form {
  margin: 0;
}

.record-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.record-form--narrow {
  width: min(100%, 55rem);
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--surface);
}

legend {
  padding: 0 .375rem;
  color: var(--text);
  font-family: ui-monospace, monospace;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .3125rem;
  color: var(--text);
  font-size: .8125rem;
  font-weight: 700;
}

.form-field--wide {
  grid-column: 1 / -1;
}

.form-field small,
.check-field small {
  display: block;
  color: var(--muted);
  font-weight: 400;
}

.field-error {
  display: block;
  color: var(--danger);
  font-size: .75rem;
  font-weight: 700;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
}

.check-list {
  display: grid;
  gap: .5rem;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  color: var(--text);
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--danger);
  border-left-width: 3px;
  border-radius: var(--radius-medium);
  background: var(--status-danger-soft);
}

.danger-zone p {
  margin: .25rem 0 0;
  color: var(--danger);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--surface);
  overflow: clip;
}

.master-detail {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(20rem, 2fr);
  align-items: start;
  gap: 1rem;
}

/* With nothing selected the panel is a placeholder, and holding two fifths of a wide
   screen for "pick a row" costs the table about four columns. Give the width back
   until there is a record to show. */
.master-detail:has(.detail-panel__placeholder) {
  grid-template-columns: minmax(0, 1fr);
}

.master-detail:has(.detail-panel__placeholder) .detail-panel {
  display: none;
}

.master-detail__master {
  min-width: 0;
}

.detail-panel {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--interactive);
  border-radius: var(--radius-medium);
  background: var(--surface);
}

.detail-panel__heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}

.detail-panel__heading h2 {
  margin: 0;
}

.detail-panel__actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: 1rem;
}

.detail-panel__placeholder {
  min-height: 10rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--muted);
  text-align: center;
}

.registry-filters {
  grid-template-columns: repeat(3, minmax(9rem, 1fr)) auto;
}

.record-thread {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.record-thread ol {
  display: grid;
  gap: .5rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.record-thread li {
  padding: .75rem;
  border-left: 3px solid var(--muted);
  border-radius: var(--radius-small);
  background: var(--surface2);
}

.record-thread li p {
  margin: 0;
  white-space: pre-wrap;
}

.record-thread li span {
  display: block;
  margin-top: .375rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: .6875rem;
  letter-spacing: .06em;
}

.inline-record-form {
  align-items: end;
  margin-top: .75rem;
}

.profile-grid--panel {
  grid-template-columns: minmax(0, 1fr);
}

.profile-grid--panel > div:nth-child(odd) {
  border-right: 0;
}

.profile-grid--panel .profile-grid__wide {
  grid-column: auto;
}

.profile-sections-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  margin-bottom: 1rem;
}

.profile-sections-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: .375rem .625rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface2);
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: .6875rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
}

.profile-sections-nav a:hover {
  border-color: var(--accent-ink);
  color: var(--accent-ink);
}

.profile-section {
  scroll-margin-top: 1rem;
}

.profile-section + .profile-section {
  margin-top: 1.25rem;
}

.profile-section h3 {
  margin: 0 0 .5rem;
}

.profile-grid > div {
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--line);
}

.profile-grid > div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.profile-grid__wide {
  grid-column: 1 / -1;
  border-right: 0 !important;
}

dt {
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: .6875rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

dd {
  margin: .25rem 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.empty-state {
  padding: 3rem 0;
  text-align: center;
}

.empty-state h1 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.status-badge,
.hidden-value {
  min-height: 1.5rem;
  display: inline-flex;
  align-items: center;
  padding: .1875rem .5rem;
  border: 1px solid var(--muted);
  border-radius: var(--radius-small);
  background: var(--surface2);
  color: var(--text);
  font-family: ui-monospace, monospace;
  font-size: .6875rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.subsection {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-ink);
  border-radius: var(--radius-medium);
  background: var(--accent-soft);
}

h2 {
  margin: 0 0 .75rem;
  font-size: 1.25rem;
  line-height: 1.25;
}

h3 {
  margin: 1.25rem 0 .5rem;
  font-size: 1rem;
  line-height: 1.35;
}

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

.related-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.related-list li {
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  border-bottom: 1px solid var(--line);
  transition: background .18s ease;
}

.related-list li:hover {
  background: var(--accent-soft);
}

.related-list span {
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tabs {
  display: flex;
  gap: .125rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line-strong);
}

.tab {
  min-height: 2rem;
  padding: .4375rem .875rem;
  border: 1px solid transparent;
  border-bottom: 0;
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.tab:hover {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.tab--active {
  border-color: var(--line-strong);
  background: var(--surface2);
  color: var(--accent-ink);
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(11.25rem, 2fr) repeat(3, minmax(8.75rem, 1fr)) auto;
  align-items: end;
  gap: .5rem;
  margin-bottom: .75rem;
}

.filter-submit {
  align-self: end;
}

.journal-table-frame {
  max-height: 38.75rem;
}

.journal-table td {
  vertical-align: top;
}

.journal-detail {
  min-width: 18.75rem;
  white-space: normal;
}

.journal-detail > * + * {
  margin-top: .25rem;
}

.journal-detail code {
  color: var(--text);
}

.wrap {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.cell-subtitle {
  display: block;
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.two-column-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}

.stat-card {
  min-height: 7rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color .18s ease, transform .18s ease;
}

.stat-card strong {
  color: var(--text);
  font-size: 1.875rem;
  font-weight: 750;
  letter-spacing: -.04em;
  line-height: 1;
}

.stat-card span {
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

a.stat-card:hover {
  border-color: var(--accent-ink);
  transform: translateY(-2px);
}

.stat-card::before {
  content: "";
  width: 1.5rem;
  height: 3px;
  background: var(--interactive);
}

.theme-preview {
  min-height: 44px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-self: end;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-medium);
}

.theme-preview span {
  min-width: 2.5rem;
}

.theme-preview__background {
  background: var(--bg);
}

.theme-preview__surface {
  background: var(--surface);
}

.theme-preview__command {
  background: var(--command);
}

.theme-preview__focus {
  background: var(--focus);
}

.drawer-open .sidebar {
  box-shadow: var(--shadow-2);
}

dialog,
[role="dialog"] {
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-2);
}

[role="menu"] {
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-1);
}

.version-line {
  margin-top: 1rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-align: right;
  text-transform: uppercase;
}

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

@media (max-width: 63.999rem) {
  .app-layout {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 30;
    width: min(20rem, calc(100vw - 3rem));
    max-width: 100%;
    transform: translateX(-105%);
    transition: transform .18s ease;
  }

  .drawer-open .sidebar {
    transform: translateX(0);
  }

  .nav-toggle,
  .drawer-close {
    display: inline-flex;
  }

  .drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--drawer-backdrop);
    cursor: pointer;
  }

  .drawer-open .drawer-backdrop {
    display: block;
  }

  .drawer-open {
    overflow: hidden;
  }

  .sidebar-nav a,
  .sidebar-user .button,
  .button,
  input,
  select,
  textarea,
  .tab,
  .related-list a {
    min-height: 44px;
  }

  .sidebar-header .identity,
  .app-header--public .identity,
  .data-table td a,
  .profile-grid a,
  .subsection a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .sidebar-user .button {
    width: 100%;
  }

  .app-header {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .page-shell {
    padding: 1rem;
  }

  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
  }

  .filter-submit {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .master-detail {
    grid-template-columns: minmax(0, 1fr);
  }

  .check-field {
    min-height: 44px;
    align-items: center;
  }

  input[type="checkbox"] {
    width: 1.5rem;
    min-width: 1.5rem;
    min-height: 1.5rem;
    margin: 0;
  }

  .table-frame {
    overscroll-behavior-inline: contain;
  }

  .data-table th a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

@media (max-width: 47.999rem) {
  .app-header {
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
  }

  .app-header__actions {
    grid-column: 1 / -1;
  }

  .app-header__actions .button {
    width: 100%;
  }

  .app-header--public {
    display: flex;
  }

  .page-shell {
    padding: 1rem .75rem;
  }

  .page-heading,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: .5rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  .toolbar,
  .pagination,
  .danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    gap: .75rem;
  }

  .pagination {
    gap: .5rem;
  }

  .pagination-summary {
    align-self: center;
  }

  .pagination-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
  }

  .pagination-actions .button {
    min-height: 3rem;
  }

  .form-grid,
  .two-column-sections,
  .stats-grid,
  .filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid {
    gap: 1rem;
  }

  .form-field--wide {
    grid-column: auto;
  }

  fieldset,
  .subsection {
    padding: 1rem .75rem;
  }

  .form-actions {
    flex-direction: column;
    gap: .75rem;
  }

  .form-actions .button {
    width: 100%;
  }

  .form-actions .button--primary,
  .app-header__actions .button--primary {
    order: -1;
  }

  .profile-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-grid > div:nth-child(odd) {
    border-right: 0;
  }

  .profile-grid__wide {
    grid-column: auto;
  }

  .tabs {
    gap: .25rem;
  }

  .tab {
    min-width: 0;
    flex: 1;
    padding-right: .5rem;
    padding-left: .5rem;
    text-align: center;
  }

  .mobile-sort {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
    overflow-x: auto;
    padding: .125rem .125rem .5rem;
    color: var(--muted);
    scrollbar-width: thin;
  }

  .mobile-sort__label {
    flex: 0 0 auto;
    font-family: ui-monospace, monospace;
    font-size: .6875rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .mobile-sort a {
    min-height: 44px;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    padding: .5rem .75rem;
    border: 1px solid var(--line-strong);
    background: var(--surface2);
    color: var(--muted);
    font-family: ui-monospace, monospace;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-decoration: none;
    text-transform: uppercase;
  }

  .mobile-sort a[aria-current="true"] {
    border-color: var(--accent-ink);
    background: var(--accent-soft);
    color: var(--accent-ink);
  }

  .table-frame,
  .journal-table-frame {
    max-height: none;
    overflow-x: auto;
  }

  .data-table {
    min-width: max(100%, 40rem);
  }

  #personnel-results .data-table,
  .shpk-table {
    min-width: max(100%, 52rem);
  }

  #personnel-results th:first-child,
  #personnel-results td:first-child,
  .shpk-table th:first-child,
  .shpk-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    border-right: 1px solid var(--line-strong);
  }

  #personnel-results th:first-child,
  .shpk-table th:first-child {
    background: var(--surface-2);
  }

  #personnel-results td:first-child,
  .shpk-table td:first-child {
    background: var(--surface);
  }

  #personnel-results tr:hover td:first-child,
  .shpk-table tr:hover td:first-child {
    background: var(--interactive-soft);
  }

  #personnel-results tr[aria-selected="true"] td:first-child,
  .shpk-table tr[aria-selected="true"] td:first-child {
    background: var(--selection);
    color: var(--on-selection);
  }

  .data-table td a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .data-table .empty-cell {
    height: 5rem;
    text-align: center;
  }

  .journal-detail {
    min-width: 0;
  }

  .journal-detail > div,
  .journal-detail > code {
    min-width: 0;
  }

  .related-list li {
    min-height: 44px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: .25rem;
    padding: .5rem 0;
  }

  .related-list a {
    display: flex;
    align-items: center;
  }

  .version-line {
    text-align: left;
  }
}

@media (pointer: coarse) {
  .sidebar-nav a,
  .sidebar-user .button,
  .button,
  input,
  select,
  textarea,
  .tab,
  .related-list a,
  .check-field {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
  }
}

html[data-reduce-motion="true"] *,
html[data-reduce-motion="true"] *::before,
html[data-reduce-motion="true"] *::after {
  scroll-behavior: auto !important;
  transition-duration: 0s !important;
}

/* WEBGAPS */

.access__status[data-connection-state="unknown"] .access__dot,
.access__status[data-connection-state="checking"] .access__dot {
  background: var(--muted);
}

.access__status[data-connection-state="ok"] .access__dot {
  background: var(--status-ok);
}

.access__status[data-connection-state="error"] .access__dot {
  background: var(--status-danger);
}

html[data-density="compact"] th,
html[data-density="compact"] td {
  height: 34px;
  padding-top: .1875rem;
  padding-bottom: .1875rem;
}

html[data-density="compact"] .profile-grid > div {
  padding: .625rem .75rem;
}

html[data-density="compact"] .record-form {
  gap: .75rem;
}

html[data-density="compact"] .record-form fieldset {
  padding: .75rem;
}

html[data-density="compact"] .form-grid {
  gap: .75rem;
}
