:root {
  --bg: #0d0b14;
  --bg2: #13101e;
  --text: #f0eeff;
  --muted: #7b6fa0;
  --line: rgba(139, 92, 246, 0.12);
  --line2: rgba(139, 92, 246, 0.22);
  --card: rgba(19, 16, 30, 0.72);
  --card-strong: rgba(24, 20, 40, 0.88);
  --accent: #a855f7;
  --accent2: #c084fc;
  --pdim: rgba(168, 85, 247, 0.10);
  --pbdr: rgba(168, 85, 247, 0.26);
  --success: #86efac;
  --warning: #fcd34d;
  --danger: #fca5a5;
  --shadow: 0 22px 54px rgba(2, 0, 18, 0.52);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  color: var(--text);
  font-family: "Manrope", -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.06) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

.app-shell {
  position: relative;
  min-height: 100vh;
  padding: max(18px, env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
}

/* ambient glow — CSS only, no canvas */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80vw 55vh at 12% 0%, rgba(139,92,246,0.10), transparent 60%),
    radial-gradient(ellipse 55vw 45vh at 88% 100%, rgba(168,85,247,0.07), transparent 55%);
}

#particles-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.topbar,
.app-main,
.mini-menu,
.copy-toast {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--line2);
  background: rgba(19, 16, 30, 0.85);
  backdrop-filter: blur(12px);
  color: var(--text);
  box-shadow: var(--shadow);
}

.brand-pill__logo {
  width: 30px;
  height: 30px;
  border-radius: 6px;
}

.brand-pill__text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-family: "JetBrains Mono", monospace;
}

.topbar-link {
  min-height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 1px solid var(--line2);
  background: rgba(19, 16, 30, 0.80);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", monospace;
  transition: color .15s, border-color .15s;
}

.topbar-link:hover {
  color: var(--accent2);
  border-color: var(--pbdr);
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line2);
  border-radius: 4px;
  background: rgba(19, 16, 30, 0.80);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.icon-button:hover {
  border-color: var(--pbdr);
  color: var(--text);
}

.icon-button span {
  display: block;
  width: 12px;
  height: 1.5px;
  margin: 2px 0;
  border-radius: 999px;
  background: currentColor;
}

.app-main {
  display: grid;
  gap: 12px;
}

.panel {
  border: 1px solid var(--line2);
  border-radius: 6px;
  background: rgba(19, 16, 30, 0.80);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(168,85,247,0.40), transparent);
}

.hero-card {
  padding: 22px 20px 20px;
}

.hero-grid {
  position: relative;
  display: grid;
  gap: 16px;
}

.hero-copy { max-width: 28rem; }

.hero-eyebrow,
.section-kicker,
.install-card__eyebrow {
  color: var(--accent2);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-family: "JetBrains Mono", monospace;
}

.hero-title,
.section-title,
.install-card__title {
  margin: 8px 0 6px;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  line-height: 1.04;
  font-weight: 700;
}

.hero-title {
  font-size: clamp(28px, 7vw, 40px);
  letter-spacing: -0.03em;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.section-title {
  font-size: clamp(22px, 5vw, 28px);
  letter-spacing: -0.02em;
}

.install-card__title {
  font-size: 22px;
}

.hero-text,
.section-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.hero-text {
  max-width: 24rem;
  font-size: clamp(15px, 4vw, 18px);
  font-weight: 600;
  line-height: 1.3;
  color: rgba(240, 238, 255, 0.75);
}

.hero-meta,
.device-tabs,
.platform-list,
.client-chips,
.install-steps,
.server-grid {
  display: grid;
  gap: 8px;
}

.hero-meta { margin-top: 14px; }

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", monospace;
}

.status-badge--success {
  background: rgba(134, 239, 172, 0.15);
  border: 1px solid rgba(134, 239, 172, 0.30);
  color: #86efac;
}

.status-badge--warning {
  background: rgba(252, 211, 77, 0.12);
  border: 1px solid rgba(252, 211, 77, 0.28);
  color: #fcd34d;
}

.status-badge--danger {
  background: rgba(252, 165, 165, 0.12);
  border: 1px solid rgba(252, 165, 165, 0.28);
  color: #fca5a5;
}

.summary-card,
.server-card,
.device-card {
  padding: 18px 16px;
}

.summary-card {
  border: 1px solid var(--line2);
  border-radius: 4px;
  background: rgba(13, 11, 20, 0.60);
}

.summary-line {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.summary-line:first-child { padding-top: 0; }
.summary-line:last-child { border-bottom: 0; padding-bottom: 0; }

.summary-line span {
  color: var(--muted);
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.summary-line strong {
  font-size: 15px;
  line-height: 1.35;
  color: var(--text);
}

.summary-line--muted strong { color: rgba(240, 238, 255, 0.65); }

.server-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
  gap: 6px;
}

.server-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  color: var(--muted);
  text-align: center;
  border: 1px solid var(--line2);
  border-radius: 4px;
  background: rgba(13, 11, 20, 0.60);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}

.server-chip:hover {
  border-color: var(--pbdr);
  color: var(--text);
  background: var(--pdim);
}

.server-chip.is-active {
  color: #fff;
  border-color: var(--pbdr);
  background: linear-gradient(135deg, rgba(168,85,247,0.22), rgba(124,58,237,0.18));
  box-shadow: 0 0 0 1px rgba(168,85,247,0.20);
}

.notice-banner {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 4px;
  border: 1px solid rgba(252, 211, 77, 0.20);
  background: rgba(40, 28, 0, 0.44);
  color: #fcd34d;
  font-size: 13px;
  line-height: 1.5;
}

.notice-banner.is-visible { display: block; }

.device-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.device-tab,
.platform-card,
.client-chip,
.ghost-link,
.config-pill {
  border: 1px solid var(--line2);
  border-radius: 4px;
  background: rgba(13, 11, 20, 0.60);
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.device-tab {
  min-height: 44px;
  padding: 0 14px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", monospace;
  color: var(--muted);
}

.device-tab:hover,
.platform-card:hover,
.client-chip:hover {
  border-color: var(--pbdr);
  background: var(--pdim);
  color: var(--text);
}

.device-tab.is-active,
.platform-card.is-active,
.client-chip.is-active {
  border-color: var(--pbdr);
  background: linear-gradient(135deg, rgba(168,85,247,0.18), rgba(124,58,237,0.12));
  color: var(--accent2);
  box-shadow: 0 0 0 1px rgba(168,85,247,0.15);
}

.platform-list { margin-top: 10px; }

.platform-card {
  min-height: 64px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 4px;
}

.platform-card img {
  width: 36px;
  height: 36px;
  padding: 6px;
  border-radius: 6px;
  background: rgba(255,255,255,0.92);
  flex-shrink: 0;
}

.platform-card__label {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.platform-card__meta {
  display: block;
  margin-top: 2px;
  min-height: 14px;
  color: var(--muted);
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
}

.install-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line2);
  border-radius: 4px;
  background: rgba(13, 11, 20, 0.70);
}

.install-card.is-animating .platform-card,
.install-card.is-animating .client-chip,
.install-card.is-animating .step-card,
.install-card.is-animating .primary-link,
.install-card.is-animating .ghost-link,
.install-card.is-animating .config-pill {
  animation: installPulse 0.28s ease;
}

@keyframes installPulse {
  0% { opacity: 0.6; transform: translateY(5px); }
  100% { opacity: 1; transform: translateY(0); }
}

.client-chips {
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  margin-top: 10px;
}

.client-chip {
  min-height: 40px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", monospace;
  color: var(--muted);
}

.install-steps,
.step-card__actions {
  margin-top: 12px;
}

.step-card__actions .primary-link,
.step-card__actions .ghost-link,
.step-card__actions .config-pill {
  width: 100%;
}

.step-card {
  min-height: 90px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(13, 11, 20, 0.50);
}

.step-card__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  background: rgba(168, 85, 247, 0.10);
  border: 1px solid rgba(168, 85, 247, 0.28);
  color: var(--accent2);
  font-weight: 700;
  font-size: 12px;
  font-family: "JetBrains Mono", monospace;
}

.step-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.step-card__hint {
  margin-top: 8px;
  color: rgba(240, 238, 255, 0.50);
  line-height: 1.45;
  font-size: 12px;
}

.step-card__actions { display: grid; gap: 8px; }

.step-card__note {
  margin-top: 8px;
  color: rgba(240, 238, 255, 0.55);
  line-height: 1.45;
  font-size: 12px;
}

.step-card__note a {
  color: var(--accent2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.step-card__or {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", monospace;
}

.primary-link,
.ghost-link,
.config-pill {
  min-height: 48px;
  padding: 12px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", monospace;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}

.primary-link {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  box-shadow: 0 10px 24px rgba(168,85,247,0.30);
  text-decoration: none;
}

.primary-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(168,85,247,0.40);
}

.ghost-link,
.config-pill {
  color: var(--text);
  text-decoration: none;
}

.ghost-link:hover,
.config-pill:hover {
  border-color: var(--pbdr);
  background: var(--pdim);
}

.mini-menu {
  position: absolute;
  top: 62px;
  right: 16px;
  min-width: 200px;
  padding: 8px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  background: rgba(19, 16, 30, 0.95);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  transform-origin: top right;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 10;
}

.mini-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.mini-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: color .15s, background .15s;
}

.mini-menu a:hover {
  color: var(--text);
  background: var(--pdim);
}

.copy-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  padding: 12px 16px;
  border-radius: 4px;
  border: 1px solid var(--pbdr);
  background: rgba(19, 16, 30, 0.96);
  backdrop-filter: blur(14px);
  color: var(--accent2);
  text-align: center;
  font-size: 13px;
  font-family: "JetBrains Mono", monospace;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 20;
}

.copy-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.step-card__actions .primary-link { font-family: "JetBrains Mono", monospace; }

.support-hero-grid,
.support-actions-grid,
.support-cards-grid,
.faq-list {
  display: grid;
  gap: 12px;
}

.support-summary .step-card__actions {
  margin-top: 14px;
}

.support-section {
  padding: 20px 18px;
}

.support-actions-grid,
.support-cards-grid {
  margin-top: 16px;
}

.support-action-card,
.support-card,
.support-template,
.faq-item {
  border: 1px solid var(--line2);
  border-radius: 4px;
  background: rgba(13, 11, 20, 0.56);
}

.support-action-card,
.support-card {
  padding: 16px;
}

.support-action-card__title,
.support-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.35;
  font-family: "Space Grotesk", "Manrope", sans-serif;
}

.support-card__badge {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--pbdr);
  background: var(--pdim);
  color: var(--accent2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", monospace;
}

.support-card p,
.faq-item__body,
.support-list {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.support-list {
  padding-left: 18px;
}

.support-list li + li {
  margin-top: 8px;
}

.support-template {
  margin-top: 16px;
  padding: 14px;
  overflow-x: auto;
}

.support-template pre {
  margin: 0;
  white-space: pre-wrap;
  color: var(--text);
  line-height: 1.6;
  font-size: 12px;
  font-family: "JetBrains Mono", monospace;
}

.support-template-actions {
  margin-top: 14px;
}

.faq-list {
  margin-top: 16px;
}

.faq-item {
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item__tag {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", monospace;
}

.faq-item__tag--accent {
  border-color: rgba(252, 211, 77, 0.28);
  background: rgba(252, 211, 77, 0.1);
  color: var(--warning);
}

.faq-item__body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}

.support-chat-panel {
  padding: 20px 18px;
}

/* ── thread header ── */
.support-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.support-thread-title {
  margin: 0;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: clamp(16px, 3.5vw, 20px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* ── messages area ── */
.support-chat-messages {
  display: grid;
  gap: 6px;
  min-height: 80px;
  max-height: min(52vh, 480px);
  overflow-y: auto;
  padding: 4px 2px 4px 0;
  scroll-behavior: smooth;
}

.support-chat-messages::-webkit-scrollbar { width: 3px; }
.support-chat-messages::-webkit-scrollbar-track { background: transparent; }
.support-chat-messages::-webkit-scrollbar-thumb {
  background: var(--line2);
  border-radius: 999px;
}

/* ── empty state ── */
.support-chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 20px;
  border: 1px dashed var(--line2);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

/* prevent display:flex from overriding [hidden] */
.support-chat-empty[hidden] { display: none; }

.support-chat-empty::before {
  content: "";
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--line2);
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    linear-gradient(135deg, rgba(168,85,247,0.4), rgba(124,58,237,0.2)) border-box;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%237b6fa0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  opacity: 0.7;
}

/* ── message bubbles ── */
.support-message {
  position: relative;
  max-width: 82%;
  padding: 9px 13px 10px;
  border-radius: 14px;
  border: 1px solid var(--line2);
  background: rgba(13, 11, 20, 0.72);
  word-break: break-word;
}

.support-message--user {
  justify-self: end;
  border-color: rgba(168, 85, 247, 0.30);
  background: linear-gradient(145deg, rgba(168,85,247,0.24), rgba(109,40,217,0.16));
  border-bottom-right-radius: 4px;
}

.support-message--support {
  justify-self: start;
  background: rgba(22, 18, 36, 0.80);
  border-color: rgba(139, 92, 246, 0.18);
  border-bottom-left-radius: 4px;
}

.support-message--pending {
  opacity: 0.55;
  pointer-events: none;
}

.support-message--pending .support-message__meta::after {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 5px;
  vertical-align: middle;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.support-message__meta {
  margin-bottom: 4px;
  color: rgba(240, 238, 255, 0.45);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", monospace;
  line-height: 1.3;
}

.support-message--user .support-message__meta {
  text-align: right;
}

.support-message__body {
  white-space: pre-wrap;
  color: var(--text);
  line-height: 1.58;
  font-size: 14px;
}

.support-message__attachments {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}

.support-attachment {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  background: rgba(13, 11, 20, 0.55);
}

.support-attachment__media {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}

.support-attachment__caption {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  font-family: "JetBrains Mono", monospace;
}

/* ── gap between consecutive same-sender messages ── */
.support-message--user + .support-message--user,
.support-message--support + .support-message--support {
  margin-top: -2px;
}

/* ── compose box ── */
.support-chat-form {
  margin-top: 16px;
}

.support-compose-box {
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: rgba(13, 11, 20, 0.72);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.support-compose-box:focus-within {
  border-color: var(--pbdr);
  box-shadow: 0 0 0 1px rgba(168,85,247,0.12);
}

.support-compose-box textarea {
  display: block;
  width: 100%;
  min-height: 88px;
  max-height: 280px;
  resize: none;
  overflow-y: auto;
  padding: 14px 14px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  outline: none;
}

.support-compose-box textarea::placeholder {
  color: rgba(123, 111, 160, 0.72);
}

.support-upload-card__input { display: none; }

.support-upload-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 12px 10px;
}

.support-upload-strip:empty { display: none; }

.support-upload-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 200px;
  padding: 5px 8px 5px 10px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  background: rgba(19, 16, 30, 0.70);
}

.support-upload-pill__meta { min-width: 0; }

.support-upload-pill__meta strong,
.support-upload-pill__meta small { display: block; }

.support-upload-pill__meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--text);
  line-height: 1.3;
}

.support-upload-pill__meta small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  font-family: "JetBrains Mono", monospace;
}

.support-upload-pill__remove {
  flex-shrink: 0;
  border: 0;
  padding: 2px 4px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  border-radius: 3px;
  transition: color 0.12s;
}
.support-upload-pill__remove:hover { color: var(--danger); }

/* ── compose action bar ── */
.support-compose-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 12px;
  border-top: 1px solid var(--line);
}

.support-compose-attach {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.support-compose-attach:hover {
  color: var(--accent2);
  border-color: var(--line2);
  background: var(--pdim);
}

.support-compose-meta {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.support-chat-counter {
  color: rgba(123, 111, 160, 0.7);
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  line-height: 1;
}

.support-chat-attachment-hint {
  color: rgba(123, 111, 160, 0.55);
  font-size: 11px;
}

.support-chat-keyboard-hint {
  color: rgba(123, 111, 160, 0.45);
  font-size: 10px;
  font-family: "JetBrains Mono", monospace;
}

.support-compose-send {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", monospace;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(168,85,247,0.30);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.support-compose-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(168,85,247,0.42);
}

.support-compose-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* send arrow icon */
.support-compose-send svg {
  flex-shrink: 0;
}

.support-settings-form {
  display: grid;
  gap: 12px;
}

.support-settings-form input[type="email"] {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line2);
  border-radius: 4px;
  background: rgba(13, 11, 20, 0.72);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s;
}

.support-settings-form input[type="email"]:focus {
  outline: none;
  border-color: var(--pbdr);
  box-shadow: 0 0 0 1px rgba(168,85,247,0.15);
}

/* ── page-level chat toast ── */
.support-chat-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  max-width: 520px;
  margin: 0 auto;
  padding: 13px 18px;
  border-radius: 6px;
  border: 1px solid var(--pbdr);
  background: rgba(19, 16, 30, 0.96);
  backdrop-filter: blur(16px);
  color: var(--accent2);
  font-size: 13px;
  font-family: "JetBrains Mono", monospace;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 20;
}

.support-chat-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.support-chat-toast--success {
  border-color: rgba(134, 239, 172, 0.3);
  background: rgba(10, 36, 18, 0.96);
  color: var(--success);
}

.support-chat-toast--error {
  border-color: rgba(252, 165, 165, 0.3);
  background: rgba(44, 12, 12, 0.96);
  color: var(--danger);
}

/* ── settings panel ── */
.support-settings-panel {
  padding: 20px 18px;
}

.support-settings-header {
  margin-bottom: 18px;
}

.support-settings-header .section-title {
  margin-top: 6px;
}

.support-settings-header .section-text {
  margin-top: 8px;
}

/* ── styled toggle switch ── */
.support-toggle-switch {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line2);
  border-radius: 4px;
  background: rgba(13, 11, 20, 0.62);
  cursor: pointer;
  transition: border-color 0.15s;
}

.support-toggle-switch:hover {
  border-color: var(--pbdr);
}

.support-toggle-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.support-toggle-switch__track {
  flex-shrink: 0;
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid var(--line2);
  transition: background 0.2s, border-color 0.2s;
}

.support-toggle-switch__thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s, background 0.2s;
}

.support-toggle-switch input:checked ~ .support-toggle-switch__track {
  background: linear-gradient(135deg, rgba(168,85,247,0.5), rgba(124,58,237,0.4));
  border-color: var(--pbdr);
}

.support-toggle-switch input:checked ~ .support-toggle-switch__track .support-toggle-switch__thumb {
  transform: translateX(18px);
  background: var(--accent2);
}

.support-toggle-switch input:disabled ~ .support-toggle-switch__track {
  opacity: 0.38;
}

.support-toggle-switch__label {
  flex: 1;
  min-width: 0;
}

.support-toggle-switch__label strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  line-height: 1.3;
}

.support-toggle-switch__label small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

/* updated actions layout: primary + ghost side by side */
.support-settings-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.support-settings-actions .primary-link,
.support-settings-actions .ghost-link {
  flex: 1 1 120px;
}

/* ── UUID entry card on /support landing ── */
.support-uuid-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.support-uuid-card .hero-eyebrow {
  margin-bottom: -4px;
}

.support-uuid-card__hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.support-uuid-form {
  display: grid;
  gap: 8px;
}

.support-uuid-form input[type="text"] {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line2);
  border-radius: 4px;
  background: rgba(13, 11, 20, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.04em;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.support-uuid-form input[type="text"]:focus {
  outline: none;
  border-color: var(--pbdr);
  box-shadow: 0 0 0 1px rgba(168,85,247,0.15);
}

.support-uuid-form input[type="text"]::placeholder {
  color: rgba(123, 111, 160, 0.5);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.support-uuid-form input[type="text"].is-error {
  border-color: rgba(252, 165, 165, 0.6);
  box-shadow: 0 0 0 1px rgba(252, 165, 165, 0.2);
}

.support-uuid-form .primary-link {
  width: 100%;
}

.support-uuid-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(123, 111, 160, 0.5);
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.support-uuid-or::before,
.support-uuid-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.support-uuid-tg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line2);
  border-radius: 4px;
  background: rgba(13, 11, 20, 0.60);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", monospace;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.support-uuid-tg:hover {
  border-color: var(--pbdr);
  color: var(--text);
  background: var(--pdim);
}

/* status-badge outline variant for "Статус серверов" link */
.status-badge--outline {
  background: transparent;
  border: 1px solid var(--line2);
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s;
  text-decoration: none;
}

.status-badge--outline:hover {
  border-color: var(--pbdr);
  color: var(--accent2);
}

/* keyboard hint below submit */
.support-chat-keyboard-hint {
  color: var(--muted);
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  line-height: 1.4;
}

.notice-banner--success {
  display: block;
  border-color: rgba(134, 239, 172, 0.2);
  background: rgba(12, 42, 20, 0.46);
  color: var(--success);
}

.notice-banner--error {
  display: block;
  border-color: rgba(252, 165, 165, 0.2);
  background: rgba(48, 16, 16, 0.44);
  color: var(--danger);
}

@media (min-width: 760px) {
  .app-shell { max-width: 760px; margin: 0 auto; }
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; align-items: end; }
  /* support landing: UUID card aligns to top so forms don't float */
  .support-hero .hero-grid { align-items: start; }
  .install-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .support-actions-grid,
  .support-cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .support-settings-panel { padding: 24px 22px; }
  .support-toggle-switch__label strong { font-size: 15px; }
}

@media (max-width: 430px) {
  .server-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .faq-item summary {
    align-items: flex-start;
    flex-direction: column;
  }

  /* chat bubbles go full-width on tiny screens */
  .support-message { max-width: 94%; }

  /* hide keyboard hint on small screens — saves horizontal space */
  .support-chat-keyboard-hint { display: none; }

  /* send button: wider on mobile */
  .support-compose-send {
    padding: 0 14px;
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  /* thread hint as empty state — reduce padding */
  .support-chat-empty { padding: 24px 14px; }

  /* upload pills wrap better */
  .support-upload-strip { gap: 6px; }
  .support-upload-pill { max-width: 160px; }
}

@media (max-width: 360px) {
  /* very narrow: hide attachment count hint too */
  .support-chat-attachment-hint { display: none; }

  .support-compose-send { gap: 0; }
  .support-compose-send svg { display: none; }
}
