.ps-ticket-shell {
  --gold: #f0b74a;
  --gold-2: #c88820;
  --bg: #0c0e14;
  --card: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f4efe6;
  --muted: #a39a8e;
  font-family: "Outfit", system-ui, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(240, 183, 74, 0.16), transparent 60%),
    radial-gradient(700px 420px at 90% 0%, rgba(200, 136, 32, 0.12), transparent 55%),
    var(--bg);
}

.ps-ticket-shell * {
  box-sizing: border-box;
}

.ps-ticket-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.ps-ticket-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ps-ticket-brand img {
  width: 28px;
  height: 28px;
}

.ps-ticket-brand strong {
  display: block;
  font-size: 15px;
}

.ps-ticket-brand span {
  color: var(--muted);
  font-size: 12px;
}

.ps-ticket-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ps-ticket-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.ps-ticket-btn.primary {
  background: linear-gradient(135deg, #ffd06a, var(--gold) 40%, var(--gold-2));
  color: #1a140c;
  border-color: transparent;
  font-weight: 600;
}

.ps-ticket-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: calc(100vh - 70px);
}

.ps-ticket-list {
  border-right: 1px solid var(--line);
  overflow: auto;
  padding: 12px;
}

.ps-ticket-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: var(--card);
  color: inherit;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  font: inherit;
}

.ps-ticket-item.is-active {
  border-color: rgba(240, 183, 74, 0.55);
  background: rgba(240, 183, 74, 0.08);
}

.ps-ticket-item-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 13px;
}

.ps-ticket-item-cat {
  font-weight: 600;
}

.ps-ticket-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--gold);
  color: #1a140c;
  font-size: 11px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
}

.ps-ticket-item-preview {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ps-ticket-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ps-ticket-main-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.ps-ticket-main-head h2 {
  margin: 0;
  font-size: 16px;
}

.ps-ticket-main-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.ps-ticket-thread {
  flex: 1;
  overflow: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ps-ticket-msg {
  max-width: 70%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.ps-ticket-msg.is-visitor {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
}

.ps-ticket-msg.is-staff {
  align-self: flex-end;
  background: rgba(240, 183, 74, 0.18);
  border: 1px solid rgba(240, 183, 74, 0.35);
}

.ps-ticket-msg.is-system {
  align-self: center;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  max-width: 90%;
  text-align: center;
}

.ps-ticket-msg a {
  color: var(--gold);
}

.ps-ticket-composer {
  border-top: 1px solid var(--line);
  padding: 14px 18px;
  display: flex;
  gap: 10px;
}

.ps-ticket-composer textarea {
  flex: 1;
  min-height: 72px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

.ps-ticket-composer textarea:focus {
  outline: 2px solid rgba(240, 183, 74, 0.45);
  outline-offset: 1px;
}

.ps-ticket-empty {
  margin: auto;
  color: var(--muted);
  text-align: center;
  padding: 40px 16px;
}

.ps-ticket-login {
  max-width: 380px;
  margin: 12vh auto;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.ps-ticket-login h1 {
  margin: 0 0 8px;
  font-size: 20px;
}

.ps-ticket-login p {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 16px;
}

.ps-ticket-login input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  margin-bottom: 12px;
}

.ps-ticket-error {
  color: #ff8d7b;
  font-size: 13px;
  margin: 0 0 10px;
}

.ps-ticket-status {
  display: flex;
  gap: 6px;
}

@media (max-width: 860px) {
  .ps-ticket-layout {
    grid-template-columns: 1fr;
  }
  .ps-ticket-list {
    max-height: 30vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
