    body {
      font-family: Arial, sans-serif;
      padding: 20px;
      display: grid;
      grid-template-areas:
        "h"
        "m"
        "n";
      grid-template-columns: 1fr;
      gap: 20px;
      align-items: start;
    }

    h2 {
      grid-area: h;
      margin: 0;
    }

    #main {
      grid-area: m;
      display: grid;
      gap: 16px;
    }

    #sidebar {
      grid-area: n;
      height: auto;
    }

    #array {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
      gap: 10px;
      margin-bottom: 20px;
      max-width: 400px;
    }

    .cell {
      width: 40px;
      height: 40px;
      border: 2px solid #444;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 18px;
      border-radius: 6px;
      transition: 0.3s;
    }

    .i {
      background-color: #4da3ff;
      color: white;
      border-color: #005bbb;
    }

    .j {
      background-color: #ff9f43;
      color: white;
      border-color: #cc6e00;
    }

    .removed {
      background-color: #ff4d4d;
      color: white;
      border-color: darkred;
    }

    button {
      padding: 10px 20px;
      font-size: 16px;
    }

    #sidebar {

      width: 300px;
      height: 100vh;
      background: #fafafa;
      border-left: 2px solid #ccc;
      display: flex;
      flex-direction: column;
      font-family: Arial, sans-serif;
    }

    #sidebar-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 15px;
      background: #eee;
      border-bottom: 1px solid #ccc;
    }

    #log-container {
      padding: 15px;
      overflow-y: auto;
      flex-grow: 1;
    }

    .log-entry {
      background: white;
      border: 1px solid #ddd;
      padding: 8px;
      margin-bottom: 10px;
      border-radius: 4px;
      font-size: 14px;
    }

    .log-info {
      border-left: 4px solid #007bff;
    }

    .log-compare {
      border-left: 4px solid #ff9800;
    }

    .log-delete {
      border-left: 4px solid #e53935;
    }

    .log-success {
      border-left: 4px solid #43a047;
    }

    /* XL screens: place sidebar on the left using grid */
    @media (min-width: 1000px) {
      body {
        grid-template-columns: 300px 1fr;
        grid-template-areas:
          "h h"
          "n m";
      }


    }