@layer base {
/* Shared design tokens. Wiki-derived values are marked below.
   Dimensions use rem so the UI scale control resizes the whole interface. */


* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 0.875rem/1.6 var(--font-body);
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
select {
  cursor: pointer;
}

button {
  color: inherit;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

button:disabled {
  cursor: not-allowed;
  color: var(--muted);
}

:focus-visible {
  outline: 0.125rem solid var(--cyan);
  outline-offset: 0.25rem;
}

main:focus {
  outline: none;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font: 900 2rem/1.2 var(--font-heading);
  letter-spacing: -0.025em;
  margin: 0.25rem 0 0.5rem;
}

h3 {
  font-size: 1rem;
  font-weight: 500;
}

strong {
  font-weight: 500;
}

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

.small {
  font-size: 0.75rem;
}

.tiny {
  font-size: 0.6875rem;
}

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

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

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

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

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

.section-label {
  color: var(--green);
  font: 400 0.8125rem/1.5 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.between {
  justify-content: space-between;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  border-right: 0.0625rem solid var(--border);
  padding: 2rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg);
  z-index: 5;
}

.brand {
  display: block;
}

.brand img {
  width: 100%;
  height: auto;
  display: block;
}

.brand-caption {
  color: var(--cyan);
  font: 0.6875rem var(--font-mono);
  margin: 1rem 0.25rem 2.25rem;
}

.sidebar nav>.section-label {
  margin: 0 0.75rem 0.5rem;
  font-size: 0.6875rem;
}

.nav-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  padding: 0.625rem 0.75rem;
  border: 0;
  border-left: 0.1875rem solid transparent;
  border-radius: 0.125rem;
  background: none;
  color: var(--text);
  font-size: 0.875rem;
  min-height: 2.625rem;
}

.nav-link:hover:not(:disabled) {
  background: var(--surface);
}

.nav-link[aria-current=page] {
  background: var(--selected);
  border-left-color: var(--green);
}

.nav-symbol {
  color: var(--cyan);
  width: 1.125rem;
  text-align: center;
  font: 1rem var(--font-mono);
}

.nav-link:disabled .nav-symbol {
  color: var(--muted);
}

.nav-link small {
  margin-left: auto;
  font-size: 0.625rem;
  color: var(--muted);
}

.sidebar-bottom {
  margin-top: auto;
}

.sidebar-monitor {
  border-top: 0.0625rem solid var(--border);
  border-bottom: 0.0625rem solid var(--border);
  padding: 1.25rem 0.25rem;
  margin-bottom: 1.25rem;
}

.sidebar-monitor .section-label {
  font-size: 0.6875rem;
  margin-bottom: 0.75rem;
}

.sidebar-monitor .row {
  justify-content: space-between;
}

.workspace {
  margin-left: var(--sidebar-width);
}

main {
  max-width: 93.75rem;
  margin: auto;
  padding: 2rem 2.5rem 1.25rem;
}

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

.eyebrow {
  font: 0.6875rem var(--font-mono);
  color: var(--muted);
  letter-spacing: .06em;
  margin-bottom: 0.5rem;
}

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

.button {
  border-radius: var(--radius);
  min-height: 2.5rem;
  padding: 0.5625rem 1rem;
  border: 0.0625rem solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.secondary {
  background: var(--surface);
  color: var(--text);
}

.secondary:hover:not(:disabled) {
  border-color: var(--cyan);
  background: var(--surface-raised);
}

.primary {
  background: var(--green);
  color: var(--bg);
  border-color: var(--green);
}

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

.button:disabled {
  background: var(--bg);
  border-style: dashed;
}

.text-button {
  border: 0;
  background: none;
  padding: 0.25rem 0;
  font-size: 0.75rem;
  color: var(--cyan);
}

.text-button:hover {
  text-decoration: underline;
  text-underline-offset: 0.25rem;
}

.full {
  width: 100%;
  justify-content: space-between;
}

select,
input:not([type=checkbox]) {
  color: var(--text);
  background: var(--bg);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
  padding: 0.5625rem 0.75rem;
  min-height: 2.5rem;
}

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

.content-section {
  margin-top: 2rem;
}

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

.content-section>h2 {
  margin-bottom: 1rem;
}

.panel {
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.system-grid {
  display: grid;
}

.system-card {
  padding: 1.25rem;
}

.square-icon {
  color: var(--cyan);
  border: 0.0625rem solid var(--border);
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font: 0.75rem var(--font-mono);
  border-radius: var(--radius);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

.status i {
  width: 0.375rem;
  height: 0.375rem;
  background: currentColor;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.system-details {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 0.0625rem solid var(--border);
  padding-top: 0.75rem;
  margin: 1rem 0 0.5rem;
  font-size: 0.6875rem;
  color: var(--muted);
}

.system-details strong {
  display: block;
  color: var(--text);
  font-size: 0.75rem;
}

.module-grid {
  display: grid;
}

.module-card {
  padding: 1.25rem;
  flex-direction: column;
}

.module-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.module-mark {
  width: 2.75rem;
  height: 2.75rem;
  border: 0.0625rem solid var(--cyan);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 0.9375rem var(--font-mono);
  color: var(--cyan);
  flex-shrink: 0;
}

.module-kind {
  font: 0.6875rem var(--font-mono);
  color: var(--cyan);
  margin-top: 0.25rem;
}

.module-description {
  color: var(--muted);
  font-size: 0.8125rem;
  margin: 1.25rem 0;
}

.availability {
  margin-top: auto;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}



table {
  width: 100%;
  min-width: 45rem;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.75rem;
}

th {
  font: 0.6875rem var(--font-mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--surface);
  padding: 0.75rem 1rem;
}

td {
  border-top: 0.0625rem solid var(--border);
  padding: 0.875rem 1rem;
}

td:not(:first-child) {
  white-space: nowrap;
}

.table-sub {
  display: block;
  font-size: 0.6875rem;
  color: var(--muted);
  margin-top: 0.125rem;
}

.note {
  border: 0.0625rem solid var(--attention-border);
  border-left: 0.1875rem solid var(--orange);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  background: var(--surface);
  margin-top: 1.5rem;
}

.note-label {
  color: var(--orange);
  font: 0.6875rem var(--font-mono);
  letter-spacing: .04em;
}

.note p {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

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

.swatch {
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.swatch-colour {
  height: 4rem;
  border-bottom: 0.0625rem solid var(--border);
}

.swatch-label {
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.swatch-label code {
  font-size: 0.6875rem;
  color: var(--muted);
}

.rule-note {
  margin-top: 1rem;
  max-width: 53.125rem;
}

.type-sheet {
  padding: 0.25rem 1.5rem;
}

.type-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 0.0625rem solid var(--border);
}

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

.type-row code {
  font-size: 0.6875rem;
  color: var(--muted);
  white-space: nowrap;
}

.type-title {
  font: 900 2rem/1.2 var(--font-heading);
  margin-top: 0.5rem;
  letter-spacing: -.025em;
}

.component-grid {
  display: grid;
  gap: 1rem;
}

.component-panel {
  padding: 1.5rem;
}

.component-panel>h3 {
  margin-bottom: 0.5rem;
}

.button-samples {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

#sample-feedback {
  margin-top: 1rem;
}



.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.75rem;
  margin: 1rem 0 0.375rem;
}

input[type=checkbox] {
  accent-color: var(--green);
  width: 1rem;
  height: 1rem;
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

.state-example {
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.state-example p {
  margin-top: 0.5rem;
}

.rules-list {
  padding: 0 1.5rem;
}

.rules-list>div {
  padding: 1rem 0;
  display: grid;
  grid-template-columns: 15rem 1fr;
  gap: 1rem;
  border-bottom: 0.0625rem solid var(--border);
}

.rules-list>div:last-child {
  border: 0;
}

.rules-list span {
  color: var(--muted);
  font-size: 0.8125rem;
}

.icon-button {
  border: 0.0625rem solid var(--border);
  background: none;
  font-size: 1.5rem;
  width: 2.25rem;
  height: 2.25rem;
}







.menu-button {
  display: none;
  background: none;
  border: 0.0625rem solid var(--border);
  padding: 0.25rem 0.625rem;
}

.skip {
  position: fixed;
  left: 0.75rem;
  top: -6.25rem;
  z-index: 20;
  background: var(--green);
  color: var(--bg);
  padding: 0.75rem;
}

.skip:focus {
  top: 0.75rem;
}

.sr-only {
  position: absolute;
  width: 0.0625rem;
  height: 0.0625rem;
  padding: 0;
  margin: -0.0625rem;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (min-width:1600px) {
  main {
    padding-top: 2.5rem;
  }

  .module-card {
    padding: 1.5rem;
  }

}

@media (max-width:1200px) {
  :root {
    --sidebar-width: 14.25rem;
  }

  main {
    padding: 1.75rem 1.5rem 1.25rem;
  }

  .system-card .row.between {
    flex-wrap: wrap;
  }

  .module-grid {
    gap: 0.75rem;
  }

  .module-card {
    padding: 1rem;
  }

  .module-title {
    align-items: flex-start;
  }

  .module-mark {
    width: 2.25rem;
    height: 2.25rem;
  }

  .module-title h3 {
    font-size: 0.875rem;
  }

  .swatch-grid {
    grid-template-columns: repeat(3,1fr);
  }

}

@media (max-width:920px) {
  .module-title h3 {
    font-size: 1rem;
  }

  .rules-list>div {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

}

@media (max-width:640px) {
  main {
    padding: 1.5rem 1rem 1rem;
  }

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

  .system-grid,
  .module-grid,
  .component-grid {
    grid-template-columns: 1fr;
  }

  .module-description {
    margin: 1rem 0;
  }

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

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

  .swatch-label {
    flex-direction: column;
  }

  .type-title {
    font-size: 1.625rem;
  }

  .type-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .component-panel {
    padding: 1rem;
  }

  .detail-list {
    grid-template-columns: 6.25rem 1fr;
  }

}

/* Appearance controls remain visible on both review pages. */
#appearance-status {
  margin-left: auto;
}

/* Let content reflow when the UI scale increases; do not shrink text to fit. */
/* Keep empty column tracks so filtering never stretches the remaining cards. */
.component-grid {
  grid-template-columns: repeat(auto-fit,minmax(min(100%,22rem),1fr));
}

.system-card .row.between {
  flex-wrap: wrap;
}

.page-heading,
.section-heading {
  flex-wrap: wrap;
}

html[data-navigation=collapsed] .sidebar {
  display: none;
  width: min(16.5rem,100vw);
}

html[data-navigation=collapsed] .workspace {
  margin-left: 0;
}

html[data-navigation=collapsed] .menu-button {
  display: inline-block;
}

html[data-navigation=collapsed] .sidebar-bottom {
  margin-top: 1.5rem;
}

/* Density changes spacing and control height, never the font-size scale. */
html[data-density=compact] {
  --sidebar-width: 14.5rem;
}

html[data-density=compact] .sidebar {
  padding: 1.25rem 1rem 1rem;
}

html[data-density=compact] .sidebar-monitor {
  padding: .75rem .25rem;
  margin-bottom: .75rem;
}

html[data-density=compact] main {
  padding: 1.25rem 1.5rem 1rem;
}

html[data-density=compact] .page-heading {
  margin-bottom: 1.25rem;
}

html[data-density=compact] .content-section {
  margin-top: 1.25rem;
}

html[data-density=compact] .section-heading,
html[data-density=compact] .content-section>h2 {
  margin-bottom: .75rem;
}

html[data-density=compact] .system-grid,
html[data-density=compact] .module-grid {
  gap: .75rem;
}

html[data-density=compact] .system-card,
html[data-density=compact] .module-card {
  padding: 1rem;
}

html[data-density=compact] .module-description {
  margin: .75rem 0;
}

html[data-density=compact] .availability {
  margin-bottom: .75rem;
}

html[data-density=compact] .system-details {
  margin-top: .75rem;
  padding-top: .5rem;
}

html[data-density=compact] .button,
html[data-density=compact] select,
html[data-density=compact] input:not([type=checkbox]) {
  min-height: 2rem;
  padding-top: .3125rem;
  padding-bottom: .3125rem;
}

html[data-density=compact] th {
  padding-top: .5rem;
  padding-bottom: .5rem;
}

html[data-density=compact] td {
  padding-top: .625rem;
  padding-bottom: .625rem;
}

html[data-density=compact] .note {
  margin-top: 1rem;
  padding: .75rem 1rem;
}

@media (max-width:640px) {
  html[data-density=compact] main {
    padding: 1rem;
  }

  #appearance-status {
    width: 100%;
    margin-left: 0;
  }

}

@media (pointer:coarse) {
  .nav-link,
  .button,
  .text-button,
  select,
  input:not([type=checkbox]),
  .menu-button,
  .icon-button {
    min-height: 2.75rem !important;
  }

}

/* The monitor is part of the workspace, never a modal. Navigation scrolls above it. */
.sidebar>nav {
  min-height: 0;
  overflow-y: auto;
  flex: 1 1 auto;
}

.sidebar-bottom {
  padding-top: .75rem;
}

.sidebar .brand,
.sidebar .brand-caption {
  flex-shrink: 0;
}

.sidebar-monitor .row {
  margin-bottom: .25rem;
}

.sidebar-monitor .row .section-label {
  margin-bottom: 0;
}

.monitor-worker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-size: .6875rem;
  margin: .5rem 0;
}

.monitor-worker select {
  width: 8rem;
  font-size: .6875rem;
  min-height: 1.75rem;
  padding: .125rem .25rem;
}

.monitor-section {
  margin-top: .5rem;
  padding-top: .375rem;
  border-top: 1px solid var(--border);
}

.monitor-section summary {
  cursor: pointer;
  color: var(--green);
  font: .6875rem/1.5 var(--font-mono);
  text-transform: uppercase;
}

.monitor-values {
  display: grid;
  gap: .125rem .5rem;
  font: .6875rem/1.5 var(--font-mono);
  margin: .375rem 0;
}

.monitor-values dt {
  color: var(--muted);
}

.monitor-values dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

#monitor-content {
  max-height: 55vh;
  overflow-y: auto;
}

#monitor-dock:not(:empty) {
  position: fixed;
  right: .75rem;
  width: min(19rem,calc(100vw - 1.5rem));
  z-index: 8;
  border: 1px solid var(--border);
  background: var(--bg);
  padding: .75rem;
}

#monitor-dock .sidebar-monitor {
  padding: 0;
  border: 0;
  margin: 0;
}

html[data-monitor=expanded][data-navigation=collapsed] main {
  padding-bottom: calc(var(--monitor-height) + 3rem);
}

.section-toggle {
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  background: none;
  border: 0;
  padding: .125rem 0;
  cursor: pointer;
  text-align: left;
}

.section-toggle:hover {
  text-decoration: underline;
  text-underline-offset: .25rem;
}

.system-grid {
  align-items: start;
}

/* Compact navigation follows the wiki's tight link rhythm, leaving room to grow. */
html[data-density=compact] .sidebar {
  padding-top: 1rem;
}

html[data-density=compact] .brand-caption {
  margin: .5rem .25rem .75rem;
}

html[data-density=compact] .sidebar nav>.section-label {
  margin-bottom: .25rem;
}

html[data-density=compact] .nav-link {
  min-height: 1.625rem;
  padding: .1875rem .5rem;
  gap: .5rem;
  line-height: 1.4;
}

html[data-density=compact] .sidebar-bottom {
  padding-top: .5rem;
}



/* Wiki shell: content first, one genuinely thin technical strip across the full window. */


.sidebar {
  bottom: var(--statusbar-height);
}

html[data-navigation=collapsed] .sidebar {
  top: 0;
}

#home-view>.content-section:first-of-type {
  margin-top: 0;
}

.nav-section {
  margin: 0 0 .75rem;
}

.nav-section>summary {
  list-style: none;
  cursor: pointer;
  color: var(--green);
  font: .6875rem/1.5 var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .125rem .75rem;
  margin-bottom: .25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-section>summary::-webkit-details-marker {
  display: none;
}

.nav-section>summary::after {
  content: "+";
}

.nav-section[open]>summary::after {
  content: "−";
}

.nav-section .nav-link {
  padding-left: .75rem;
}

.system-grid,
.module-grid {
  align-items: stretch;
}

.system-card {
  display: flex;
  flex-direction: column;
}

.system-card>div[id^=section-] {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.system-card .machine-footer {
  margin-top: auto;
  min-height: 1.5rem;
}

.module-card {
  display: block;
}

.module-summary {
  list-style: none;
  cursor: pointer;
}

.module-summary-top {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
}

.card-caret {
  font: .875rem var(--font-mono);
  color: var(--cyan);
}

.module-summary .availability {
  margin: .625rem 0 0;
}

.module-summary .module-mark {
  width: 2rem;
  height: 2rem;
  font-size: .75rem;
}

.module-body {
  border-top: 1px solid var(--border);
}

.module-body .button {
  margin-top: .75rem;
}

html[data-density=compact] .module-card {
  padding: .75rem;
}

html[data-density=compact] .module-summary .availability {
  margin-bottom: 0;
}

.statusbar {
  position: fixed;
  inset: auto 0 0;
  height: var(--statusbar-height);
  z-index: 12;
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: 0 .75rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
  font: .625rem/1 var(--font-mono);
  white-space: nowrap;
}

.bar-separator {
  color: var(--border);
}

.statusbar .menu-button {
  border: 0;
  padding: 0 .25rem;
  font: inherit;
  color: var(--cyan);
  min-height: 0;
}

.view-menu {
  margin-left: auto;
  flex-shrink: 0;
}

.view-menu>summary {
  color: var(--cyan);
  cursor: pointer;
  list-style: none;
  padding: .25rem 0;
}

.view-menu>summary::-webkit-details-marker {
  display: none;
}

.view-menu>summary::after {
  content: " ▴";
}

.view-panel {
  position: absolute;
  right: .5rem;
  bottom: calc(var(--statusbar-height) + .375rem);
  width: min(19rem,calc(100vw - 1rem));
  padding: .875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  gap: .75rem;
  font: .75rem/1.5 var(--font-body);
  white-space: normal;
}

.view-panel label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  color: var(--muted);
}

.view-panel select {
  width: 10rem;
  font-size: .75rem;
}

#monitor-dock:not(:empty) {
  bottom: calc(var(--statusbar-height) + .75rem);
}

@media (max-width:800px) {
  .bar-hardware {
    display: none;
  }

}

@media (max-width:500px) {
  .statusbar .bar-separator {
    display: none;
  }

  .statusbar {
    gap: .5rem;
    padding-inline: .5rem;
  }

}

@media (pointer:coarse) {
  :root {
    --statusbar-height: 2rem;
  }

  .statusbar .menu-button {
    min-height: 2rem !important;
  }

  .view-menu>summary {
    padding-block: .5rem;
  }

}

/* Optional module artwork uses the existing fixed slot; missing art keeps the monogram. */
.module-mark {
  overflow: hidden;
}

.module-mark.has-artwork {
  border-radius: var(--radius);
}

.module-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.module-mark img.contain {
  object-fit: contain;
}

.install-state {
  color: var(--muted);
  font-size: .6875rem;
}

.module-summary .availability {
  gap: .125rem;
}

.catalogue-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-heading:has(>#modules-title),
.section-heading:has(>#system-title),
.section-heading:has(>#activity-title) {
  justify-content: flex-start;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}

.catalogue-filter {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--muted);
  font-size: .6875rem;
}

.catalogue-filter select {
  min-height: 1.75rem;
  padding: .125rem .5rem;
  font-size: .6875rem;
}

.install-state.green {
  color: var(--green);
}

.install-state.cyan {
  color: var(--cyan);
}

.avatar-edit {
  padding: 0;
  background: var(--bg);
  overflow: hidden;
}

.avatar-edit:hover {
  border-color: var(--cyan);
}

.avatar-edit img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-preview {
  width: 5rem;
  height: 5rem;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

#profile-file {
  max-width: 100%;
}

/* Compact companion-window default; View can scale from 50% to 100%. */
html {
  font-size: 70%;
}

/* Sidebar visibility changes only through its control; no viewport or scale auto-hide. */
html[data-navigation=expanded] .sidebar {
  display: flex;
  width: var(--sidebar-width);
  top: 0;
}

html[data-navigation=expanded] .workspace {
  margin-left: var(--sidebar-width);
}

.statusbar .menu-button {
  display: inline-block;
}

#monitor-window-note {
  line-height: 1.4;
  margin-top: .25rem;
}

#monitor-only-host {
  display: none;
}

html[data-mode=monitor] .sidebar,
html[data-mode=monitor] .workspace {
  display: none;
}

html[data-mode=monitor] #monitor-only-host {
  display: block;
  max-width: 24rem;
  padding: .75rem;
}

#monitor-only-host .sidebar-monitor,
#pinned-monitor-host .sidebar-monitor {
  padding: 0;
  margin: 0;
  border: 0;
}

#monitor-only-host #monitor-content,
#pinned-monitor-host #monitor-content {
  max-height: none;
}

html[data-mode=monitor] .statusbar .bar-hardware,
html[data-mode=monitor] .statusbar .bar-separator,
html[data-mode=monitor] .statusbar .menu-button,
html[data-mode=monitor] .statusbar>.orange {
  display: none;
}

.pinned-monitor-body {
  padding: .75rem;
}

/* At narrow widths, retain the sidebar and reflow content rather than hiding it. */
.workspace {
  min-width: 0;
}

.system-card .system-details {
  flex-wrap: wrap;
}

@media (max-width:500px) {
  .statusbar .bar-version {
    display: none;
  }

  .system-card>.row>.row {
    flex-wrap: wrap;
  }

}

/* Stable live fields: status updates do not change surrounding geometry. */


.status {
  min-inline-size: 0;
  max-inline-size: 100%;
  block-size: var(--status-line-height);
  line-height: var(--status-line-height);
  font-variant-numeric: tabular-nums;
}

.status-label {
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stable-line {
  display: block;
  min-inline-size: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  block-size: 1lh;
}

.system-card>.row.between>.row {
  flex: 1 1 0;
  min-inline-size: 0;
}

.system-card>.row.between>.row>div {
  min-inline-size: 0;
}

.system-card>.row.between>.row>div>h3,
.system-card>.row.between>.row>div>p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-card .system-details {
  display: grid;
  align-items: start;
}

.system-details>span {
  min-inline-size: 0;
}

.module-summary .availability {
  min-block-size: var(--status-line-height);
}

.module-summary .status {
  inline-size: 100%;
  white-space: nowrap;
}

.module-body>p:has(#image-remote) {
  block-size: 1lh;
}

.monitor-values {
  grid-template-columns: 6.5rem minmax(0,1fr);
  font-variant-numeric: tabular-nums;
}

/* Stable table tracks: a longer state must not resize every other column. */
















/* Monitor actions stay on its heading, with no separate action section. */
.monitor-heading {
  justify-content: space-between;
  gap: .5rem;
}

.monitor-heading-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  white-space: nowrap;
}

.monitor-heading-actions .text-button {
  padding: 0;
  min-height: 0;
  font-size: .6875rem;
}

#monitor-window-note[hidden] {
  display: none;
}

/* Fixed application shell and card dimensions. Only deliberate View scaling resizes cards. */


html {
  height: 100%;
  overflow: hidden;
  scrollbar-gutter: auto;
}

body {
  height: 100%;
  overflow: hidden;
  padding-bottom: 0;
}

.workspace {
  position: fixed;
  inset: 0 0 var(--statusbar-height,1.375rem) var(--sidebar-width);
  margin: 0 !important;
  overflow: hidden;
}

html[data-navigation=collapsed] .workspace {
  left: 0;
}

.workspace main,
html[data-density=compact] .workspace main {
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 1rem;
  overflow: auto;
  scrollbar-gutter: stable;
}

.sidebar {
  overflow: hidden;
}

.sidebar nav {
  min-height: 0;
  overflow: auto;
  flex: 1 1 auto;
}

.sidebar-bottom {
  flex: 0 0 auto;
}

.system-grid {
  grid-template-columns: repeat(auto-fill,var(--machine-card-width));
  min-width: var(--machine-card-width);
  gap: var(--app-gap);
}

.module-grid {
  grid-template-columns: repeat(auto-fill,var(--module-card-width));
  min-width: var(--module-card-width);
  gap: var(--app-gap);
}

.system-card,
html[data-density=compact] .system-card {
  width: var(--machine-card-width);
  padding: var(--card-padding);
}

.module-card,
html[data-density=compact] .module-card {
  width: var(--module-card-width);
  padding: var(--card-padding);
  cursor: pointer;
}

.module-card:hover {
  border-color: var(--cyan);
}

a.module-summary {
  display: block;
  color: inherit;
  min-height: 4.5rem;
}

.module-summary h3 {
  font-size: 1rem;
}

.card-caret::after {
  content: "→";
}

.module-body .module-description {
  margin: 0 0 .5rem;
  overflow: auto;
  line-height: 1.45;
}

.module-body>p:last-child {
  margin: 0;
  height: 1.25rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.content-section,
html[data-density=compact] .content-section {
  margin-top: var(--section-gap);
}

#home-view>.content-section:first-child {
  margin-top: 0;
}

.section-heading,
html[data-density=compact] .section-heading {
  min-height: 2rem;
  margin-bottom: .5rem;
}

.system-card .system-details {
  margin: .5rem 0;
  padding-top: .5rem;
}









.module-install,
.module-interface-placeholder {
  padding: 1rem;
  margin: .75rem 0;
}

.module-install>.button {
  margin: .75rem 0;
}

html[data-mode=monitor] #monitor-only-host {
  height: calc(100% - var(--statusbar-height,1.375rem));
  overflow: auto;
}

.pinned-monitor-body {
  overflow: auto;
}



.module-card {
  height: var(--card-height-collapsed);
}

.module-card[data-expanded=true] {
  height: var(--card-height);
}

.system-card {
  height: var(--card-height);
}

.system-card:has(>div[id^=section-][hidden]) {
  height: var(--card-height-collapsed);
}

/* PC and module cards share one width, header rhythm and expanded height. */
.system-card>.row.between {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: auto 1.2rem;
  gap: .375rem;
}

.system-card>.row.between>.row {
  flex-wrap: nowrap;
}

.system-card .square-icon {
  width: 2rem;
  height: 2rem;
}

.system-card>.row.between>.status {
  width: 100%;
}

.system-card .system-details {
  grid-template-columns: minmax(0,1fr);
  gap: .25rem;
}

.system-details>span {
  display: grid;
  grid-template-columns: 4.5rem minmax(0,1fr);
  gap: .5rem;
}

.system-details strong {
  margin-top: 0;
}

.system-card>div[id^=section-]>.row {
  display: flex;
  flex-wrap: wrap;
}

.system-card>div[id^=section-]>.row>p {
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.system-card>div[id^=section-]>.row>.text-button {
  padding: 0;
}

/* Unfilled cards retain thin outlines and locked geometry. */
.system-card,
#home-view .module-card {
  background: transparent;
  border-color: var(--border);
}

.system-card {
  border-color: transparent;
  border-radius: 0;
}

.system-card[data-sharing=true],
.system-card:hover,
#home-view .module-card:hover,
.system-card:has(:focus-visible),
#home-view .module-card:has(:focus-visible) {
  background: var(--surface);
}

#home-view .module-card:hover,
#home-view .module-card:has(:focus-visible) {
  border-color: var(--cyan);
}

.system-card {
  cursor: pointer;
}

.machine-link {
  color: inherit;
}

.machine-link:hover {
  color: var(--cyan);
}

.machine-modules {
  width: 100%;
  table-layout: fixed;
  margin-bottom: .5rem;
}

.machine-modules th,
.machine-modules td {
  padding: .5rem;
}

.machine-job {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .375rem 0;
  border-bottom: 1px solid var(--border);
}

/* Compact cards share stable text slots; details wrap inside the fixed footprint. */
.system-card>.row.between>.row {
  min-height: 2.4rem;
  align-items: flex-start;
}

.system-card>.row.between>.row>div>h3 {
  line-height: 1.2rem;
}

.system-card>.row.between>.row>div>p {
  white-space: normal;
  overflow: visible;
  line-height: 1.1rem;
}

.system-card .system-details,
html[data-density=compact] .system-card .system-details {
  margin: .375rem 0;
  padding-top: .375rem;
  gap: .25rem;
}

.system-details>span {
  line-height: 1.05rem;
  align-items: start;
}

.system-details>span:first-child {
  min-height: 2.1rem;
}

.system-details strong {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  line-height: 1.05rem;
}

.system-card>div[id^=section-]>.row {
  min-height: 1.5rem;
  align-items: center;
  justify-content: flex-start;
  gap: .75rem;
}

.hardware-value-line {
  display: block;
  white-space: nowrap;
}

.module-title,
.module-title>div {
  min-width: 0;
}

.module-title {
  flex: 1;
}

.module-summary-top {
  min-height: 3.4rem;
  align-items: flex-start;
}

.module-title h3 {
  line-height: 1.2rem;
}

.module-kind {
  line-height: 1.1rem;
  white-space: normal;
}

.module-summary .availability {
  margin-top: .25rem;
}

.module-body {
  margin-top: .25rem;
  padding-top: .25rem;
}

.module-body .module-description {
  height: 3.25rem;
  margin-bottom: .25rem;
}

.module-body>p:last-child,
.module-body>p:has(#image-remote) {
  height: 1.2rem;
  block-size: 1.2rem;
  white-space: normal;
  overflow: auto;
  line-height: 1.2rem;
}

.module-body #image-remote.stable-line {
  white-space: normal;
  block-size: auto;
  line-height: inherit;
  overflow: visible;
}

/* Recent work follows its panel width; card tracks remain fixed. */




#home-view>.note {
  margin-top: var(--work-group-gap);
  background: transparent;
  border: 0;
  border-left: 2px solid var(--orange);
  border-radius: 0;
}

















#home-tasks-empty {
  padding: .625rem;
}





.machine-modules {
  min-width: 0;
}



.workspace-title {
  font: 600 1.25rem/1.3 var(--font-body);
  margin: 0 0 .75rem;
}

#home-view>.workspace-title+.content-section {
  margin-top: 0;
}



/* The live guide stays inside the workspace, with its own scrolling. */
#guide-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

#guide-frame {
  display: block;
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  border: 1px solid var(--border);
  background: var(--bg);
}













.system-card .system-details {
  border-top-color: transparent;
}

/* Shared GPU controls appear only in owner details, never on remote cards. */
.sharing-switch {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: .75rem;
  color: var(--muted);
}

.sharing-switch [data-sharing-label] {
  min-width: 1.5rem;
  text-align: left;
}

.switch-track {
  display: inline-flex;
  align-items: center;
  width: 1.75rem;
  height: 1rem;
  padding: .125rem;
  border: 1px solid var(--muted);
  border-radius: .5rem;
}

.switch-track::before {
  content: "";
  width: .625rem;
  height: .625rem;
  border-radius: 50%;
  background: currentColor;
}

.sharing-switch[aria-checked=true] {
  color: var(--green);
}

.sharing-switch[aria-checked=true] .switch-track {
  border-color: var(--green);
  justify-content: flex-end;
}
}
