:root {
  --bg: #2f2f30;
  --panel: #272728;
  --panel-strong: #202021;
  --line: #58585a;
  --line-soft: #404042;
  --text: #f5f5f5;
  --muted: #a9adb5;
  --muted-strong: #c3c5ca;
  --red: #eb0529;
  --green: #4bd68a;
  --wait: #e3b582;
  --font-ui: "Segoe UI", Arial, sans-serif;
  --font-mono: Consolas, "Cascadia Mono", monospace;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

.directory-page {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
}

.directory-shell {
  display: flex;
  width: min(1220px, calc(100% - 36px));
  min-height: 100vh;
  flex-direction: column;
  margin: 0 auto;
  padding: 22px 0 40px;
}

.directory-header {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  margin-bottom: 14px;
  padding: 0 4px 13px;
  border-bottom: 1px solid var(--red);
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.brand .brand-logo {
  display: block;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  object-fit: contain;
}

.brand h1 {
  margin: 0;
  padding: 0;
  font: 700 18px/1.2 var(--font-ui);
  letter-spacing: .1px;
}

.brand h1::before { display: none; }

.brand small {
  display: block;
  margin-top: 5px;
  color: var(--muted-strong);
  font: 400 10px/1.5 var(--font-ui);
  letter-spacing: .25px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-right: -4px;
}

.directory-page .client-download {
  display: inline-flex;
  width: calc((min(1220px, calc(100vw - 36px)) - 24px) / 5);
  height: 34px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel-strong);
  color: #fff;
  font: 700 10px/1 var(--font-ui);
  text-decoration: none;
  white-space: nowrap;
}

.client-download svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.client-download span {
  color: var(--green);
  font-family: var(--font-mono);
}

.directory-page .client-download:disabled { cursor: default; }

.directory-page .client-download:not(:disabled):hover,
.directory-page .client-download:focus-visible {
  border-color: var(--red);
  background: var(--panel-strong);
  outline: 0;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.panel {
  display: flex;
  min-width: 0;
  height: 164px;
  flex-direction: column;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
}

.panel.primary { background: var(--panel-strong); }

.panel-label {
  color: var(--muted-strong);
  font: 11px var(--font-mono);
  letter-spacing: .5px;
}

.panel-value {
  margin-top: 9px;
  color: #fff;
  font-size: 29px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.panel-value.live { color: var(--green); }

.panel-value small {
  margin-left: 5px;
  color: var(--muted);
  font: 10px var(--font-mono);
}

.progress {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
  margin-top: 12px;
}

.progress i { height: 3px; background: var(--line); }
.progress i.on { background: var(--green); }
.progress i.blocked { background: var(--red); }

.panel-foot {
  margin-top: auto;
  overflow: hidden;
  color: var(--muted);
  font: 10px var(--font-mono);
  letter-spacing: .35px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-foot .blocked-text { color: var(--red); font: inherit; }

.detail-list {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}

.detail-list.mcp-detail-list { gap: 3px; }

.detail-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font: 10px var(--font-mono);
}

.detail-row:last-child { border-bottom: 0; }

.detail-row strong {
  color: #fff;
  font: 700 11px var(--font-mono);
  white-space: nowrap;
}

.detail-row strong.ok { color: var(--green); }

.status-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
  color: var(--green);
  font: 700 10px var(--font-mono);
}

#directory-status.status-line {
  display: flex;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  text-align: left;
}

#directory-status.status-line.wait { color: var(--wait); }
#directory-status.status-line.offline { color: var(--red); }

.status-line::before {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 12%, transparent);
  content: "";
}

.directory { margin-top: 14px; }
.directory-toolbar { display: block; margin-bottom: 6px; }
.directory-search-wrap { position: relative; }

.directory-search {
  width: 100%;
  height: 42px;
  padding: 0 46px 0 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel-strong);
  color: #fff;
  font: 12px var(--font-ui);
  outline: 0;
}

.directory-search:focus { border-color: var(--red); }
.directory-search::placeholder { color: var(--muted); opacity: 1; }
.directory-search::-webkit-search-cancel-button { display: none; }

.directory-search-clear {
  position: absolute;
  top: 5px;
  right: 5px;
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted-strong);
  cursor: pointer;
}

.directory-search-clear[hidden] { display: none; }

.directory-search-clear svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.directory-search-clear:hover,
.directory-search-clear:focus-visible {
  border-color: var(--red);
  color: var(--red);
  outline: 0;
}

.state-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}

.directory-table {
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.directory-head,
.system-row,
.ghost-profile {
  display: grid;
  grid-template-columns: minmax(155px, .78fr) minmax(320px, 1.62fr) minmax(170px, .82fr) minmax(175px, .88fr) 172px;
  align-items: center;
  column-gap: 14px;
}

.directory-head {
  min-height: 40px;
  padding: 0 12px;
  background: #68686a;
  color: #fff;
  font: 700 12px var(--font-ui);
}

.directory-head span:first-child { padding-left: 32px; }

.system-row {
  min-height: 81px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
  transition: background-color .12s ease;
}

.system-row:nth-child(odd) { background: #232324; }
.system-row:last-child { border-bottom: 0; }
.system-row:hover { background: #303031; }

.system-row.empty-row {
  display: block;
  min-height: 81px;
  padding: 11px 12px;
  border-top: 1px dashed var(--line);
  border-bottom: 0;
  background: var(--panel);
}

.system-row.empty-row:nth-child(odd) { background: #232324; }
.system-row.empty-row:hover { background: #303031; }
.system-row.empty-row:hover .ghost-profile { opacity: .55; }

.ghost-profile {
  width: 100%;
  height: 58px;
  opacity: .38;
  transition: opacity .12s ease;
}

.ghost-cell {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.ghost-cell i {
  display: block;
  width: 100%;
  height: 7px;
  border: 1px dashed var(--line);
  background: rgb(255 255 255 / 2%);
}

.ghost-cell i:last-child { width: 72%; }

.ghost-system {
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
}

.ghost-system::before {
  grid-row: 1 / 3;
  width: 22px;
  height: 22px;
  border: 1px dashed var(--line);
  content: "";
}

.ghost-system i { grid-column: 2; }
.ghost-system i:first-child { width: 58%; }
.ghost-software { height: 58px; align-content: center; gap: 14px; }
.ghost-hardware { height: 58px; align-content: center; gap: 14px; }
.ghost-software i { width: 64%; }
.ghost-access i:first-child { width: 46%; }

.ghost-actions {
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 5px;
}

.ghost-actions i,
.ghost-actions i:last-child {
  width: 100%;
  height: 34px;
}

.system-identity,
.system-hardware,
.system-software,
.system-access {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.system-identity {
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
}

.system-identity > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.favorite-toggle {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: #74777d;
  cursor: pointer;
}

.favorite-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.favorite-toggle:hover,
.favorite-toggle:focus-visible {
  border-color: var(--line);
  color: #fff;
  outline: 0;
}

.favorite-toggle[aria-pressed="true"] { color: var(--red); }
.favorite-toggle[aria-pressed="true"] svg { fill: currentColor; }

.system-identity strong {
  overflow: hidden;
  color: #fff;
  font: 700 14px var(--font-ui);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-identity small,
.system-hardware > .hardware-line,
.version-pair,
.system-access small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font: 10px var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-hardware > .hardware-line {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 7px;
}

@media (min-width: 981px) {
  .system-hardware { padding-right: 24px; }
}

.system-hardware b {
  color: var(--muted-strong);
  font-weight: 400;
}

.hardware-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hardware-metrics {
  display: grid;
  min-width: 13.8ch;
  grid-template-columns: 8ch .8ch 4ch;
  column-gap: .5ch;
  align-items: baseline;
  justify-items: end;
  color: #fff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hardware-separator { justify-self: center; }
.hardware-metrics.unavailable { color: var(--muted); }

.version-pair {
  display: grid;
  grid-template-columns: 50px 56px 18px;
  align-items: center;
  gap: 6px;
}

.version-pair strong { color: #fff; font-size: 11px; }
.version-pair strong.ok { color: var(--green); }

.version-pair i {
  width: 18px;
  font: 700 16px/1 var(--font-ui);
  font-style: normal;
  text-align: center;
}

.version-pair i[title] { cursor: help; }
.version-pair .ok { color: var(--green); }
.version-pair .bad { color: var(--red); }
.version-pair .unknown { color: var(--muted); }

.system-state {
  color: var(--green);
  font: 700 10px var(--font-mono);
  white-space: nowrap;
}

.system-state.wait { color: var(--wait); }
.system-access small { color: #fff; }

.system-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 5px;
}

.system-actions a,
.system-actions button {
  display: inline-flex;
  min-width: 0;
  height: 34px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: #fff;
  font: 700 10px var(--font-ui);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-actions a:hover,
.system-actions a:focus-visible,
.system-actions button:hover:not(:disabled),
.system-actions button:focus-visible:not(:disabled) {
  border-color: var(--red);
  background: var(--panel-strong);
  outline: 0;
}

.system-actions button:disabled { color: #70747b; cursor: not-allowed; }

.system-actions .copy {
  padding: 0;
  cursor: pointer;
}

.system-actions .copy svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
}

.system-actions .copy.copied { border-color: var(--green); color: var(--green); }

.directory-pagination {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) 108px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--panel);
}

.directory-pagination button {
  border: 0;
  background: var(--panel);
  color: #fff;
  font: 700 10px var(--font-ui);
  cursor: pointer;
}

.directory-pagination button:hover:not(:disabled),
.directory-pagination button:focus-visible:not(:disabled) {
  background: var(--red);
  outline: 0;
}

.directory-pagination button:disabled { color: #70747b; cursor: default; }

.directory-pagination span {
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line-soft);
  border-left: 1px solid var(--line-soft);
  color: var(--muted);
  font: 10px var(--font-mono);
  text-align: center;
}

.legal-footer { margin-top: auto; padding-top: 32px; }

.directory-page .made-with {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
  color: var(--muted);
  font: 700 10px/1 var(--font-mono);
  letter-spacing: .7px;
}

.made-with svg { width: 13px; height: 13px; flex: none; }
.made-heart { fill: var(--red); }
.germany-heart-outline { fill: none; stroke: #c3c5ca; stroke-width: .7; }

/* Switch before the five desktop columns or overview footnotes run out of room. */
@media (max-width: 1200px) {
  .panel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel:last-child { grid-column: 1 / -1; }
  .directory-head { display: none; }
  .system-row { grid-template-columns: 1fr 1fr; gap: 12px 18px; padding: 12px; }
  .system-actions { grid-column: 1 / -1; }
  .ghost-profile { grid-template-columns: 1fr 1fr; height: auto; gap: 12px 18px; }
  .ghost-actions { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  .directory-header { flex-wrap: wrap; row-gap: 12px; }
  .header-actions { display: grid; width: calc(100% + 8px); margin-left: -4px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory-page .client-download { width: 100%; }
}

@media (max-width: 520px) {
  .directory-shell { width: calc(100% - 18px); padding-top: 12px; }
  .directory-header { align-items: flex-start; flex-direction: column; padding-bottom: 10px; }
  .brand .brand-logo { width: 44px; height: 44px; flex-basis: 44px; }
  .brand h1 { font-size: 15px; }
  .header-actions { width: calc(100% + 8px); margin-right: -4px; margin-left: -4px; justify-content: flex-end; }
  .header-actions { grid-template-columns: 1fr; }
  .directory-page .client-download { width: 100%; }
  .panel-grid { grid-template-columns: 1fr; }
  .panel:last-child { grid-column: auto; }
  .panel { height: 154px; }
  .directory-table { display: grid; gap: 8px; border: 0; background: transparent; }
  #connections { display: grid; gap: 8px; }
  .system-row {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 8px 20px rgb(0 0 0 / 14%);
  }
  .system-row:nth-child(odd) { background: #232324; }
  .system-row:last-child { border-bottom: 1px solid var(--line); }
  .system-identity { padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
  .system-hardware::before,
  .system-software::before,
  .system-access::before {
    color: var(--muted-strong);
    font: 700 9px/1 var(--font-ui);
    letter-spacing: .35px;
  }
  .system-hardware::before { content: "HARDWARE"; }
  .system-software::before { content: "SOFTWARE"; }
  .system-access::before { content: "ACCESS / STATE"; }
  .system-actions { grid-column: auto; }
  .ghost-profile { grid-template-columns: 1fr; }
  .ghost-actions { grid-column: auto; }
  .system-row.empty-row { min-height: 0; border: 1px dashed var(--line); }
  .directory-pagination { grid-template-columns: 82px minmax(0, 1fr) 82px; }
  .legal-footer { padding-top: 22px; }
}
