  html {
    overscroll-behavior: none;
  }
    
  body {
    background-color: #F8F9FA;
    font-family: "Noto Sans", sans-serif;
    font-size: 1rem;
    user-select: none; /* Prevent text selection during cell drag */
    margin: 0px;
    padding: 0px;
    
  }
  
  #toolbar-container {
    background-color: #F8F9FA;
    height: 40px;
    padding: 12px;
    z-index: 100;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
  }
  
  #toolbar {
    background-color: #FFFFFF;
    height: 28px;
    border-radius: 10px;
    box-shadow: rgba(0, 0, 0, 0.1) 1px 1px 2px 0px;
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 6px;
    justify-content: start;
    overflow-x: scroll;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* Internet Explorer 10+ */
  }
  #toolbar::-webkit-scrollbar { /* WebKit */
    width: 0;
    height: 0;
}
  
  #toolbar button {
    background: none;
    border: none;
    cursor: pointer;
    height: 28px;
    padding: 4px;
    width: 28px;
    display: inline-block;
    flex-shrink: 0;
    text-align: center;
    margin: 0px;
    border-radius: 5px;
  }
  
  .ql-stroke {
    fill: none;
    stroke: #212529;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2px;
  }
  
  .ql-fill {
    fill: #212529;
    stroke-width: 0px;
  }
  
  #toolbar button:hover {
    background-color: #eee;
  }
  
  #toolbar button:hover .ql-stroke {
    stroke: #007AFF;
  }
  
  #toolbar button:hover .ql-fill {
    fill: #007AFF;
  }
    
  #toolbar .separator {
    width: 1px;
    background-color: #d1d5db;
    margin: 4px 6px;
    flex-shrink: 0;
}
  
  #table-container {
    margin-top: 64px;
    width: 100%;
  }
  
  table {
    border-spacing: 0;
    width: 100%;
  }
  
  th {
    border-bottom: 1px solid #ababab;
    border-right: 1px solid #ababab;
    
    padding: 4px;
    box-sizing: border-box;
    min-height: 40px; 
    height: auto;
    vertical-align: middle;
    
    min-width: 20px;
    background-color: #F8F9FA;
    text-align: center;
    color: #212529;
    font-weight: 400;
    cursor: pointer;
    
    z-index: 10; /* Keep header above scrolling cells */
  }
  
  thead th {
    position: sticky;
    top: 64px;
    
    border-image: linear-gradient(to bottom, transparent 10%, #ababab 90%);
    border-image-slice: 1;
  }
  
  tbody th {
    position: sticky;
    left : 0;
    
    border-image: linear-gradient(to right, transparent 10%, #ababab 90%);
    border-image-slice: 1;
  }
  
  thead th:first-child { /* top left cell*/
    min-width: 45px;
    left: 0;
    z-index: 15; /* Highest z-index to stay on top */
    
    background: linear-gradient(to bottom right,transparent 49.8%,#dfdfdf 50%) bottom right/30px 30px no-repeat, #F8F9FA;
    box-shadow: 0 0 0 3px #F8F9FA inset;
    
  }
  
  .major_columns_header {
    border-bottom: 0;
    font-weight: 600;
  }
  
  td {
    border-bottom: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    padding: 4px;
    box-sizing: border-box;
    min-height: 40px; 
    height: auto;
    vertical-align: top;
    
    min-width: 200px;
    cursor: cell;
    
    position: relative;
    
    background-color: white;
    
    --td-transition: opacity .12s ease-in-out; /* Consider removing transition to increase performance */
  }
  
  td:focus {
    outline: none;
  }
  
  tbody td:nth-child(4), tbody td:nth-child(6), tbody td:nth-child(8) {
    border-right-color: #ababab;
  }
  
  td::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 122, 255, 0.2); 
    pointer-events: none;
    opacity: 0;
    z-index: 3;
    transition: var(--td-transition);
  }
  
  td.selected::after {
    opacity: 1;
  }
  
  .active-cell.selected::after {
    display: none;
  }
  
   th:hover {
     background-color: #cce4ff;
   }
    
  th .selected {
    background-color: #e1e1e1;
    /*border-color: #a5b4fc;*/
  }
  
  .active-cell {
    /* Use box-shadow to prevent layout shifts */
    background-color: white;
    background-image: none;
    box-shadow: 0 0 0 2px #007AFF inset;
    z-index: 1;
    filter: brightness(100%);
    
  }
  