.compact-ticket {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.55);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.compact-ticket:hover {
  border-color: rgba(184, 47, 50, 0.3);
  background: #fff;
  transform: translateX(2px);
}

.compact-ticket strong,
.compact-ticket small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-table {
  display: grid;
  gap: 9px;
}

.ticket-row {
  display: grid;
  grid-template-columns: 10px 92px minmax(0, 1fr) auto 150px;
  gap: 13px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(4, 10, 7, 0.1);
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.ticket-row:hover {
  background: var(--surface-strong);
  box-shadow: 0 14px 34px rgba(4, 10, 7, 0.16);
  transform: translateY(-2px);
}

.ticket-id {
  font-weight: 900;
}

.ticket-row strong,
.ticket-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-row time {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 32px;
  text-align: center;
}

.empty-state .icon {
  width: 48px;
  height: 48px;
  color: var(--red);
}

.ticket-layout {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.ticket-meta {
  position: sticky;
  top: 94px;
  padding: 18px;
}

.ticket-title-block {
  margin: 16px 0;
}

.ticket-title-block h1 {
  margin: 9px 0 6px;
  font-size: 2.2rem;
}

.owner-block {
  gap: 11px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.6);
}

.detail-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.detail-list div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.48);
}

.detail-list span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-list strong {
  overflow-wrap: anywhere;
  font-weight: 700;
  line-height: 1.45;
}

.staff-actions {
  display: grid;
  gap: 12px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.staff-actions h2 {
  margin-bottom: 0;
}

.inline-form,
.close-form {
  display: grid;
  gap: 8px;
}

.locked-note,
.reply-locked {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.55);
}

.chat-panel {
  overflow: hidden;
}

.chat-header {
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.chat-header h2 {
  margin: 0;
}

.helper-line {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: right;
}

.message-list {
  display: grid;
  gap: 13px;
  max-height: min(66vh, 720px);
  min-height: 420px;
  overflow: auto;
  padding: 18px;
  scroll-padding-bottom: 20px;
}

.message {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.message-system {
  grid-template-columns: minmax(0, 1fr);
}

.message-system .avatar-shell {
  display: none;
}

.message-system .message-bubble {
  color: var(--ink-soft);
  border-style: dashed;
  background: rgba(235, 241, 237, 0.74);
}

.avatar-shell {
  position: relative;
  width: 48px;
  height: 48px;
}

.message-avatar {
  width: 48px;
  height: 48px;
}

.staff-mark {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--red);
}

.staff-mark .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
}

.message-bubble {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.message-staff .message-bubble {
  border-color: rgba(49, 95, 140, 0.24);
  background: rgba(235, 244, 249, 0.82);
}

.message-name {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: baseline;
  margin-bottom: 6px;
}

.message-bubble p {
  margin: 0;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.reply-form textarea {
  min-height: 54px;
  max-height: 180px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  resize: vertical;
}

.reply-locked {
  margin: 14px;
}

