/* Deck Finder — design B «Арена» (guide 52, owner 16.11).
   Dark theme only (owner 17.11: the light one is gone); every colour is a token below.
   Contrast (text on --card): text 15.3, muted 7.0, accent 9.5, ok 9.9, bad 7.8. */
:root {
  color-scheme: dark;
  --bg: #0d111a;
  --card: #151b28;
  --soft: #1c2434;
  --line: #232c3f;
  --line-strong: #2c3750;
  --text: #eef2f8;
  --muted: #9aa6ba;
  --accent: #f2b63d;          /* fill: buttons, meters, logo; also links and the active tab */
  --on-accent: #1a1204;       /* text on the fill */
  --link: #f2b63d;
  --ok: #7ad7a6;
  --ok-soft: #143325;
  --warn: #f5d699;
  --warn-soft: #2a210f;
  --warn-line: #5c4515;
  --bad: #ff8f87;
  --bad-line: #6b2a27;
  --idle: #7d8794;
  --pro-bg: #1a1710;
  --nav-active: #1c2434;
  --shadow: none;
  --shadow-float: 0 10px 30px rgba(0, 0, 0, .45);
  --r-card: 18px;
  --r-field: 12px;
  --r-pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --f-xs: 12px; --f-sm: 13px; --f-md: 14px; --f-lg: 16px; --f-xl: 20px;
  --lh: 1.45;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Owner 28.11: the account model from v1/login/options (panel.js sets html[data-account-model]). */
html[data-account-model="telegram"] .for-site { display: none !important; }
html:not([data-account-model="telegram"]) .for-telegram { display: none !important; }
/* Owner 02.12: the payment by the page's place (panel.js sets html[data-pay]): card in the browser,
   Stars in the Mini App. */
html:not([data-pay="stars"]) .pay-stars { display: none !important; }
html[data-pay="stars"] .pay-card { display: none !important; }
html, body { margin: 0; }
/* Same width on every tab: a long tab with a scrollbar no longer shifts the layout. */
@media (hover: hover) and (pointer: fine) { html { scrollbar-gutter: stable; } }
/* Thin, theme-coloured scrollbars; touch screens keep the system overlay ones. */
html { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
@media (hover: none), (pointer: coarse) {
  html { scrollbar-width: none; }
  ::-webkit-scrollbar { width: 0; height: 0; }
}
body {
  background: var(--bg);
  color: var(--text);
  font: var(--f-md)/var(--lh) system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--link); }
.muted { color: var(--muted); }
.small { font-size: var(--f-xs); }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
      stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 16px; height: 16px; }
.ic.bolt { fill: var(--accent); stroke: none; }

/* ---------- app shell (owner 17.11): a top bar on wide screens, the bottom bar on phones and in
   the OBS dock. The bar's inside and the page content share one centred width. ---------- */
:root { --page: 1180px; }
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.bar {
  position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line);
}
.bar-in {
  max-width: var(--page); margin: 0 auto; padding: 0 32px; min-height: 64px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s4);
}
/* Only the wide top bar aligns its zones: browsers also apply justify-self to the fixed bottom bar
   (phone, tablet, OBS dock), which then shrank to its content in the middle (owner 17.11). */
@media (min-width: 900px) {
  html:not(.obs) .bar-in > .brand { justify-self: start; }
  html:not(.obs) .bar-in > .tabs { justify-self: center; }
  html:not(.obs) .bar-in > .avatar { justify-self: end; grid-column: 3; }
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text);
         text-decoration: none; font-weight: 800; font-size: 17px; flex: none; }
.logo { border-radius: 9px; flex: none; }
.logo-full { display: block; height: 52px; width: auto; max-width: 100%; }
.bar .logo-full { height: 38px; }
.docs-top .logo-full { height: 44px; }
/* The avatar: the way into «Аккаунт»; a yellow ring while that tab is open. */
.avatar {
  width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--soft); border: 1px solid var(--line-strong); color: var(--text);
  font-weight: 800; font-size: 16px; cursor: pointer;
}
.avatar:hover { border-color: var(--accent); }
.code-sent { margin: 0 0 8px; overflow-wrap: anywhere; }
.avatar[aria-selected="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 182, 61, .3); }
@media (prefers-reduced-motion: reduce) { #tabSearch > * { transition: none !important; } }
.card-head .pill.small { margin-left: auto; font-size: var(--f-xs); min-height: 32px; padding: 4px 12px; }
.content { flex: 1; width: 100%; max-width: var(--page); margin: 0 auto; padding: 24px 32px 40px; }
/* Owner 17.11: the narrower tabs sit in the middle of the page, under the centred tabs. */
.content > .tab, .content > .card { max-width: 860px; margin-left: auto; margin-right: auto; }
.content > #tabSearch { max-width: none; }

/* Navigation: one set of tab buttons for both layouts (panel.js finds them in #tabs). */
.tabs { display: flex; min-width: 0; }
/* Wide screens: the tabs are one capsule, like the bottom bar on a phone. */
.tabs-list { display: flex; gap: 2px; min-width: 0; padding: 4px; background: var(--card);
             border: 1px solid var(--line); border-radius: 999px; }
.tabs-more { display: contents; }
.tabs button[role="tab"] {
  display: flex; align-items: center; gap: var(--s2); white-space: nowrap;
  font: inherit; font-weight: 600; color: var(--muted); background: none; border: 0;
  border-radius: 999px; padding: 6px 14px; cursor: pointer; min-height: 36px;
}
.tabs button[role="tab"]:hover { color: var(--text); background: var(--soft); }
.tabs button[aria-selected="true"] { color: var(--text); background: var(--nav-active);
  box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow); }
.tabs button[aria-selected="true"] .ic { color: var(--link); }
.tabs [data-tab="search"] { order: 1; }
.tabs [data-tab="settings"] { order: 2; }
.tabs [data-tab="devices"] { order: 3; }
.tabs [data-tab="account"] { order: 4; }
.tabs [data-tab="plan"] { order: 5; }
.tabs [data-tab="help"] { order: 6; }
.more-btn { display: none; }
.tabs .short { display: none; }
/* Owner 17.11: on a wide screen one highlight glides between the tabs (panel.js places it); the
   avatar has its own ring, so the highlight fades out for «Аккаунт». A new tab fades in. */
.tab-glider { display: none; }
@media (min-width: 900px) {
  html:not(.obs) .tabs-list { position: relative; }
  html:not(.obs) .tabs-list > button { position: relative; z-index: 1; }
  html:not(.obs) .tab-glider {
    display: block; position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0;
    border-radius: 999px; background: var(--nav-active); box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow);
    opacity: 0; pointer-events: none; transition: transform .25s ease, width .25s ease, opacity .2s ease;
  }
  html:not(.obs) .tab-glider.on { opacity: 1; }
  html:not(.obs) .tab-glider.still { transition: none; }
  html:not(.obs) .tabs.glide button[aria-selected="true"] { background: none; box-shadow: none; }
}
.tab-enter { animation: tab-in .18s ease-out; }
@keyframes tab-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .tab-glider { transition: none !important; }
  .tab-enter { animation: none; }
}
/* A narrower window: short tab names and no address next to «Выйти». */
@media (min-width: 900px) and (max-width: 1199px) {
  .bar-in { gap: var(--s3); padding: 0 20px; }
  .content { padding: 20px 20px 40px; }
  .tabs-list > button .long { display: none; }
  .tabs-list > button .short { display: inline; }
  .tabs button[role="tab"] { padding: 8px 10px; }
}

@media (max-width: 899px) {
  .bar { position: static; border: 0; background: none; }
  .bar-in { padding: 12px 16px 0; min-height: 0; display: flex; justify-content: space-between; }
  .bar .logo-full { height: 32px; }
  .avatar { width: 36px; height: 36px; font-size: 15px; }
  .content { padding: 12px 16px 112px; }
  .tabs {
    position: fixed; z-index: 10; left: 10px; right: 10px; bottom: 10px; flex-direction: row;
    align-items: stretch; background: var(--card); border: 1px solid var(--line-strong);
    border-radius: 20px; padding: 4px; box-shadow: var(--shadow-float);
  }
  .tabs-list { flex: 1 1 auto; min-width: 0; flex-direction: row; gap: 2px; padding: 0; background: none;
               border: 0; border-radius: 0; }
  .tabs button[role="tab"], .more-btn {
    flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 2px; padding: 6px 2px;
    font-size: 11px; text-align: center; min-height: 52px; border-radius: 14px; white-space: normal;
  }
  .tabs button[aria-selected="true"] { background: none; box-shadow: none; color: var(--link); }
  .tabs-list > button .long { display: none; }
  .tabs-list > button .short { display: inline; }
}

/* ---------- cards and text ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 20px; margin-bottom: var(--s4); box-shadow: var(--shadow);
}
.card h2 { font-size: var(--f-lg); font-weight: 750; margin: 0 0 var(--s2); display: flex; align-items: center; gap: var(--s2); }
.card h2 .ic { color: var(--link); }
.card p { margin: 0 0 10px; }
.note { border-color: var(--warn-line); background: var(--warn-soft); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.tab-title { font-size: 26px; font-weight: 800; margin: 4px 0 var(--s4); letter-spacing: -.01em; }

.badge {
  flex: none; font-size: var(--f-xs); font-weight: 650; padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--soft); color: var(--muted);
}
.badge.small { font-size: 11px; padding: 2px 8px; }
.badge[data-tone="ok"] { color: var(--ok); background: var(--ok-soft); }
.badge[data-tone="warn"] { color: var(--warn); background: var(--warn-soft); }
.badge[data-tone="bad"] { color: var(--bad); }

/* ---------- controls ---------- */
.row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
input[type="password"], input[type="text"], input[type="email"], input[type="number"], select {
  font: inherit; color: var(--text); background: var(--card); min-width: 0; min-height: 42px;
  border: 1px solid var(--line-strong); border-radius: var(--r-field); padding: 8px 12px;
}
input[type="password"], input[type="text"], input[type="email"] { flex: 1 1 180px; }
input[type="password"], input[type="text"], input[type="email"], input[type="number"], select { background: var(--bg); }
/* Owner 17.11: iOS Safari zooms into a field whose text is under 16 px; on touch screens (phones,
   tablets) the fields use 16 px. Mouse screens and the OBS dock keep the smaller text. */
@media (pointer: coarse) {
  input[type="password"], input[type="text"], input[type="email"], input[type="number"], select { font-size: 16px; }
}
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
button, a.button, .button-like {
  font: inherit; font-weight: 650; color: var(--text); background: var(--card);
  border: 1px solid var(--line-strong); border-radius: var(--r-field); padding: 8px 16px;
  min-height: 42px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s2); text-decoration: none;
}
button, a.button, .button-like { background: var(--soft); }
button:hover, a.button:hover, .button-like:hover { filter: brightness(.97); }
button.primary, a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.ghost { background: none; border-color: var(--line-strong); flex: none; }
button.link {
  background: none; border: none; padding: 4px 2px; min-height: 0; color: var(--link); font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
}
button.link.inline { padding: 0; font-size: inherit; }
button.danger { background: none; color: var(--bad); border-color: var(--bad-line); }
button.wide { flex: 1; }
button:disabled { opacity: .55; cursor: default; filter: none; }
.button-like:focus-within { outline: 2px solid var(--link); outline-offset: 2px; }
/* Kept in the layout (not display:none) so iOS Safari opens the picker from the label. */
.sr-only { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }

.pill {
  font-size: var(--f-sm); font-weight: 650; padding: 6px 12px; min-height: 36px; border-radius: var(--r-pill);
  white-space: nowrap;
}
.pill .ic { width: 16px; height: 16px; }
.pill[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pill[aria-pressed="true"] .ic.bolt { fill: var(--on-accent); }

.pro-active { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--card); font-size: var(--f-sm);
  color: var(--ok); border: 1px solid var(--line); }
.card-pay { display: grid; gap: var(--s2); margin-top: var(--s2); }
.consent { display: flex; gap: 8px; align-items: flex-start; font-size: var(--f-sm); cursor: pointer; }
.consent input { margin-top: 3px; flex: none; }
.login-adult { margin: 4px 0 10px; }
.message { min-height: 1.45em; font-size: var(--f-sm); margin: 8px 0 0 !important; }
.message[data-tone="ok"] { color: var(--ok); }
.message[data-tone="bad"] { color: var(--bad); }
.message[data-tone="warn"] { color: var(--warn); }

kbd {
  font: 600 12px ui-monospace, Consolas, monospace; padding: 1px 6px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--soft);
}

/* Segmented choice (clan mode, device). */
.segmented { display: flex; gap: 2px; padding: 3px; background: var(--soft); border: 1px solid var(--line);
             border-radius: var(--r-field); }
.segmented label { flex: 1; position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span {
  display: block; text-align: center; padding: 7px 4px; font-size: var(--f-sm); font-weight: 600;
  color: var(--muted); border-radius: 9px;
}
.segmented input:checked + span { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(18, 24, 38, .12); }
.segmented input:focus-visible + span { outline: 2px solid var(--link); outline-offset: -2px; }
.devices-switch { margin-top: var(--s3); }
.devices-switch button {
  flex: 1; border: 0; background: none; color: var(--muted); font-size: var(--f-sm); min-height: 40px;
  padding: 6px 4px; border-radius: 9px;
}
.devices-switch button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(18, 24, 38, .12); }
.segmented input:checked + span, .devices-switch button[aria-pressed="true"] { background: #2a3347; }

/* Selects: own arrow with room on the right. */
.select { position: relative; display: block; min-width: 0; }
.select select { width: 100%; appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer; }
.select::after {
  content: ""; position: absolute; right: 15px; top: 50%; width: 7px; height: 7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}

/* Switches: a real checkbox drawn as a toggle. */
.switch { display: flex; gap: var(--s3); align-items: center; cursor: pointer; padding: 12px 0;
          border-top: 1px solid var(--line); }
.switch:first-of-type { border-top: 0; }
.switch input {
  appearance: none; -webkit-appearance: none; flex: none; order: 2; margin: 0 0 0 auto; width: 46px; height: 28px;
  border-radius: var(--r-pill); background: var(--line-strong); position: relative; cursor: pointer;
  transition: background .15s;
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(18, 24, 38, .25); transition: transform .15s;
}
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
@media (prefers-reduced-motion: reduce) { .switch input, .switch input::after { transition: none; } }

/* ---------- search tab ----------
   Owner 17.11: two equal columns on a wide screen. Left: «Данные для поиска» (always open) and
   «Снимок»; right: «Статус поиска» with the players and the deck. The status grows with its
   content up to the height of the left column, then scrolls inside: the slot is stretched by
   the grid, the card is positioned in it, so it never makes the rows taller. */
.status-slot { display: contents; }
#statusCard, #formCard { scroll-margin-top: 12px; }
@media (min-width: 1100px) {
  html:not(.obs) #tabSearch:not([hidden]) {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; align-items: start;
    grid-template-areas: "access access" "form status" "capture status" "note note";
  }
  html:not(.obs) #tabSearch > #accessCard { grid-area: access; }
  html:not(.obs) #tabSearch > #formCard { grid-area: form; }
  html:not(.obs) #tabSearch > #captureCard { grid-area: capture; }
  html:not(.obs) #tabSearch > #obsNote { grid-area: note; }
  html:not(.obs) #tabSearch > #statusSlot {
    display: block; grid-area: status; align-self: stretch; position: relative; margin-bottom: var(--s4);
  }
  html:not(.obs) #statusCard {
    position: absolute; top: 0; left: 0; right: 0; max-height: 100%; margin: 0;
    overflow-y: auto;      /* no overscroll-behavior: the wheel must reach the page (owner 17.11) */
  }
  /* Owner 17.11: while nothing is searched, «Данные для поиска» and «Снимок» stand in the middle and
     «Статус поиска» is away; when work starts they slide to the left and the status comes in on the
     right (panel.js adds .status-open after a short pause). Only transform and opacity move. */
  html:not(.obs) #tabSearch > #formCard, html:not(.obs) #tabSearch > #captureCard { transition: transform .35s ease; }
  html:not(.obs) #tabSearch:not(.status-open) > #formCard,
  html:not(.obs) #tabSearch:not(.status-open) > #captureCard { transform: translateX(calc(50% + 10px)); }
  html:not(.obs) #tabSearch > #statusSlot { transition: opacity .3s ease, transform .35s ease, visibility .35s; }
  html:not(.obs) #tabSearch:not(.status-open) > #statusSlot {
    opacity: 0; transform: translateX(24px); visibility: hidden; pointer-events: none;
  }
  html:not(.obs) #tabSearch.instant > * { transition: none !important; }
}
.status { display: flex; gap: var(--s3); align-items: flex-start; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--idle); }
.status[data-tone="ok"] .dot { background: var(--ok); }
.status[data-tone="warn"] .dot { background: #e0a82e; }
.status[data-tone="bad"] .dot { background: var(--bad); }
.status[data-tone="busy"] .dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(242, 182, 61, .25);
                                 animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .status[data-tone="busy"] .dot { animation: none; } }
.status-body { flex: 1; min-width: 0; }
.status-title { font-weight: 700; font-size: 15px; }
.status-text { color: var(--muted); }
.status-progress {
  margin-top: 6px; font-size: var(--f-xs); color: var(--muted); background: var(--soft);
  border-radius: 8px; padding: 4px 8px; overflow-wrap: anywhere;
}
#statusCard .status { padding: 12px 14px; background: var(--soft); border-radius: var(--r-field); }
#captureCard.over { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 182, 61, .25); }
#captureControls { border: 1.5px dashed var(--line-strong); border-radius: 14px; padding: 14px; }
.folder-name { margin: -2px 0 8px !important; overflow-wrap: anywhere; }
.folder-name:empty { display: none; }
#pasteHint { align-self: center; }
.shot { position: relative; margin: 12px 0 0; }
.shot img {
  display: block; width: 100%; max-height: 260px; object-fit: contain;
  background: var(--soft); border: 1px solid var(--line); border-radius: var(--r-field);
}
.shot figcaption { font-size: var(--f-xs); margin-top: 4px; }
/* ✕ on the screenshot: on hover/focus with a mouse, always on touch screens. */
.shot-remove {
  position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; min-height: 0; padding: 0;
  border-radius: 50%; font-size: 14px; line-height: 1; background: rgba(0, 0, 0, .6); color: #fff; border: none;
  opacity: 0; transition: opacity .15s;
}
.shot:hover .shot-remove, .shot-remove:focus-visible { opacity: 1; }
@media (hover: none) { .shot-remove { opacity: 1; } }
.shot-actions { margin-top: var(--s2); }
.shot-actions button, .status-actions button { font-size: var(--f-sm); min-height: 36px; padding: 6px 12px; }
.shot-note { margin: 12px 0 0 !important; }
.status-actions { margin-top: 10px; }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span:not(.select) { font-size: var(--f-sm); font-weight: 650; }
.pair { display: flex; gap: var(--s2); flex-wrap: wrap; }
.pair > * { flex: 1 1 140px; min-width: 0; }
.pair > .select { flex: 0 1 130px; }
#formBody { margin-top: var(--s3); }
#formReset { flex: none; }

.candidates { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: var(--s2); }
.candidates .divider { font-size: var(--f-xs); font-weight: 650; color: var(--muted); padding: 6px 2px 0; margin: 0; }
.candidate {
  width: 100%; text-align: left; display: flex; align-items: center; gap: var(--s3); justify-content: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-weight: 400;
}
.candidate.best { border-color: var(--accent); background: var(--pro-bg); }
.cand-av {
  flex: none; width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; background: var(--soft); color: var(--text);
}
.candidate.best .cand-av { background: var(--accent); color: var(--on-accent); }
.cand-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.badge.rec { background: var(--accent); color: var(--on-accent); font-size: 11px; padding: 2px 8px; }
.cand-head .tag { margin-left: auto; }
.candidate { background: var(--bg); }
.candidate:hover { border-color: var(--accent); filter: none; }
.cand-head { display: flex; flex-wrap: wrap; gap: 6px var(--s2); align-items: center; }
.cand-name { font-weight: 700; overflow-wrap: anywhere; }
.cand-meta { font-size: var(--f-xs); color: var(--muted); }
.cand-warn { font-size: var(--f-xs); color: var(--warn); }
.tag {
  font: 12px ui-monospace, Consolas, monospace; color: var(--muted); background: var(--soft);
  border-radius: 6px; padding: 2px 6px; flex: none;
}

.deck-head { display: flex; justify-content: space-between; gap: var(--s2); align-items: flex-start; margin-bottom: 14px; }
.deck-name { font-weight: 800; font-size: 22px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.deck-label {
  display: inline-block; font-size: var(--f-xs); font-weight: 650; color: var(--muted); margin-bottom: 10px;
  background: var(--soft); border-radius: var(--r-pill); padding: 3px 10px;
}
.deck-img { display: block; width: 100%; border-radius: 14px; background: var(--soft); margin-bottom: 14px; }
#deckCard.previous .deck-img { opacity: .8; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 10px 0; font-size: var(--f-sm); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.cards-list { margin: 0 0 10px; padding-left: 18px; font-size: var(--f-sm); }
.cards-list .deck-round { list-style: none; margin: 8px 0 2px -18px; font-weight: 600; }
.notes { list-style: none; margin: 0 0 8px; padding: 0; font-size: var(--f-sm); color: var(--warn); }
.notes:empty { display: none; }

/* ---------- other tabs ---------- */
.settings { display: grid; gap: 4px; margin-top: 6px; }
#devicesBody .field, #settingsBody .field { margin-bottom: var(--s3); }
.steps { margin: 0 0 12px; padding: 0; list-style: none; counter-reset: step; font-size: var(--f-sm); }
.steps li { counter-increment: step; position: relative; padding: 10px 0 10px 40px; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 8px; width: 28px; height: 28px; border-radius: 9px;
  background: var(--soft); color: var(--link); font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.plain { margin: 0; padding-left: 18px; color: var(--muted); font-size: var(--f-sm); }
.plain li { margin-bottom: 4px; }
.guide-url { overflow-wrap: anywhere; word-break: break-all; margin-top: 4px !important; }
.tg-box { margin-top: 10px; padding: 12px; border-radius: 14px; background: var(--soft); }
.tg-box > .button { margin: 4px 0; }
.cmd-row { display: flex; gap: var(--s2); align-items: stretch; flex-wrap: wrap; margin: 6px 0; }
.cmd {
  flex: 1 1 200px; min-width: 0; display: block; font: 14px ui-monospace, Consolas, monospace;
  color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-field);
  padding: 10px 12px; overflow-wrap: anywhere; word-break: break-all; user-select: all;
}
.cmd { background: var(--bg); }
.copy { flex: none; font-size: var(--f-sm); }
.sessions { list-style: none; margin: 0 0 12px; padding: 0; }
.sessions li {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s2); padding: 12px 0;
  border-bottom: 1px solid var(--line); font-size: var(--f-sm);
}
.sessions li:last-child { border-bottom: none; }
.sessions button { font-size: var(--f-xs); min-height: 34px; padding: 4px 12px; }
#planCard dl.facts { font-size: var(--f-md); }
#promoInput { letter-spacing: .06em; }
.help-text p { margin: 0; }
.commands { grid-template-columns: 90px 1fr; }
.commands dt code { font-size: var(--f-md); font-weight: 650; color: var(--link); }
.commands dt, .commands dd { padding: 8px 0; border-top: 1px solid var(--line); }
.commands dt:first-of-type, .commands dd:first-of-type { border-top: 0; }

/* ---------- sign in ---------- */
#loginCard { max-width: 980px; padding: 0; overflow: hidden; display: grid;
             grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.login-hero { padding: 32px; background: var(--soft); display: flex; flex-direction: column; gap: var(--s4); }
.login-hero h1 { margin: 0; font-size: 32px; line-height: 1.12; font-weight: 800; letter-spacing: -.02em; }
.login-hero ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.login-hero li { display: flex; gap: 10px; align-items: center; }
.login-hero li .ic { color: var(--link); }
.login-form { padding: 32px; }
.login-form h2 { font-size: 24px; font-weight: 800; }
#loginCard .wide { width: 100%; }
#codeInput { letter-spacing: .3em; font-size: 22px; font-weight: 700; text-align: center; }
.divider {
  display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: var(--f-xs);
}
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
/* Owner 17.11: signed out, the bar holds only the logo and the card sits in the middle. */
.signed-out .content { display: flex; align-items: center; justify-content: center; }
.signed-out .content > #loginCard { width: 100%; margin: 0 auto; }
@media (max-width: 899px) {
  .signed-out .content { padding-bottom: 24px; }
  .signed-out .foot { padding-bottom: 28px; }
  .login-hero { padding: 22px; }
  .login-hero h1 { font-size: 26px; }
  .login-form { padding: 22px; }
}

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 20px 32px 28px; display: grid; gap: 10px;
        font-size: var(--f-sm); color: var(--muted); }
.foot { padding-inline: max(32px, calc((100% - var(--page)) / 2 + 32px)); }   /* same width as the page */
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); text-decoration: underline; }
.foot p { margin: 0; font-size: var(--f-xs); }
.foot .fan-note { color: var(--muted); }   /* owner 02.12: Supercell Fan Content Policy notice */
@media (max-width: 899px) { .foot { padding: 16px 16px 100px; } .content { flex: 1; } }

/* ---------- documents pages: header ---------- */
.docs-top { display: flex; align-items: center; gap: var(--s3); max-width: 860px; margin: 0 auto; padding: 16px 24px; }
.docs-top .button { margin-left: auto; }
@media (max-width: 899px) { .docs-top { padding: 12px; } }

/* The documents page has no bottom bar to clear. */
body > .foot { padding-bottom: 28px; }

/* ---------- spacing between a control and the text after it (owner 16.11) ---------- */
.card :is(button, a.button, .row, form, .tg-box, .cmd-row, .divider, .segmented, .steps, ul, ol, dl, .plans) + p:not(.message) {
  margin-top: 14px;
}
.card :is(button, a.button, .row, .cmd-row) + :is(.tg-box, .row, .field) { margin-top: 12px; }
.login-form p.small { margin-top: 12px; }
.login-form .divider + button { margin-top: 0; }

/* ---------- help: sections fold ---------- */
details.help-text > summary { list-style: none; cursor: pointer; display: flex; align-items: center; }
details.help-text > summary::-webkit-details-marker { display: none; }
details.help-text > summary h2 { margin: 0; flex: 1; }
details.help-text > summary::after {
  content: ""; width: 8px; height: 8px; margin: 0 4px 4px 12px; border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s;
}
details.help-text[open] > summary::after { transform: rotate(225deg); margin-bottom: -4px; }
details.help-text[open] > summary { margin-bottom: 12px; }
@media (prefers-reduced-motion: reduce) { details.help-text > summary::after { transition: none; } }

/* ---------- plan comparison ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: var(--s3); margin: 14px 0; }
.plan { border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.plan.pro { border-color: var(--warn-line); background: var(--pro-bg); }
.plan h3 { margin: 0; font-size: var(--f-lg); display: flex; align-items: center; gap: var(--s2); }
.pro-badge { background: var(--accent); color: var(--on-accent); }
.price { font-size: 26px; font-weight: 800; }
.checks { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 6px; font-size: var(--f-sm); }
.checks li { position: relative; padding-left: 24px; }
.checks li::before {
  content: ""; position: absolute; left: 4px; top: 3px; width: 6px; height: 11px;
  border-right: 2px solid var(--link); border-bottom: 2px solid var(--link); transform: rotate(45deg);
}

/* ---------- OBS dock (html.obs from panel.js): compact, no footer, bar on the edge ---------- */
html.obs { scrollbar-gutter: auto; }
.obs .foot, .obs .login-hero, .obs .bar .brand { display: none; }
.obs .bar { position: static; border: 0; background: none; }
.obs .bar-in { padding: 8px 10px 0; min-height: 0; display: flex; justify-content: flex-end; }
.obs .avatar { width: 32px; height: 32px; font-size: 14px; }
.obs .content { padding: 8px 10px 76px; }
.obs .card { padding: 14px; border-radius: 14px; margin-bottom: 10px; }
.obs .tabs {
  position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; flex-direction: row; align-items: stretch;
  background: var(--card); border: 0; border-top: 1px solid var(--line-strong); border-radius: 0; padding: 2px;
  box-shadow: none;
}
.obs .tabs-list { flex: 1 1 auto; min-width: 0; flex-direction: row; gap: 2px; padding: 0; background: none;
                  border: 0; border-radius: 0; }
.obs .tabs button[role="tab"], .obs .more-btn {
  flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 2px; padding: 4px 2px;
  font-size: 11px; text-align: center; min-height: 48px; border-radius: 10px; display: flex; align-items: center;
  font-weight: 600; color: var(--muted); background: none; border: 0;
}
.obs .tabs button[aria-selected="true"] { background: none; box-shadow: none; color: var(--link); }
.obs .tabs-list > button .long { display: none; }
.obs .tabs-list > button .short { display: inline; }
.obs .more-btn.active, .obs .more-btn[aria-expanded="true"] { color: var(--link); }
.obs .tabs-more {
  display: none; position: absolute; right: 4px; bottom: calc(100% + 6px); width: min(240px, 100% - 8px);
  flex-direction: column; gap: 2px; padding: 6px; background: var(--card); border: 1px solid var(--line-strong);
  border-radius: 14px; box-shadow: var(--shadow-float);
}
.obs .tabs.more-open .tabs-more { display: flex; }
.obs .tabs-more button[role="tab"] { flex-direction: row; justify-content: flex-start; font-size: var(--f-md); min-height: 44px; }
.obs #tabSearch:not([hidden]) { display: block; }

/* ---------- folder row: name, «Другая папка», «Забыть», watch switch (owner 16.11) ---------- */
.folder-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 8px; }
.folder-row .folder-name { margin: 0 !important; font-weight: 700; color: var(--text); font-size: var(--f-md); }
.folder-row .folder-name:empty { display: none; }
.folder-row button.link { font-size: var(--f-sm); }
.switch.compact { border: 0; padding: 0; margin-left: auto; font-size: var(--f-sm); font-weight: 600; gap: 10px; }
.switch.compact input { margin-left: 0; }
#folderText { margin-bottom: 12px; }

/* ---------- settings: crop schema and phone target cards ---------- */
.crop-schema { flex: none; order: 1; width: 72px; height: 44px; margin-left: auto; }
.switch.with-schema input { margin-left: 0; }
.cs-screen { fill: var(--soft); stroke: var(--line-strong); stroke-width: 1.5; }
.cs-area { fill: rgba(242, 182, 61, .3); stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 2; }
.cs-text { stroke: var(--text); stroke-width: 2; stroke-linecap: round; }
.cs-arena { fill: var(--line-strong); }
.choice-cards { border: 0; padding: 12px 0 0; margin: 4px 0 0; border-top: 1px solid var(--line);
                display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 10px; }
.choice-cards legend { font-weight: 650; padding: 12px 0 8px; float: left; width: 100%; }
.choice { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px; cursor: pointer;
          border: 1px solid var(--line-strong); border-radius: 14px; background: var(--card); }
.choice { background: var(--bg); }
.choice input {
  appearance: none; -webkit-appearance: none; flex: none; margin: 1px 0 0; width: 20px; height: 20px;
  border-radius: 50%; border: 2px solid var(--muted); cursor: pointer;
}
.choice input:checked { border: 6px solid var(--accent); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--pro-bg); }
.choice > span { display: grid; gap: 2px; }

/* ---------- help: copy next to each command ---------- */
.commands dd { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.commands dd .copy { min-height: 32px; padding: 4px 10px; font-size: var(--f-xs); }

/* ---------- loading placeholders ---------- */
.skel, .skel-row {
  display: block; min-height: 1.1em; min-width: 6em; border-radius: 6px; color: transparent;
  background: linear-gradient(90deg, var(--soft) 25%, var(--line) 50%, var(--soft) 75%);
  background-size: 200% 100%; animation: skel 1.2s ease-in-out infinite;
}
.sessions .skel-row { height: 40px; margin: 10px 0; border-bottom: 0; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skel, .skel-row { animation: none; } }

/* Snapshot card without a picture: no reserved gap under «Выбрать снимок» (owner 16.11). */
#captureMessage:empty, #folderMessage:empty { display: none; }
.shot-actions { margin-top: 0; }
.shot-actions:has(> :not([hidden])) { margin-top: 12px; }

/* The OBS dock puts «Распознать снимок» in the search status. */
.status-actions { margin-top: 0; }
.status-actions button { margin-top: 10px; }

/* Screenshot as a thumbnail; click for a large view and back (owner 16.11). */
.shot { width: fit-content; max-width: 100%; }
.shot.large { width: 100%; }
.shot-zoom { display: block; padding: 0; border: 0; background: none; min-height: 0; border-radius: var(--r-field);
             cursor: zoom-in; }
.shot-zoom:hover { filter: none; }
.shot .shot-zoom img { max-height: 120px; width: auto; max-width: 100%; }
.shot.large .shot-zoom { cursor: zoom-out; width: 100%; }
.shot.large .shot-zoom img { max-height: 75vh; width: 100%; }
.status-actions { display: flex; flex-wrap: wrap; gap: 0 8px; }

/* ---------- legal documents (owner 16.11): list + one page per document, no side menu ---------- */
.legal { max-width: 860px; margin: 0 auto; padding: 8px 24px 40px; }
.doc-list { list-style: none; margin: 0 0 var(--s4); padding: 0; display: grid; gap: 12px; }
.doc-card { display: grid; gap: 4px; margin: 0; text-decoration: none; color: var(--text); }
.doc-card b { font-size: 18px; }
.doc-card:hover { border-color: var(--accent); }
.doc-owner p { margin: 0 0 8px; }
.legal-doc { padding: 32px 36px; }
.legal-doc h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.01em; }
.legal-sub { margin: 6px 0 4px !important; font-size: var(--f-lg); color: var(--muted); }
.legal-edition { margin: 0 0 20px !important; font-size: var(--f-sm); color: var(--muted); }
.legal-toc { background: var(--soft); border-radius: 14px; padding: 14px 18px; margin-bottom: 24px; }
.legal-toc h2 { font-size: var(--f-md); margin: 0 0 6px; }
.legal-toc ol { margin: 0; padding-left: 22px; columns: 2 240px; column-gap: 28px; font-size: var(--f-sm); }
.legal-toc li { margin: 3px 0; break-inside: avoid; }
.legal-text { max-width: 72ch; font-size: 15.5px; line-height: 1.7; }
.legal-text h2 { font-size: 19px; margin: 28px 0 8px; scroll-margin-top: 16px; }
.legal-text h3 { font-size: var(--f-lg); margin: 18px 0 6px; }
.legal-text p { margin: 0 0 10px; }
.legal-text ul { margin: 0 0 12px; padding-left: 22px; }
.legal-text li { margin: 3px 0; }
@media (max-width: 899px) {
  .legal { padding: 4px 12px 24px; }
  .legal-doc { padding: 20px 18px; }
  .legal-doc h1 { font-size: 23px; }
}

/* «Статус поиска» (owner 16.11): small while idle; players to pick and the deck open inside it. */
.status-part { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.status-part h3 { margin: 0 0 6px; font-size: var(--f-lg); font-weight: 750; }

/* ---------- Deck Finder Pro locks (owner 16.11): a lock that invites to get Pro ---------- */
.pro-lock {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0 10px; padding: 16px 18px;
  border-radius: 16px; border: 1px solid var(--warn-line); background: var(--pro-bg);
}
.pro-lock-icon {
  flex: none; width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center;
  justify-content: center; background: var(--accent); color: var(--on-accent);
}
.pro-lock-icon .ic { width: 22px; height: 22px; }
.pro-lock-body { flex: 1 1 220px; min-width: 0; display: grid; gap: 2px; }
.pro-lock-body b { font-size: var(--f-lg); }
.pro-lock .primary { flex: none; }
@media (max-width: 899px) { .pro-lock .primary { width: 100%; } }
.pro-tab { position: relative; }
.free .pro-tab::after {
  content: "PRO"; margin-left: 2px; font-size: 10px; font-weight: 800; letter-spacing: .04em;
  padding: 2px 6px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent);
}
@media (max-width: 899px) {
  .free .pro-tab::after { position: absolute; top: 2px; right: 50%; margin: 0 -28px 0 0; padding: 0 4px; font-size: 9px; }
}
.obs.free .pro-tab::after { position: absolute; top: 2px; right: 50%; margin: 0 -28px 0 0; padding: 0 4px; font-size: 9px; }

/* «В Telegram» without a linked Telegram (owner 16.11). */
.choice:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.choice input:disabled { cursor: not-allowed; }

/* Owner 17.11: a crown instead of a second «PRO» next to «Deck Finder Pro». */
.pro-crown { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
             border-radius: 8px; background: var(--accent); color: var(--on-accent); }
.pro-crown .ic { width: 16px; height: 16px; fill: currentColor; stroke: none; }
/* Photo switches inside «Снимок». */
.shot-settings { margin-top: 12px; padding-top: 4px; border-top: 1px solid var(--line); }
.shot-settings .switch:first-of-type { border-top: 0; }
.shot-settings p { margin: 6px 0 0; }
/* Five tabs, no «Ещё» (owner 17.11). */
@media (max-width: 899px) { .tabs-list { flex: 1 1 auto; } }
.obs .tabs-list { flex: 1 1 auto; }
#keyCardPane .choice-cards { margin-top: 16px; }
/* Owner 30.11: embedded video guides in «Авто скриншоты». */
.video { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 8px 0 12px; border-radius: 10px;
  overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
