/* NLauncher /servers/add — пошаговое добавление сервера в каталог (sv-add.v2.js). v2: блок «Что дальше» после добавления.
 * Поверх sv.v1.css: только его токены (--bg, --card, --ink, --acc, --line…), светлая и тёмная тема.
 * Versioned filename: прокси кэширует /assets/* без учёта ?v= — правки только в sv-add.v3.css. */

#sa { padding-bottom: 8px; }
#sa .crumbs i { font-style: normal; color: var(--faint); }

.sa-head { margin: 6px 0 26px; max-width: 760px; }
.sa-head h1 { margin: 0 0 12px; font-weight: 900; font-size: clamp(34px, 4.4vw, 56px); line-height: .98; letter-spacing: -.05em; }
.sa-head p { margin: 0; font-size: 17px; line-height: 1.5; color: var(--ink2); max-width: 620px; text-wrap: pretty; }

/* ---------- шаги ---------- */
.sa-steps { list-style: none; margin: 0 0 18px; padding: 0; display: flex; align-items: center; gap: 0; max-width: 820px; }
.sa-steps li { flex: 1 1 0; min-width: 0; display: flex; align-items: center; }
.sa-steps li:not(:last-child)::after { content: ""; flex: 1; height: 2px; margin: 0 10px; border-radius: 2px; background: var(--line2); min-width: 12px; }
.sa-steps li.done:not(:last-child)::after { background: var(--acc); }
.sa-steps button { -webkit-appearance: none; appearance: none; border: 0; background: transparent; padding: 4px 2px; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--mute); font-weight: 700; font-size: 14.5px; white-space: nowrap; min-width: 0; border-radius: 10px; }
.sa-steps button:disabled { cursor: default; }
.sa-steps .n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; border: 2px solid var(--line2); color: var(--mute); background: var(--card); font-variant-numeric: tabular-nums; }
.sa-steps .t { overflow: hidden; text-overflow: ellipsis; }
.sa-steps li.done button { color: var(--ink2); }
.sa-steps li.done .n { background: var(--acc); border-color: var(--acc); color: #fff; }
.sa-steps li.done button:not(:disabled):hover { color: var(--acc); }
.sa-steps li.cur button { color: var(--ink); }
.sa-steps li.cur .n { border-color: var(--acc); color: var(--acc); background: var(--acc-soft); }

/* ---------- раскладка ---------- */
.sa-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; align-items: start; }
.sa-form { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); padding: 28px 30px 26px; }
.sa-load { color: var(--mute); padding: 30px 0; }
.sa-side { position: sticky; top: 88px; min-width: 0; }
.sa-pv-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 2px 12px; }
.sa-pv-h b { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.sa-pv-h span { font-size: 13px; color: var(--mute); }
.sa-pv .sc { box-shadow: var(--shadow-lg); }
.sa-pv .sc:hover { transform: none; }
.sa-pv-cap { margin: 12px 2px 0; font-size: 13.5px; line-height: 1.5; color: var(--mute); }

/* ---------- шаг ---------- */
.sa-step h2 { margin: 0 0 6px; font-size: 24px; font-weight: 900; letter-spacing: -.035em; line-height: 1.1; }
.sa-step > .lead { margin: 0 0 22px; font-size: 15px; line-height: 1.55; color: var(--ink2); max-width: 600px; }
.sa-f { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; min-width: 0; }
.sa-f > label, .sa-f > .lb { font-weight: 700; font-size: 14.5px; color: var(--ink); }
.sa-f > label small, .sa-f > .lb small { font-weight: 600; color: var(--mute); font-size: 13px; margin-left: 6px; }
.sa-hint { font-size: 13px; line-height: 1.45; color: var(--mute); }
.sa-hint.bad { color: var(--bad); font-weight: 600; }
.sa-in { width: 100%; min-width: 0; height: 48px; border-radius: 13px; border: 1px solid var(--line2); background: var(--bg); padding: 0 14px; font-size: 15px; font-weight: 500; color: var(--ink); outline: none; -webkit-appearance: none; appearance: none; }
.sa-in::placeholder { color: var(--faint); }
.sa-in:focus { border-color: var(--acc); background: var(--card); box-shadow: 0 0 0 4px var(--acc-soft); }
.sa-in.mono { font-family: var(--mono); font-size: 14.5px; }
.sa-in[aria-invalid="true"] { border-color: var(--bad); }
textarea.sa-in { height: auto; min-height: 104px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.sa-row { display: flex; gap: 10px; min-width: 0; }
.sa-row > * { min-width: 0; }
.sa-addr .host { flex: 1 1 auto; }
.sa-addr .port { flex: 0 0 116px; }
.sa-addr .btn { flex: none; }
.sa-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.sa-ver { display: flex; align-items: center; gap: 10px; }
.sa-ver .sa-in { flex: 1; }
.sa-ver span { color: var(--mute); font-weight: 700; }
.sa-count { align-self: flex-end; font-size: 12.5px; color: var(--mute); font-variant-numeric: tabular-nums; margin-top: -2px; }
.sa-count.bad { color: var(--bad); font-weight: 700; }
.sa-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sa-chips .chip { height: 38px; padding: 0 14px; font-size: 14px; }

/* результат проверки */
.sa-probe { margin: 4px 0 20px; border: 1px solid var(--line2); border-radius: 18px; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.sa-probe .st { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.sa-probe .st i { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); flex: none; }
.sa-probe .st.off i { background: var(--faint); box-shadow: 0 0 0 4px var(--chip); }
.sa-probe .st small { font-size: 13.5px; font-weight: 600; color: var(--mute); }
.sa-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.sa-facts div { min-width: 0; padding: 10px 12px; border-radius: 12px; background: var(--card2); }
.sa-facts dt { font-size: 12.5px; color: var(--mute); font-weight: 600; }
.sa-facts dd { margin: 3px 0 0; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-probe .mc { margin: 0; }

.sa-note { display: flex; flex-direction: column; gap: 8px; margin: 0 0 20px; padding: 14px 16px; border-radius: 16px; background: var(--card2); border: 1px solid var(--line); font-size: 14.5px; line-height: 1.5; color: var(--ink2); }
.sa-note b { color: var(--ink); }
.sa-note.warn { background: rgba(217,119,6,.08); border-color: rgba(217,119,6,.28); }
.sa-note.bad { background: var(--bad-soft); border-color: rgba(220,38,38,.28); }
html[data-theme="dark"] .sa-note.warn { background: rgba(245,184,46,.08); border-color: rgba(245,184,46,.26); }
html[data-theme="dark"] .sa-note.bad { border-color: rgba(255,107,107,.3); }
.sa-note .links { display: flex; flex-wrap: wrap; gap: 8px 16px; font-weight: 700; }

/* баннер и иконка */
.sa-icon { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 16px; background: var(--card2); margin-bottom: 22px; }
.sa-icon .ic { width: 64px; height: 64px; border-radius: 16px; box-shadow: none; font-size: 26px; }
.sa-icon p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink2); }
.sa-icon p b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 2px; }
.sa-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 150px; padding: 22px; border-radius: 18px; border: 2px dashed var(--line2); background: var(--bg); text-align: center; cursor: pointer; }
.sa-drop:hover, .sa-drop.over { border-color: var(--acc); background: var(--acc-soft); }
.sa-drop:focus-within { border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft); }
.sa-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.sa-drop b { font-size: 15.5px; }
.sa-drop span { font-size: 13px; color: var(--mute); max-width: 420px; line-height: 1.45; }
.sa-ban { display: flex; flex-direction: column; gap: 10px; }
.sa-ban img { display: block; width: 100%; max-height: 200px; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); }
.sa-ban .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sa-ban .row span { font-size: 13px; color: var(--mute); flex: 1; min-width: 160px; overflow-wrap: anywhere; }

/* проверка */
.sa-sum { margin: 0 0 22px; border-top: 1px solid var(--line); }
.sa-sum div { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 14px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sa-sum dt { color: var(--mute); font-size: 14px; font-weight: 600; }
.sa-sum dd { margin: 0; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; min-width: 0; }
.sa-sum dd.mono { font-family: var(--mono); font-size: 14px; }
.sa-sum dd em { font-style: normal; color: var(--faint); font-weight: 500; }
.sa-sum button { -webkit-appearance: none; appearance: none; border: 0; background: transparent; color: var(--acc-tx); font-weight: 700; font-size: 13.5px; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.sa-sum button:hover { text-decoration: underline; text-underline-offset: 3px; }
.sa-fine { margin: 0 0 20px; font-size: 13.5px; line-height: 1.5; color: var(--mute); }

.sa-acts { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--line); }
.sa-acts .sp { flex: 1; }
.sa-err { margin: 0 0 16px; padding: 12px 14px; border-radius: 14px; background: var(--bad-soft); color: var(--bad); font-weight: 600; font-size: 14.5px; line-height: 1.45; }
.sa-err a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* готово / вход */
.sa-done h2 { margin: 0 0 10px; font-size: 30px; font-weight: 900; letter-spacing: -.04em; line-height: 1.05; }
.sa-done p { margin: 0 0 18px; font-size: 15.5px; line-height: 1.55; color: var(--ink2); max-width: 560px; }
.sa-done .st { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 10px; font-weight: 800; font-size: 13.5px; margin-bottom: 14px; }
.sa-done .st.ok { background: var(--ok-soft); color: var(--ok); }
.sa-done .st.mod { background: rgba(217,119,6,.12); color: var(--warn); }
html[data-theme="dark"] .sa-done .st.mod { color: #F5B82E; background: rgba(245,184,46,.12); }
.sa-done .row { display: flex; flex-wrap: wrap; gap: 10px; }
.sa-gate ul { margin: 0 0 22px; padding-left: 20px; color: var(--ink2); line-height: 1.7; font-size: 15px; }

@media (max-width: 1060px) {
  .sa-grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; }
}
@media (max-width: 900px) {
  .sa-grid { grid-template-columns: minmax(0, 1fr); }
  .sa-side { position: static; }
  .sa-pv { max-width: 440px; }
}
@media (max-width: 640px) {
  .wrap#sa { padding: 0 16px; }
  .sa-head { margin-bottom: 20px; }
  .sa-head p { font-size: 15.5px; }
  .sa-steps { margin-bottom: 14px; }
  .sa-steps li:not(.cur) .t { display: none; }
  .sa-steps li.cur { flex: 0 0 auto; }
  .sa-steps li.cur:not(:last-child)::after { width: 18px; flex: none; }
  .sa-probe .st { flex-wrap: wrap; row-gap: 2px; }
  .sa-probe .st small { flex-basis: 100%; padding-left: 20px; }
  .sa-steps li:not(:last-child)::after { margin: 0 6px; }
  .sa-form { padding: 20px 16px 18px; border-radius: 22px; }
  .sa-step h2 { font-size: 21px; }
  .sa-addr { flex-wrap: wrap; }
  .sa-addr .host { flex: 1 1 100%; }
  .sa-addr .port { flex: 1 1 90px; }
  .sa-two { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .sa-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sa-facts div:last-child { grid-column: 1 / -1; }
  .sa-sum div { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .sa-sum dt { grid-column: 1; }
  .sa-sum dd { grid-column: 1 / -1; grid-row: 2; }
  .sa-sum button { grid-column: 2; grid-row: 1; }
  .sa-acts { flex-wrap: wrap; }
  .sa-acts .btn.pri { flex: 1 1 auto; }
  .sa-done h2 { font-size: 25px; }
  .sa-done .row .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .sa-steps button, .sa-drop { transition: none; }
}

/* v2: «Что дальше» */
.sa-next { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.sa-next-h { font-size: 20px; font-weight: 850; letter-spacing: -.025em; margin-bottom: 14px; }
.sa-next-h span { display: block; margin-top: 2px; font-size: 13.5px; font-weight: 600; color: var(--mute); letter-spacing: 0; }
.sa-nx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.sa-nx { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 18px; background: var(--card2); border: 1px solid var(--line); }
.sa-nx.top { background: color-mix(in srgb, var(--gold) 10%, var(--card)); border-color: color-mix(in srgb, var(--gold) 35%, transparent); }
.sa-nx b { font-size: 16px; font-weight: 850; letter-spacing: -.015em; color: var(--ink); }
.sa-nx p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink2); }
.sa-nx ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.sa-nx li { display: flex; align-items: center; gap: 8px; }
.sa-nx .btn { margin-top: auto; align-self: flex-start; }
.sa-next .sa-fine { margin: 14px 0 0; }
.tb { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 99px; font-size: 11px; font-weight: 800; white-space: nowrap; background: var(--chip); color: var(--ink2); min-width: 50px; justify-content: center; }
.tb.t1 { background: linear-gradient(135deg, #FFD66B, #F5A524); color: #4A2A00; }
.tb.t5 { background: color-mix(in srgb, var(--gold) 26%, var(--card)); color: #8A5300; }
.tb.t10 { background: color-mix(in srgb, var(--acc) 16%, var(--card)); color: var(--acc-tx); }
html[data-theme="dark"] .tb.t5 { color: var(--gold); }
