:root {
  color-scheme: dark;
  --mono: "SF Mono", Menlo, Consolas, monospace;
  --terminal-font: "SF Mono", Menlo, Consolas, monospace;
  --theme-intensity: 1;
  --bg: #020203;
  --ink: #f4f5f7;
  --ink-dim: #a2a8b0;
  --muted: #626a73;
  --hairline: rgba(255, 255, 255, 0.105);
  --hairline-strong: rgba(255, 255, 255, 0.18);
  --panel: rgba(9, 10, 12, 0.88);
  --panel-solid: #0a0b0d;
  --panel-raised: #101216;
  --field: rgba(255, 255, 255, 0.045);
  --field-strong: rgba(255, 255, 255, 0.075);
  --accent: #f0f3f7;
  --blue: #7fb7ff;
  --green: #65d98f;
  --amber: #e7bc5a;
  --red: #f06d6d;
  --violet: #b5a3ff;
  --radius: 8px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 26%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    #020203;
  background-size: auto, 96px 96px, 96px 96px, auto;
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  letter-spacing: 0;
  padding-top: env(safe-area-inset-top, 0);
  padding-right: env(safe-area-inset-right, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  padding-left: env(safe-area-inset-left, 0);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 15%, transparent 85%, rgba(255, 255, 255, 0.035)),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.012), rgba(255, 255, 255, 0.012) 1px, transparent 1px, transparent 5px);
  opacity: 0.58;
}

button {
  height: 30px;
  min-width: 44px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
}

button:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.05));
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #000;
  transition: opacity 420ms ease, visibility 420ms ease;
}

.boot-screen.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.boot-screen::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.026), rgba(255, 255, 255, 0.026) 1px, transparent 1px, transparent 4px);
  opacity: 0.45;
  animation: scanLines 1400ms linear infinite;
}

.boot-terminal {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 34px minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #030304;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: opacity 420ms ease, transform 420ms ease, filter 420ms ease;
}

.boot-terminal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0 12px;
  color: rgba(244, 245, 247, 0.7);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
}

.boot-terminal-body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 28px;
  min-height: 0;
  padding: 24px 28px 56px;
  color: #d7dce2;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.42;
}

.boot-code {
  min-height: 0;
  overflow: hidden;
  white-space: pre-wrap;
}

.boot-line {
  min-height: 1.42em;
  color: rgba(215, 220, 226, 0.86);
  animation: terminalLineIn 80ms steps(2, end) both;
}

.boot-line span {
  color: rgba(127, 183, 255, 0.88);
}

.boot-line.command {
  color: #f1f4f8;
}

.boot-line.success {
  color: var(--green);
}

.progress-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: rgba(215, 220, 226, 0.9);
  white-space: nowrap;
}

.progress-line i {
  color: var(--green);
  font-style: normal;
}

.progress-line span {
  color: rgba(215, 220, 226, 0.76);
}

.boot-prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
}

.boot-prompt span {
  flex: 0 0 auto;
  color: rgba(127, 183, 255, 0.88);
}

.boot-prompt code {
  min-width: 0;
  overflow: hidden;
  color: #f1f4f8;
  font: inherit;
  text-overflow: ellipsis;
}

.boot-prompt b {
  width: 8px;
  height: 1.1em;
  background: #f1f4f8;
  animation: cursorBlink 900ms steps(1, end) infinite;
}

.boot-progress {
  position: absolute;
  left: 50%;
  bottom: 4.2vh;
  z-index: 2;
  width: calc(100vw - 56px);
  height: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  transform: translateX(-50%);
}

.boot-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #7fb7ff, #f4f5f7, #65d98f);
  transition: width 220ms ease;
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
  height: 100vh;
  padding: 12px;
  gap: 12px;
  filter: saturate(calc(0.82 + var(--theme-intensity) * 0.22)) brightness(calc(0.9 + var(--theme-intensity) * 0.08));
}

.topbar,
.panel,
.terminal-panel {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(18, 20, 24, 0.92), rgba(7, 8, 10, 0.92));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.065);
  backdrop-filter: blur(22px);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  user-select: none;
}

.identity {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 12px;
}

.product {
  overflow: hidden;
  font-size: 0.95rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subtle,
.soft,
.label,
small {
  color: var(--ink-dim);
}

.top-stats {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--ink);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(292px, 340px) minmax(420px, 1fr) minmax(292px, 340px);
  gap: 12px;
  min-height: 0;
}

.left-rail,
.right-rail {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.left-rail {
  grid-template-rows: auto auto auto minmax(132px, auto);
}

.right-rail {
  grid-template-rows: minmax(0, 1.05fr) minmax(0, 1fr);
}

.panel,
.terminal-panel {
  min-width: 0;
  overflow: hidden;
}

.panel {
  padding: 15px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
  color: var(--ink);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
}

.chip {
  max-width: 155px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink-dim);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sysgrid,
.netgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.sysgrid div,
.netgrid div,
.network-card {
  min-width: 0;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.026));
  padding: 10px;
}

.label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gauge-list {
  display: grid;
  gap: 15px;
}

.gauge-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.76rem;
}

.meter {
  position: relative;
  height: 7px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
}

.meter span,
.battery-body span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #f7f9ff);
  transition: width 260ms ease;
}

.meter.amber span {
  background: linear-gradient(90deg, var(--amber), #fff0c2);
}

.gauge-row small {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.network-card {
  margin-bottom: 10px;
}

.network-card strong {
  color: var(--ink);
  font-size: 1rem;
}

.network-card .soft {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spark {
  display: grid;
  grid-template-columns: repeat(26, minmax(2px, 1fr));
  align-items: end;
  height: 46px;
  margin-top: 12px;
  gap: 3px;
}

.spark span {
  min-height: 3px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, #fff, rgba(127, 183, 255, 0.55));
  opacity: 0.72;
}

.battery-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8px;
  align-items: center;
  gap: 4px;
}

.battery-body {
  height: 34px;
  overflow: hidden;
  border: 1px solid var(--hairline-strong);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  padding: 3px;
}

.battery-body span {
  background: linear-gradient(90deg, var(--green), #eafff0);
}

.battery-cap {
  width: 8px;
  height: 18px;
  border-radius: 0 4px 4px 0;
  background: rgba(255, 255, 255, 0.28);
}

.battery-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  color: var(--ink-dim);
  font-size: 0.78rem;
}

.battery-meta strong {
  font-size: 1rem;
}

.terminal-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #030304;
}

.terminal-head {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
}

.terminal-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.terminal-state {
  color: var(--green);
  font-size: 0.7rem;
  text-transform: none;
}

.terminal-actions {
  justify-content: flex-end;
}

#terminal {
  min-height: 0;
  padding: 10px;
}

.xterm {
  height: 100%;
}

.xterm .xterm-viewport {
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.apps-panel,
.process-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.024));
  padding: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.08);
}

.status-dot.active {
  background: var(--green);
  box-shadow: 0 0 12px rgba(101, 217, 143, 0.48);
}

.status-dot.visible {
  background: var(--blue);
  box-shadow: 0 0 12px rgba(127, 183, 255, 0.42);
}

.row-main {
  min-width: 0;
}

.row-title,
.row-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-title {
  font-size: 0.8rem;
  font-weight: 750;
}

.row-meta {
  margin-top: 3px;
  color: var(--ink-dim);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.67rem;
}

.row-value {
  color: var(--ink-dim);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  white-space: nowrap;
}

.proc-row {
  grid-template-columns: minmax(0, 1fr) 56px;
}

.proc-meter {
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.proc-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), #fff);
}

@keyframes bootSweep {
  0% { transform: translateX(-62%); }
  55% { transform: translateX(62%); }
  100% { transform: translateX(62%); }
}

@keyframes codeFall {
  from { transform: translateY(-36%); }
  to { transform: translateY(12%); }
}

@keyframes splitLeft {
  0% { opacity: 0; transform: translateX(-48px) skewX(-10deg); filter: blur(8px); }
  20% { opacity: 1; transform: translateX(-22px) skewX(-8deg); filter: blur(0); }
  48% { transform: translateX(-74px) skewX(-13deg); }
  72% { transform: translateX(-10px) skewX(-3deg); }
  100% { transform: translateX(0) skewX(0); }
}

@keyframes splitRight {
  0% { opacity: 0; transform: translateX(48px) skewX(-10deg); filter: blur(8px); }
  20% { opacity: 1; transform: translateX(22px) skewX(-8deg); filter: blur(0); }
  48% { transform: translateX(74px) skewX(-13deg); }
  72% { transform: translateX(10px) skewX(-3deg); }
  100% { transform: translateX(0) skewX(0); }
}

@keyframes cutLine {
  0% { opacity: 0; transform: translate(-50%, -50%) scaleX(0); }
  18% { opacity: 1; transform: translate(-50%, -50%) scaleX(0.42); }
  46% { opacity: 1; transform: translate(-50%, -50%) scaleX(1); }
  78% { opacity: 0.74; transform: translate(-50%, -50%) scaleX(0.72); }
  100% { opacity: 0; transform: translate(-50%, -50%) scaleX(0); }
}

@keyframes coreLock {
  0%,
  62% { opacity: 0; }
  86% { opacity: 1; }
  100% { opacity: 0.42; }
}

@keyframes codeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scanLines {
  to { transform: translateY(7px); }
}

@media (max-width: 1160px) {
  body {
    overflow: auto;
  }

  .shell {
    height: auto;
    min-height: 100vh;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .left-rail,
  .right-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
  }

  .terminal-panel {
    min-height: 580px;
  }
}

@media (max-width: 740px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .top-stats {
    display: none;
  }

  .left-rail,
  .right-rail,
  .sysgrid,
  .netgrid {
    grid-template-columns: 1fr;
  }

  .identity {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .terminal-panel {
    min-height: 530px;
  }

  .boot-terminal {
    width: 100vw;
    height: 100vh;
  }

  .boot-terminal-body {
    font-size: 0.74rem;
  }

}

/* eDEX-style FH-UI cockpit */
body {
  background:
    radial-gradient(circle at center, rgba(170, 207, 211, 0.025), transparent 34%),
    radial-gradient(rgba(170, 207, 211, 0.18) 1px, transparent 1px),
    #000;
  background-size: auto, 26px 26px, auto;
  color: #aec6c9;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

.edex-shell {
  position: relative;
  z-index: 1;
  display: block;
  height: 100vh;
  padding: 8px;
  overflow: hidden;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  text-transform: uppercase;
}

.edex-shell::before {
  position: absolute;
  inset: 8px;
  z-index: -1;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(174, 198, 201, 0.11);
  background:
    linear-gradient(90deg, rgba(174, 198, 201, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(174, 198, 201, 0.065) 1px, transparent 1px);
  background-size: 52px 52px;
  opacity: 0.36;
}

.edex-grid {
  display: grid;
  grid-template-columns: minmax(276px, 318px) minmax(520px, 1fr) minmax(276px, 318px);
  grid-template-rows: minmax(0, 1fr) 252px;
  height: calc(100vh - 16px);
  gap: 8px;
  min-width: 0;
  min-height: 0;
}

.edex-panel,
.edex-terminal {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(174, 198, 201, 0.38);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(8, 12, 14, 0.92), rgba(1, 3, 5, 0.96)),
    radial-gradient(rgba(174, 198, 201, 0.16) 1px, transparent 1px);
  background-size: auto, 25px 25px;
  box-shadow:
    inset 0 0 0 1px rgba(174, 198, 201, 0.06),
    inset 0 0 42px rgba(174, 198, 201, 0.025),
    0 0 0 1px rgba(0, 0, 0, 0.72);
}

.edex-panel::after,
.edex-terminal::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: repeating-linear-gradient(180deg, rgba(174, 198, 201, 0.025), rgba(174, 198, 201, 0.025) 1px, transparent 1px, transparent 5px);
  opacity: 0.52;
}

.edex-strip {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 24px;
  border-bottom: 1px solid rgba(174, 198, 201, 0.3);
  padding: 0 9px;
  color: rgba(174, 198, 201, 0.76);
  font-size: 0.68rem;
  font-weight: 800;
}

.edex-strip strong {
  display: inline;
  color: #c4dcdf;
  font: inherit;
}

.system-rail,
.network-rail {
  display: grid;
  grid-template-rows: 24px auto auto auto minmax(0, 1fr);
  gap: 7px;
  padding: 0 8px 8px;
}

.system-rail {
  grid-column: 1;
  grid-row: 1;
  grid-template-rows: 24px auto auto auto auto minmax(0, 1fr);
}

.edex-terminal {
  grid-column: 2;
  grid-row: 1;
}

.network-rail {
  grid-column: 3;
  grid-row: 1;
}

.edex-section {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  border-top: 1px solid rgba(174, 198, 201, 0.26);
  border-bottom: 1px solid rgba(174, 198, 201, 0.13);
  padding: 7px 0;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: #c2dadd;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.1;
}

.section-title small,
.edex-strip span,
.system-line,
.endpoint-line,
.micro-copy {
  color: rgba(174, 198, 201, 0.56);
}

.split-title small {
  overflow: hidden;
  max-width: 132px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-module {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid rgba(174, 198, 201, 0.3);
  padding: 16px 0 12px;
}

.edex-clock {
  color: #d7eef1;
  font-size: 3rem;
  font-weight: 500;
  line-height: 1;
  text-shadow: 0 0 18px rgba(174, 198, 201, 0.17);
  white-space: nowrap;
}

.date-row {
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
  color: #a9c4c8;
  font-size: 0.9rem;
  font-weight: 800;
}

.date-row span:last-child {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-line {
  overflow: hidden;
  margin-top: 6px;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dense-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 10px;
  row-gap: 6px;
}

.dense-grid div {
  min-width: 0;
}

.dense-grid span,
.readout-row span,
.mini-grid span,
.state-grid span,
.traffic-line span,
.radio-grid span {
  display: block;
  color: rgba(174, 198, 201, 0.5);
  font-size: 0.66rem;
  font-weight: 800;
}

.dense-grid b,
.readout-row b,
.state-grid b,
.traffic-line b,
.radio-grid b,
.mini-grid b {
  display: block;
  overflow: hidden;
  color: rgba(205, 228, 231, 0.88);
  font-size: 0.76rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.readout-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
}

.readout-row strong {
  display: block;
  color: #d2e8eb;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.edex-meter {
  height: 8px;
  margin: 6px 0 8px;
  border: 1px solid rgba(174, 198, 201, 0.28);
  background:
    linear-gradient(90deg, rgba(174, 198, 201, 0.08) 1px, transparent 1px),
    rgba(174, 198, 201, 0.035);
  background-size: 12px 100%;
}

.edex-meter span,
.edex-shell .battery-body span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #8ca9ad, #d8eef1);
  transition: width 240ms ease;
}

.edex-meter.pale span {
  background: linear-gradient(90deg, #71868a, #c2d6d9);
}

.mini-grid,
.micro-copy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  font-size: 0.68rem;
}

.micro-copy {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 6px;
}

.mini-grid span,
.micro-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edex-shell .battery-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.edex-shell .battery-body {
  height: 16px;
  overflow: hidden;
  border: 1px solid rgba(174, 198, 201, 0.32);
  border-radius: 0;
  background: rgba(174, 198, 201, 0.045);
  padding: 2px;
}

.edex-shell .battery-line > span,
.edex-shell .battery-line > strong {
  overflow: hidden;
  color: #c7dee1;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-module {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.edex-terminal {
  display: grid;
  grid-template-rows: 36px minmax(0, 1fr) 25px;
  background: #010305;
}

.terminal-tabs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(138px, 1.2fr) repeat(4, minmax(76px, 1fr)) auto;
  align-items: stretch;
  min-width: 0;
  border-bottom: 1px solid rgba(174, 198, 201, 0.38);
}

.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border-right: 1px solid rgba(174, 198, 201, 0.38);
  padding: 0 12px;
  color: rgba(174, 198, 201, 0.72);
  font-size: 0.84rem;
  font-weight: 900;
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 100%, 20px 100%);
}

.tab.active {
  justify-content: space-between;
  background: #b9d1d4;
  color: #030506;
}

.tab small {
  overflow: hidden;
  color: inherit;
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
}

.terminal-actions button {
  width: 42px;
  min-width: 42px;
  height: 26px;
  border: 1px solid rgba(174, 198, 201, 0.36);
  border-radius: 0;
  background: rgba(174, 198, 201, 0.045);
  color: #c9e2e5;
  font-size: 0.66rem;
  font-weight: 900;
}

.terminal-actions button:hover {
  background: rgba(174, 198, 201, 0.13);
}

.terminal-frame {
  position: relative;
  z-index: 1;
  min-height: 0;
  border-left: 1px solid rgba(174, 198, 201, 0.2);
  border-right: 1px solid rgba(174, 198, 201, 0.2);
  background: #010305;
}

.edex-shell #terminal {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 8px;
}

.edex-shell .xterm {
  height: 100%;
}

.terminal-statusbar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(174, 198, 201, 0.22);
  padding: 0 10px;
  color: rgba(174, 198, 201, 0.68);
  font-size: 0.66rem;
}

.terminal-statusbar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-grid,
.radio-grid {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 5px 10px;
}

.state-grid b:first-of-type {
  color: #d6eff2;
}

.world-module {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.endpoint-line {
  overflow: hidden;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.globe {
  position: relative;
  width: 190px;
  height: 190px;
  margin: 6px auto 0;
  overflow: hidden;
  border-radius: 50%;
  background:
    radial-gradient(circle at 45% 42%, rgba(196, 220, 223, 0.3), rgba(103, 126, 130, 0.08) 34%, transparent 68%),
    radial-gradient(circle, rgba(174, 198, 201, 0.08), transparent 62%);
  box-shadow: inset -18px -24px 42px rgba(0, 0, 0, 0.86), 0 0 22px rgba(174, 198, 201, 0.06);
  transform: rotate(-12deg);
}

.globe::before {
  position: absolute;
  inset: 14px;
  content: "";
  background-image: radial-gradient(rgba(204, 228, 231, 0.72) 1.2px, transparent 1.4px);
  background-size: 7px 7px;
  clip-path: polygon(12% 32%, 28% 18%, 46% 20%, 57% 32%, 68% 26%, 82% 38%, 78% 56%, 61% 60%, 52% 78%, 34% 72%, 20% 60%);
  opacity: 0.66;
}

.globe::after {
  position: absolute;
  inset: 30px 20px 36px 48px;
  content: "";
  background-image: radial-gradient(rgba(204, 228, 231, 0.58) 1.1px, transparent 1.3px);
  background-size: 6px 6px;
  clip-path: polygon(0 8%, 26% 0, 46% 22%, 38% 44%, 62% 56%, 52% 100%, 22% 78%, 8% 52%);
  opacity: 0.58;
}

.globe span {
  position: absolute;
  inset: 13px;
  border: 1px solid rgba(174, 198, 201, 0.12);
  border-radius: 50%;
}

.globe span:nth-child(2) { inset: 34px; opacity: 0.65; }
.globe span:nth-child(3) { inset: 54px; opacity: 0.42; }
.globe span:nth-child(4) { transform: scaleX(0.42); }
.globe span:nth-child(5) { transform: rotate(90deg) scaleX(0.42); }
.globe span:nth-child(6) { border-color: rgba(174, 198, 201, 0.06); transform: rotate(34deg) scaleX(0.58); }

.network-metrics {
  display: grid;
  grid-template-rows: auto auto 150px auto;
}

.traffic-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.graph-spark {
  display: grid;
  grid-template-columns: repeat(26, minmax(2px, 1fr));
  align-items: end;
  height: 150px;
  margin: 8px 0;
  gap: 2px;
  border: 1px solid rgba(174, 198, 201, 0.2);
  background:
    linear-gradient(90deg, rgba(174, 198, 201, 0.16) 1px, transparent 1px),
    linear-gradient(180deg, rgba(174, 198, 201, 0.16) 1px, transparent 1px),
    rgba(0, 0, 0, 0.16);
  background-size: 52px 36px;
  padding: 8px;
}

.graph-spark span {
  display: block;
  min-height: 3px;
  border-radius: 0;
  background: #b9d1d4;
  opacity: 0.76;
}

.filesystem-panel {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-rows: 24px minmax(0, 1fr);
  padding: 0 8px 8px;
}

.filesystem-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  gap: 9px;
  padding-top: 10px;
}

.fs-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: start;
  gap: 10px 9px;
  min-width: 0;
  max-height: 86px;
  overflow: hidden;
}

.fs-item {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  color: rgba(190, 214, 217, 0.92);
  font-size: 0.65rem;
  text-align: center;
}

.fs-item span {
  overflow: hidden;
  width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fs-item i {
  position: relative;
  display: block;
  width: 43px;
  height: 32px;
  border: 1px solid rgba(174, 198, 201, 0.34);
  background: rgba(174, 198, 201, 0.87);
}

.folder-icon i {
  border-radius: 2px;
}

.folder-icon i::before {
  position: absolute;
  left: 4px;
  top: -6px;
  width: 17px;
  height: 7px;
  border-radius: 2px 2px 0 0;
  background: rgba(174, 198, 201, 0.82);
  content: "";
}

.file-icon i {
  width: 28px;
  border-radius: 1px;
  background: rgba(174, 198, 201, 0.82);
}

.file-icon i::after {
  position: absolute;
  top: 0;
  right: 0;
  border-top: 9px solid #020506;
  border-left: 9px solid transparent;
  content: "";
}

.grid-icon i {
  width: 35px;
  height: 35px;
  border: 0;
  background:
    linear-gradient(90deg, #b9d1d4 8px, transparent 8px 13px, #b9d1d4 13px 21px, transparent 21px 26px, #b9d1d4 26px),
    linear-gradient(#b9d1d4 8px, transparent 8px 13px, #b9d1d4 13px 21px, transparent 21px 26px, #b9d1d4 26px);
  background-blend-mode: multiply;
}

.link-icon i {
  width: 41px;
  height: 22px;
  border: 5px solid rgba(174, 198, 201, 0.85);
  border-left-color: transparent;
  border-right-color: transparent;
  border-radius: 999px;
  background: transparent;
}

.apps-module {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.edex-shell .list {
  display: grid;
  gap: 0;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
  scrollbar-color: rgba(174, 198, 201, 0.35) transparent;
}

.edex-shell .list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  border: 0;
  border-bottom: 1px dotted rgba(174, 198, 201, 0.22);
  border-radius: 0;
  background: transparent;
  padding: 3px 0;
}

.edex-shell .status-dot {
  width: 6px;
  height: 6px;
  border: 1px solid rgba(174, 198, 201, 0.54);
  border-radius: 0;
  background: rgba(174, 198, 201, 0.28);
  box-shadow: none;
}

.edex-shell .status-dot.active {
  background: #d2e8eb;
  box-shadow: 0 0 8px rgba(210, 232, 235, 0.36);
}

.edex-shell .status-dot.visible {
  background: #97b2b6;
  box-shadow: 0 0 8px rgba(151, 178, 182, 0.3);
}

.edex-shell .row-title,
.edex-shell .row-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edex-shell .row-title {
  color: rgba(211, 232, 235, 0.9);
  font-size: 0.68rem;
  font-weight: 800;
}

.edex-shell .row-meta {
  margin-top: 1px;
  color: rgba(174, 198, 201, 0.47);
  font-size: 0.58rem;
}

.edex-shell .row-value {
  color: rgba(190, 214, 217, 0.68);
  font-size: 0.62rem;
}

.edex-shell .proc-row {
  grid-template-columns: minmax(0, 1fr) 48px;
}

.edex-shell .proc-meter {
  display: none;
}

.keyboard-panel {
  grid-column: 2 / 4;
  grid-row: 2;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 12px 16px;
}

.keyboard-row {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  gap: 9px;
}

.key {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 34px;
  border: 1px solid rgba(174, 198, 201, 0.25);
  color: rgba(201, 224, 227, 0.9);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
}

.key.wide { min-width: 82px; }
.key.xl { min-width: 108px; }
.key.space { flex: 1 1 320px; }
.key.arrow { min-width: 34px; }
.key.ghost {
  border-color: transparent;
  opacity: 0;
}

.keyboard-row.top-row .key {
  height: 28px;
  color: rgba(174, 198, 201, 0.82);
  font-size: 0.78rem;
}

.bottom-row {
  margin-top: 2px;
}

@keyframes terminalLineIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cursorBlink {
  0%,
  49% { opacity: 1; }
  50%,
  100% { opacity: 0; }
}

@media (max-height: 980px) {
  .edex-grid {
    grid-template-rows: minmax(0, 1fr) 212px;
  }

  .edex-clock {
    font-size: 2.45rem;
  }

  .globe {
    width: 144px;
    height: 144px;
  }

  .network-metrics {
    grid-template-rows: auto auto 104px auto;
  }

  .graph-spark {
    height: 104px;
  }

  .key {
    height: 28px;
    font-size: 0.78rem;
  }
}

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  .edex-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .edex-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto 620px auto auto auto;
    height: auto;
    min-height: calc(100vh - 12px);
  }

  .system-rail,
  .edex-terminal,
  .network-rail,
  .filesystem-panel,
  .keyboard-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .system-rail,
  .network-rail {
    min-height: 520px;
  }

  .filesystem-panel {
    min-height: 260px;
  }

  .keyboard-panel {
    min-height: 250px;
  }
}

@media (max-width: 740px) {
  .edex-shell {
    padding: 6px;
  }

  .edex-clock {
    font-size: 2.2rem;
  }

  .dense-grid,
  .filesystem-body {
    grid-template-columns: 1fr;
  }

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

  .keyboard-row {
    gap: 5px;
  }

  .key {
    min-width: 28px;
    height: 28px;
    font-size: 0.68rem;
  }

  .key.wide { min-width: 54px; }
  .key.xl { min-width: 66px; }
  .key.space { flex-basis: 120px; }
}

/* Functional desktop surface: real filesystem and live mechanical keyboard */
.edex-grid {
  grid-template-columns: minmax(276px, 318px) minmax(480px, 1fr) minmax(420px, 500px);
  grid-template-rows: minmax(0, 1fr) 300px;
}

.filesystem-panel {
  grid-column: 1 / 3;
  grid-row: 2;
  grid-template-rows: 24px 35px minmax(0, 1fr) 28px;
  padding: 0 8px 8px;
  background:
    linear-gradient(180deg, rgba(8, 10, 11, 0.97), rgba(2, 3, 4, 0.98)),
    radial-gradient(rgba(174, 198, 201, 0.1) 1px, transparent 1px);
  background-size: auto, 28px 28px;
}

.keyboard-panel {
  grid-column: 3;
  grid-row: 2;
  display: grid;
  grid-template-rows: 24px 38px repeat(5, minmax(0, 1fr));
  align-content: stretch;
  gap: 8px;
  padding: 0 12px 12px;
  border-color: rgba(99, 112, 116, 0.72);
  background:
    linear-gradient(180deg, #090b0d, #010102 72%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025), transparent 42%, rgba(255, 255, 255, 0.02));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -32px 64px rgba(0, 0, 0, 0.72),
    0 18px 48px rgba(0, 0, 0, 0.55);
}

.fs-toolbar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, auto) minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid rgba(174, 198, 201, 0.18);
  padding: 5px 0;
}

.fs-toolbar button,
.fs-row,
.keyboard-panel button {
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

.fs-toolbar button {
  min-width: 46px;
  height: 24px;
  border: 1px solid rgba(174, 198, 201, 0.28);
  border-radius: 3px;
  background: rgba(10, 13, 15, 0.9);
  color: rgba(210, 232, 235, 0.86);
  font-size: 0.62rem;
  font-weight: 900;
}

.fs-toolbar button:hover {
  border-color: rgba(210, 232, 235, 0.6);
  background: rgba(31, 38, 41, 0.92);
}

.fs-toolbar span {
  overflow: hidden;
  color: rgba(174, 198, 201, 0.58);
  font-size: 0.64rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filesystem-body.real-filesystem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 290px);
  min-height: 0;
  gap: 12px;
  padding-top: 8px;
}

.fs-browser,
.apps-module {
  min-width: 0;
  min-height: 0;
}

.fs-list {
  display: grid;
  align-content: start;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  border: 1px solid rgba(174, 198, 201, 0.16);
  background:
    linear-gradient(90deg, rgba(174, 198, 201, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(174, 198, 201, 0.045) 1px, transparent 1px),
    rgba(0, 0, 0, 0.22);
  background-size: 44px 44px;
  scrollbar-color: rgba(174, 198, 201, 0.38) transparent;
}

.fs-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 72px 76px 112px;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 28px;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid rgba(174, 198, 201, 0.11);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.04);
  color: rgba(217, 236, 239, 0.9);
  cursor: default;
  font-size: 0.68rem;
  font-weight: 800;
  text-align: left;
}

.fs-row:hover,
.fs-row.is-selected {
  background: rgba(174, 198, 201, 0.115);
}

.fs-row.is-selected {
  box-shadow: inset 3px 0 0 #d7eef1;
}

.fs-row i {
  position: relative;
  display: block;
  width: 15px;
  height: 18px;
  border: 1px solid rgba(205, 228, 231, 0.58);
  background: rgba(205, 228, 231, 0.2);
}

.fs-row.kind-directory i,
.fs-row.kind-app i {
  width: 19px;
  height: 14px;
  border-radius: 2px;
  background: rgba(205, 228, 231, 0.72);
}

.fs-row.kind-directory i::before,
.fs-row.kind-app i::before {
  position: absolute;
  left: 2px;
  top: -5px;
  width: 9px;
  height: 5px;
  border-radius: 2px 2px 0 0;
  background: rgba(205, 228, 231, 0.62);
  content: "";
}

.fs-row.kind-code i {
  border-color: rgba(127, 183, 255, 0.62);
  background: rgba(127, 183, 255, 0.16);
}

.fs-row.kind-image i,
.fs-row.kind-video i {
  border-color: rgba(101, 217, 143, 0.58);
  background: rgba(101, 217, 143, 0.14);
}

.fs-row span,
.fs-row small,
.fs-row b,
.fs-row em {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fs-row small,
.fs-row b,
.fs-row em {
  color: rgba(174, 198, 201, 0.58);
  font-size: 0.6rem;
  font-style: normal;
  font-weight: 700;
}

.fs-detail {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(174, 198, 201, 0.18);
  color: rgba(174, 198, 201, 0.62);
  font-size: 0.66rem;
}

.fs-detail span,
.fs-detail strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fs-detail strong {
  color: rgba(210, 232, 235, 0.84);
  font: inherit;
  font-weight: 900;
}

.keyboard-live {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(83, 92, 96, 0.78);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(13, 15, 17, 0.95), rgba(4, 5, 6, 0.98)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03), transparent);
  padding: 0 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), inset 0 -10px 16px rgba(0, 0, 0, 0.48);
}

.keyboard-live span {
  min-width: 72px;
  color: #e7f4f6;
  font-size: 0.78rem;
  font-weight: 950;
}

.keyboard-live strong {
  overflow: hidden;
  color: rgba(174, 198, 201, 0.74);
  font-size: 0.66rem;
  font-weight: 800;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keyboard-panel .keyboard-row {
  display: flex;
  align-items: stretch;
  gap: 5px;
  min-width: 0;
}

.keyboard-panel .key {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: auto;
  min-height: 30px;
  border: 1px solid #30363a;
  border-radius: 4px;
  background:
    linear-gradient(180deg, #202326 0%, #111315 54%, #050607 100%);
  color: rgba(226, 238, 240, 0.88);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 1px 1px #000;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -5px 0 rgba(0, 0, 0, 0.58),
    0 3px 0 #000,
    0 8px 14px rgba(0, 0, 0, 0.42);
  transition: transform 70ms ease, box-shadow 70ms ease, border-color 70ms ease, color 70ms ease;
}

.keyboard-panel .key::after {
  position: absolute;
  inset: 4px 5px auto;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  content: "";
}

.keyboard-panel .key.wide { flex-grow: 1.7; }
.keyboard-panel .key.xl { flex-grow: 2.25; }
.keyboard-panel .key.space { flex-grow: 6.8; }
.keyboard-panel .key.arrow { flex-grow: 1.15; font-size: 0.56rem; }

.keyboard-panel .key.is-pressed {
  border-color: rgba(215, 238, 241, 0.82);
  color: #ffffff;
  transform: translateY(3px);
  background: linear-gradient(180deg, #3b4246, #171b1e 54%, #060708);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -2px 0 rgba(0, 0, 0, 0.62),
    0 0 18px rgba(174, 198, 201, 0.22);
}

.keyboard-panel .key.ghost {
  visibility: hidden;
}

@media (max-height: 980px) {
  .edex-grid {
    grid-template-rows: minmax(0, 1fr) 282px;
  }

  .keyboard-panel {
    grid-template-rows: 24px 34px repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .keyboard-panel .key {
    min-height: 27px;
    font-size: 0.66rem;
  }
}

@media (max-width: 1280px) {
  .edex-grid {
    grid-template-columns: minmax(260px, 300px) minmax(430px, 1fr) minmax(370px, 440px);
  }

  .filesystem-body.real-filesystem {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  }
}

@media (max-width: 1180px) {
  .filesystem-panel,
  .keyboard-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .keyboard-panel {
    min-height: 340px;
  }
}

@media (max-width: 740px) {
  .filesystem-body.real-filesystem {
    grid-template-columns: 1fr;
  }

  .fs-row {
    grid-template-columns: 22px minmax(0, 1fr) 58px 62px;
  }

  .fs-row em {
    display: none;
  }
}

/* Photo-matched eDEX keyboard: large, flat, cyan-outline layout */
.edex-grid {
  grid-template-columns: minmax(276px, 318px) minmax(520px, 1fr) minmax(276px, 318px);
  grid-template-rows: minmax(0, 1fr) 252px;
}

.filesystem-panel {
  grid-column: 1;
  grid-row: 2;
  grid-template-rows: 24px 35px minmax(0, 1fr) 28px;
}

.filesystem-body.real-filesystem {
  grid-template-columns: 1fr;
}

.filesystem-panel .apps-module {
  display: none;
}

.fs-row {
  grid-template-columns: 22px minmax(0, 1fr) 72px;
}

.fs-row b,
.fs-row em {
  display: none;
}

.keyboard-panel {
  grid-column: 2 / 4;
  grid-row: 2;
  grid-template-rows: 24px 30px repeat(5, minmax(28px, 1fr));
  gap: 8px;
  padding: 0 14px 12px;
  border-color: rgba(174, 198, 201, 0.36);
  background:
    radial-gradient(rgba(174, 198, 201, 0.14) 1px, transparent 1px),
    linear-gradient(180deg, rgba(3, 5, 6, 0.98), rgba(0, 0, 0, 0.99));
  background-size: 25px 25px, auto;
  box-shadow:
    inset 0 0 0 1px rgba(174, 198, 201, 0.055),
    inset 0 0 38px rgba(174, 198, 201, 0.018);
}

.keyboard-live {
  border: 0;
  border-bottom: 1px solid rgba(174, 198, 201, 0.22);
  border-radius: 0;
  background: transparent;
  padding: 0 4px;
  box-shadow: none;
}

.keyboard-live span {
  color: #c8e2e5;
  font-size: 0.72rem;
}

.keyboard-live strong {
  color: rgba(174, 198, 201, 0.58);
  font-size: 0.62rem;
}

.keyboard-panel .keyboard-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.keyboard-panel .keyboard-row:nth-of-type(4) {
  padding-left: 20px;
}

.keyboard-panel .keyboard-row:nth-of-type(5) {
  padding-left: 36px;
}

.keyboard-panel .bottom-row {
  padding-left: 12px;
}

.keyboard-panel .key {
  flex: 1 1 0;
  min-width: 0;
  min-height: 32px;
  border: 1px solid rgba(174, 198, 201, 0.32);
  border-radius: 3px;
  background: rgba(4, 7, 8, 0.36);
  color: #bcd7da;
  font-size: 1rem;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(174, 198, 201, 0.18);
  box-shadow: none;
  transform: none;
}

.keyboard-panel .key::after {
  display: none;
}

.keyboard-panel .key.wide {
  flex-grow: 1.9;
}

.keyboard-panel .key.xl {
  flex-grow: 2.65;
}

.keyboard-panel .key.space {
  flex-grow: 7.8;
  border-color: rgba(174, 198, 201, 0.28);
}

.keyboard-panel .key.arrow {
  flex-grow: 0.82;
  font-size: 1.15rem;
}

.keyboard-panel .top-row .key {
  min-height: 28px;
  color: rgba(174, 198, 201, 0.86);
  font-size: 0.78rem;
}

.keyboard-panel .key.is-pressed {
  border-color: #d7eef1;
  background: rgba(174, 198, 201, 0.92);
  color: #061012;
  text-shadow: none;
  transform: none;
  box-shadow:
    0 0 16px rgba(174, 198, 201, 0.32),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.keyboard-panel .key.ghost {
  visibility: hidden;
}

@media (max-height: 980px) {
  .edex-grid {
    grid-template-rows: minmax(0, 1fr) 242px;
  }

  .keyboard-panel {
    grid-template-rows: 24px 26px repeat(5, minmax(24px, 1fr));
    gap: 7px;
  }

  .keyboard-panel .key {
    min-height: 27px;
    font-size: 0.9rem;
  }

  .keyboard-panel .top-row .key {
    min-height: 24px;
    font-size: 0.72rem;
  }
}

@media (max-width: 1180px) {
  .filesystem-panel,
  .keyboard-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .keyboard-panel {
    min-height: 320px;
  }
}

/* Closer eDEX keyboard copy: most keys are floating legends, only structural keys are framed. */
.edex-grid {
  grid-template-rows: minmax(0, 1fr) 310px;
}

.keyboard-panel {
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: clamp(7px, 1vh, 11px);
  padding: 26px 16px 18px;
  overflow: hidden;
  opacity: 0;
  transform: perspective(900px) rotateX(10deg) translateY(42px) scale(0.985);
  transform-origin: bottom center;
}

.keyboard-panel > .edex-strip,
.keyboard-panel .keyboard-live {
  display: none;
}

.keyboard-panel::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(174, 198, 201, 0.28), transparent),
    linear-gradient(180deg, rgba(174, 198, 201, 0.08), transparent 34%, rgba(174, 198, 201, 0.05));
  content: "";
  opacity: 0;
  transform: translateY(-100%);
}

.keyboard-panel.is-deployed {
  animation: keyboardDeckDeploy 980ms cubic-bezier(0.18, 0.88, 0.2, 1) forwards;
}

.keyboard-panel.is-deployed::before {
  animation: keyboardScanDeploy 1080ms cubic-bezier(0.22, 0.9, 0.22, 1) 120ms both;
}

.keyboard-panel .keyboard-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 0;
  gap: clamp(7px, 0.85vw, 12px);
  opacity: 0;
  transform: translateX(-36px);
}

.keyboard-panel .keyboard-row:nth-of-type(3),
.keyboard-panel .keyboard-row:nth-of-type(5) {
  --row-offset: 36px;
  transform: translateX(36px);
}

.keyboard-panel.is-deployed .keyboard-row {
  animation: keyboardRowLock 620ms cubic-bezier(0.2, 0.9, 0.18, 1) forwards;
}

.keyboard-panel.is-deployed .keyboard-row:nth-of-type(3) { animation-delay: 90ms; }
.keyboard-panel.is-deployed .keyboard-row:nth-of-type(4) { animation-delay: 160ms; }
.keyboard-panel.is-deployed .keyboard-row:nth-of-type(5) { animation-delay: 230ms; }
.keyboard-panel.is-deployed .keyboard-row:nth-of-type(6) { animation-delay: 320ms; }
.keyboard-panel.is-deployed .keyboard-row:nth-of-type(7) { animation-delay: 420ms; }

.keyboard-panel .keyboard-row:nth-of-type(4) {
  padding-left: 34px;
}

.keyboard-panel .keyboard-row:nth-of-type(5) {
  padding-left: 18px;
}

.keyboard-panel .bottom-row {
  padding-left: 38px;
  align-items: end;
}

.keyboard-panel .key {
  display: grid;
  place-items: center;
  flex: 1 1 0;
  min-width: 0;
  min-height: clamp(30px, 4.4vh, 44px);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #bdd9dc;
  font-size: clamp(1.05rem, 1.45vw, 1.62rem);
  font-weight: 900;
  line-height: 0.95;
  text-shadow: 0 0 9px rgba(174, 198, 201, 0.24);
  box-shadow: none;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
}

.keyboard-panel .key.dual {
  grid-template-rows: auto auto;
  gap: 0;
}

.keyboard-panel .key.dual > span {
  font-size: 1.44rem;
}

.keyboard-panel .key small {
  color: #bdd9dc;
  font-size: 1.02rem;
  font-weight: 900;
}

.keyboard-panel .top-row .key {
  font-size: 1.36rem;
}

.keyboard-panel .key.wide {
  flex-grow: 1.8;
}

.keyboard-panel .key.xl {
  flex-grow: 2.7;
}

.keyboard-panel .key.space {
  flex-grow: 7.9;
  min-height: clamp(38px, 5.8vh, 52px);
  border: 1px solid rgba(174, 198, 201, 0.42);
  border-radius: 4px;
}

.keyboard-panel .key.filled {
  min-height: clamp(42px, 6vh, 58px);
  border-radius: 8px;
  background: rgba(174, 210, 214, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.keyboard-panel .key.enter-key {
  align-self: center;
  min-height: clamp(40px, 6vh, 58px);
  border: 1px solid rgba(174, 198, 201, 0.45);
  border-radius: 6px;
}

.keyboard-panel .key.enter-key::before {
  display: none;
  content: none;
}

.keyboard-panel .key.arrow {
  flex-grow: 0.72;
  min-height: clamp(34px, 5vh, 46px);
  border: 1px solid rgba(174, 198, 201, 0.45);
  font-size: clamp(1.1rem, 1.3vw, 1.5rem);
}

.keyboard-panel .key.is-pressed {
  border-color: #d7eef1;
  background: rgba(174, 198, 201, 0.9);
  color: #061012;
  text-shadow: none;
  box-shadow: 0 0 18px rgba(174, 198, 201, 0.34);
}

.keyboard-panel.is-deployed .key {
  animation: keyGlyphLock 440ms cubic-bezier(0.16, 0.96, 0.22, 1) forwards;
}

.keyboard-panel.is-deployed .key:nth-child(2n) { animation-delay: 90ms; }
.keyboard-panel.is-deployed .key:nth-child(3n) { animation-delay: 140ms; }
.keyboard-panel.is-deployed .key:nth-child(5n) { animation-delay: 190ms; }
.keyboard-panel.is-deployed .key.enter-key,
.keyboard-panel.is-deployed .key.space,
.keyboard-panel.is-deployed .key.filled,
.keyboard-panel.is-deployed .key.arrow {
  animation: keyModuleLock 560ms cubic-bezier(0.16, 0.96, 0.22, 1) 360ms forwards;
}

.keyboard-panel .key.ghost {
  visibility: hidden;
}

@media (max-height: 980px) {
  .edex-grid {
    grid-template-rows: minmax(0, 1fr) 292px;
  }

  .keyboard-panel {
    gap: 8px;
    padding-top: 20px;
    padding-bottom: 14px;
  }

  .keyboard-panel .key {
    min-height: 34px;
    font-size: 1.36rem;
  }

  .keyboard-panel .key.dual > span {
    font-size: 1.22rem;
  }

  .keyboard-panel .key small {
    font-size: 0.86rem;
  }

  .keyboard-panel .key.space {
    min-height: 42px;
  }

  .keyboard-panel .key.filled {
    min-height: 48px;
  }

  .keyboard-panel .key.enter-key {
    min-height: 46px;
  }
}

@keyframes keyboardDeckDeploy {
  0% {
    opacity: 0;
    transform: perspective(900px) rotateX(14deg) translateY(54px) scale(0.965);
    filter: blur(2px);
  }
  52% {
    opacity: 1;
    transform: perspective(900px) rotateX(-2deg) translateY(-6px) scale(1.006);
    filter: blur(0);
  }
  76% {
    transform: perspective(900px) rotateX(1deg) translateY(2px) scale(0.998);
  }
  100% {
    opacity: 1;
    transform: perspective(900px) rotateX(0) translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes keyboardScanDeploy {
  0% {
    opacity: 0;
    transform: translateY(-100%);
  }
  18% {
    opacity: 0.86;
  }
  64% {
    opacity: 0.46;
  }
  100% {
    opacity: 0;
    transform: translateY(110%);
  }
}

@keyframes keyboardRowLock {
  0% {
    opacity: 0;
    transform: translateX(var(--row-offset, -36px)) skewX(-7deg);
  }
  72% {
    opacity: 1;
    transform: translateX(4px) skewX(1deg);
  }
  100% {
    opacity: 1;
    transform: translateX(0) skewX(0);
  }
}

@keyframes keyGlyphLock {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes keyModuleLock {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.92);
    filter: blur(2px);
  }
  62% {
    opacity: 1;
    transform: translateY(-3px) scale(1.025);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Photo-matched right rail: network status, dotted world view, and eDEX traffic graph. */
.network-rail {
  grid-template-rows: 24px auto minmax(260px, 1fr) minmax(210px, 0.72fr);
  gap: 8px;
  padding: 0 9px 8px;
}

.network-status {
  padding: 9px 0 10px;
}

.network-status .section-title {
  margin-bottom: 8px;
  padding: 0 4px;
  font-size: clamp(1rem, 1.35vw, 1.22rem);
  letter-spacing: 0;
}

.network-status .section-title small,
.network-status .section-title small b {
  color: rgba(174, 198, 201, 0.56);
  font-size: clamp(0.66rem, 0.78vw, 0.78rem);
  font-weight: 800;
}

.network-status-grid {
  grid-template-columns: 0.78fr minmax(0, 1.65fr) 0.62fr;
  gap: 2px 14px;
  padding: 0 4px;
}

.network-status-grid span,
.network-status-grid b {
  min-width: 0;
  font-family: var(--mono);
  letter-spacing: 0;
  text-transform: uppercase;
}

.network-status-grid span {
  color: rgba(174, 198, 201, 0.46);
  font-size: clamp(0.9rem, 1.16vw, 1.08rem);
  font-weight: 900;
}

.network-status-grid b {
  color: #c8e7ea;
  font-size: clamp(0.9rem, 1.08vw, 1.06rem);
  font-weight: 800;
  line-height: 1.05;
  text-shadow: 0 0 12px rgba(174, 198, 201, 0.14);
}

.network-status-grid span:nth-of-type(4),
.network-status-grid b#wifiSsid {
  display: none;
}

.world-module {
  grid-template-rows: auto auto minmax(0, 1fr);
  padding-top: 10px;
}

.world-module .section-title,
.network-metrics .section-title {
  padding: 0 4px;
  color: #c7e0e3;
  font-size: clamp(1rem, 1.28vw, 1.18rem);
}

.world-module .section-title small,
.network-metrics .section-title small {
  color: rgba(174, 198, 201, 0.46);
  font-size: clamp(0.62rem, 0.74vw, 0.74rem);
  font-weight: 900;
}

.endpoint-line {
  padding: 0 4px;
  color: rgba(174, 198, 201, 0.46);
  font-size: clamp(0.76rem, 0.92vw, 0.92rem);
  font-weight: 900;
}

.globe {
  width: min(92%, 266px);
  height: auto;
  aspect-ratio: 1;
  margin: 10px auto 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(174, 198, 201, 0.08), transparent 63%),
    radial-gradient(circle at 49% 50%, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.5) 74%, rgba(0, 0, 0, 0.9) 100%);
  box-shadow: none;
  transform: none;
}

.globe canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 11px rgba(174, 198, 201, 0.18));
}

.globe::before,
.globe::after {
  display: none;
}

.globe span {
  border-color: rgba(174, 198, 201, 0.11);
}

.globe span:nth-child(2) { inset: 11%; }
.globe span:nth-child(3) { inset: 24%; }
.globe span:nth-child(4) { inset: 7%; transform: rotate(-28deg) scaleY(0.36); }
.globe span:nth-child(5) { inset: 9%; transform: rotate(62deg) scaleY(0.28); }
.globe span:nth-child(6) { inset: 15%; border-color: rgba(174, 198, 201, 0.07); transform: rotate(112deg) scaleY(0.44); }

.network-metrics {
  grid-template-rows: auto auto minmax(140px, 1fr) auto;
  padding-top: 10px;
}

.network-metrics .section-title {
  align-items: baseline;
  white-space: nowrap;
}

.network-metrics .section-title small b {
  color: rgba(174, 198, 201, 0.64);
  font: inherit;
}

.traffic-line {
  grid-template-columns: 70px minmax(0, 1fr);
  padding: 0 4px;
}

.traffic-line span,
.traffic-line b {
  color: rgba(174, 198, 201, 0.46);
  font-size: clamp(0.82rem, 0.96vw, 0.96rem);
  font-weight: 900;
}

.graph-spark {
  position: relative;
  display: block;
  height: 100%;
  min-height: 154px;
  margin: 9px 4px 6px;
  border: 1px solid rgba(174, 198, 201, 0.38);
  border-left-color: rgba(174, 198, 201, 0.54);
  background:
    linear-gradient(90deg, rgba(174, 198, 201, 0.28) 1px, transparent 1px),
    linear-gradient(180deg, rgba(174, 198, 201, 0.26) 1px, transparent 1px),
    linear-gradient(180deg, rgba(174, 198, 201, 0.025), rgba(0, 0, 0, 0.16));
  background-size: 33.333% 100%, 100% 25%, auto;
  padding: 0;
}

.traffic-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.traffic-line-path {
  fill: none;
  stroke: rgba(207, 235, 238, 0.92);
  stroke-linecap: square;
  stroke-linejoin: bevel;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.traffic-line-path.ghost {
  stroke: rgba(207, 235, 238, 0.72);
  stroke-width: 1.1;
}

.traffic-svg text {
  fill: #cce9ec;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
}

.radio-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 14px;
  padding: 0 4px;
}

.access-grid {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 6px 12px;
  font-family: var(--mono);
  font-size: 0.76rem;
}

.access-grid span {
  color: rgba(174, 198, 201, 0.54);
}

.access-grid b {
  color: #d8eef1;
  font-weight: 800;
  letter-spacing: 0;
}

@media (max-height: 980px) {
  .network-rail {
    grid-template-rows: 24px auto minmax(196px, 1fr) minmax(166px, 0.75fr);
  }

  .globe {
    width: min(82%, 210px);
  }

  .graph-spark {
    min-height: 118px;
  }
}

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  justify-items: end;
  padding: 22px;
  background: rgba(1, 3, 4, 0.62);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.settings-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(1, 3, 4, 0.72), rgba(1, 3, 4, 0.84)),
    radial-gradient(circle at top, rgba(174, 198, 201, 0.08), transparent 44%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.consent-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.consent-panel {
  width: min(560px, calc(100vw - 28px));
  display: grid;
  gap: 18px;
  border: 1px solid rgba(174, 198, 201, 0.28);
  padding: 20px;
  background:
    radial-gradient(rgba(174, 198, 201, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(4, 8, 9, 0.98), rgba(0, 0, 0, 0.98));
  background-size: 24px 24px, auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.62);
  transform: translateY(18px) scale(0.98);
  transition: transform 220ms ease;
}

.consent-overlay.is-open .consent-panel {
  transform: translateY(0) scale(1);
}

.consent-head span,
.consent-grid span {
  display: block;
  color: rgba(174, 198, 201, 0.56);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 800;
}

.consent-head strong,
.consent-grid strong {
  display: block;
  color: #d6edf0;
}

.consent-copy {
  display: grid;
  gap: 14px;
}

.consent-copy p {
  margin: 0;
  color: rgba(214, 237, 240, 0.86);
  line-height: 1.6;
}

.consent-grid {
  display: grid;
  gap: 10px;
}

.consent-grid > div {
  border: 1px solid rgba(174, 198, 201, 0.14);
  background: rgba(255, 255, 255, 0.028);
  padding: 12px 14px;
}

.consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.consent-actions button {
  min-width: 112px;
}

.consent-actions button:last-child {
  border-color: rgba(174, 198, 201, 0.42);
  background: linear-gradient(180deg, rgba(204, 236, 239, 0.16), rgba(255, 255, 255, 0.04));
}

.settings-panel {
  width: min(520px, calc(100vw - 36px));
  height: min(100%, 760px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid rgba(174, 198, 201, 0.28);
  background:
    radial-gradient(rgba(174, 198, 201, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(4, 8, 9, 0.98), rgba(0, 0, 0, 0.98));
  background-size: 24px 24px, auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.62);
  transform: translateX(36px);
  transition: transform 260ms ease;
}

.settings-overlay.is-open .settings-panel {
  transform: translateX(0);
}

.settings-head,
.settings-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(174, 198, 201, 0.2);
}

.settings-foot {
  border-top: 1px solid rgba(174, 198, 201, 0.18);
  border-bottom: 0;
  color: rgba(174, 198, 201, 0.62);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.settings-head span,
.settings-foot span,
.settings-card span {
  display: block;
  color: rgba(174, 198, 201, 0.54);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 800;
}

.settings-head strong,
.settings-card strong,
.settings-foot strong {
  display: block;
  color: #d6edf0;
  font-family: var(--mono);
  font-size: 1.02rem;
  font-weight: 800;
}

.settings-foot small {
  color: rgba(174, 198, 201, 0.48);
  font-family: var(--mono);
  font-size: 0.66rem;
}

.settings-grid {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.settings-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 148px;
  padding: 16px;
  border: 1px solid rgba(174, 198, 201, 0.22);
  background: rgba(4, 9, 10, 0.7);
}

.settings-card input[type="range"],
.settings-card select {
  width: 100%;
}

.settings-card select {
  height: 42px;
  border: 1px solid rgba(174, 198, 201, 0.22);
  background: rgba(2, 6, 7, 0.9);
  color: #d6edf0;
  font-family: var(--mono);
  font-size: 0.84rem;
}

.settings-card input[type="range"] {
  accent-color: #d7eef1;
}

.toggle-card {
  align-content: start;
}

.toggle-card input {
  position: absolute;
  inset: auto 16px 18px auto;
  width: 58px;
  height: 30px;
  margin: 0;
  opacity: 0;
}

.toggle-card i {
  position: absolute;
  right: 16px;
  bottom: 18px;
  width: 58px;
  height: 30px;
  border: 1px solid rgba(174, 198, 201, 0.24);
  background: rgba(255, 255, 255, 0.03);
}

.toggle-card i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 22px;
  background: rgba(174, 198, 201, 0.28);
  content: "";
  transition: transform 180ms ease, background 180ms ease;
}

.toggle-card input:checked + i::after {
  transform: translateX(30px);
  background: rgba(214, 237, 240, 0.92);
}

.toggle-card input:checked + i {
  border-color: rgba(214, 237, 240, 0.52);
}

.edex-shell .xterm,
.edex-shell .xterm * {
  font-family: var(--terminal-font) !important;
}

@media (max-width: 1180px) {
  .edex-grid {
    grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.4fr);
    grid-template-rows: minmax(0, auto) minmax(0, auto) 272px;
  }

  .system-rail {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .edex-terminal {
    grid-column: 2;
    grid-row: 1;
    min-height: 420px;
  }

  .network-rail {
    grid-column: 2;
    grid-row: 2;
  }

  .filesystem-panel {
    grid-column: 1;
    grid-row: 3;
  }

  .keyboard-panel {
    grid-column: 2;
    grid-row: 3;
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .shell {
    height: auto;
    min-height: 100vh;
    padding: max(10px, env(safe-area-inset-top, 0)) max(10px, env(safe-area-inset-right, 0)) max(10px, env(safe-area-inset-bottom, 0)) max(10px, env(safe-area-inset-left, 0));
    gap: 10px;
  }

  .edex-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(5, auto);
  }

  .system-rail,
  .edex-terminal,
  .network-rail,
  .filesystem-panel,
  .keyboard-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .edex-terminal {
    min-height: 380px;
  }

  .network-rail {
    min-height: 620px;
  }

  .keyboard-panel {
    min-height: 248px;
  }

  .terminal-tabs {
    grid-template-columns: minmax(118px, 1fr) repeat(2, minmax(64px, 0.8fr)) auto;
  }

  .terminal-tabs .tab:nth-child(4),
  .terminal-tabs .tab:nth-child(5) {
    display: none;
  }

  .settings-overlay {
    justify-items: stretch;
    padding: 10px;
  }

  .settings-panel {
    width: 100%;
    height: auto;
    max-height: calc(100vh - 20px);
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .shell {
    padding: max(8px, env(safe-area-inset-top, 0)) max(8px, env(safe-area-inset-right, 0)) max(18px, env(safe-area-inset-bottom, 0)) max(8px, env(safe-area-inset-left, 0));
    gap: 8px;
  }

  .edex-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .edex-terminal {
    order: 1;
    min-height: 52vh;
    border-width: 1px;
  }

  .network-rail {
    order: 2;
    min-height: 0;
    grid-template-rows: 24px auto auto auto;
    padding: 0 8px 8px;
  }

  .filesystem-panel {
    order: 3;
  }

  .system-rail {
    order: 4;
    grid-template-rows: 24px auto auto auto;
    padding: 0 8px 8px;
  }

  .keyboard-panel {
    order: 5;
    min-height: 186px;
    padding: 18px 12px 12px;
  }

  .edex-clock {
    font-size: 2.15rem;
  }

  .date-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 6px;
  }

  .date-row span:last-child {
    display: none;
  }

  .time-module {
    padding: 14px 0 10px;
  }

  .identity-section .dense-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
  }

  .identity-section .dense-grid b {
    font-size: 0.72rem;
  }

  .process-module {
    display: none;
  }

  .readout-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 6px;
  }

  .readout-row b,
  .readout-row strong {
    font-size: 0.72rem;
  }

  .mini-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .terminal-tabs {
    grid-template-columns: minmax(96px, 1fr) auto;
  }

  .terminal-tabs .tab:not(:first-child) {
    display: none;
  }

  .terminal-actions {
    gap: 4px;
    padding-right: 4px;
  }

  .terminal-actions button {
    width: 34px;
    min-width: 34px;
    height: 24px;
    padding: 0;
    font-size: 0.58rem;
  }

  .terminal-statusbar {
    grid-template-columns: 1fr auto;
    gap: 4px 8px;
    padding: 4px 8px;
  }

  .terminal-statusbar span:nth-child(2) {
    grid-column: 1 / -1;
  }

  .network-status .section-title,
  .world-module .section-title,
  .network-metrics .section-title {
    font-size: 0.94rem;
  }

  .network-status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px 10px;
  }

  .access-grid {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 5px 10px;
    font-size: 0.7rem;
  }

  .network-status-grid span {
    font-size: 0.72rem;
  }

  .network-status-grid b {
    font-size: 0.84rem;
  }

  .endpoint-line {
    font-size: 0.72rem;
  }

  .globe {
    width: min(74vw, 236px);
    margin-top: 8px;
  }

  .graph-spark {
    min-height: 126px;
    margin: 8px 4px 4px;
  }

  .radio-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4px 10px;
  }

  .fs-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 0;
  }

  .fs-toolbar button {
    width: 100%;
    min-width: 0;
  }

  .fs-toolbar span {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .filesystem-body.real-filesystem {
    min-height: 0;
  }

  .fs-browser {
    max-height: 240px;
    overflow: auto;
  }

  .fs-detail {
    gap: 8px;
    padding-top: 6px;
  }

  .fs-detail span,
  .fs-detail strong {
    font-size: 0.68rem;
  }

  .keyboard-panel > .edex-strip,
  .keyboard-panel .keyboard-live {
    display: none;
  }

  .keyboard-panel {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .keyboard-panel::-webkit-scrollbar {
    display: none;
  }

  .keyboard-panel .keyboard-row {
    min-width: 780px;
  }

  .settings-head,
  .settings-foot {
    padding: 12px 14px;
  }

  .consent-overlay {
    padding: 10px;
  }

  .consent-panel {
    width: 100%;
    gap: 14px;
    padding: 16px 14px;
  }

  .consent-copy p,
  .consent-grid strong {
    font-size: 0.84rem;
  }

  .consent-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .consent-actions button {
    width: 100%;
    min-width: 0;
  }

  .settings-foot {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .settings-card {
    min-height: 126px;
    padding: 14px;
  }
}
