/* Страница поддержки / тикеты — стекло и градиенты в духе miniapp */
html {
  overflow-x: hidden;
  max-width: 100%;
}

#sup-body {
  overflow-x: clip;
  max-width: 100vw;
  overscroll-behavior-x: none;
}

.sup-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  width: 100%;
  padding: 0;
  overflow-x: hidden;
}

.sup-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: calc(0.5rem + env(safe-area-inset-top, 0px)) 0.75rem 0.65rem;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(
    180deg,
    rgba(7, 8, 16, 0.94) 0%,
    rgba(7, 8, 16, 0.78) 55%,
    transparent 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.theme-light .sup-head {
  background: linear-gradient(
    180deg,
    rgba(228, 232, 238, 0.96) 0%,
    rgba(228, 232, 238, 0.82) 55%,
    transparent 100%
  );
}

.sup-back {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(148, 163, 255, 0.22);
  background: rgba(12, 16, 34, 0.55);
  color: rgba(241, 245, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}

body.theme-light .sup-back {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 23, 42, 0.12);
  color: rgba(30, 41, 59, 0.92);
}

.sup-back:active {
  transform: scale(0.97);
}

.sup-title {
  flex: 1;
  text-align: center;
  font-family: "Sora", "IBM Plex Sans", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  color: rgba(248, 250, 255, 0.96);
}

body.theme-light .sup-title {
  color: rgba(15, 23, 42, 0.94);
}

.sup-head-spacer {
  width: 2.5rem;
  flex-shrink: 0;
}

.sup-main {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.45rem max(0.85rem, env(safe-area-inset-left, 0px)) calc(1.1rem + env(safe-area-inset-bottom, 0px))
    max(0.85rem, env(safe-area-inset-right, 0px));
  margin: 0 auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: clip;
}

.sup-canvas {
  width: 100%;
  max-width: min(32rem, 100%);
  margin: 0 auto;
  padding: 1rem 1.05rem 1.15rem;
  border-radius: 1.35rem;
  border: 1px solid rgba(124, 150, 255, 0.2);
  background: rgba(10, 14, 28, 0.52);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 18px 48px -20px rgba(0, 0, 0, 0.55);
  box-sizing: border-box;
}

body.theme-light .sup-canvas {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 12px 36px -14px rgba(15, 23, 42, 0.1);
}

.sup-lead {
  margin: 0 0 1rem;
  line-height: 1.45;
  font-size: 0.92rem;
}

.sup-hero-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(124, 150, 255, 0.35);
  background: linear-gradient(
    135deg,
    rgba(95, 123, 255, 0.35) 0%,
    rgba(124, 92, 255, 0.22) 48%,
    rgba(56, 189, 248, 0.12) 100%
  );
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 14px 40px -12px rgba(56, 70, 140, 0.55);
  cursor: pointer;
  text-align: left;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

body.theme-light .sup-hero-btn {
  border-color: rgba(99, 102, 241, 0.35);
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.2) 0%,
    rgba(14, 165, 233, 0.12) 100%
  );
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 10px 28px -8px rgba(15, 23, 42, 0.12);
}

.sup-hero-btn:active {
  transform: scale(0.99);
}

.sup-hero-btn__ic {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 28, 0.45);
  color: #a5b4fc;
  border: 1px solid rgba(165, 180, 252, 0.35);
}

body.theme-light .sup-hero-btn__ic {
  background: rgba(255, 255, 255, 0.85);
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.35);
}

.sup-hero-btn__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.sup-hero-btn__title {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: rgba(248, 250, 255, 0.98);
}

body.theme-light .sup-hero-btn__title {
  color: rgba(15, 23, 42, 0.96);
}

.sup-hero-btn__sub {
  font-size: 0.82rem;
  color: rgba(203, 213, 245, 0.75);
  line-height: 1.35;
}

body.theme-light .sup-hero-btn__sub {
  color: rgba(51, 65, 85, 0.82);
}

.sup-link-faq {
  margin-top: 0.75rem;
}

.sup-h2 {
  font-family: "Sora", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.85);
  margin: 1.35rem 0 0.65rem;
}

body.theme-light .sup-h2 {
  color: rgba(71, 85, 105, 0.88);
}

.sup-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sup-ticket-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.75rem 0.9rem;
  border-radius: 1rem;
  border: 1px solid rgba(124, 150, 255, 0.16);
  background: rgba(12, 16, 34, 0.55);
  cursor: pointer;
  text-align: left;
  color: inherit;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}

body.theme-light .sup-ticket-row {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(15, 23, 42, 0.1);
}

.sup-ticket-row:active {
  background: rgba(95, 123, 255, 0.12);
}

body.theme-light .sup-ticket-row:active {
  background: rgba(99, 102, 241, 0.1);
}

.sup-ticket-row__top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-weight: 600;
  font-size: 0.88rem;
}

.sup-ticket-row__preview {
  font-size: 0.82rem;
  color: rgba(203, 213, 225, 0.82);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.theme-light .sup-ticket-row__preview {
  color: rgba(51, 65, 85, 0.88);
}

.sup-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.sup-badge--open {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.35);
}

body.theme-light .sup-badge--open {
  background: rgba(22, 163, 74, 0.15);
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.35);
}

.sup-badge--answered {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(147, 197, 253, 0.35);
}

body.theme-light .sup-badge--answered {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.12);
}

.sup-badge--closed {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.sup-textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 1.05rem;
  border: 1px solid rgba(124, 150, 255, 0.22);
  background: rgba(8, 11, 22, 0.65);
  color: rgba(248, 250, 255, 0.95);
  padding: 0.75rem 0.9rem;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.45;
  resize: vertical;
  min-height: 6rem;
  margin-bottom: 0.85rem;
}

body.theme-light .sup-textarea {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.12);
  color: rgba(15, 23, 42, 0.92);
}

.sup-textarea--compact {
  min-height: 2.75rem;
  margin-bottom: 0;
  flex: 1 1 auto;
}

.sup-chat-meta {
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.95);
  margin-bottom: 0.65rem;
  line-height: 1.4;
}

body.theme-light .sup-chat-meta {
  color: rgba(71, 85, 105, 0.9);
}

.sup-chat-log {
  flex: 1 1 auto;
  min-height: 8rem;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.35rem 0.1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0;
  overscroll-behavior: contain;
}

.sup-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 92%;
}

.sup-msg--user {
  align-self: flex-end;
  align-items: flex-end;
}

.sup-msg--admin {
  align-self: flex-start;
}

.sup-msg__bubble {
  padding: 0.68rem 0.9rem;
  border-radius: 1.05rem 1.05rem 1.05rem 0.35rem;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.sup-msg--user .sup-msg__bubble {
  border-radius: 1.05rem 1.05rem 0.35rem 1.05rem;
  background: linear-gradient(135deg, rgba(95, 123, 255, 0.55), rgba(124, 92, 255, 0.38));
  border: 1px solid rgba(165, 180, 252, 0.35);
  color: rgba(248, 250, 255, 0.98);
}

body.theme-light .sup-msg--user .sup-msg__bubble {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(14, 165, 233, 0.22));
  border-color: rgba(99, 102, 241, 0.35);
  color: rgba(15, 23, 42, 0.95);
}

.sup-msg--admin .sup-msg__bubble {
  background: rgba(12, 16, 34, 0.72);
  border: 1px solid rgba(124, 150, 255, 0.2);
  color: rgba(226, 232, 255, 0.94);
}

body.theme-light .sup-msg--admin .sup-msg__bubble {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.1);
  color: rgba(30, 41, 59, 0.94);
}

.sup-msg__time {
  font-size: 0.65rem;
  color: rgba(148, 163, 184, 0.75);
  margin-top: 0.2rem;
}

.sup-view--form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
}

.sup-form-card {
  width: 100%;
  box-sizing: border-box;
  padding: 1rem 1.05rem 1.15rem;
  border-radius: 1.2rem;
  border: 1px solid rgba(124, 150, 255, 0.2);
  background: rgba(10, 14, 28, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 12px 36px -16px rgba(0, 0, 0, 0.55);
}

body.theme-light .sup-form-card {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 10px 28px -12px rgba(15, 23, 42, 0.1);
}

.sup-form-card__title {
  margin: 0 0 0.35rem;
  font-family: "Sora", sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: rgba(248, 250, 255, 0.98);
}

body.theme-light .sup-form-card__title {
  color: rgba(15, 23, 42, 0.95);
}

.sup-form-card__lead {
  margin: 0 0 1rem;
  font-size: 0.84rem;
  line-height: 1.45;
}

.sup-form-card__label {
  display: block;
  margin-bottom: 0.35rem;
}

.sup-view--chat {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100dvh - 4.25rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  border-radius: 1.15rem;
  border: 1px solid rgba(124, 150, 255, 0.18);
  background: rgba(8, 11, 22, 0.45);
  box-sizing: border-box;
  padding: 0.65rem 0.75rem 0.5rem;
}

body.theme-light .sup-view--chat {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.sup-chat-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.sup-chat-compose {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  flex-shrink: 0;
  padding-top: 0.65rem;
  margin-top: auto;
  padding-bottom: calc(0.35rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(124, 150, 255, 0.14);
  background: linear-gradient(180deg, transparent 0%, rgba(7, 8, 16, 0.92) 28%);
}

body.theme-light .sup-chat-compose {
  border-top-color: rgba(15, 23, 42, 0.1);
  background: linear-gradient(180deg, transparent 0%, rgba(228, 232, 238, 0.96) 35%);
}

.sup-chat-send-btn {
  flex-shrink: 0;
  min-height: 2.75rem;
  min-width: 6.5rem;
  padding-left: 1rem;
  padding-right: 1rem;
  border-radius: 0.95rem;
}

.sup-chat-closed {
  margin: 0 0 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.9rem;
  font-size: 0.82rem;
  line-height: 1.45;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: rgba(253, 230, 138, 0.95);
}

body.theme-light .sup-chat-closed {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(217, 119, 6, 0.35);
  color: rgba(120, 53, 15, 0.95);
}

#sup-view-create .ma-label {
  margin-top: 0;
}
