.ticket-history-panel {
  margin-bottom: 22px;
}

.ticket-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.ticket-panel-heading .eyebrow,
.ticket-panel-heading h2,
.ticket-panel-heading h3 {
  margin-top: 0;
}

.ticket-panel-heading h2,
.ticket-panel-heading h3 {
  margin-bottom: 0;
}

.empty-state {
  margin: 0;
  border-inline-start: 3px solid #b8ceca;
  padding: 12px 14px;
  background: var(--soft);
  color: #38545a;
}

.table-wrap {
  overflow-x: auto;
}

.tickets-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: fixed;
}

.tickets-table th,
.tickets-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: start;
  vertical-align: top;
}

.tickets-table th {
  background: var(--soft);
  color: #38545a;
  font-size: 12px;
  font-weight: 900;
}

.tickets-table th:nth-child(1) { width: 45%; }
.tickets-table th:nth-child(2) { width: 16%; }
.tickets-table th:nth-child(3) { width: 14%; }
.tickets-table th:nth-child(4) { width: 15%; }
.tickets-table th:nth-child(5) { width: 10%; }

.tickets-table td:first-child {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.tickets-table td:first-child strong,
.tickets-table td:first-child small {
  display: block;
}

.tickets-table td:first-child small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 500;
}

.ticket-view-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 7px 11px;
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  border: 1px solid #b8ece4;
  border-radius: 999px;
  padding: 6px 11px;
  background: #eafaf7;
  color: var(--dark);
  font-weight: 900;
  text-transform: capitalize;
}

.status-pill.muted {
  border-color: var(--line);
  background: var(--soft);
  color: #38545a;
}

.ticket-detail {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.ticket-thread {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.ticket-message {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
}

.ticket-message.from-user {
  background: var(--soft);
}

.ticket-message strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.ticket-message p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#ticketReplyForm {
  display: grid;
  gap: 10px;
}

@media (max-width: 720px) {
  .ticket-panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .ticket-panel-heading button {
    align-self: flex-start;
  }
}
