/* Support tickets */

.support-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 0%, rgba(var(--accent-rgb), 0.055), transparent 34rem),
    linear-gradient(180deg, #0b0c0f 0%, var(--bg) 38rem);
}

.support-page .cabinet-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.78), transparent 72%);
}

.support-main,
.support-page .footer {
  position: relative;
  z-index: 1;
}

.support-main {
  padding-top: calc(var(--site-header-h) + 1.25rem);
}

.support-hero__inner,
.support-shell {
  width: min(1240px, calc(100vw - 2rem));
  margin: 0 auto;
}

.support-hero {
  padding: clamp(0.95rem, 2vw, 1.5rem) 0 0.75rem;
}

.support-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(22rem, 0.48fr);
  align-items: end;
  gap: clamp(1rem, 2.5vw, 1.8rem);
}

.support-breadcrumb {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin-bottom: 0.3rem;
  color: var(--text-dim);
  font-size: 0.76rem;
  font-weight: 700;
}

.support-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.18s ease;
}

.support-breadcrumb a:hover {
  color: var(--accent);
}

.support-hero__copy .section-tag,
.support-create__head .section-tag {
  margin-bottom: 0.5rem;
  font-size: 0.64rem;
  letter-spacing: 0.12em;
}

.support-hero__copy h1 {
  max-width: 18ch;
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.45vw, 3rem);
  font-weight: 850;
  line-height: 1.02;
  letter-spacing: 0;
}

.support-hero__copy p {
  max-width: 39rem;
  margin: 0.72rem 0 0;
  color: var(--text-muted);
  font-size: clamp(0.9rem, 1.1vw, 1rem);
  line-height: 1.55;
}

.support-hero__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.support-hero__metrics div {
  min-width: 0;
  padding: 0.75rem 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.support-hero__metrics strong,
.support-hero__metrics span {
  display: block;
}

.support-hero__metrics strong {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: clamp(0.98rem, 1.5vw, 1.28rem);
  font-weight: 800;
  line-height: 1.05;
}

.support-hero__metrics span {
  margin-top: 0.26rem;
  color: var(--text-dim);
  font-size: 0.66rem;
  font-weight: 750;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.support-shell {
  padding: 0.65rem 0 clamp(2.2rem, 4vw, 3.5rem);
}

.support-alert {
  margin-bottom: 0.8rem;
  padding: 0.72rem 0.85rem;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 750;
}

.support-alert--success {
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  background: rgba(var(--accent-rgb), 0.07);
}

.support-alert--warning {
  color: #ffd38a;
  border: 1px solid rgba(255, 211, 138, 0.22);
  background: rgba(255, 211, 138, 0.07);
}

.support-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(9.5rem, 1fr));
  gap: 0.28rem;
  margin-bottom: 0.72rem;
  padding: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.support-tab {
  display: grid;
  gap: 0.14rem;
  min-width: 0;
  min-height: 2.95rem;
  padding: 0.52rem 0.78rem;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.support-tab span,
.support-tab small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-tab span {
  color: inherit;
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.1;
}

.support-tab small {
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
}

.support-tab:hover,
.support-tab:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  outline: none;
}

.support-tab.is-active {
  border-color: rgba(var(--accent-rgb), 0.26);
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), rgba(255, 255, 255, 0.04));
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.support-tab.is-active small {
  color: var(--accent);
}

.support-tab-panel {
  animation: supportPanelIn 0.22s ease both;
}

.support-tab-panel[hidden] {
  display: none !important;
}

.support-auth,
.support-create,
.support-workspace {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    rgba(12, 14, 19, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 42px rgba(0, 0, 0, 0.22);
  animation: supportRise 0.42s ease both;
}

.support-auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem;
  padding: clamp(1rem, 2.2vw, 1.35rem);
}

.support-auth__label {
  display: inline-flex;
  margin-bottom: 0.44rem;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.support-auth h2,
.support-create__head h2,
.support-rail__head h2,
.support-thread-head h2,
.support-thread-empty h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  letter-spacing: 0;
}

.support-auth h2,
.support-create__head h2 {
  font-size: clamp(1.12rem, 1.8vw, 1.45rem);
  line-height: 1.12;
}

.support-auth p,
.support-create__head p {
  max-width: 48rem;
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.support-auth__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.support-workspace {
  display: grid;
  grid-template-columns: minmax(17.5rem, 0.34fr) minmax(0, 1fr);
  min-height: 25.5rem;
}

.support-workspace--admin {
  margin-bottom: 1rem;
}

.support-rail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.18);
}

.support-rail__head,
.support-thread-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.support-rail__head h2,
.support-thread-head h2 {
  font-size: 0.98rem;
  line-height: 1.25;
}

.support-rail__head p,
.support-thread-head p {
  margin: 0.22rem 0 0;
  color: var(--text-dim);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.35;
}

.support-rail__new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.support-rail__new:hover,
.support-rail__new:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.13);
  outline: none;
  transform: translateY(-1px);
}

.support-ticket-list {
  display: grid;
  align-content: start;
  gap: 0.42rem;
  min-height: 0;
  max-height: 34rem;
  padding: 0.64rem;
  overflow: auto;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.support-ticket-link {
  position: relative;
  display: grid;
  gap: 0.28rem;
  min-width: 0;
  padding: 0.72rem 0.76rem;
  border: 1px solid transparent;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.support-ticket-link::before {
  content: "";
  position: absolute;
  top: 0.65rem;
  bottom: 0.65rem;
  left: 0;
  width: 2px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.support-ticket-link:hover,
.support-ticket-link:focus-visible {
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.055);
  outline: none;
  transform: translateX(2px);
}

.support-ticket-link.is-active {
  border-color: rgba(var(--accent-rgb), 0.28);
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.105), rgba(255, 255, 255, 0.04));
}

.support-ticket-link.is-active::before {
  opacity: 1;
}

.support-ticket-link__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-width: 0;
}

.support-ticket-link__top strong {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 780;
  line-height: 1;
  white-space: nowrap;
}

.support-ticket-link__subject {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.28;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.support-ticket-link__meta {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  min-width: 0;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.support-ticket-link__meta span:first-child {
  min-width: 0;
}

.support-ticket-link__unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.32rem;
  border-radius: 999px;
  background: var(--accent);
  color: #0a0b0d;
  font-size: 0.62rem;
  font-weight: 850;
  line-height: 1;
}

.support-status {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  min-height: 1.38rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.support-status::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.support-status--active {
  color: #ffd38a;
  background: rgba(255, 211, 138, 0.105);
}

.support-status--done {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.105);
}

.support-status--cancelled {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.055);
}

.support-empty,
.support-thread-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.35rem;
  min-height: 11rem;
  padding: 1rem;
  color: var(--text-dim);
  text-align: center;
}

.support-empty strong,
.support-thread-empty h2 {
  color: var(--text);
}

.support-empty span,
.support-thread-empty p {
  max-width: 22rem;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
}

.support-thread-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 25.5rem;
}

.support-thread-head__num {
  display: inline-flex;
  margin-bottom: 0.24rem;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.support-thread-head__actions,
.support-status-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.support-status-form select {
  min-height: 2.1rem;
  padding: 0 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font: inherit;
}

.support-link-button {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0 0.68rem;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.support-link-button:hover,
.support-link-button:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.34);
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.06);
  outline: none;
}

.support-thread {
  display: grid;
  align-content: start;
  gap: 0.74rem;
  min-height: 0;
  max-height: 36rem;
  padding: 1rem;
  overflow: auto;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.support-message {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  min-width: 0;
}

.support-message--admin {
  justify-content: flex-start;
}

.support-message--user {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.support-message__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  flex: 0 0 auto;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.09);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 800;
}

.support-message--admin .support-message__avatar {
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-muted);
}

.support-message__bubble {
  width: fit-content;
  max-width: min(70%, 42rem);
  padding: 0.72rem 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  overflow-wrap: anywhere;
}

.support-message--user .support-message__bubble {
  border-color: rgba(var(--accent-rgb), 0.2);
  background: rgba(var(--accent-rgb), 0.095);
  border-bottom-right-radius: 4px;
}

.support-message--admin .support-message__bubble {
  border-bottom-left-radius: 4px;
}

.support-message__bubble header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.28rem;
}

.support-message__bubble strong {
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 850;
}

.support-message__bubble time {
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.support-message__bubble p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.support-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.64rem;
  padding: 0.9rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.13);
}

.support-composer label {
  grid-column: 1 / -1;
}

.support-composer .support-field-error {
  grid-column: 1 / -1;
}

.support-composer label,
.support-field span {
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 820;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.support-composer textarea,
.support-field input,
.support-field select,
.support-field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.support-composer textarea {
  min-height: 3.4rem;
  max-height: 10rem;
  padding: 0.72rem 0.8rem;
  resize: vertical;
  line-height: 1.45;
}

.support-field textarea {
  min-height: 7.2rem;
  padding: 0.72rem 0.8rem;
  resize: vertical;
  line-height: 1.5;
}

.support-field input,
.support-field select {
  min-height: 2.45rem;
  padding: 0 0.78rem;
}

.support-composer textarea:focus,
.support-field input:focus,
.support-field select:focus,
.support-field textarea:focus {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.095);
}

.support-field-error,
.support-field small {
  margin: 0;
  color: var(--accent-hot);
  font-size: 0.76rem;
  font-weight: 650;
}

.support-create {
  margin-top: 0;
  padding: clamp(0.95rem, 2vw, 1.25rem);
}

.support-create__head {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 0.9rem;
}

.support-form {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr 1fr;
  gap: 0.7rem;
}

.support-field {
  display: grid;
  align-content: start;
  gap: 0.36rem;
  min-width: 0;
}

.support-field--wide {
  grid-column: 1 / -1;
}

.support-form__submit {
  grid-column: 1 / -1;
  justify-self: start;
  min-height: 2.65rem;
}

.support-pagination {
  padding: 0.68rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.support-pagination nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.support-pagination a,
.support-pagination span {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.support-thread-empty__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 12px;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.075);
  font-family: var(--font-display);
  font-weight: 900;
}

@keyframes supportRise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes supportPanelIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .support-hero__inner,
  .support-workspace {
    grid-template-columns: 1fr;
  }

  .support-rail {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .support-ticket-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }
}

@media (max-width: 768px) {
  .support-main {
    padding-top: calc(var(--mobile-header-offset, var(--site-header-h)) + 0.75rem);
  }

  .support-hero {
    padding-top: 0.7rem;
  }

  .support-hero__inner,
  .support-shell {
    width: min(100% - 1rem, 1240px);
  }

  .support-breadcrumb {
    margin-bottom: 0.2rem;
    font-size: 0.72rem;
  }

  .support-hero__copy h1 {
    font-size: clamp(1.75rem, 9vw, 2.55rem);
  }

  .support-hero__copy p {
    margin-top: 0.55rem;
    font-size: 0.88rem;
  }

  .support-hero__metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.38rem;
  }

  .support-hero__metrics div {
    padding: 0.58rem 0.5rem;
    border-radius: 10px;
  }

  .support-hero__metrics strong {
    font-size: 0.94rem;
  }

  .support-hero__metrics span {
    font-size: 0.56rem;
    letter-spacing: 0.04em;
  }

  .support-auth {
    grid-template-columns: 1fr;
  }

  .support-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .support-tab {
    min-height: 2.72rem;
    padding: 0.48rem 0.62rem;
  }

  .support-tab span {
    font-size: 0.8rem;
  }

  .support-tab small {
    font-size: 0.62rem;
  }

  .support-auth__actions,
  .support-auth__actions .btn {
    width: 100%;
  }

  .support-workspace {
    min-height: 0;
    border-radius: 14px;
  }

  .support-ticket-list {
    grid-template-columns: 1fr;
    gap: 0.38rem;
    max-height: min(48svh, 22rem);
    padding: 0.55rem;
  }

  .support-ticket-link {
    padding: 0.68rem 0.72rem;
  }

  .support-thread-panel {
    min-height: 16rem;
  }

  .support-thread-head,
  .support-rail__head {
    flex-direction: column;
    padding: 0.82rem;
  }

  .support-thread-head__actions,
  .support-status-form {
    justify-content: flex-start;
    width: 100%;
  }

  .support-status-form select,
  .support-status-form .btn {
    width: 100%;
  }

  .support-thread,
  .support-composer,
  .support-create {
    padding: 0.82rem;
  }

  .support-empty,
  .support-thread-empty {
    min-height: 9.5rem;
  }

  .support-message {
    gap: 0.42rem;
  }

  .support-message__avatar {
    width: 1.55rem;
    height: 1.55rem;
    font-size: 0.62rem;
  }

  .support-message__bubble {
    max-width: calc(100% - 2rem);
    padding: 0.66rem 0.72rem;
  }

  .support-message__bubble header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.12rem;
  }

  .support-composer,
  .support-form {
    grid-template-columns: 1fr;
  }

  .support-composer button,
  .support-form__submit {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .support-auth,
  .support-create,
  .support-workspace,
  .support-tab-panel,
  .support-tab,
  .support-ticket-link,
  .support-rail__new {
    animation: none;
    transition: none;
  }
}
