/* Экраны: шапка кабинета, вход и регистрация, устройства, подключение, письмо. */

.container { width: min(var(--container), 100% - 48px); margin-inline: auto; }

/* ---------- Шапка кабинета (как в референсе: 56 px, фиолетовая, компактная) ---------- */
.topbar { position: sticky; top: 0; z-index: 500; height: var(--header-h); background: var(--purple); color: #fff; }
.topbar-inner { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; flex: none; border-radius: var(--r-xs); }
.brand img { height: 22px; width: auto; }
.topnav { display: flex; align-items: stretch; gap: 4px; height: 100%; margin-left: 8px; }
.topnav a { position: relative; display: inline-flex; align-items: center; padding: 0 12px; color: rgba(255, 255, 255, .86); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; transition: color .16s; }
.topnav a:hover { color: #fff; }
.topnav a[aria-current=page] { color: #fff; font-weight: 600; }
.topnav a[aria-current=page]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--orange); }
.topnav a:focus-visible { outline: 2px solid #fff; outline-offset: -6px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.top-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; border: 0; border-radius: var(--r-xs); background: transparent; color: #fff; font-size: 14px; font-weight: 500; }
.top-btn:hover, .top-btn[aria-expanded=true] { background: rgba(255, 255, 255, .14); }
.top-btn:focus-visible { outline: 2px solid #fff; outline-offset: 0; }
.top-btn .icon { width: 18px; height: 18px; }
.top-btn .icon.chev { width: 16px; height: 16px; opacity: .8; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--purple-700); font-size: 13px; font-weight: 700; }
.top-email { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.burger { display: none; }

/* Мобильное меню */
.mnav { position: fixed; z-index: 810; inset: var(--header-h) 0 auto 0; background: var(--surface); box-shadow: var(--shadow-3); padding: 8px 16px 16px; animation: pop-in .16s var(--ease); max-height: calc(100vh - var(--header-h)); overflow: auto; }
.mnav a, .mnav button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 8px; border: 0; background: none; color: var(--ink); font-size: 16px; font-weight: 500; text-decoration: none; border-radius: var(--r-xs); }
.mnav a[aria-current=page] { color: var(--purple-700); font-weight: 700; background: var(--tint); }
.mnav .icon { color: var(--muted); }
.mnav-sep { height: 1px; background: var(--line); margin: 8px 0; }
.mnav-who { padding: 10px 8px 4px; font-size: 13px; color: var(--muted); }

/* ---------- Заголовок страницы (белая полоса) ---------- */
.pagehead { background: var(--surface); border-bottom: 1px solid var(--line); }
.pagehead-inner { display: flex; align-items: center; gap: 24px; min-height: 88px; padding-block: 16px; }
.pagehead-text { flex: 1; min-width: 0; }
.pagehead-sub { margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 18px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.pagehead-sub .sub-item { display: inline-flex; align-items: center; gap: 7px; }

.page { padding-block: 20px 64px; }

/* ---------- Устройства: панель инструментов ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.search { flex: 0 1 360px; min-width: 220px; }
.search .input { min-height: 40px; background: var(--surface); }
.search .input-trail .icon-btn { width: 34px; height: 34px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.seg::-webkit-scrollbar { display: none; }
.seg button { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 0; border-radius: var(--r-xs); background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; transition: background-color .16s, color .16s; }
.seg button:hover { color: var(--ink); background: var(--bg); }
.seg button[aria-pressed=true] { background: var(--tint); color: var(--purple-700); }
.seg .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-xs); background: var(--bg); color: var(--muted); font-size: 12px; display: inline-grid; place-items: center; }
.seg button[aria-pressed=true] .count { background: #fff; color: var(--purple-700); }
.toolbar-note { margin-left: auto; font-size: 13px; color: var(--faint); }

/* Подсказка о проблеме */
.alert { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; margin-bottom: 14px; border: 1px solid var(--orange-line); border-radius: var(--r-md); background: var(--orange-soft); font-size: 14px; line-height: 19px; }
.alert > .icon { color: #b36b00; }
.alert-text { flex: 1; min-width: 0; }
.alert-text b { font-weight: 600; }
.alert-actions { display: flex; gap: 6px; flex: none; }
.alert .btn { min-height: 34px; padding: 7px 12px 5px; font-size: 12px; }

/* ---------- Таблица устройств ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1); }
.dtable { width: 100%; }
.drow { display: grid; grid-template-columns: minmax(240px, 2.1fr) minmax(170px, 1.35fr) minmax(210px, 1.5fr) 96px 92px 48px; align-items: center; gap: 16px; padding: 12px 12px 12px 16px; border-top: 1px solid var(--line); min-height: 68px; }
.drow:first-child { border-top: 0; }
.dhead { min-height: 40px; padding-block: 8px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--faint); letter-spacing: .02em; background: #fafafc; border-radius: var(--r-md) var(--r-md) 0 0; }
.drow.is-item { cursor: pointer; transition: background-color .14s; }
.drow.is-item:hover { background: #fafaff; }
.drow.is-item.is-flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 30% { background: var(--orange-soft); } }
.dcell-dev { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dev-tile { flex: none; width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--tint); color: var(--purple-600); position: relative; }
.dev-tile .icon { width: 22px; height: 22px; }
.dev-name { display: block; max-width: 100%; border: 0; background: none; padding: 0; text-align: left; font-size: 15px; line-height: 20px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-name:hover { color: var(--purple-700); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(75, 88, 174, .4); }
.dev-meta { display: block; font-size: 13px; line-height: 17px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-text { min-width: 0; }
.status { display: grid; grid-template-columns: 8px 1fr; column-gap: 9px; row-gap: 1px; align-items: center; min-width: 0; font-size: 14px; line-height: 18px; font-weight: 500; }
.status .status-sub { grid-column: 2; font-size: 12.5px; line-height: 16px; color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status.is-attention .status-label { color: #9a5b00; }
.dcell-list .dd-trigger { width: 100%; }
.dcell-ver { font-size: 13px; color: var(--muted); display: grid; gap: 3px; justify-items: start; }
.dcell-ver .badge { height: 20px; font-size: 11.5px; padding: 0 7px; }
.dcell-act { display: flex; justify-content: flex-end; }
.dcell-added { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Заголовок столбца — кнопка сортировки; стрелка видна у выбранного столбца и при наведении. */
.th-sort { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; margin: -4px -6px; padding: 4px 6px; border: 0; border-radius: var(--r-xs); background: none; font: inherit; color: inherit; letter-spacing: inherit; cursor: pointer; text-align: left; }
.th-sort:hover { color: var(--ink); background: var(--tint); }
.th-sort.is-on { color: var(--purple-700); }
.th-arrow { width: 14px; height: 14px; flex: none; opacity: 0; transition: opacity .14s, transform .16s var(--ease); }
.th-sort:hover .th-arrow, .th-sort:focus-visible .th-arrow, .th-sort.is-on .th-arrow { opacity: 1; }
.th-sort.is-asc .th-arrow, .sort-menu .th-arrow.is-asc { transform: rotate(180deg); }
.sort-menu { display: none; width: auto; }
.sort-menu .th-arrow { opacity: 1; margin-right: 4px; vertical-align: -2px; }

/* Пустые/служебные состояния внутри панели */
.state { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 48px 24px; }
.state-mark { width: 48px; height: 48px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--tint); color: var(--purple-600); margin-bottom: 4px; }
.state-mark.is-error { background: var(--red-soft); color: var(--red); }
.state p { color: var(--muted); max-width: 440px; }
.state .btn { margin-top: 6px; }
.skel-row .skel { height: 12px; }

/* ---------- Первое знакомство (пустой аккаунт) ---------- */
.welcome { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.onb { padding: 24px; }
.onb-top { display: flex; align-items: flex-start; gap: 24px; justify-content: space-between; flex-wrap: wrap; }
.onb-top h2 { font-size: 20px; }
.onb-top p { color: var(--muted); margin-top: 4px; max-width: 620px; }
.onb-cta { display: grid; justify-items: end; gap: 6px; }
.onb-cta .small { color: var(--faint); max-width: 300px; text-align: right; }
.onb-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 20px; counter-reset: step; }
.onb-step { position: relative; display: grid; grid-template-rows: auto auto 1fr auto; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fcfcfe; min-width: 0; }
.onb-step.is-current { border-color: var(--violet); background: var(--surface); box-shadow: 0 0 0 3px rgba(151, 165, 249, .2); }
.onb-step.is-done { background: #f7fbf9; border-color: #cfe9da; }
.onb-num { width: 28px; height: 28px; border-radius: var(--r-xs); display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--tint); color: var(--purple-700); }
.onb-step.is-current .onb-num { background: var(--orange); color: var(--ink); }
.onb-step.is-done .onb-num { background: var(--green); color: #fff; }
.onb-step p { color: var(--muted); font-size: 14px; line-height: 19px; }
.onb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; }
.onb-actions .btn { min-height: 36px; padding: 7px 12px 5px; font-size: 12px; }
.onb-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md); background: var(--tint); color: var(--ink-2); font-size: 14px; line-height: 19px; }
.onb-note .icon { color: var(--purple-600); margin-top: 1px; }
.empty-devices { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border: 1px dashed var(--line-2); border-radius: var(--r-md); color: var(--muted); font-size: 14px; }
.empty-devices .dev-icons { display: flex; gap: 6px; color: var(--faint); }

/* ---------- Боковая панель устройства ---------- */
.dr-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 16px 16px 20px; border-bottom: 1px solid var(--line); }
.dr-head .dev-tile { width: 44px; height: 44px; }
.dr-title { flex: 1; min-width: 0; }
.dr-title h2 { font-size: 18px; line-height: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-title .status { margin-top: 3px; font-size: 13px; }
.dr-body { flex: 1; overflow: auto; padding: 20px; display: grid; gap: 22px; align-content: start; }
.dr-section { display: grid; gap: 14px; }
.dr-section-title { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.opt-row { display: flex; align-items: flex-start; gap: 14px; justify-content: space-between; }
.opt-row .opt-text { min-width: 0; }
.opt-row .opt-title { font-size: 15px; font-weight: 500; }
.opt-row .opt-hint { font-size: 13px; line-height: 17px; color: var(--muted); margin-top: 2px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.dr-issue { display: flex; gap: 10px; padding: 12px; border-radius: var(--r-md); background: var(--orange-soft); border: 1px solid var(--orange-line); font-size: 14px; line-height: 19px; }
.dr-issue .icon { color: #b36b00; margin-top: 1px; }
.dr-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface); }
.dr-foot .spacer { flex: 1; }
.danger-link { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--red); font-size: 14px; font-weight: 500; padding: 8px 4px; border-radius: var(--r-xs); }
.danger-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.danger-link .icon { width: 18px; height: 18px; }

/* ---------- Подключение устройства ---------- */
.pair-steps { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--faint); margin: 2px 0 14px; }
.pair-steps span { display: inline-flex; align-items: center; gap: 6px; }
.pair-steps i { width: 20px; height: 20px; border-radius: var(--r-xs); display: inline-grid; place-items: center; font-style: normal; background: var(--bg); color: var(--muted); font-size: 11px; }
.pair-steps .is-on { color: var(--ink); }
.pair-steps .is-on i { background: var(--orange); color: var(--ink); }
.pair-steps .is-done i { background: var(--green); color: #fff; }
.pair-steps .line { flex: 0 0 28px; height: 1px; background: var(--line-2); }
/* Вкладки заметнее (владелец 02.10.2026: «кнопки сделай поярче, плохо видно их»): рамка у группы, тёмный текст у
   невыбранных, выбранная — оранжевая, как главная кнопка; подписи в одну строку. */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 0; border-radius: var(--r-xs); background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.tabs button:hover { background: var(--tint); color: var(--ink); }
.tabs button[aria-selected=true] { background: var(--orange); color: var(--ink); box-shadow: var(--shadow-1); }
/* «(рекомендуемый способ)» у вкладки OTT ID — мельче основной подписи; на узком экране вкладка переносится. */
.tabs .tab-note { font-size: 12px; font-weight: 500; }
@media (max-width: 640px) { .tabs button { white-space: normal; text-align: center; line-height: 1.2; padding: 6px 8px; } .tabs .tab-note { display: block; } }
@media (max-width: 520px) { .tabs { flex-wrap: wrap; } .tabs button { flex: 1 1 auto; } }
.tabs button:focus-visible { outline: none; box-shadow: var(--focus); }
.pair-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.pair-body { min-height: 268px; }
.tv-schema { position: relative; aspect-ratio: 16 / 10; border-radius: 6px; background: #17132a; border: 5px solid #2b2645; display: grid; place-items: center; align-content: center; gap: 6px; color: #fff; text-align: center; padding: 10px; }
.tv-schema::after { content: ""; position: absolute; bottom: -13px; left: 50%; width: 60px; height: 6px; border-radius: 0 0 4px 4px; transform: translateX(-50%); background: #2b2645; }
.tv-schema .tv-logo { height: 11px; width: auto; opacity: .9; }
.tv-schema .tv-hint { font-size: 9.5px; line-height: 12px; color: #bcb6da; }
.tv-schema .tv-code { font-size: 20px; line-height: 24px; letter-spacing: .12em; font-weight: 700; color: var(--orange); font-variant-numeric: tabular-nums; }
.tv-schema .tv-qr { width: 54px; height: 54px; border-radius: 4px; background: #fff; padding: 5px; color: #17132a; }
.tv-schema .tv-qr .icon { width: 100%; height: 100%; stroke-width: 1.6; }
.schema-cap { margin-top: 18px; font-size: 12px; line-height: 16px; color: var(--faint); text-align: center; }
.code-cells { display: flex; gap: 8px; }
.code-cells input { width: 100%; min-width: 0; height: 52px; padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-xs); background: var(--surface); text-align: center; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); transition: border-color .16s, box-shadow .16s; }
.code-cells input:nth-child(3) { margin-right: 10px; }
.code-cells input:focus { border-color: var(--purple); box-shadow: var(--focus); outline: none; }
.field.is-error .code-cells input { border-color: var(--red-line); }
.code-cells.is-busy input { background: var(--bg); color: var(--muted); }
.pair-lead { font-size: 14px; line-height: 20px; color: var(--ink-2); margin-bottom: 14px; }
.pair-help { margin-top: 14px; font-size: 13px; line-height: 18px; color: var(--muted); }
.demo-hint { display: inline-flex; gap: 6px; align-items: center; margin-top: 12px; padding: 4px 8px; border-radius: var(--r-xs); background: var(--orange-soft); color: #8a5200; font-size: 12px; line-height: 16px; }
.qr-wait { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--tint); font-size: 14px; color: var(--ink-2); }
.found { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--green-soft); margin-bottom: 18px; }
.found .dev-tile { background: #fff; color: var(--green); }
.found b { display: block; font-weight: 600; }
.found span { font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-xs); background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 500; }
.chip:hover { border-color: var(--violet); background: var(--tint); }
.chip[aria-pressed=true] { border-color: var(--purple); background: var(--tint); color: var(--purple-700); }
.chip:focus-visible { outline: none; box-shadow: var(--focus); }
.pair-form { display: grid; gap: 16px; }
.success { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 18px 8px 8px; }
.success-mark { width: 56px; height: 56px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--green-soft); color: var(--green); }
.success-mark .icon { width: 28px; height: 28px; stroke-width: 2.2; }
.success p { color: var(--muted); max-width: 380px; }

/* ---------- Вход и регистрация ---------- */
.auth { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; background:
  radial-gradient(1200px 520px at 50% -140px, #e6e9fb 0%, rgba(230, 233, 251, 0) 70%), var(--bg); }
.auth-top { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.auth-top .brand img { height: 24px; }
.auth-top .top-btn { color: var(--ink); }
.auth-top .top-btn:hover, .auth-top .top-btn[aria-expanded=true] { background: rgba(33, 20, 73, .06); }
.auth-top .top-btn:focus-visible { outline-color: var(--purple); }
.auth-main { display: grid; place-items: start center; padding: 24px 16px 48px; }
.auth-card { width: min(400px, 100%); padding: 28px 28px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2); }
.auth-card.is-wide { width: min(460px, 100%); }
.auth-card h1 { font-size: 22px; line-height: 28px; font-weight: 700; }
.auth-card .auth-sub { color: var(--muted); margin-top: 4px; font-size: 14px; line-height: 19px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; border-radius: var(--r-sm); background: var(--bg); margin-bottom: 20px; }
.auth-tabs a { display: grid; place-items: center; height: 36px; border-radius: var(--r-xs); color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.auth-tabs a[aria-current=page] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.auth-tabs a:hover:not([aria-current=page]) { color: var(--ink); }
.auth-form { display: grid; gap: 14px; margin-top: 20px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.form-error { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-xs); background: var(--red-soft); color: #8f2f29; font-size: 14px; line-height: 19px; }
.form-error .icon { flex: none; color: var(--red); margin-top: 1px; }
.form-error .link-btn { color: #8f2f29; font-weight: 600; }
.form-ok { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-xs); background: var(--green-soft); color: #185c3a; font-size: 14px; line-height: 19px; }
.form-ok .icon { color: var(--green); flex: none; margin-top: 1px; }
.caps { font-size: 12.5px; color: #8a5200; display: flex; gap: 6px; align-items: center; }
.or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--faint); font-size: 12.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.socials { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.socials.is-1 { grid-template-columns: 1fr; }
.socials.is-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.social { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r-xs); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500; white-space: nowrap; transition: border-color .16s, background-color .16s; }
.social:hover { border-color: #b3afcb; background: #fafaff; }
.social:focus-visible { outline: none; box-shadow: var(--focus); }
.social svg { width: 18px; height: 18px; flex: none; }
.auth-foot { margin-top: 18px; font-size: 13px; line-height: 18px; color: var(--muted); text-align: center; }
.auth-legal { padding: 16px; text-align: center; font-size: 12.5px; color: var(--faint); }
.auth-legal a { color: var(--muted); }
.mail-mark { width: 52px; height: 52px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--tint); color: var(--purple-600); margin-bottom: 14px; }
.mail-mark .icon { width: 26px; height: 26px; }
.mail-mark.is-ok { background: var(--green-soft); color: var(--green); }
.auth-card .addr { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.stack { display: grid; gap: 10px; margin-top: 20px; }
.tip { display: flex; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; line-height: 18px; color: var(--muted); }
.tip .icon { color: var(--faint); width: 18px; height: 18px; margin-top: 1px; }
.timer { font-variant-numeric: tabular-nums; }

/* Социальный вход: окно-заглушка стороннего сервиса */
.oauth { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 8px 0 4px; }
.oauth-logos { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.oauth-logos .lg { width: 44px; height: 44px; border-radius: var(--r-md); border: 1px solid var(--line); display: grid; place-items: center; background: #fff; }
.oauth-logos .lg img { width: 26px; height: 26px; }
.oauth-logos .lg svg { width: 22px; height: 22px; }
.oauth-logos .dots { color: var(--faint); letter-spacing: 3px; }
.oauth p { color: var(--muted); max-width: 360px; }

/* ---------- Письмо (превью) ---------- */
.mailview { min-height: 100vh; background: #e9e9ef; padding: 24px 16px 48px; }
.mail-client { width: min(680px, 100%); margin: 0 auto; }
.mail-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.mail-meta b { color: var(--ink); font-weight: 600; }
.mail-meta .spacer { flex: 1; }
.letter { background: #fff; border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-2); }
.letter-head { background: var(--purple); padding: 22px 32px; }
.letter-head img { height: 22px; }
.letter-body { padding: 32px; }
.letter-body h1 { font-size: 24px; line-height: 30px; margin-bottom: 12px; }
.letter-body p { color: var(--ink-2); line-height: 22px; margin-bottom: 12px; }
.letter-body .btn { margin: 10px 0 18px; min-height: 48px; padding-inline: 24px; }
.letter-fallback { font-size: 13px; line-height: 18px; color: var(--muted); padding: 12px 14px; background: var(--bg); border-radius: var(--r-xs); overflow-wrap: anywhere; }
.letter-foot { padding: 18px 32px 24px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 18px; color: var(--faint); }

/* ---------- Заглушка следующих экранов ---------- */
.stub { max-width: 640px; margin: 40px auto; padding: 40px 40px 36px; text-align: center; display: grid; justify-items: center; gap: 12px; }
.stub .btn { margin-top: 12px; }
.stub p { color: var(--muted); }

/* ---------- Демо-панель прототипа ---------- */
.demo-fab { position: fixed; z-index: 700; left: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px dashed #b9b4d4; border-radius: var(--r-xs); background: rgba(255, 255, 255, .92); color: var(--muted); font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow-1); backdrop-filter: blur(6px); }
.demo-fab:hover { color: var(--ink); border-color: var(--purple); }
.demo-fab .icon { width: 16px; height: 16px; }
.demo-panel { position: fixed; z-index: 905; left: 16px; bottom: 60px; width: min(320px, calc(100vw - 32px)); padding: 14px; border: 1px dashed #b9b4d4; border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-3); font-size: 13px; animation: pop-in .14s var(--ease); }
.demo-panel h3 { font-size: 13px; margin-bottom: 8px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.demo-panel .grp { display: grid; gap: 4px; margin-bottom: 10px; }
.demo-panel button { text-align: left; border: 0; background: var(--bg); border-radius: var(--r-xs); padding: 8px 10px; font-size: 13px; color: var(--ink-2); }
.demo-panel button:hover { background: var(--tint); }
.demo-panel button[aria-pressed=true] { background: var(--tint-2); color: var(--purple-700); font-weight: 600; }
.demo-panel p { color: var(--muted); line-height: 17px; }
.demo-panel code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--bg); padding: 1px 4px; border-radius: 3px; color: var(--ink); }

/* ---------- Адаптивность ---------- */
@media (max-width: 1100px) {
  .drow { grid-template-columns: minmax(200px, 1.8fr) minmax(150px, 1.2fr) minmax(190px, 1.4fr) 48px; }
  .dcell-ver, .dhead .h-ver, .dcell-added, .dhead .h-added { display: none; }
  .sort-menu { display: inline-flex; }
  .top-email { display: none; }
}
@media (max-width: 900px) {
  .topnav { display: none; }
  .burger { display: inline-grid; }
  .topbar-right .top-account { display: none; }
  .onb-steps { grid-template-columns: 1fr; }
  .onb-cta { justify-items: start; }
  .onb-cta .small { text-align: left; }
  .toolbar-note { display: none; }
}
@media (max-width: 760px) {
  .container { width: calc(100% - 32px); }
  .pagehead-inner { flex-wrap: wrap; gap: 12px; min-height: 0; padding-block: 16px 14px; }
  .pagehead .pagehead-action { width: 100%; }
  .pagehead .pagehead-action .btn { width: 100%; min-height: 46px; }
  .page { padding-top: 14px; }
  .search { flex: 1 1 100%; min-width: 0; }
  .search .input { min-height: 46px; }
  .toolbar .seg { width: 100%; }
  .toolbar .seg button { height: 36px; flex: 1 0 auto; }
  .alert { flex-wrap: wrap; }
  .alert-text { flex-basis: calc(100% - 40px); }
  .alert-actions { width: 100%; padding-left: 32px; }
  .dhead { display: none; }
  .drow { grid-template-columns: minmax(0, 1fr) 44px; grid-template-areas: "dev act" "status status" "list list"; gap: 10px 8px; padding: 14px 8px 14px 14px; }
  .dcell-dev { grid-area: dev; }
  .dcell-status { grid-area: status; padding-left: 52px; }
  .dcell-list { grid-area: list; padding-left: 52px; padding-right: 6px; }
  .dcell-list .dd-trigger { min-height: 44px; }
  .dcell-act { grid-area: act; align-self: start; }
  .toolbar .sort-menu { width: 100%; min-height: 40px; }
  .pair-grid { grid-template-columns: 1fr; }
  .pair-grid .schema { max-width: 220px; margin: 0 auto 4px; }
  .pair-body { min-height: 0; }
  .onb { padding: 18px 16px; }
  .auth-card { padding: 22px 18px 20px; }
  .socials { grid-template-columns: 1fr; }
  .social { min-height: 46px; }
  .auth-main { padding-top: 8px; }
  .letter-head, .letter-body, .letter-foot { padding-inline: 20px; }
  .empty-devices { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 380px) {
  .code-cells { gap: 5px; }
  .code-cells input:nth-child(3) { margin-right: 6px; }
}

/* Служебные классы вместо встроенных стилей (их запрещают правила безопасности страницы). */
[hidden] { display: none !important; }
.btn-lg { min-height: 44px; }
.avatar.is-brand { background: var(--purple); color: #fff; }
.skel-lines { display: grid; gap: 7px; flex: 1; }
.skel-tile { width: 40px; height: 40px; }
.w-35 { width: 35%; } .w-55 { width: 55%; } .w-70 { width: 70%; } .w-85 { width: 85%; } .w-40 { width: 40px; }
.auth-sub.is-lead { font-size: 15px; line-height: 21px; }
[data-push] { margin-right: auto; }
.onb-note.is-below { margin-top: 14px; }
.onb-note.ott-extra > div { display: grid; gap: 4px; }
.onb-note.ott-extra b { color: var(--ink); font-size: 15px; line-height: 20px; }
.onb-note.ott-extra ul { margin: 2px 0 0; padding-left: 18px; }
.onb-note.ott-extra li + li { margin-top: 2px; }
.onb-note.fmt-only { margin-top: 14px; font-size: 15px; line-height: 20px; }
.onb-note.fmt-only b { color: #4d2e00; }
.gap-top { margin-top: 16px; }
.gap-top-sm { margin-top: 8px; }
.schema { margin: 0; }
.badge.is-plain { text-transform: none; letter-spacing: 0; }
.table-tip { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--faint); }

/* Окна с шагами не прыгают: верх закреплён, место под сообщение об ошибке зарезервировано. */
@media (min-width: 641px) {
  .modal.is-wide { top: max(24px, 11vh); transform: translateX(-50%); animation-name: modal-in-top; }
  .modal.is-wide .modal-body { min-height: 408px; }
  .modal.is-wide .success { padding-top: 64px; }
  @keyframes modal-in-top { from { opacity: 0; transform: translate(-50%, 10px); } }
}
#code-msg { display: flex; min-height: 34px; }
#code-msg:empty { display: flex; }
.chips { margin-top: 2px; }
@media (max-width: 760px) {
  .toolbar .seg { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
  .toolbar .seg button { justify-content: space-between; min-height: 40px; }
  .dhead + .drow { border-top: 0; }
  .app-in .demo-fab { display: none; }
  .demo-fab { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: var(--r-xs); bottom: 12px; left: 12px; }
  .demo-panel { bottom: 12px; }
  .demo-fab-text { display: none; }
  .page { padding-bottom: 80px; }
}
.onb-steps { padding: 0; margin: 20px 0 0; list-style: none; }
@media (min-width: 761px) and (max-width: 1100px) {
  .dcell-list .dd-sub { display: none; }
  .status .status-sub { white-space: normal; }
  .drow { grid-template-columns: minmax(190px, 1.6fr) minmax(150px, 1.3fr) minmax(170px, 1.2fr) 44px; }
}
@media (max-width: 900px) { .search { flex: 1 1 100%; } }
@media (max-width: 640px) { .stub { padding: 28px 20px 24px; margin: 20px auto; } }

/* Ровные края: видимое содержимое шапки и строк совпадает с краем контейнера. */
.topbar-right { margin-right: -10px; }
.topnav { margin-left: -4px; }
.auth-top .top-btn:last-child { margin-right: -10px; }
.mnav { padding-top: 12px; }
@media (max-width: 760px) {
  .drow { padding: 14px 14px 14px 14px; }
  .dcell-list { padding-right: 0; }
  .dcell-act .icon-btn { margin-right: -12px; margin-top: -2px; }
}
@media (min-width: 761px) {
  .drow { padding-right: 16px; padding-left: 16px; }
  .dcell-act .icon-btn { margin-right: -11px; }
  .alert { padding: 10px 16px; }
  .alert-actions .btn-quiet:last-child { margin-right: -14px; }
}
.mail-mark.is-warn { background: var(--orange-soft); color: #b36b00; }
.alert.is-info { border-color: var(--line-2); background: #f4f5ff; }
.alert.is-info > .icon { color: var(--purple-600); }

/* Ящик писем: список слева, письмо справа — все письма в одном фирменном шаблоне */
.mail-client.is-box { width: min(1080px, 100%); }
.mailbox { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.mail-list { background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-1); padding: 8px; position: sticky; top: 16px; }
.mail-list h2 { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 6px; margin: 0; }
.mail-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mail-item { display: grid; gap: 2px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--r-sm); background: none; text-align: left; color: var(--ink); }
.mail-item b { font-size: 14px; line-height: 19px; font-weight: 600; }
.mail-item span { font-size: 12.5px; line-height: 17px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mail-item:hover { background: var(--tint); }
.mail-item.is-on { background: #eef0ff; box-shadow: inset 3px 0 0 var(--purple); }
.mail-item:focus-visible { outline: none; box-shadow: var(--focus); }
.mail-open { min-width: 0; }
.letter-steps { list-style: none; margin: 4px 0 16px; padding: 0; display: grid; gap: 10px; }
.letter-steps li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-2); line-height: 21px; }
.letter-steps i { flex: none; width: 24px; height: 24px; border-radius: var(--r-xs); display: grid; place-items: center; background: var(--orange); color: var(--ink); font-style: normal; font-weight: 700; font-size: 13px; }
.letter-info { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; padding: 12px 14px; margin: 4px 0 16px; border-radius: var(--r-sm); background: var(--bg); font-size: 14px; }
.letter-info span { color: var(--muted); }
@media (max-width: 860px) {
  .mailbox { grid-template-columns: minmax(0, 1fr); }
  .mail-list { position: static; }
  .mail-list ul { display: flex; overflow-x: auto; scrollbar-width: none; gap: 6px; }
  .mail-list li { flex: none; width: 220px; }
}

/* «Подтвердите почту»: шаги, статус повторной отправки, помощь, если письма нет */
.check-steps { list-style: none; margin: 4px 0 18px; padding: 0; display: grid; gap: 10px; text-align: left; }
.check-steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 20px; color: var(--ink-2); }
.check-steps i { flex: none; width: 24px; height: 24px; border-radius: var(--r-xs); display: grid; place-items: center; background: var(--tint); color: var(--purple-600); font-style: normal; font-weight: 700; font-size: 13px; }
.check-status { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 13.5px; line-height: 19px; color: var(--green); font-weight: 600; text-align: left; }
.check-status .icon { flex: none; margin-top: 1px; }
.check-status .link-btn { font-weight: 600; }
.nomail { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--r-md); text-align: left; }
.nomail summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 14px; cursor: pointer; font-weight: 600; list-style: none; }
.nomail summary::-webkit-details-marker { display: none; }
.nomail summary span { flex: 1; }
.nomail[open] summary > .icon:last-child { transform: rotate(180deg); }
.nomail summary:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-md); }
.nomail ol { margin: 0; padding: 0 14px 0 36px; display: grid; gap: 6px; font-size: 14px; line-height: 20px; color: var(--ink-2); }
.nomail p { margin: 10px 14px 14px; font-size: 14px; }
.nomail.is-warn { border-color: var(--orange-line); background: var(--orange-soft); }
.nomail.is-warn summary > .icon:first-child { color: #b36b00; }
.pf-del-wait { margin-bottom: 10px; }
.mail-meta .top-btn { color: var(--ink); }
.mail-meta .top-btn:hover, .mail-meta .top-btn[aria-expanded=true] { background: rgba(33, 20, 73, .06); }

/* Какие плейлисты подходят — плашка шага «Плейлист» мастера (владелец 02.10.2026: «надо заметнее»). */
.fmt-box { display: grid; gap: 10px; margin: 0 0 20px; padding: 14px 16px; border: 1px solid var(--violet, #8f99e6); border-radius: var(--r-md); background: var(--tint); }
.fmt-box > b { font-size: 15px; line-height: 20px; color: var(--ink); }
.fmt-box-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.fmt-badge { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: var(--r-xs); background: var(--surface); color: var(--purple-700); font-size: 14px; font-weight: 600; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line-2); }
.fmt-box-note { color: var(--ink-2); font-size: 13.5px; line-height: 18px; }
/* Ограниченная совместимость ссылки — предупреждение, не ошибка: подключится, но может работать не полностью. */
.onb-note.is-warn { background: var(--orange-soft); color: #6b4000; }
.onb-note.is-warn .icon { color: #8a5200; }
.lrow-line .badge[data-compat] { margin-left: 8px; }


/* Админка владельца (js/site/admin.js) */
.adm { padding: 8px 24px 24px; }
.adm-block { padding: 20px 0; border-bottom: 1px solid var(--line); }
.adm-block:last-child { border-bottom: 0; }
.adm-block h2 { font-size: 18px; line-height: 24px; margin-bottom: 6px; }
.adm-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.adm-note { color: var(--muted); font-size: 14px; line-height: 20px; margin: 4px 0 12px; }
.adm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 10px; }
.adm-stat { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--tint); }
.adm-stat-label { color: var(--muted); font-size: 13px; }
.adm-stat-value { font-size: 28px; line-height: 34px; color: var(--ink); }
.adm-stat-sub { color: var(--muted); font-size: 13px; line-height: 18px; }
.adm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-chip { display: inline-flex; gap: 8px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-xs); font-size: 14px; }
.adm-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
button.adm-chip { font: inherit; font-size: 14px; background: var(--surface); color: var(--ink); cursor: pointer; }
button.adm-chip:hover { background: var(--tint); }
button.adm-chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.adm-noise { color: var(--muted); }
.adm-row.is-service .adm-shape { color: var(--muted); }
.adm-table { display: grid; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.adm-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px 70px 110px 110px; gap: 12px; align-items: start; padding: 10px 14px;
  border: 0; border-top: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.adm-row:hover { background: var(--tint); }
.adm-row.is-head { border-top: 0; background: var(--tint); color: var(--muted); font-size: 13px; cursor: default; }
.adm-shape { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 18px; overflow-wrap: anywhere; }
.adm-form { display: flex; gap: 10px; max-width: 360px; margin-bottom: 10px; }
.adm-log { max-height: 480px; overflow: auto; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--tint);
  font-size: 12px; line-height: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.adm-domains { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; max-width: 420px; min-height: 160px; resize: vertical; }
@media (max-width: 720px) {
  .adm { padding: 4px 16px 16px; }
  .adm-row { grid-template-columns: minmax(0, 1fr) 56px; }
  .adm-row > :nth-child(n+3) { display: none; }
}
.adm-tabs { margin-bottom: 16px; }
.adm-sub { font-size: 16px; line-height: 22px; margin: 18px 0 4px; }
.adm-row.is-static { cursor: default; }
.adm-row-5 { grid-template-columns: minmax(0, 1fr) 90px 80px 110px minmax(0, 160px); }
.adm-row-4 { grid-template-columns: minmax(0, 1fr) 100px 100px 100px; }
.adm-row-ch { grid-template-columns: minmax(0, 1.3fr) 90px 80px minmax(0, 1.2fr) minmax(0, 1fr) 120px; }
.adm-search { max-width: 360px; margin-bottom: 12px; }
@media (max-width: 720px) {
  .adm-row-5, .adm-row-4, .adm-row-ch { grid-template-columns: minmax(0, 1fr) 56px; }
}

/* Сканер QR в окне подключения (владелец 06.10.2026): видео камеры во всю ширину колонки. */
.qr-scan { position: relative; overflow: hidden; border-radius: var(--r-sm); background: #000; aspect-ratio: 4 / 3; }
.qr-scan video { display: block; width: 100%; height: 100%; object-fit: cover; }
