/* Compact support page */

.support-page {
  padding: 18px 14px calc(104px + env(safe-area-inset-bottom, 0px) + 56px);
  max-width: 1040px;
  margin: 0 auto;
  min-height: 100vh;
}

.surface {
  background:
    radial-gradient(circle at top right, rgba(90, 212, 255, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(13, 17, 27, 0.96), rgba(8, 12, 20, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.support-shell {
  padding: 20px;
  display: grid;
  gap: 14px;
}

.support-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 2px 10px;
}

.support-eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--primary);
  font-weight: 700;
}

.support-head h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.05;
}

.support-status-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 999px;
  color: #dff7ff;
  font-size: 13px;
  font-weight: 800;
  background: rgba(75, 211, 255, 0.1);
  border: 1px solid rgba(75, 211, 255, 0.22);
}

.support-status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #63f29b;
  box-shadow: 0 0 16px rgba(99, 242, 155, 0.8);
}

.support-subtitle,
.support-head-note,
.support-email-editor-note,
.chat-hint,
.field-meta small,
.support-mini-info,
.ticket-meta-sub {
  margin: 0;
  color: rgba(232, 242, 255, 0.72);
  line-height: 1.5;
}

.support-head-note {
  max-width: 250px;
  font-size: 14px;
  text-align: right;
}

.support-head-note strong {
  color: #fff;
}

.support-alert {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(75, 211, 255, 0.22);
  background: rgba(75, 211, 255, 0.12);
  color: #dff7ff;
}

.support-alert.success {
  background: rgba(46, 213, 115, 0.12);
  border-color: rgba(46, 213, 115, 0.24);
  color: #d9ffe7;
}

.support-alert.error {
  background: rgba(255, 106, 106, 0.12);
  border-color: rgba(255, 106, 106, 0.24);
  color: #ffdede;
}

.support-email-bar,
.ticket-meta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.support-email-main strong,
.ticket-meta-cell strong {
  display: block;
  margin-top: 4px;
  font-size: 17px;
}

.support-email-label,
.ticket-meta-cell span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(147, 166, 196, 0.86);
}

.support-email-editor {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.support-email-editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
}

.support-email-editor input,
.field input,
.field textarea,
.field .select,
.chat-input {
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 15px;
  padding: 14px 15px;
  color: var(--text);
  font: inherit;
}

.support-email-editor input:focus,
.field input:focus,
.field textarea:focus,
.field .select:focus,
.chat-input:focus {
  outline: none;
  border-color: rgba(75, 211, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(75, 211, 255, 0.12);
}

.support-view {
  width: 100%;
}

.ticket-form {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(75, 211, 255, 0.055), rgba(255, 106, 213, 0.035)),
    rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.support-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.72fr);
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field > span {
  font-size: 12px;
  font-weight: 700;
  color: rgba(232, 242, 255, 0.92);
}

.field textarea {
  min-height: 158px;
  resize: vertical;
  line-height: 1.55;
}

.field .select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%235ad4ff"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}

.field-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  font-size: 13px;
  color: rgba(147, 166, 196, 0.82);
}

.support-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.support-mini-info {
  font-size: 13px;
  text-align: right;
}

.ticket-meta-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.ticket-meta-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ticket-meta-main h2 {
  margin: 0;
  font-size: 24px;
}

.ticket-meta-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ticket-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ticket-meta-cell {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ticket-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.ticket-status-badge.open {
  background: rgba(255, 152, 0, 0.12);
  border-color: rgba(255, 152, 0, 0.2);
  color: #ffcc80;
}

.ticket-status-badge.answered {
  background: rgba(46, 213, 115, 0.12);
  border-color: rgba(46, 213, 115, 0.22);
  color: #8dffc1;
}

.ticket-status-badge.closed {
  background: rgba(147, 166, 196, 0.12);
  border-color: rgba(147, 166, 196, 0.2);
  color: rgba(232, 242, 255, 0.78);
}

.chat-shell {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.chat-messages {
  min-height: 320px;
  max-height: min(46vh, 520px);
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, rgba(75, 211, 255, 0.05), rgba(11, 15, 25, 1));
}

.message {
  display: flex;
}

.message-content {
  max-width: min(80%, 700px);
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.message-content.own {
  margin-left: auto;
  background: linear-gradient(135deg, rgba(75, 211, 255, 0.15), rgba(255, 106, 213, 0.14));
  border-color: rgba(75, 211, 255, 0.24);
}

.message-content.admin {
  background: linear-gradient(135deg, rgba(46, 213, 115, 0.13), rgba(75, 211, 255, 0.1));
  border-color: rgba(46, 213, 115, 0.22);
}

.message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.message-nickname {
  font-weight: 700;
  color: var(--primary);
}

.message-content.admin .message-nickname {
  color: #7df0a8;
}

.message-content.own .message-nickname {
  color: #ffd6f2;
}

.message-time {
  font-size: 12px;
  color: rgba(147, 166, 196, 0.8);
}

.message-text {
  white-space: pre-wrap;
  line-height: 1.55;
}

.chat-input-container {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 15, 25, 0.92);
}

.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.chat-input {
  flex: 1;
  min-height: 50px;
  max-height: 140px;
  resize: none;
}

.send-btn {
  min-width: 118px;
  padding: 13px 16px;
  border: none;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #081018;
  font-weight: 800;
  cursor: pointer;
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.loading,
.empty-state {
  padding: 24px;
  text-align: center;
  color: rgba(232, 242, 255, 0.72);
}

.empty-state-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.chat-hint {
  min-height: 0;
  margin-top: 0;
}

.chat-hint:empty {
  display: none;
}

@media (min-width: 781px) {
  .ticket-form .support-actions .btn {
    min-width: 180px;
  }
}

@media (max-width: 960px) {
  .support-form-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 780px) {
  .support-shell {
    padding: 16px;
  }

  .support-head,
  .support-email-bar,
  .ticket-meta-main,
  .support-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .support-head-note,
  .support-mini-info {
    text-align: left;
    max-width: none;
  }

  .support-email-editor-row,
  .support-form-row,
  .ticket-meta-grid,
  .chat-input-wrapper {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .send-btn {
    width: 100%;
  }

  .support-actions .btn {
    width: 100%;
  }

  .message-content {
    max-width: 88%;
  }
}
