/* Clear the fixed navbar so empty/login states aren't covered */
main.main.main--interior {
  padding-top: calc(5.5rem + env(safe-area-inset-top, 0px));
}

@media (min-width: 992px) {
  main.main.main--interior {
    padding-top: calc(6rem + env(safe-area-inset-top, 0px));
  }
}

#tasks-table,
#tasks-table thead th,
#tasks-table tbody td,
#tasks-table strong,
#tasks-table small {
  font-size: 1rem;
  font-family: inherit;
}

/* Make habits table 90% of viewport width */
#tasks-table {
  width: 90vw;
  max-width: 90vw;
  table-layout: fixed;
}

/* Align numeric / date columns */
#tasks-table thead th:nth-child(2),
#tasks-table thead th:nth-child(3),
#tasks-table td:nth-child(2),
#tasks-table td:nth-child(3) {
  text-align: center;
}

/* —— Mobile: habit ~70vw; Days Kept / Start Date shrink-wrap & wrap —— */
@media (max-width: 991.98px) {
  #tasks-table {
    table-layout: auto;
  }

  #tasks-table thead th:nth-child(1),
  #tasks-table td:nth-child(1) {
    width: 70vw;
    max-width: 70vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #tasks-table thead th:nth-child(2),
  #tasks-table td:nth-child(2),
  #tasks-table thead th:nth-child(3),
  #tasks-table td:nth-child(3) {
    width: 1%;
    min-width: 0;
    max-width: none;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.2;
    vertical-align: middle;
  }

  /* Headers may wrap; cell values stay on one line */
  #tasks-table thead th:nth-child(2),
  #tasks-table thead th:nth-child(3) {
    white-space: normal;
  }

  #tasks-table td:nth-child(2),
  #tasks-table td:nth-child(3) {
    white-space: nowrap;
  }
}

/* —— Desktop: keep tighter fixed side columns —— */
@media (min-width: 992px) {
  #tasks-table thead th:nth-child(1),
  #tasks-table td:nth-child(1) {
    width: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #tasks-table thead th:nth-child(2),
  #tasks-table td:nth-child(2) {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
  }

  #tasks-table thead th:nth-child(3),
  #tasks-table td:nth-child(3) {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
  }

  #tasks-table thead th:nth-child(2),
  #tasks-table thead th:nth-child(3) {
    white-space: normal;
  }

  #tasks-table td:nth-child(2),
  #tasks-table td:nth-child(3) {
    white-space: nowrap;
  }
}

#tasks-table tbody tr {
  cursor: pointer;
}
#tasks-table,
#tasks-table thead th,
#tasks-table thead td {
  border: none !important;
}
#tasks-table {
  border-collapse: separate;
  border-spacing: 0 6px;
}
#tasks-table tbody td {
  border-top: 1px solid #dee2e6 !important;
  border-bottom: 1px solid #dee2e6 !important;
  border-left: none !important;
  border-right: none !important;
  background: inherit;
}
#tasks-table tbody td:first-child {
  border-left: 1px solid #dee2e6 !important;
}
#tasks-table tbody td:last-child {
  border-right: 1px solid #dee2e6 !important;
}
#tasks-table tbody td:first-child {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}
#tasks-table tbody td:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

.mb-4 {
  margin-bottom: 0.5rem !important;
}
.card {
  border: none !important;
  box-shadow: none !important;
}
.card .table-responsive:first-of-type {
  border: none;
}
.table-responsive {
  margin-bottom: 0;
}
.table-responsive .table {
  margin-bottom: 0;
}
