/* 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;
}

/* —— Achievements inbox (TikTok-style activity list) —— */
.inbox-page {
  background: #fff;
  min-height: 100vh;
}

.inbox {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
}

.inbox-header {
  padding: 8px 16px 4px;
}

.inbox-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #161823;
  text-align: left;
}

.inbox-list {
  padding: 0;
}

.inbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: default;
  background: #fff;
}

.inbox-item:active {
  background: #f8f8f8;
}

.inbox-avatar {
  position: relative;
  flex: 0 0 48px;
  width: 48px;
  height: 54px;
}

.inbox-shield {
  display: flex;
  align-items: center;
  justify-content: center;
}

.inbox-shield-svg {
  display: block;
  width: 48px;
  height: 54px;
  overflow: visible;
}

.inbox-shield-svg text {
  letter-spacing: -0.02em;
}

.inbox-item-body {
  flex: 1 1 auto;
  min-width: 0;
}

.inbox-item-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  color: #161823;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.inbox-item-time {
  flex: 0 0 auto;
  margin-left: 8px;
  font-size: 13px;
  color: #8a8b91;
  white-space: nowrap;
  align-self: flex-start;
  padding-top: 2px;
}

.inbox-status {
  padding: 48px 16px;
  text-align: center;
  color: #8a8b91;
  font-size: 15px;
}

.inbox-status--error {
  color: #fe2c55;
}

.inbox-status--empty {
  color: #8a8b91;
}

.inbox-login {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px;
}

.inbox-login .inbox-title {
  margin-bottom: 12px;
}

.inbox-login p {
  color: #8a8b91;
  margin-bottom: 16px;
}

/* Homepage achievement belt table */
.home-belts-table {
  max-width: 28rem;
}

.home-belts-table th,
.home-belts-table td {
  vertical-align: middle;
}

.home-belt-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.home-belt-cell .inbox-avatar {
  flex: none;
}
