* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;

  --bg: #0d1117;
  --panel: #0b1016;
  --panel-2: #111820;
  --titlebar: #161b22;
  --border: #30363d;
  --border-soft: #242c35;

  --text: #e6edf3;
  --muted: #8b949e;

  --green: #3fb950;
  --green-bright: #56d364;
  --blue: #58a6ff;
  --yellow: #e3b341;
  --red: #f85149;
  --purple: #bc8cff;
  --cyan: #39c5cf;
}

html,
body {
  min-height: 100%;
  margin: 0;

  background:
    radial-gradient(circle at 50% -10%, rgba(63, 185, 80, 0.06), transparent 34%),
    var(--bg);

  color: var(--text);
}

body {
  min-height: 100vh;

  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    Menlo,
    monospace;
}

button {
  font: inherit;
}

.monitor-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 24px;
}

.monitor-window {
  overflow: hidden;

  background: #090e13;

  border: 1px solid var(--border);
  border-radius: 14px;

  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.015) inset;
}

.monitor-titlebar {
  height: 48px;

  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;

  padding: 0 16px;

  background: var(--titlebar);
  border-bottom: 1px solid #252d36;
}

.window-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.window-dot {
  width: 12px;
  height: 12px;

  display: inline-block;

  border: 0;
  border-radius: 50%;
}

a.window-dot {
  text-decoration: none;
  cursor: pointer;
}

.window-dot.red {
  background: #ff5f57;
}

.window-dot.yellow {
  background: #febc2e;
}

.window-dot.green {
  background: #28c840;
}

a.window-dot.red:hover,
a.window-dot.red:focus-visible {
  outline: 2px solid rgba(255, 95, 87, 0.35);
  outline-offset: 3px;
  transform: scale(1.08);
}

.monitor-title {
  color: #9aa4af;
  font-size: 0.78rem;
  text-align: center;
}

.monitor-status {
  justify-self: end;

  display: flex;
  align-items: center;
  gap: 7px;

  color: var(--green);

  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.status-dot {
  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: var(--green);
  box-shadow: 0 0 10px rgba(63, 185, 80, 0.45);
}

.monitor-console {
  outline: none;

  padding: 20px;

  background:
    linear-gradient(rgba(6, 10, 14, 0.965), rgba(6, 10, 14, 0.965)),
    repeating-linear-gradient(
      0deg,
      transparent 0 25px,
      rgba(255, 255, 255, 0.012) 25px 26px
    );
}

.console-command {
  margin-bottom: 14px;

  color: #c9d1d9;

  font-size: 0.8rem;
}

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

.monitor-grid {
  display: grid;
  gap: 12px;
}

.monitor-grid-top {
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
}

.monitor-grid-main {
  grid-template-columns: minmax(230px, 0.72fr) minmax(0, 1.28fr);
  margin-top: 12px;
}

.panel {
  min-width: 0;

  padding: 14px;

  background: rgba(13, 19, 26, 0.88);

  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.panel h2 {
  margin: 0 0 12px;

  color: #7d8590;

  font-size: 0.68rem;
  letter-spacing: 0.1em;
}

.panel-heading-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.panel-heading-row h2 {
  margin-bottom: 12px;
}

.process-help,
.sim-state {
  color: #59636e;
  font-size: 0.62rem;
}

.kv {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;

  margin-bottom: 7px;

  font-size: 0.75rem;
}

.kv span {
  color: #6e7681;
}

.kv strong {
  color: #c9d1d9;
  font-weight: 600;
}

.meter-row {
  display: grid;
  grid-template-columns: 48px minmax(100px, 1fr) 46px;
  gap: 10px;
  align-items: center;

  margin-bottom: 12px;
}

.meter-label {
  color: #79828d;
  font-size: 0.72rem;
}

.meter-track {
  overflow: hidden;

  height: 12px;

  background:
    repeating-linear-gradient(
      90deg,
      #141a21 0 12px,
      #0d1318 12px 14px
    );

  border: 1px solid #232b33;
  border-radius: 3px;
}

.meter-fill {
  height: 100%;

  transition: width 0.5s ease;
}

.meter-fill.cpu {
  background: var(--green);
}

.meter-fill.ram {
  background: var(--blue);
}

.meter-fill.disk {
  background: var(--purple);
}

.meter-value {
  color: #d7dee5;

  font-size: 0.72rem;
  text-align: right;
}

.net-row {
  display: grid;
  grid-template-columns: 48px 1fr 1fr;
  gap: 10px;

  margin-top: 4px;

  color: #737d87;

  font-size: 0.7rem;
}

.net-row strong:first-of-type {
  color: var(--cyan);
}

.net-row strong:last-of-type {
  color: var(--yellow);
}

.services-list {
  margin: 0;
  padding: 0;

  list-style: none;
}

.services-list li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;

  padding: 6px 0;

  border-bottom: 1px solid rgba(48, 54, 61, 0.45);

  font-size: 0.72rem;
}

.services-list li:last-child {
  border-bottom: 0;
}

.service-dot {
  width: 6px;
  height: 6px;

  border-radius: 50%;
  background: var(--green);
}

.services-list span:nth-child(2) {
  color: #c3ccd5;
}

.services-list strong {
  color: var(--green);

  font-size: 0.65rem;
  font-weight: 600;
}

.process-table-wrap {
  overflow-x: auto;
}

.process-table {
  width: 100%;

  border-collapse: collapse;

  font-size: 0.7rem;
}

.process-table th,
.process-table td {
  padding: 6px 8px;

  border-bottom: 1px solid rgba(48, 54, 61, 0.42);

  text-align: left;
  white-space: nowrap;
}

.process-table th {
  color: #636d77;
  font-size: 0.62rem;
  font-weight: 700;
}

.process-table td {
  color: #b8c1ca;
}

.process-table tr.selected td {
  background: rgba(63, 185, 80, 0.095);
  color: #f0f6fc;
}

.process-table tr.selected td:first-child {
  box-shadow: inset 2px 0 0 var(--green);
}

.events-panel {
  margin-top: 12px;
}

.event-log {
  min-height: 88px;
  max-height: 120px;
  overflow-y: auto;

  padding-right: 4px;

  font-size: 0.68rem;
  line-height: 1.55;
}

.event-line {
  color: #7d8791;
}

.event-line time {
  color: #5e6872;
}

.event-line .event-ok {
  color: var(--green);
}

.event-line .event-info {
  color: var(--blue);
}

.event-line .event-warn {
  color: var(--yellow);
}

.event-line .event-kill {
  color: var(--red);
}

.status-strip {
  display: flex;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;

  margin-top: 12px;
  padding: 10px 12px;

  color: #69737d;

  border-top: 1px solid #1d252d;
  border-bottom: 1px solid #1d252d;

  font-size: 0.68rem;
}

.status-strip strong {
  color: #c2cad3;
}

.control-strip {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;

  margin-top: 12px;
}

.control-strip button,
.quit-link {
  min-height: 40px;

  display: inline-flex;
  align-items: center;

  padding: 7px 10px;

  color: #9ba5af;
  background: transparent;

  border: 1px solid transparent;
  border-radius: 6px;

  text-decoration: none;
  cursor: pointer;
}

.control-strip button:hover,
.control-strip button:focus-visible,
.quit-link:hover,
.quit-link:focus-visible {
  color: var(--green-bright);
  border-color: #2b353e;
  outline: none;
}

.monitor-note {
  margin: 12px 0 0;

  color: #6e7681;

  font-size: 0.7rem;
  text-align: center;
}

@media (max-width: 820px) {
  .monitor-grid-top,
  .monitor-grid-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .monitor-shell {
    width: min(100% - 18px, 1280px);
    padding-top: 12px;
  }

  .monitor-titlebar {
    padding: 0 10px;
  }

  .monitor-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .monitor-console {
    padding: 12px;
  }

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

  .meter-row {
    grid-template-columns: 42px minmax(80px, 1fr) 40px;
  }

  .net-row {
    grid-template-columns: 42px 1fr;
  }

  .net-row strong:last-of-type {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .meter-fill {
    transition: none;
  }
}


/* RunsLinux shared Labs workstation shell */
@media (min-width: 901px) {
  html, body { width: 100%; height: 100%; overflow: hidden; }
  body.rl-has-site-nav { background: #080d13; }
  .monitor-shell {
    position: relative !important;
    width: 100vw !important;
    max-width: none !important;
    height: calc(100vh - 54px) !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: url('/assets/terminal-workstation.webp') center top / cover no-repeat !important;
  }
  .monitor-shell > .monitor-window {
    position: absolute !important;
    left: 19.65% !important;
    top: 5.75% !important;
    width: 62.75% !important;
    height: 60.45% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: auto !important;
    border-radius: 10px !important;
    z-index: 3 !important;
    box-shadow: none !important;
  }
  .monitor-shell > :not(.monitor-window) { display: none !important; }
}

/* Workstation fit pass v1.1: make the system dashboard fully usable inside the monitor. */
@media (min-width: 901px) {
  .monitor-shell > .monitor-window { overflow: hidden !important; display: flex !important; flex-direction: column !important; }
  .monitor-titlebar { flex: 0 0 42px !important; height: 42px !important; }
  .monitor-console { flex: 1 1 auto !important; min-height: 0 !important; height: auto !important; overflow: auto !important; padding: 10px 12px 12px !important; }
  .monitor-grid { gap: 8px !important; }
  .panel { padding: 10px !important; }
  .monitor-grid, .monitor-grid-top, .monitor-grid-main { min-height: 0 !important; }
}
