.layout-container {
  overflow-x: clip;
}

section[aria-labelledby="alarm-comparison"] * {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

section[aria-labelledby="alarm-comparison"] .preamble {
  max-width: 750px;
  margin: 0 auto;
}


section[aria-labelledby="alarm-comparison"] .table-wrapper * {
    font-size: 1rem;

}
section[aria-labelledby="alarm-comparison"] .visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

section[aria-labelledby="alarm-comparison"] caption {
  font-size: .75rem !important;
  text-align: right;
  padding: .5rem 0 .5rem;
  opacity: .5;
  caption-side: top;
}

section[aria-labelledby="alarm-comparison"] .brand-logo {
  display: block;
  margin: 0 auto;
  max-width: 100px;
  height: auto;
}

/* ----------------------------
  Table wrapper
---------------------------- */
section[aria-labelledby="alarm-comparison"] .table-wrapper {
  font-family: "Fira Sans", sans-serif;
  width: 100%;
  margin: 3rem 0 0;
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;   /* horizontal scroll works */
  overflow-y: visible; /* doesn't break layout but keeps sticky working */
  position: relative;
}

section[aria-labelledby="alarm-comparison"] .table-wrapper .category-row th {
  background: #eaeaea !important;
  padding: 1rem;
  color: #262626 !important;
  font-size: 1.1rem;
}

/* Table basics */
section[aria-labelledby="alarm-comparison"] .table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  min-width: 600px; /* keeps structure on very narrow devices */
}

section[aria-labelledby="alarm-comparison"] .table-wrapper th#th-verisure {
  padding: .5rem 0;
}

/* Cells */
section[aria-labelledby="alarm-comparison"] .table-wrapper th,
section[aria-labelledby="alarm-comparison"] .table-wrapper td {
  border: 1px solid #e6e6e6;
  padding: 0.9rem 1rem;
  vertical-align: middle;
  box-sizing: border-box;
}

/* Header background */
section[aria-labelledby="alarm-comparison"] .table-wrapper thead tr {
  background: #dcddde;
}

/* ----------------------------
  Sticky headers (Verisure style)
---------------------------- */
section[aria-labelledby="alarm-comparison"] .table-wrapper thead th {
  background: #dcddde;  /* solid background so content doesn’t show through */
  font-size: 1rem;
    font-weight: 500;
    text-align: center;
    border-bottom: 0;
    border-color: #ccc;
}

/* Keep Funktion header neutral */
section[aria-labelledby="alarm-comparison"] .table-wrapper thead th#th-funktion,
section[aria-labelledby="alarm-comparison"] .table-wrapper thead th:first-child {
  color: #262626;
  text-align: left;
  font-weight: 500;
  font-size: 1rem;
}

/* Funktion column on desktop */
section[aria-labelledby="alarm-comparison"] .table-wrapper tbody td:first-child {
  text-align: left;
  background: #f9f9f9;
  color: #262626;
  font-weight: 400;
  font-size: 1rem;
}

/* Checkmark / cross styling */
section[aria-labelledby="alarm-comparison"] .table-wrapper td span[role="img"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1;
  margin: 0 auto;
}

section[aria-labelledby="alarm-comparison"] .table-wrapper td span[role="img"][aria-label="Ja"] {
  background: #00a37d;
}

section[aria-labelledby="alarm-comparison"] .table-wrapper td span[role="img"][aria-label="Nej"] {
  background: #ed002f;
}

/* Desktop row hover */
section[aria-labelledby="alarm-comparison"] .table-wrapper tbody tr:hover {
  background: #f9f9f9;
  transition: background 0.18s ease;
}

/* ---------- MOBILE layout ---------- */
@media (max-width: 768px) {
  section[aria-labelledby="alarm-comparison"] .table-wrapper table {
    display: block;
    width: 100%;
    min-width: 0;
  }
  
  section[aria-labelledby="alarm-comparison"] .table-wrapper {
    margin-top: 2rem;
  }

  section[aria-labelledby="alarm-comparison"] .table-wrapper thead {
    display: block;
    width: 100%;
    border: none;
  }

  section[aria-labelledby="alarm-comparison"] .table-wrapper tbody tr {
    width: 100%;
  }

  /* Hide Funktion header cell */
  section[aria-labelledby="alarm-comparison"] .table-wrapper thead th:first-child {
    display: none;
  }

  /* Brand headers grid */
  section[aria-labelledby="alarm-comparison"] .table-wrapper thead tr {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  section[aria-labelledby="alarm-comparison"] .table-wrapper thead th:nth-child(n+2) {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0.6rem;
    border: 1px solid #cfcfcf;
    background: transparent;
    color: #262626;
    font-size: .9rem;
    border-bottom: 0;
  }

  section[aria-labelledby="alarm-comparison"] .table-wrapper tbody {
    display: block;
    border: none;
  }

  section[aria-labelledby="alarm-comparison"] .table-wrapper tbody tr {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: auto;
    gap: 0;
    margin: 0;
    overflow: hidden;
    border: none;
    background: #fff;
  }

  section[aria-labelledby="alarm-comparison"] .table-wrapper tbody td:first-child {
    grid-column: 1 / -1;
    display: block;
    width: 100%;
    background: #f9f9f9;
    padding: 0.5rem 1rem;
    text-align: center;
    font-weight: 500;
    border-bottom: 1px solid #e6e6e6;
    font-size: .9rem;
  }
  
  section[aria-labelledby="alarm-comparison"] .table-wrapper tbody td:first-child strong {
  font-size: .9rem;
  }

  section[aria-labelledby="alarm-comparison"] .table-wrapper tbody td:nth-child(2) { 
    grid-column: 1 / 2; 
  }
  section[aria-labelledby="alarm-comparison"] .table-wrapper tbody td:nth-child(3) { 
    grid-column: 2 / 3; 
  }
  section[aria-labelledby="alarm-comparison"] .table-wrapper tbody td:nth-child(4) { 
    grid-column: 3 / 4; 
    border-right: 1px solid #e6e6e6 !important;
  }

  section[aria-labelledby="alarm-comparison"] .table-wrapper tbody td:nth-child(n+2) {
    padding: 0.5rem;
    text-align: center;
    border: none;
    border-left: 1px solid #e6e6e6;
  }

  section[aria-labelledby="alarm-comparison"] .table-wrapper tbody td span[role="img"] {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }

  section[aria-labelledby="alarm-comparison"] .table-wrapper tbody tr:hover {
    background: none;
  }
  
   section[aria-labelledby="alarm-comparison"] .table-wrapper tbody tr:last-child td:nth-child(n+2) {
    border-bottom: 1px solid #e6e6e6;
  }
  
    section[aria-labelledby="alarm-comparison"] .table-wrapper .category-row {
    display: block; /* break out of grid */
    width: 100%;
  }

  section[aria-labelledby="alarm-comparison"] .table-wrapper .category-row th {
    display: block;
    grid-column: 1 / -1;     /* stretch across all columns */
    width: 100%;
    background: #dcddde;    /* your chosen style */
    text-align: center;     /* or left, depending on preference */
    font-weight: 400;
    padding: 0.75rem 1rem;
    border: none;
    font-size: .95rem;
  }
  
  section[aria-labelledby="alarm-comparison"] caption {
    display: block;
    font-size: .65rem !important;
  }
}

/* ---------- DESKTOP strict equal row height ---------- */
@media (min-width: 769px) {
  section[aria-labelledby="alarm-comparison"] .table-wrapper table colgroup col:first-child {
    width: 45%;
  }
  section[aria-labelledby="alarm-comparison"] .table-wrapper table colgroup col:nth-child(n+2) {
    width: 19%;
  }

  section[aria-labelledby="alarm-comparison"] .table-wrapper td:not(:first-child) {
    text-align: center;
    vertical-align: middle;
  }

  section[aria-labelledby="alarm-comparison"] .table-wrapper td:not(:first-child) span[role="img"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
  }

  section[aria-labelledby="alarm-comparison"] .table-wrapper tbody td,
  section[aria-labelledby="alarm-comparison"] .table-wrapper thead th {
    height: 60px; /* equal height */
    line-height: 1.3;
    vertical-align: middle;
    overflow: hidden;
  }
}

section[aria-labelledby="alarm-comparison"] .cloned-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  background: #f1f1f1;
  border-collapse: collapse;
  table-layout: fixed;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); /* subtle floating effect */

}

