/* ============================================================================================
   UMEY — страница поддержки (support.html). Токены и поверхности публичных страниц.
   ============================================================================================ */

.sp-hero { padding-bottom: var(--pub-s5); }
.sp-hero h1 { max-width: 20ch; }

.sp-layout {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .85fr); gap: var(--pub-s5);
  align-items: start;
  padding: var(--pub-s5) 0 var(--pub-section);
}
.sp-main, .sp-side { display: grid; gap: var(--pub-s5); min-width: 0; }
.sp-panel {
  padding: clamp(22px, 2.8vw, 36px);
  border: 1px solid var(--pub-line); border-radius: var(--pub-r3);
  background: var(--pub-raise); box-shadow: var(--pub-el1);
}
.sp-panel h2 { margin: 0 0 var(--pub-s4); color: var(--pub-text); font-size: clamp(22px, 2vw, 28px); line-height: 1.2; letter-spacing: -.025em; }
.sp-panel h3 { margin: 0 0 var(--pub-s3); color: var(--pub-text); font-size: 18px; letter-spacing: -.015em; }
.sp-panel p { margin: 0 0 var(--pub-s4); color: var(--pub-text-2); font-size: var(--pub-secondary); line-height: 1.6; }
.sp-panel a:not(.pub-btn) { color: var(--pub-accent); font-weight: 600; }
.sp-loading { color: var(--pub-text-2); }
.sp-fallback { margin-top: var(--pub-s5) !important; padding-top: var(--pub-s4); border-top: 1px solid var(--pub-line); }

/* --- выбор темы: карточки-переключатели ---------------------------------------------------- */
.sp-topics { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--pub-s2); margin: 0 0 var(--pub-s5); padding: 0; border: 0; }
.sp-topics legend { margin-bottom: var(--pub-s3); padding: 0; color: var(--pub-text-2); font-size: var(--pub-caption); font-weight: 650; }
.sp-topic { position: relative; display: grid; cursor: pointer; }
.sp-topic input { position: absolute; opacity: 0; pointer-events: none; }
.sp-topic > span {
  display: grid; gap: 2px; align-content: start;
  padding: var(--pub-s3) var(--pub-s4) var(--pub-s3) 44px;
  border: 1px solid var(--pub-line-strong); border-radius: var(--pub-r2);
  background: rgba(255, 255, 255, .03);
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}
.sp-topic > span::before {
  content: ""; position: absolute; left: 16px; top: 16px;
  width: 18px; height: 18px; border: 2px solid var(--pub-line-strong); border-radius: 50%;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.sp-topic strong { color: var(--pub-text); font-size: 15px; line-height: 1.35; }
.sp-topic small { color: var(--pub-text-3); font-size: 13px; line-height: 1.4; }
.sp-topic:hover > span { border-color: rgba(170, 150, 255, .5); background: rgba(255, 255, 255, .05); }
.sp-topic input:checked + span { border-color: var(--pub-violet); background: rgba(138, 108, 255, .14); }
.sp-topic input:checked + span::before { border-color: var(--pub-violet); box-shadow: inset 0 0 0 4px var(--pub-raise), inset 0 0 0 10px var(--pub-violet); }
.sp-topic input:focus-visible + span { outline: 3px solid var(--pub-violet); outline-offset: 2px; }

/* --- поля ------------------------------------------------------------------------------------- */
.sp-field { display: grid; gap: var(--pub-s2); margin-bottom: var(--pub-s5); }
.sp-field label, .sp-label-row label { color: var(--pub-text-2); font-size: var(--pub-caption); font-weight: 650; }
.sp-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--pub-s3); }
.sp-optional { margin-left: 6px; color: var(--pub-text-3); font-weight: 500; }
.sp-counter { color: var(--pub-text-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.sp-field input, .sp-field textarea {
  box-sizing: border-box; width: 100%; padding: 12px var(--pub-s4);
  border: 1px solid var(--pub-line-strong); border-radius: var(--pub-r2);
  color: var(--pub-text); background: rgba(255, 255, 255, .04);
  font: inherit; font-size: 16px; line-height: 1.5;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.sp-field input { min-height: 48px; }
.sp-field textarea { min-height: 160px; resize: vertical; }
.sp-field input::placeholder, .sp-field textarea::placeholder { color: var(--pub-text-3); }
.sp-field input:hover, .sp-field textarea:hover { border-color: rgba(170, 150, 255, .5); }
.sp-field input:focus, .sp-field textarea:focus { outline: none; border-color: var(--pub-violet); box-shadow: 0 0 0 4px rgba(138, 108, 255, .22); }
.sp-hint { margin: 0 !important; color: var(--pub-text-3) !important; font-size: 13px !important; line-height: 1.5 !important; }
.sp-error {
  margin: 0 0 var(--pub-s4) !important; padding: var(--pub-s3) var(--pub-s4);
  border: 1px solid rgba(255, 120, 120, .4); border-radius: var(--pub-r2);
  color: #ffd2d2 !important; background: rgba(255, 90, 90, .1);
}
.sp-actions { display: grid; gap: var(--pub-s3); }
.sp-actions .pub-btn { justify-self: start; }
.sp-actions .pub-btn:disabled { opacity: .7; cursor: progress; transform: none; }

/* --- после отправки ------------------------------------------------------------------------- */
.sp-done { display: grid; justify-items: start; }
.sp-done:focus { outline: none; }
.sp-done-mark {
  width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: var(--pub-s4);
  border-radius: 50%; color: var(--pub-ok); background: rgba(79, 214, 168, .16); font-size: 22px; font-weight: 800;
}

/* --- мои обращения ------------------------------------------------------------------------- */
.sp-history { display: grid; gap: var(--pub-s3); }
.sp-muted { margin: 0 !important; color: var(--pub-text-3) !important; }
.sp-request { padding: var(--pub-s4); border: 1px solid var(--pub-line); border-radius: var(--pub-r2); background: rgba(255, 255, 255, .025); }
.sp-request-head { display: flex; align-items: center; justify-content: space-between; gap: var(--pub-s3); }
.sp-request-head strong { color: var(--pub-text); font-size: 15px; }
.sp-request-date, .sp-request-meta { margin: 2px 0 0 !important; color: var(--pub-text-3) !important; font-size: 13px !important; }
.sp-request-text {
  margin: var(--pub-s2) 0 0 !important; color: var(--pub-text-2) !important; font-size: 14px !important; white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.sp-status { flex: 0 0 auto; padding: 3px 10px; border-radius: var(--pub-pill); font-size: 12px; font-weight: 700; }
.sp-status-open { color: var(--pub-text-2); background: rgba(255, 255, 255, .08); }
.sp-status-progress { color: #ffd88a; background: rgba(255, 196, 80, .14); }
.sp-status-answered { color: var(--pub-ok); background: rgba(79, 214, 168, .16); }
.sp-status-closed { color: var(--pub-text-3); background: rgba(255, 255, 255, .05); }
.sp-reply { margin-top: var(--pub-s3); padding: var(--pub-s3) var(--pub-s4); border-left: 3px solid var(--pub-violet); border-radius: 0 var(--pub-r1) var(--pub-r1) 0; background: rgba(138, 108, 255, .1); }
.sp-reply-label { display: block; margin-bottom: 4px; color: var(--pub-accent); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.sp-reply p { margin: 0 !important; color: var(--pub-text) !important; font-size: 14px !important; white-space: pre-line; }
.sp-note ol { display: grid; gap: var(--pub-s2); margin: 0; padding-left: 20px; color: var(--pub-text-2); font-size: var(--pub-secondary); line-height: 1.55; }

@media (max-width: 960px) {
  .sp-layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .sp-topics { grid-template-columns: 1fr; }
  .sp-actions .pub-btn { justify-self: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-topic > span, .sp-topic > span::before, .sp-field input, .sp-field textarea { transition: none; }
}
