/* Инлайн-модалка подключения на /dashboard — 3-шаговый визард (держать 1:1 со страницей подписки sub.DOMAIN,
   компоненты AppPicker/InstallStep/ConnectStep/StoreBadge). Строится connect.js. Токены — из site.css. */
.connect-modal { border: 0; padding: 0; background: transparent; color: var(--text); max-width: 100vw; }
.connect-modal::backdrop { background: rgba(6, 12, 20, 0.55); backdrop-filter: blur(3px); }
.connect-modal-inner {
  position: relative; width: 29rem; max-width: 94vw; max-height: 90vh; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: 20px;
  padding: 1.25rem; box-shadow: var(--shadow);
}
.connect-modal[open] .connect-modal-inner { animation: connect-in 0.18s var(--ease); }
.connect-modal::backdrop { animation: connect-bd 0.18s ease; }
@keyframes connect-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes connect-bd { from { opacity: 0; } }

.connect-modal-close {
  position: absolute; top: 0.75rem; right: 0.75rem; width: 32px; height: 32px; z-index: 2;
  display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 50%;
  background: var(--panel-2); color: var(--text-dim); cursor: pointer; font-size: 0.9rem; line-height: 1;
  transition: color 0.15s, border-color 0.15s;
}
.connect-modal-close:hover { color: var(--accent); border-color: var(--accent); }
.connect-modal-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Визард ---- */
.cw { display: flex; flex-direction: column; gap: 1rem; }
.cw-head { text-align: center; }
.cw-head h3 { margin: 0; font-family: var(--font); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.3px; }
.cw-head p { margin: 0.25rem 0 0; font-size: 0.85rem; color: var(--text-dim); }

.cw-step { border: 1px solid var(--line); background: var(--panel); border-radius: 16px; padding: 1rem; }
.cw-step-h { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.8rem; }
.cw-num { width: 26px; height: 26px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 700; }

/* ① Приложения — иконка + название в строку */
.cw-apps { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.cw-apps-single { grid-template-columns: 1fr; }
.cw-app { display: flex; align-items: center; gap: 0.7rem; text-align: left; padding: 0.85rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.cw-app:hover { border-color: var(--accent); }
.cw-app.is-active { border-color: var(--accent); background: var(--accent-soft); }
.cw-app-ico { width: 40px; height: 40px; flex: none; border-radius: 11px; box-shadow: var(--shadow-sm); }
.cw-app-name { font-weight: 600; font-size: 0.95rem; }

/* ② Установка — селектор ОС (нативный select-пилюля) в шапке шага, справа от заголовка */
.cw-os-select {
  margin-left: auto; appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px;
  background-color: var(--panel-2); color: var(--text); font-size: 0.78rem; font-weight: 600; line-height: 1.2;
  padding: 0.4rem 1.5rem 0.4rem 0.8rem; cursor: pointer;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%23888e99" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>');
  background-repeat: no-repeat; background-position: right 0.55rem center; background-size: 12px;
}
.cw-os-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.cw-badges { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.cw-badge { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 1rem; border-radius: 12px; background: #1a1d21; border: 1px solid rgba(255, 255, 255, 0.15); color: #fff; text-decoration: none; box-shadow: var(--shadow-sm); transition: border-color 0.15s; }
.cw-badge:hover { border-color: rgba(255, 255, 255, 0.32); }
.cw-badge-logo { display: inline-grid; place-items: center; width: 28px; flex: none; }
.cw-badge-txt { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.cw-badge-top { font-size: 10px; color: rgba(255, 255, 255, 0.6); }
.cw-badge-main { font-size: 15px; font-weight: 600; margin-top: 2px; }
.cw-note { margin: 0.6rem 0 0; font-size: 0.72rem; color: var(--text-mute); }
.cw-note b { color: var(--text-dim); font-weight: 500; }

/* ③ Подключение */
.cw-cta { display: flex; align-items: center; justify-content: center; gap: 0.4rem; width: 100%; padding: 0.85rem; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 0.95rem; text-decoration: none; transition: background 0.15s; }
.cw-cta:hover { background: var(--accent-hover); }
.cw-hint { margin-top: 0.6rem; padding: 0.7rem; border-radius: 12px; font-size: 0.78rem; line-height: 1.45; border: 1px solid var(--line); color: var(--text); }
.cw-hint-a { background: var(--accent-soft); }
.cw-hint-warn { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.4); }
.cw-fallback { margin-top: 0.6rem; padding: 0.85rem; border: 1px solid color-mix(in srgb, var(--err) 40%, transparent); border-radius: 12px; background: var(--err-bg); }
.cw-fb-h { margin: 0; font-size: 0.82rem; font-weight: 700; color: var(--err); }
.cw-fb-sub { margin: 0.15rem 0 0.6rem; font-size: 0.75rem; }
.cw-fb-tip { margin: 0.4rem 0 0; font-size: 0.72rem; }
.connect-copy { background: var(--panel); }
.cw-qr { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.75rem; padding: 0.7rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.cw-qr-img { flex: none; background: #fff; border-radius: 10px; padding: 0.4rem; line-height: 0; }
.cw-qr-img svg { display: block; width: 6rem; height: 6rem; }
.cw-qr .muted { font-size: 0.78rem; }
