/* самохостинг шрифтов, не Google Fonts CDN — тот открывается не у всех продавцов */
@font-face {
  font-family: "Geist"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/fonts/Geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/fonts/Geist-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/fonts/Manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/fonts/Manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {

  color-scheme: dark;
  --bg: #10131a;
  --card: #171b24;
  --card-2: #1a1f2b;
  --line: #262c39;
  --text: #e6e9ef;
  --muted: #8b93a7;

  --accent: #2f9bc4;
  --ok: #3fbf7f;
  --warn: #e0a33e;
  --bad: #e06060;

  --field: #0d1017;
  --panel-2: #1b2030;
  --control: #202634;
  --control-hover: #1c2130;
  --warn-border: #8a6d3b;
  --shadow: rgba(0, 0, 0, .45);
  --hover-tint: #ffffff;

  --danger-text: #ff9a9a;
  --gift-text: #c79bff;
  --set-text: #ffd479;
  --chart-end: #6fc9e8;
  --tg-text: #5ec2f0;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1f5;
  --card: #ffffff;
  --card-2: #f6f8fa;
  --line: #e0e4ea;
  --text: #1a2233;
  --muted: #5b6578;
  --accent: #1c7fa8;
  --ok: #1f9d55;
  --warn: #b5750f;
  --bad: #d33a3a;

  --field: #eef0f4;
  --panel-2: #eef2f8;
  --control: #e8ebf0;
  --control-hover: #dde1e8;
  --warn-border: #c99a4a;
  --shadow: rgba(15, 23, 42, .12);
  --hover-tint: #0f172a;

  --danger-text: #b23b3b;
  --gift-text: #7c4fd1;
  --set-text: #9a6a0a;
  --chart-end: #2e97be;
  --tg-text: #1f8ec9;
}

:root[data-palette="indigo"] {
  --bg: #0e0d1a; --card: #171527; --card-2: #1c1930; --line: #2c2740;
  --text: #ebe9f5; --muted: #948fb3; --accent: #8b6bff;
  --ok: #2fd48f; --warn: #e8a93f; --bad: #ef5c7a;
  --field: #0b0a16; --panel-2: #1c1930; --control: #221d3a; --control-hover: #28223f;
  --chart-end: #b39bff;
}
:root[data-theme="light"][data-palette="indigo"] {
  --bg: #f1f0fb; --card: #ffffff; --card-2: #f7f5ff; --line: #e2ddf5;
  --text: #241f3d; --muted: #6c6490; --accent: #7c5cff;
  --ok: #1f9d6e; --warn: #b5750f; --bad: #d33a6a;
  --field: #f3f1fb; --panel-2: #f3effc; --control: #ece8fa; --control-hover: #e2dcf6;
  --chart-end: #a98cff;
}

:root[data-palette="emerald"] {
  --bg: #0b0f0d; --card: #121917; --card-2: #16201c; --line: #223029;
  --text: #e7f3ec; --muted: #86a195; --accent: #22c5a0;
  --ok: #4caf6d; --warn: #d9a441; --bad: #e2585f;
  --field: #080b09; --panel-2: #16201c; --control: #1a2521; --control-hover: #1f2b26;
  --chart-end: #7fe0c4;
}
:root[data-theme="light"][data-palette="emerald"] {
  --bg: #eef5f1; --card: #ffffff; --card-2: #f3faf6; --line: #dcebe2;
  --text: #142621; --muted: #5c7a6c; --accent: #1aa37a;
  --ok: #3fae5e; --warn: #b5750f; --bad: #d3453f;
  --field: #eef6f1; --panel-2: #eef8f2; --control: #e4f1e9; --control-hover: #d8ecdf;
  --chart-end: #5fc49f;
}

:root[data-palette="warm"] {
  --bg: #15130f; --card: #1e1b16; --card-2: #24201a; --line: #352f26;
  --text: #f1e9dd; --muted: #a89a84; --accent: #e08a3c;
  --ok: #6fbf73; --warn: #e0a33e; --bad: #e0605f;
  --field: #100e0a; --panel-2: #24201a; --control: #2b2520; --control-hover: #322b24;
  --chart-end: #f0b87a;
}
:root[data-theme="light"][data-palette="warm"] {
  --bg: #f7f1e8; --card: #fffdf9; --card-2: #fbf4e7; --line: #ecdfc8;
  --text: #352a1a; --muted: #8a7556; --accent: #d9772e;
  --ok: #4d9e5c; --warn: #b5750f; --bad: #d3453f;
  --field: #f9f3e9; --panel-2: #faf3e6; --control: #f2e8d5; --control-hover: #ecdfc5;
  --chart-end: #eda869;
}

* { box-sizing: border-box; }

* { scrollbar-width: thin; scrollbar-color: var(--muted) var(--line); }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--line); }
*::-webkit-scrollbar-thumb {
  background-color: var(--muted); border-radius: 5px;
  border: 1px solid transparent; background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: var(--accent); background-clip: content-box; }
*::-webkit-scrollbar-corner { background: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Geist", "Manrope", -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600; letter-spacing: .02em;
  color: var(--text); text-decoration: none;
}
.brand:hover { color: var(--accent); }

.brand-mark { width: 22px; height: 22px; flex: 0 0 auto; color: var(--accent); display: block; }

.icon { width: 14px; height: 14px; flex: 0 0 auto; vertical-align: -2px; fill: currentColor;
  user-select: none; }
.header-right { display: flex; gap: 10px; align-items: center; }

.header-tools { display: flex; gap: 10px; align-items: center; }

.tg-link { color: var(--tg-text); text-decoration: none; }
.tg-link:hover { text-decoration: underline; }

.tgme-card { text-align: center; padding: 28px 18px; }
.tgme-title {
  font-size: 26px; line-height: 32px; font-weight: bold;
  color: var(--text); padding: 0 10px;
}
.tgme-extra { font-size: 15px; line-height: 18px; padding: 6px 16px 0; color: var(--muted); }
.tgme-action { margin-top: 24px; line-height: 0; }
/* если oauth.telegram.org отдаёт пустое содержимое — iframe всё равно создаётся
   (same-origin не даёт заглянуть внутрь и понять, что оно пустое), пусть хотя бы
   не выглядит обрывком вёрстки */
.tgme-card iframe { border-radius: 22px; border: 1px solid var(--line); vertical-align: top; }

.tgme-btn {
  display: inline-block; vertical-align: top;
  font-size: 14px; line-height: 17px; font-weight: bold;
  -webkit-font-smoothing: antialiased;
  color: #fff; background-color: #1c93e3;
  border-radius: 22px; padding: 13px 24px; height: 42px;
  text-transform: uppercase; text-decoration: none; overflow: hidden;

  background-image: linear-gradient(270deg, rgba(100, 181, 239, 0) 48.44%,
                    #64b5ef 75.52%, rgba(100, 181, 239, 0) 100%);
  background-repeat: no-repeat;
  animation: tgme-shine linear 5s infinite;
}
.tgme-btn:hover, .tgme-btn:active { background-color: #1a8ad5; color: #fff; text-decoration: none; }

@keyframes tgme-shine {
  0% { background-position: -500px 0; }
  100% { background-position: 1000px 0; }
}

.tgme-additional {
  font-size: 14px; line-height: 16px; padding: 0 16px;
  margin-top: 24px; color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .tgme-btn { animation: none; background-image: none; }
}

main { padding: 20px; max-width: 1850px; margin: 0 auto; }

.card {
  background: var(--card);

  box-shadow: 0 1px 2px var(--shadow), 0 6px 16px var(--shadow);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
}

.card.narrow { max-width: 520px; margin: 60px auto; width: 100%; }

.welcome-hero { max-width: 520px; margin: 0 auto 28px; text-align: center; }

.welcome-mark-wrap { position: relative; width: 72px; height: 72px; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center; }
.welcome-mark { width: 56px; height: 56px; color: var(--accent); display: block; position: relative; z-index: 2; }

.welcome-mark-wrap::before {
  content: ""; position: absolute; inset: -22px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 38%, transparent), transparent 72%);
  filter: blur(6px);
  animation: welcome-glow-pulse 4.5s ease-in-out infinite;
}

.welcome-mark-wrap::after {
  content: ""; position: absolute; inset: -13px; border-radius: 50%;
  background: conic-gradient(from 0deg,
    transparent 0 60%,
    color-mix(in srgb, var(--accent) 80%, transparent) 62%,
    color-mix(in srgb, var(--accent) 80%, transparent) 90%,
    transparent 92%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  animation: welcome-ring-spin 9s linear infinite;
}
@keyframes welcome-glow-pulse {
  0%, 100% { opacity: .5; transform: scale(1); }
  50% { opacity: .9; transform: scale(1.12); }
}
@keyframes welcome-ring-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .welcome-mark-wrap::before, .welcome-mark-wrap::after { animation: none; }
}
.welcome-hero h1 { font-size: 26px; letter-spacing: -.01em; margin: 0 0 10px; }
.welcome-hero p { margin: 0; }
.welcome-hero + .card.narrow { margin-top: 0; }

.welcome-page { min-height: calc(100dvh - 186px); display: flex; flex-direction: column;
  justify-content: center; }

.welcome-page::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 18% 24%, rgba(255,255,255,.85), transparent 60%),
    radial-gradient(1.5px 1.5px at 64% 14%, rgba(255,255,255,.65), transparent 60%),
    radial-gradient(1px 1px at 82% 48%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1.5px 1.5px at 38% 68%, rgba(255,255,255,.45), transparent 60%),
    radial-gradient(1px 1px at 92% 78%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 8% 82%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1px 1px at 52% 42%, rgba(255,255,255,.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 28% 8%, rgba(255,255,255,.55), transparent 60%);
  animation: welcome-stars-twinkle 6s ease-in-out infinite;
}
:root[data-theme="light"] .welcome-page::before {
  background-image: none;
  background: radial-gradient(1100px 480px at 50% -8%, rgba(255, 185, 60, .16), transparent 70%);
  animation: welcome-sun-wash 10s ease-in-out infinite;
}
@keyframes welcome-stars-twinkle { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes welcome-sun-wash { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .welcome-page::before { animation: none; }
}
.card.legal-doc { max-width: 760px; margin: 40px auto; padding: 28px 32px; }
.card.legal-doc h1 { font-size: 25px; letter-spacing: -.01em; }
.card.legal-doc > p.muted:first-of-type { margin-top: -6px; margin-bottom: 22px; }

.card.legal-doc h2 {
  display: flex; align-items: center; gap: 10px;
  margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 16px;
}
.card.legal-doc h2:first-of-type { margin-top: 22px; padding-top: 0; border-top: none; }

.sec-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%;
  background: var(--panel-2); color: var(--accent);
  font-size: 13px; font-weight: 700;
}
.card.legal-doc p { line-height: 1.65; }
.card.legal-doc ul { margin: 4px 0 14px; padding-left: 22px; }
.card.legal-doc li { margin-bottom: 6px; line-height: 1.6; }
.card.legal-doc li::marker { color: var(--accent); }

.legal-callout {
  margin-top: 18px; padding: 16px 18px; border-radius: 10px;
  background: var(--card-2); border: 1px solid var(--line);
}
.legal-callout p { margin: 0 0 10px; }
.legal-callout p:last-child { margin-bottom: 0; }

.legal-price {
  display: inline-flex; align-items: baseline; gap: 6px;
  margin: 6px 0 16px; padding: 10px 16px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--accent); font-size: 22px; font-weight: 700;
}
.legal-price span { color: var(--muted); font-size: 13px; font-weight: 400; }
.card.legal-doc .codeword { margin-top: 24px; opacity: .6; }

.legal-back {
  display: flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 13px; text-decoration: none;
  margin: 0 auto 14px; max-width: 760px;
}
.legal-back:hover { color: var(--accent); text-decoration: none; }

.card.narrow:has(+ .tgme-card) { margin-bottom: 0; }

.card.narrow.tgme-card { margin-top: 28px; margin-bottom: 0; }

h1 { font-size: 20px; margin: 0 0 12px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h2 .count { color: var(--muted); font-weight: 400; font-size: 14px; }

.muted { color: var(--muted); font-size: 13px; }

button.reserved-note { background: none; border: none; padding: 0; margin: 0;
  color: inherit; font: inherit; cursor: pointer; text-decoration: underline dotted; }
button.reserved-note:hover { text-decoration: underline solid; }

.card div.muted + table.grid, .card div.muted + .table-scroll { margin-top: 12px; }

.site-footer {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  margin: 32px auto 16px; padding: 16px 20px 0; max-width: 960px;
  border-top: 1px solid var(--line); font-size: 13px;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: inherit; }

.card > p, .card > div > p.muted, .card h3 + p.muted { max-width: 80ch; }
.error { color: var(--bad); }

code {
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 13px;
}

code.secret {
  filter: blur(4px);
  cursor: pointer;
  user-select: none;
  transition: filter .12s ease;
}
code.secret:hover { filter: blur(3px); }
code.secret.revealed { filter: none; cursor: text; user-select: text; }
code.secret:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

body.streamer .sens {
  filter: blur(5px);
  cursor: pointer;
  user-select: none;
  transition: filter .12s ease;

  pointer-events: none;
}
body.streamer .sens.revealed { filter: none; cursor: auto; user-select: text; pointer-events: auto; }

body.streamer .sens { pointer-events: auto; }
body.streamer .sens:not(.revealed) > * { pointer-events: none; }

#streamer-toggle.on { color: var(--accent); border-color: var(--accent); }

.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 10, 15, .82);
  backdrop-filter: blur(6px);
  animation: overlay-in .2s ease;
}
.overlay.hidden { display: none; }
@keyframes overlay-in { from { opacity: 0 } to { opacity: 1 } }

.overlay-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px 26px; max-width: 420px; width: calc(100% - 32px); text-align: center;
  box-shadow: 0 18px 50px var(--shadow);
}
.overlay-box h2 { margin: 16px 0 6px; }
.overlay-note { margin-top: 14px; }
.overlay-box button { margin-top: 16px; }

.overlay-spinner { display: flex; gap: 7px; justify-content: center; }
.overlay-spinner span {
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  animation: overlay-dot 1.1s ease-in-out infinite;
}
.overlay-spinner span:nth-child(2) { animation-delay: .16s; }
.overlay-spinner span:nth-child(3) { animation-delay: .32s; }
@keyframes overlay-dot {
  0%, 80%, 100% { opacity: .25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-5px); }
}

.overlay-bar {
  margin-top: 18px; height: 4px; border-radius: 3px;
  background: var(--line); overflow: hidden;
}
.overlay-bar > div {
  height: 100%; width: 35%; border-radius: 3px; background: var(--accent);
  animation: overlay-bar 1.4s ease-in-out infinite;
}
@keyframes overlay-bar {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(340%); }
}

.photo-wait {
  display: flex; align-items: center; gap: 7px;
  color: var(--muted); font-size: 13px; margin-top: 3px;
}
.photo-wait .spinner {
  display: inline-block; width: 56px; height: 3px; border-radius: 3px;
  background: var(--control-hover); overflow: hidden; position: relative;
}
.photo-wait .spinner::after {
  content: ""; position: absolute; inset: 0; width: 40%; border-radius: 3px;
  background: var(--accent); animation: overlay-bar 1.4s ease-in-out infinite;
}

.photo-wait.photo-ready { color: var(--ok); font-size: 12px; opacity: .8; }

.load-target:empty {
  display: block; min-height: 72px; border-radius: 10px;
  background: linear-gradient(100deg, var(--card-2) 30%, var(--control) 50%, var(--card-2) 70%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
  0% { background-position: 150% 0; }
  100% { background-position: -50% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .overlay, .overlay-spinner span, .overlay-bar > div { animation: none; }
  .overlay-spinner span { opacity: .7; }
  .load-target:empty { animation: none; background: var(--card-2); }
  .photo-wait .spinner::after { animation: none; width: 100%; opacity: .5; }
}

.tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
nav.tabs { gap: 2px; }
nav.tabs .tab-sep { width: 1px; height: 20px; background: var(--line); margin: 0 8px; flex: 0 0 auto; }
nav.tabs .tab {
  background: none; border: 1px solid transparent; color: var(--muted);
  padding: 7px 12px; font-size: 14px;
}
nav.tabs .tab:hover { color: var(--text); background: var(--control-hover); }
nav.tabs .tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.tab, button, .btn, .pill {
  background: var(--control);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 14px;
  cursor: pointer;
  font: inherit;
  text-decoration: none;

  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
button:hover, .btn:hover, .tab:hover { border-color: var(--accent); }

a.btn { color: var(--text); text-decoration: none; display: inline-block; }
button:disabled { opacity: .5; cursor: default; }

button.danger, .btn.danger {
  color: var(--danger-text); border-color: rgba(224, 96, 96, .5);
}
button.danger:hover, .btn.danger:hover { border-color: var(--bad); background: rgba(224, 96, 96, .08); }

.tab-dot {
  display: inline-block; margin-left: 6px; min-width: 16px; padding: 0 5px;
  border-radius: 9px; background: rgba(224, 96, 96, .18); color: var(--danger-text);
  font-size: 11px; line-height: 16px; text-align: center; vertical-align: 2px;
}

.pill {
  display: inline-flex; align-items: center; gap: 5px;

  background: none; border-radius: 9px; padding: 3px 10px;
  font-size: 12px; white-space: nowrap; cursor: default;

  user-select: none;
}

.pill.on { color: var(--ok); border-color: rgba(63, 191, 127, .45); }
.pill.off { color: var(--bad); border-color: rgba(224, 96, 96, .45); }
.pill.warn { color: var(--warn); border-color: rgba(224, 163, 62, .45); }

.pill.market-pause { border-radius: 8px; padding: 4px 10px; white-space: normal; }

.pill.sale { color: var(--ok); border-color: rgba(63, 191, 127, .45); }
.pill.gift { color: var(--gift-text); border-color: #7a5aa8; }
.pill.muted { color: var(--muted); }

button.tiny { padding: 2px 8px; font-size: 12px; margin-left: 6px; }

.status-bar {
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center;
  justify-content: space-between; padding: 12px 16px;
}
.status-left, .status-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.status-left > span:first-child { font-weight: 600; }

#health { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.health-more { position: relative; }
.health-more > summary { cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; }
.health-more > summary::-webkit-details-marker { display: none; }
.health-more > summary::after { content: " ▾"; }
.health-more[open] > summary::after { content: " ▴"; }
.health-list {
  position: absolute; z-index: 20; left: 0; top: calc(100% + 6px); width: max-content; max-width: 70ch;
  background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
  font-size: 12px; color: var(--muted); line-height: 1.6; box-shadow: 0 8px 24px var(--shadow);
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.grid th { color: var(--muted); font-weight: 500; font-size: 13px; }
.grid tr:last-child td { border-bottom: none; }

.grid th[data-sort] { cursor: pointer; user-select: none; }
.grid th[data-sort]:hover { color: var(--text); }
.grid th[data-sort].sorted::after { content: " ▲"; font-size: 10px; }
.grid th[data-sort].sorted.sorted-desc::after { content: " ▼"; }

input, select, textarea {
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  width: 100%;
}

input.short { width: 110px; }

input[type="checkbox"], input[type="radio"],
.filters input[type="checkbox"], .filters input[type="radio"] {
  width: auto; min-width: 0; flex: 0 0 auto;
}

.card > select, .card > input[type="text"], .card > input:not([type]),
.card > label > select, .analytics-controls select,
.actions select, .actions input[type="text"] { max-width: 360px; }

.settings-textarea { min-height: 90px; resize: vertical; font-family: inherit; line-height: 1.4; }

.auth-code-box {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0;
}
#auth-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 4px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  user-select: all;

  min-width: 164px;
  text-align: center;
}
.confirmation-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
}
.confirmation-card img { width: 40px; height: 40px; border-radius: 6px; flex-shrink: 0; }
.confirmation-card .body { flex: 1; }
.confirmation-card .headline { font-weight: 600; }
.confirmation-card .summary { color: var(--muted); font-size: 13px; }
.confirmation-card .actions { display: flex; gap: 6px; }

.log-view {
  margin-top: 10px;

  min-height: 320px;
  max-height: 60vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.4;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

form { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
form label.wide, form button, form .wide { grid-column: 1 / -1; }

.filters { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.filters select, .filters input { width: auto; min-width: 180px; }

.account {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 14px 24px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.account-main { display: flex; gap: 12px; align-items: flex-start; }
.account-side { min-width: 0; }
.account-side .stat-tiles { margin: 0; }
.account-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.account-pills .pill { white-space: normal; overflow-wrap: break-word; max-width: 100%; }

@media (max-width: 1100px) {
  .account { grid-template-columns: 1fr; }
}

.account-info { flex: 1 1 auto; min-width: 0; }

.account-avatar {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--field);
}
.account-avatar.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.account-avatar.placeholder .icon { width: 22px; height: 22px; }
.account .name .persona { color: var(--muted); font-size: 13px; }

.account .name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 400;
  font-size: 16px;
}
.account .name .who { font-weight: 600; }
.account .name .pill.muted { color: var(--muted); }
.account .meta { color: var(--muted); font-size: 13px; line-height: 1.55; }

.account .meta.key-note {
  max-width: 560px;
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.75;
}
/* сетка вместо флекса — запрос 06.11.26: все кнопки действий сразу в одном ряду
   (без схлопывания части за «ещё») и ОДИНАКОВОГО размера. auto-fill с общим
   grid-template-columns даёт одну и ту же ширину колонок на всех строках сразу —
   в отличие от флекса, где у соседних строк ширина кнопок могла бы разъехаться */
.account .buttons {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 6px; grid-column: 1 / -1; margin-top: 4px;
}
.account .buttons button, .account .buttons a.btn {
  padding: 7px 10px; font-size: 13px; width: 100%; box-sizing: border-box;
  text-align: center; white-space: normal; line-height: 1.3;
}

.tab-back {
  margin: 0 0 10px;
  padding: 6px 12px;
  font-size: 13px;
}

.setting-link { color: var(--accent, #6ea8fe); cursor: pointer; text-decoration: underline dotted; }

tr.flash > td, .version-card.flash { animation: flash-bg 2.2s ease; }
@keyframes flash-bg {
  0%, 40% { background: rgba(110, 168, 254, .22); }
  100% { background: transparent; }
}

.proxy-advice {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent, #6ea8fe);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--panel-2);
}
.proxy-advice p { margin: 6px 0 0; }

.proxy-advice a { color: var(--accent); text-decoration: underline; }
.proxy-advice a.pill { text-decoration: none; }

.proxy-advice-providers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.price-parse { margin: 10px 0; }

.tool-notes { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12px; }
.tool-notes span:empty { display: none; }
.actions .gap { width: 12px; }
.progress {
  position: relative;
  height: 22px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-top: 8px;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--ok);
  opacity: 0.35;
  transition: width 0.4s ease;
}
.progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text);
}

.proxy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.proxy-info { flex: 1 1 100%; min-width: 0; }
.proxy-row .name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.proxy-row .name code { font-size: 13px; word-break: break-all; }
.proxy-row .meta { color: var(--muted); font-size: 13px; line-height: 1.55; }
.proxy-row .buttons { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 1 100%; margin-top: 4px; }
.proxy-row .buttons button { padding: 7px 12px; font-size: 13px; }
.proxy-reco { margin-bottom: 12px; }
.proxy-reco .pill { font-size: 14px; }
.proxy-reco p { margin: 6px 0 0; }

.grid .sold { color: var(--warn); font-weight: 500; }

.update-card { border: 1px solid var(--warn-border); background: var(--panel-2); }
.update-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.update-version { margin-top: 10px; }
.update-version ul { margin: 6px 0 0; padding-left: 20px; }
.update-version li { margin-bottom: 5px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.update-version li b { color: var(--text); }

.table-scroll { overflow-x: auto; }

.render-gallery { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 8px; }
.render-gallery img { height: 140px; width: auto; border-radius: 10px; flex: none;
  border: 1px solid var(--line); background: var(--panel-2); }
.render-gallery .muted { padding: 8px 0; }

.ref-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ref-actions input { flex: 1; min-width: 200px; }
.ref-actions label { display: flex; flex-direction: column; gap: 4px; font-size: 13px;
  color: var(--muted); }
.ref-actions label input { min-width: 0; }

.item-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 180px; }
.item-actions button { white-space: nowrap; padding: 4px 8px; font-size: 12px; }
.grid td.actions-cell { text-align: right; }

.grid td.num, .grid th.num { text-align: right; white-space: nowrap; }
.grid input.short { width: 62px; text-align: right; }
.grid.thumbs td { padding-top: 6px; padding-bottom: 6px; }

.grid.thumbs th, .grid.thumbs td { padding-left: 7px; padding-right: 7px; }

.item-cell { display: flex; align-items: flex-start; gap: 10px; }
.item-name { flex: 0 0 200px; min-width: 0; overflow-wrap: anywhere; }
.item-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; max-width: min(260px, 60vw); }
.item-badges .pill { padding: 3px 8px; font-size: 12px; }
.item-badges button.tiny { margin-left: 0; }

.item-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.item-tools button.tiny { margin-left: 0; }

@media (max-width: 1100px) {

  .item-cell { flex-direction: column; gap: 4px; }
  .item-name { flex: 1 1 auto; }
}

.pill.set { color: var(--set-text); border-color: var(--warn-border); }
.pill.fixed { color: var(--set-text); border-color: var(--warn-border); padding: 2px 7px; font-size: 12px; }

.price-note { margin-top: 3px; font-size: 11px; display: flex; align-items: center; gap: 4px; }

.set-parts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px;
  max-width: min(460px, 90vw); }
.set-part {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--control);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 12px;
  color: var(--muted);
}
.thumb.tiny { width: 20px; height: 20px; object-fit: contain; }

.set-builder {
  border: 1px solid var(--warn-border);
  border-radius: 10px;
  padding: 12px;
  margin: 10px 0;
  background: var(--panel-2);
}
.set-builder-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.set-builder-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 10px; }
.set-builder-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }

.set-builder-form label.check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 8px; }

.pick-row { display: flex; flex-direction: row; gap: 6px; justify-content: center; }

.pick-toggle {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card-2); color: var(--muted);
  flex: 0 0 auto;
}
.pick-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pick-toggle .icon { width: 13px; height: 13px; }
.pick-toggle:has(input:checked) {
  border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--card-2));
  color: var(--accent);
}
.instance-row .pick-toggle { width: 18px; height: 18px; margin-right: 4px; vertical-align: middle; }
.instance-row .pick-toggle .icon { width: 11px; height: 11px; }
@media (max-width: 760px) {

  .pick-toggle { width: 28px; height: 28px; }
  .pick-toggle .icon { width: 15px; height: 15px; }
}

.hidden { display: none; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 12px 16px;
  max-width: 420px;
  max-height: 40vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 10px 30px var(--shadow);

  opacity: 1; transform: translateY(0);
  transition: opacity .25s ease, transform .25s ease;
}
#toast.hidden {
  display: block; opacity: 0; transform: translateY(10px); pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}

@media (max-width: 520px) {
  .toast { right: 12px; left: 12px; bottom: 12px; max-width: none; max-height: 45vh; }
}

#code-form { grid-template-columns: 1fr auto; }
#code-form input { letter-spacing: .4em; text-align: center; font-size: 20px; }

.mafile-drop {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.mafile-drop.over { border-color: var(--accent); background: var(--panel-2); }
.mafile-drop .muted { flex: 1 1 260px; }

.mafile-info { flex-basis: 100%; font-size: 13px; }
.mafile-info.ok { color: var(--ok); }
.mafile-info.bad { color: var(--bad); }

.grid.thumbs td { vertical-align: middle; }

.thumb { width: 44px; height: 44px; object-fit: contain; background: var(--field); border-radius: 6px; }

.thumb-cycle { position: relative; display: inline-block; width: 44px; height: 44px;
  vertical-align: middle; cursor: pointer; }
.thumb-cycle.small { width: 32px; height: 32px; }
.thumb-cycle.tiny { width: 20px; height: 20px; }
.thumb-cycle img.thumb { position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity 700ms ease; }
.thumb-cycle img.thumb.active { opacity: 1; }

.sell-box { max-width: 520px; text-align: left; }
.sell-box h2 { margin-top: 0; }
/* кнопки Добавить/Отмена в один ровный ряд, не «большая сверху — мелкая слева снизу»
   (запрос 06.11.26) */
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; margin-top: 6px; }
.form-actions button { flex: 1 1 0; margin-top: 0; }
.sell-option {
  display: block; width: 100%; text-align: left; margin-top: 12px;
  padding: 14px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg);
}
.sell-option:hover:not(:disabled) { border-color: var(--accent); }
.sell-option:disabled { opacity: .45; cursor: default; }
.sell-option b { display: block; font-size: 15px; margin-bottom: 4px; }
.sell-option .row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.sell-option .row span:first-child { color: var(--muted); }
.sell-option .take { color: var(--text); font-weight: 600; }
.sell-warn { margin-top: 14px; font-size: 13px; }

.undercut { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.undercut-on { display: flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--text); }
.undercut-grid {
  display: grid; grid-template-columns: max-content max-content; align-items: center;
  column-gap: 6px; row-gap: 4px;
}
.undercut-grid label { display: contents; }
.undercut-grid label > span:first-child { white-space: nowrap; justify-self: start; }

.undercut-value { display: inline-flex; align-items: center; gap: 4px; }
.undercut input[type=number] {
  width: 68px; padding: 3px 6px; text-align: right;
  border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 12px;
}
.undercut input:focus { outline: none; border-color: var(--accent); }

.undercut input[type=checkbox] { width: auto; flex: none; margin: 0; }

.book-wrap { display: flex; gap: 28px; flex-wrap: wrap; padding: 4px 0 2px; }
.book-title { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
table.grid.book { width: auto; min-width: 230px; }
table.grid.book td, table.grid.book th { padding: 4px 14px 4px 0; font-variant-numeric: tabular-nums; }
table.grid.book td:nth-child(2) { text-align: right; }
.book-tail td { color: var(--muted); border-top: 1px solid var(--line); }
.book-mine { margin-top: 12px; font-size: 13px; }
.book-hint { margin-top: 6px; font-size: 12px; color: var(--muted); max-width: 260px; }

.gift-floor { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.gift-floor input {
  width: 84px; padding: 5px 8px; text-align: right;
  border-radius: 7px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 13px;
}
.gift-floor input:focus { outline: none; border-color: var(--accent); }

.sell-custom { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.sell-custom.hidden { display: none; }
.sell-custom > b { display: block; margin-bottom: 10px; font-size: 15px; }
.sell-custom label {
  display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px;
  color: var(--muted);
}
.sell-custom label > .field { margin-left: auto; position: relative; flex: none; }
.sell-custom label .dim { opacity: .7; }
.sell-custom input {
  width: 120px; padding: 7px 26px 7px 10px; text-align: right;
  border-radius: 8px; border: 1px solid var(--line); background: var(--bg);
  color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums;
}
.sell-custom input:focus { outline: none; border-color: var(--accent); }
.sell-custom .field .cur {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 13px; pointer-events: none;
}
#sell-custom-note { margin-top: 10px; font-size: 13px; min-height: 18px; }
#sell-custom-note.bad { color: var(--bad); }
#sell-custom-go { margin-top: 12px; }

.market-balance { margin-top: 10px; font-size: 15px; }
.market-balance.ready { color: var(--text); font-size: 20px; font-weight: 600; }
.market-balance .cur { color: var(--muted); font-size: 14px; font-weight: 400; }
.market-balance .cur.ago { margin-left: 14px; font-size: 13px; }
.market-problem { margin-top: 8px; font-size: 13px; font-weight: 400; color: var(--muted); }
.grid tr.group td { background: var(--panel-2); color: var(--muted); font-size: 13px; padding: 6px 10px; }
.grid tr.locked-row { opacity: .65; }
.grid tr.active-row td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.filters .check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.filters .check input { width: auto; }

.grid a { color: var(--accent); text-decoration: none; }
.grid a:hover { text-decoration: underline; }

.tiles { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.thumb.small { width: 32px; height: 32px; }

.item-gallery { max-height: 260px; overflow-y: auto; margin-top: 6px; }
.item-gallery b { font-size: 12px; color: var(--muted); }

#items td:first-child, #items th:first-child { width: 56px; }
#items input.short { width: 90px; }
#items td .muted { font-size: 12px; }
.grid td { vertical-align: top; }

.account-edit { flex-basis: 100%; margin-top: 10px; }
.account-edit.hidden { display: none; }

.link-input { min-width: 260px; }

@media (max-width: 760px) {
  body { font-size: 15px; }

  header:has(.header-right) { padding: 8px 12px; flex-wrap: wrap; gap: 6px 8px; }
  header:not(:has(.header-right)) { padding: 8px 12px; }

  .header-right { display: contents; }
  header:has(.header-right) .header-tools { flex-wrap: wrap; gap: 6px 8px; }

  header .pill, #theme-toggle {
    padding: 7px 11px; font-size: 13px; min-height: 0;
  }
  #theme-toggle { padding: 7px 10px; }
  main { padding: 12px 10px; }
  .card { padding: 13px; border-radius: 10px; margin-bottom: 12px; }

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; padding: 9px 13px; font-size: 14px; }

  .pill { white-space: normal; }

  button, .pill, select, input, textarea { font-size: 16px; }
  button { min-height: 40px; padding: 9px 14px; }
  button.tiny { min-height: 30px; padding: 4px 9px; font-size: 13px; }
  input, select, textarea { width: 100%; min-height: 40px; }

  input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; transform: scale(1.3); }

  .filters { gap: 8px; }
  .filters select, .filters input { min-width: 0; width: 100%; }
  .filters .check { width: 100%; }
  .filters .check input { width: auto; min-height: 0; }

  .status-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .actions { width: 100%; }
  .actions button { width: 100%; }

  .thumb { width: 38px; height: 38px; }
  .log-view { font-size: 12px; }
  .toast { left: 10px; right: 10px; bottom: 10px; }
}

.grid.as-cards, .grid.as-cards tbody, .grid.as-cards tr, .grid.as-cards td {
  display: block;
  width: 100%;
}

#items.as-cards td:first-child,
#items.as-cards th:first-child,
#items.as-cards input.short { width: auto; }
.grid.as-cards tr:first-child,
.grid.as-cards th { display: none; }
.grid.as-cards tr {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: var(--panel-2);

  contain: paint;
  transform: translateZ(0);
}
.grid.as-cards tr.group {
  background: var(--panel-2);
  padding: 7px 12px;
  margin-bottom: 8px;
  font-weight: 600;
}

.grid.as-cards tr.group td { display: block; width: 100%; padding: 0; border: none; background: none; }
.grid.as-cards td {
  border: none;
  padding: 5px 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  text-align: left;
}

.grid.as-cards td[data-label]::before {
  content: attr(data-label);
  color: var(--muted);
  font-size: 13px;
  flex: 0 0 auto;
  margin-right: auto;
  padding-right: 8px;
}
.grid.as-cards td:empty { display: none; }

.grid.kv.as-cards td:first-child { font-weight: 600; }
.grid.kv.as-cards td:first-child::before { display: none; }

.grid.kv.as-cards td:nth-child(2) { flex-direction: column; align-items: stretch; }
.grid.kv.as-cards td:nth-child(2)::before { display: none; }
.grid.thumbs.as-cards td { position: static; padding-bottom: 5px; }
.grid.as-cards td.num, .grid.as-cards th.num { text-align: right; white-space: normal; }
.grid.as-cards input.short { width: 100px; }

#items.as-cards tr:not(.group) {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 12px;

  padding-left: 86px;
}

#items.as-cards tr:not(.group) td:nth-child(1) {
  position: absolute;
  left: 12px;
  top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
}

#items.as-cards tr:not(.group) td:nth-child(n + 3):not(.actions-cell) {
  display: block;
  padding: 4px 0;
}
#items.as-cards tr:not(.group) td:nth-child(n + 3)::before {
  display: block;
  margin: 0 0 1px;
  padding-right: 0;
  font-size: 11px;
}

#items.as-cards tr:not(.group) td.num,
#items.as-cards tr:not(.group) td.num::before { text-align: left; }

#items.as-cards tr:not(.group) { grid-auto-columns: minmax(0, 1fr); }
#items.as-cards tr:not(.group) td[data-label="Продавцу ₽"],
#items.as-cards tr:not(.group) td[data-label="Цена лота"] { grid-column: 1; }
#items.as-cards tr:not(.group) td[data-label="Покупателю ₽"] { grid-column: 2; }
#items.as-cards tr:not(.group) td[data-label="% от Steam"] { grid-column: 3; }

#items.as-cards tr:first-child { display: none; }

#items.as-cards tr:not(.group) td:nth-child(2) {
  grid-column: 1 / -1;
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 4px;
}
#items.as-cards tr:not(.group) td:nth-child(2)::before { display: none; }
#items.as-cards tr:not(.group) td:nth-child(2) .item-name { font-size: 15px; font-weight: 600; }
#items.as-cards td.actions-cell { grid-column: 1 / -1; margin-top: 6px; }
#items.as-cards td .muted { font-size: 11px; }
#items.as-cards input.short { width: 100%; max-width: 110px; }

#items.as-cards .item-cell { flex-direction: column; align-items: flex-start; gap: 6px; }
#items.as-cards .item-name { flex: 1 1 auto; }
#items.as-cards .item-actions { max-width: none; width: 100%; justify-content: flex-start; }
#items.as-cards .item-actions button { flex: 1 1 auto; }

@media (max-width: 1100px) {
  .account { flex-direction: column; align-items: stretch; }

  .set-builder-form { flex-direction: column; align-items: stretch; }
  .set-builder-form label { width: 100%; }
}

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: relative;
  width: 40px;
  height: 22px;
  flex: 0 0 auto;
  background: var(--control);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background .15s;
}
.switch .slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .15s, background .15s;
}
.switch input:checked + .slider { background: rgba(63, 191, 127, .25); border-color: var(--ok); }
.switch input:checked + .slider::before { transform: translateX(18px); background: var(--ok); }
.switch input:focus-visible + .slider { border-color: var(--accent); }
.switch-label { font-size: 13px; color: var(--muted); }

.setting-help {
  margin-top: 3px; max-width: 460px; line-height: 1.45; font-size: 12px;
  white-space: pre-line;
}

.ph-hint { margin-top: 6px; }

.ph-label { display: flex; flex-direction: column; gap: 4px; font-size: 12px;
  color: var(--muted); width: 100%; }
.ph-label select { width: auto; }
.ph-note { margin-top: 3px; }
.ph-list { display: flex; flex-wrap: wrap; gap: 5px; }
button.ph {
  padding: 2px 8px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--accent);
  border-color: var(--line);
  min-height: 0;
}
.ph-examples { margin-top: 6px; }
.ph-examples summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.ph-row { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline;
  margin-top: 6px; font-size: 12px; }
.ph-row code { font-size: 11px; }
.ph-row span:last-child { overflow-wrap: anywhere; }
/* описание — на всю ширину строкой под {key}, стрелка и пример идут ниже отдельно */
.ph-desc { flex-basis: 100%; color: var(--text); }

.version-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--panel-2);
}
.version-card.current { border-color: var(--ok); }

.version-card.no-build { background: var(--card); border-style: dashed; }

.version-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px;
  cursor: pointer; list-style: none; user-select: none;
}
.version-head::-webkit-details-marker { display: none; }
.version-head > b::before { content: "▸ "; color: var(--muted); }
.version-card[open] > .version-head > b::before { content: "▾ "; }
.version-head .version-action { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.version-head .version-action button, .version-head .version-action span { cursor: auto; }

.version-floor {
  color: var(--muted); border-color: var(--line); background: transparent;
}
.version-floor.on { color: var(--ok); border-color: var(--ok); }

.version-warn {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-left: 3px solid var(--warn);
  border-radius: 6px;
  background: rgba(224, 163, 62, .12);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}
.version-card ul { margin: 6px 0 0; padding-left: 20px; }
.version-card li { margin-bottom: 5px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.version-card li b { color: var(--text); }

.game-block { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.game-name { font-weight: 600; margin-bottom: 8px; }
.game-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 14px; }
.game-field { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.game-field .k { color: var(--muted); font-size: 13px; font-family: monospace; }

.game-field.wide .k { font-family: inherit; }
.game-field.wide .game-field-help { max-width: 72ch; }
.game-field input.short, .game-field select { width: 130px; }

.game-field.wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(280px, 560px) 1fr;
  gap: 10px 18px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.game-field.wide .k { margin-bottom: 0; }

.setting {
  display: grid; grid-template-columns: minmax(300px, 520px) 1fr;
  gap: 10px 20px; align-items: start; padding: 14px 0 2px;
}
.setting > .control { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.setting .setting-help { max-width: 72ch; margin-top: 4px; }
.setting .subtabs { margin: 0; }
@media (max-width: 900px) { .setting { grid-template-columns: 1fr; } }

@media (max-width: 900px) { .game-field.wide { grid-template-columns: 1fr; } }

.setting-title {
  color: var(--text); font-size: 14px; font-weight: 500;

  font-family: -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

.setting-key {
  display: inline-block; margin-top: 1px; font-size: 12px; color: var(--muted);
  background: none; border: none; padding: 0; font-family: ui-monospace, Menlo, Consolas, monospace;
}
.setting-cell { max-width: 620px; }
.setting-cell .setting-help { margin-top: 4px; max-width: 72ch; }

.game-field.wide .setting-title { display: block; }

#settings td input, #settings td select { max-width: 360px; }
#settings td textarea { max-width: 760px; }
.game-ta { width: 100%; min-height: 60px; box-sizing: border-box; }
.game-more { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 6px; }
.game-more summary { cursor: pointer; color: var(--muted); font-size: 13px; user-select: none; }
.game-more[open] summary { margin-bottom: 6px; }

.analytics-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

.analytics-controls select, .orders-toolbar select { padding: 2px 8px; font-size: 12px; }

.analytics-metrics { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.analytics-metrics .metric { min-width: 150px; }
.analytics-metrics .metric-accent { min-width: 190px; }

.metric {
  background: var(--field); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; min-width: 128px;
}

.stat-tiles { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 16px; }
.stat-tiles .metric { min-width: 126px; }
.tiles-note { margin-top: 8px; }
.metric-ok .metric-value { color: var(--ok); }
.metric-warn .metric-value { color: var(--warn); }
.metric-bad .metric-value { color: var(--bad); }
.metric-value { font-size: 20px; font-weight: 700; }
.metric-key { font-size: 13px; margin-top: 2px; }
.metric-sub { font-size: 12px; }
.analytics-chart-wrap { margin: 14px 0 0; }
.analytics-chart-title { font-size: 12px; margin-bottom: 6px; }
.analytics-note { font-size: 12px; margin-top: 8px; }

.analytics-cols { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: start; }

@media (max-width: 1100px) { .analytics-cols { grid-template-columns: 1fr; gap: 14px; } }

.area-chart svg { display: block; width: 100%; height: auto; }
.area-chart .grid-line { stroke: var(--line); stroke-width: 1; }
.area-chart .axis { fill: var(--muted); font-size: 11px; }
.area-chart .area-fill { fill: var(--accent, #4f8cff); fill-opacity: .14; }
.area-chart .area-line { fill: none; stroke: var(--accent, #4f8cff); stroke-width: 2; stroke-linejoin: round; }
.area-chart .area-dot { fill: var(--accent, #4f8cff); stroke: var(--card); stroke-width: 2; }
.area-chart .area-end { fill: var(--chart-end); stroke: var(--card); stroke-width: 2; }
.area-chart .area-total { fill: var(--text); font-size: 15px; font-weight: 600; }
.area-chart .tip-zone:hover { fill-opacity: .06; fill: var(--hover-tint); }

.chart-draw-in svg { animation: chart-draw-in .5s ease; }
@keyframes chart-draw-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .chart-draw-in svg { animation: none; }
}

.hbar-chart { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; }
.hbar-label { font-size: 12px; color: var(--muted); }
.hbar-track { height: 20px; background: var(--bg, #0f131b); border-radius: 5px; overflow: hidden; }
.hbar-track i { display: block; height: 100%; background: rgba(79,140,255,.55); border-radius: 5px; transition: width .2s; }
.hbar-track i.best { background: var(--accent, #4f8cff); }
.hbar:hover .hbar-track i { filter: brightness(1.25); }
.hbar-value { font-size: 12px; font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }

.analytics-forecast { margin: 0; font-size: 13px; }
.forecast-tiles { display: flex; gap: 10px; flex-wrap: wrap; }
.forecast-tiles .metric { flex: 1 1 130px; }
.forecast-note { margin-top: 10px; line-height: 1.5; }

.metric { position: relative; }
.metric-key { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.metric-value { font-size: 22px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.metric-value-text { font-size: 15px; font-weight: 500; line-height: 1.35; }
.metric-sub { font-size: 12px; margin-top: 2px; }
.metric-accent { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.metric-trend { font-size: 12px; font-weight: 600; margin-top: 6px; }
.metric-trend.up, .trend-ink.up { color: var(--ok); }
.metric-trend.down, .trend-ink.down { color: var(--warn); }
.metric-trend.flat, .trend-ink.flat { color: var(--muted); }
.trend-ink { font-weight: 600; }
.metric-spark { margin-top: 4px; height: 26px; color: var(--accent); }
.metric-spark.up { color: var(--ok); }
.metric-spark.down { color: var(--warn); }
.sparkline { width: 100%; height: 26px; display: block; }

.chart-tip { position: fixed; transform: translate(-50%, -100%); background: var(--field); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: 12px;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .1s; z-index: 1000; }
.chart-tip.show { opacity: 1; }

.analytics-empty { text-align: center; padding: 40px 20px; border: 1px dashed var(--line); border-radius: 10px; }
.analytics-empty-icon { opacity: .8; }
.analytics-empty-icon .icon { width: 40px; height: 40px; }
.analytics-empty-title { font-size: 16px; font-weight: 600; margin-top: 10px; }
.analytics-empty-sub { max-width: 460px; margin: 6px auto 0; line-height: 1.5; }
.chart-empty { display: flex; align-items: center; justify-content: center; height: 120px; width: 100%; font-size: 13px; }

.admin-banner {
  background: #3a2a12; border: 1px solid var(--warn); color: #f0c980;
  border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; font-weight: 500;
}

:root[data-theme="light"] .admin-banner { background: #fdf0d5; color: #8a5a00; }

.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; }

.subtab { background: var(--control); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 4px 11px; font-size: 12px; cursor: pointer; }
.subtab:hover { border-color: var(--accent); }
.subtab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
#lot-design-base h3, #lot-design-game h3 { font-size: 15px; margin: 18px 0 6px; }
#lot-design-base h3:first-child { margin-top: 0; }

.game-field-help { margin-top: 3px; font-size: 12px; line-height: 1.4; font-family: inherit; }

.tri-toggle { display: flex; gap: 4px; flex-wrap: wrap; }
.tri-opt { background: var(--control); color: var(--text); border: 1px solid var(--line);
  border-radius: 7px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.tri-opt:hover { border-color: var(--accent); }
.tri-opt.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.edit-modal-box { max-width: 560px; width: calc(100% - 32px); text-align: left;
  max-height: 85vh; overflow-y: auto; }
.edit-modal-box .rename-form { border: none; padding: 0; margin-top: 0; max-width: none; }

.reserved-modal-box { max-width: 560px; width: calc(100% - 32px); text-align: left;
  max-height: 85vh; overflow-y: auto; }
.reserved-modal-box h3 { margin: 0 0 10px; }
.reserved-modal-box table { width: 100%; }
.pinned-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.pinned-row select { width: auto; }

.lot-preview { width: 100%; background: var(--card-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.lot-preview details { margin-top: 4px; }
.lot-preview summary { cursor: pointer; color: var(--muted); font-size: 12px; }

.live-resolve:empty { display: none; }
.live-resolve { font-size: 12px; margin-top: -4px; }

.rename-form { display: flex; flex-direction: column; align-items: stretch; gap: 14px;
  margin-top: 6px; padding: 8px; border: 1px dashed var(--line); border-radius: 8px;
  max-width: min(460px, 90vw); box-sizing: border-box; }
.rename-form input { width: 100%; max-width: 100%; box-sizing: border-box; }

.rename-form.hidden { display: none; }

.ph-field { display: flex; flex-direction: column; gap: 6px; }
.ph-field textarea { width: 100%; box-sizing: border-box; }
.ph-field .char-count { align-self: flex-end; margin: 0; }
.rename-form .ph-hint, .ph-field .ph-hint { margin-top: 0; }

.ph-field-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; }

.ph-pinned-row { display: flex; align-items: stretch; gap: 8px; flex-wrap: nowrap; }
.ph-pinned-row input:not(.ph-pin-slot), .ph-pinned-row textarea { flex: 1 1 auto; min-width: 0; width: auto; }

.ph-pinned-row textarea ~ .ph-pin-slot, .ph-pinned-row .ph-pin-slot:has(~ textarea) {
  padding-top: 7px; text-align: left;
}

.ph-pinned-row .ph-pin-slot {
  flex: 0 0 auto; width: 70px;
  padding: 0 6px; font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
}
.ph-pin-slot:focus { border-color: var(--accent); }

.char-count { font-size: 11px; align-self: center; margin-left: auto; }

.orders-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.orders-toolbar select { width: auto; }

.gift-games { display: flex; flex-wrap: wrap; gap: 4px 12px; }

.gift-game { display: inline-flex; align-items: center; gap: 5px; font-size: 13px;
             cursor: pointer; white-space: nowrap; }
.gift-game input { margin: 0; }

.gift-pick-game { margin-top: 14px; }
.gift-pick-title { font-weight: 600; margin-bottom: 8px; }
.gift-pick-items { display: flex; flex-wrap: wrap; gap: 8px; }

button.gift-pick {
  display: inline-flex; align-items: center; gap: 8px;
  max-width: 330px; text-align: left; padding: 6px 10px;
}
button.gift-pick img { width: 28px; height: 28px; object-fit: contain; flex: none; }

button.gift-pick > span:not(.muted) {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
button.gift-pick > .muted { flex: none; }

#gift-pick-search { max-width: 280px; }
#gift-pick-game { max-width: 200px; }

.build-card { max-width: 860px; margin: 24px auto; }
.build-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.build-head h2 { margin: 0; }
.build-bar {
  height: 10px; border-radius: 6px; background: var(--field); overflow: hidden; margin: 14px 0 6px;
}
.build-bar > div {
  height: 100%; width: 0; border-radius: 6px; background: var(--accent);
  transition: width .6s ease;
}
.build-bar > div.ok { background: var(--ok); }
.build-bar > div.bad { background: var(--bad); }
.build-numbers { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.build-numbers > span:first-child { font-size: 22px; font-weight: 600; }
.build-stages { list-style: none; padding: 0; margin: 16px 0 0; }
.build-stages li { padding: 5px 0; color: var(--muted); }
.build-stages li.stage-done { color: var(--text); }
.build-stages li.stage-run { color: var(--accent); font-weight: 600; }
.build-log { margin-top: 16px; }
.build-log pre {
  margin: 8px 0 0; padding: 10px; border-radius: 8px; background: var(--field);
  max-height: 260px; overflow: auto; font-size: 12px; line-height: 1.5; white-space: pre-wrap;
}

@media (min-width: 900px) {
  .build-card { max-width: 1100px; padding: 28px 30px; }
  .build-body { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 26px;
                align-items: start; }
  .build-stages { margin-top: 0; }
  .build-log { margin-top: 0; }
  .build-log pre { max-height: 340px; }
  .build-numbers > span:first-child { font-size: 28px; }
}

.error-card {
  max-width: 560px; text-align: center; padding: 48px 28px;
  margin: 10vh auto 0;
}
.error-card h2 { font-size: 22px; }
.error-code { font-size: 86px; font-weight: 700; color: var(--muted); line-height: 1; }
@media (max-width: 600px) {
  .error-card { margin-top: 6vh; padding: 32px 20px; }
  .error-code { font-size: 64px; }
}
.error-card h2 { margin: 12px 0 6px; }
.error-home {
  display: inline-block; margin-top: 10px; color: var(--accent); text-decoration: none;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 16px;
}
.error-home:hover { border-color: var(--accent); }

.item-details { margin-top: 4px; }

.instances-list { margin-top: 6px; max-height: 180px; overflow-y: auto; }
.instance-row { font-size: 12px; padding: 2px 0; display: flex; align-items: center; gap: 6px; }
.instance-row.instance-locked { opacity: .7; }

.instance-photo-status { margin-left: auto; font-size: 11px; white-space: nowrap; }
.mark-prices { margin-top: 4px; }
.mark-list { display: inline-block; min-width: 260px; max-width: 420px; }
.mark-row {
  display: flex; justify-content: space-between; gap: 14px;
  font-size: 12px; color: var(--muted); padding: 2px 0;
}
.mark-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mark-price { white-space: nowrap; color: var(--text); display: flex; gap: 8px; align-items: baseline; }

.mark-each { color: var(--muted); font-size: 11px; }
.mark-total {
  border-top: 1px solid var(--line); margin-top: 3px; padding-top: 4px;
  color: var(--text); font-weight: 600;
}

.lot-edit { display: grid; grid-template-columns: 1fr minmax(300px, 400px); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .lot-edit { grid-template-columns: 1fr; } }
.lot-preview-box { position: sticky; top: 12px; }
.lot-preview-cap { font-size: 12px; margin-bottom: 6px; }
.lot-preview {
  background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 14px;
}
.lot-preview-title { font-weight: 600; line-height: 1.35; }
.lot-preview-body {
  margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.5; white-space: pre-line;
}
.lot-preview-note { font-size: 12px; margin-top: 8px; line-height: 1.5; }

.empty-state {
  display: flex; flex-direction: column; gap: 4px; align-items: center;
  text-align: center; padding: 26px 16px 20px; color: var(--muted); font-size: 13px;
}
.empty-state b { color: var(--text); font-size: 15px; font-weight: 500; }
.empty-state span { max-width: 56ch; line-height: 1.5; }
.grid tr.empty-row td { border-bottom: none; }

.account-kv { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px;
              margin: 10px 0 0; font-size: 13px; }
.account-kv dt { color: var(--muted); }
.account-kv dd { margin: 0; }

/* кнопка открытия окна добавления аккаунта — отдельным пунктирным блоком, с
   заметным отступом от списка аккаунтов (запрос 06.11.26: раньше details-форма
   сидела вплотную к разделителю карточки) */
.account-add-open {
  display: block; width: 100%; margin-top: 20px; padding: 12px;
  background: none; border: 1px dashed var(--line); border-radius: 10px;
  color: var(--muted); font-size: 14px; cursor: pointer;
}
.account-add-open:hover { border-color: var(--accent); color: var(--text); }

/* баннер «выпустить ключ?» — запрос 06.11.26: осечка выпуска ключа без согласия
   продавца, теперь спрашиваем прямо на карточке аккаунта */
.account-key-prompt {
  flex-basis: 100%; display: flex; align-items: center; gap: 10px; margin-top: 10px;
  padding: 10px 12px; background: var(--field); border: 1px solid var(--warn-border);
  border-radius: 10px; font-size: 13px;
}
.account-key-prompt .icon { color: var(--warn); flex: 0 0 auto; }
.account-key-prompt span { flex: 1 1 auto; color: var(--text); }
.account-key-prompt-buttons { display: flex; gap: 6px; flex: 0 0 auto; }
.account-key-prompt-buttons button { padding: 7px 12px; font-size: 13px; }

/* переключатель лицензий в шапке — <details>, не <select>: нужна иконка онлайн/офлайн
   внутри пункта списка, а <option> умеет только текст (запрос 03.11.26) */
.license-switch { position: relative; }
.license-switch.disabled { opacity: .6; pointer-events: none; }
.license-switch > summary {
  cursor: pointer; list-style: none; user-select: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.license-switch > summary::-webkit-details-marker { display: none; }
.license-switch > summary::after { content: " ▾"; color: var(--muted); font-size: 10px; }
.license-switch[open] > summary::after { content: " ▴"; }
.license-switch-list {
  position: absolute; top: 100%; right: 0; margin-top: 6px; z-index: 50;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px; min-width: 220px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.license-switch-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px;
  cursor: pointer; font-size: 13px; white-space: nowrap; color: var(--text);
}
.license-switch-item:hover { background: var(--control); }
.license-switch-item.active { color: var(--accent); }
.license-switch-item .icon { width: 14px; height: 14px; flex: none; }
.license-switch-item .icon.online { color: var(--ok); }
.license-switch-item .icon.offline { color: var(--muted); }
.license-switch-item .ls-state { color: var(--muted); font-size: 11px; margin-left: auto; padding-left: 10px; }

.auth-code-life { min-width: 170px; }
.auth-code-bar { height: 4px; background: var(--field); border-radius: 3px; overflow: hidden; }
.auth-code-bar i { display: block; height: 100%; background: var(--accent); transition: width 1s linear; }
#auth-code-left { font-size: 12px; margin-top: 6px; }

#auth-code.stale { color: var(--muted); border-color: var(--warn); }

#auth-code { transition: opacity .2s ease, border-color .3s ease; }
#auth-code.loading { opacity: .5; }
#auth-code.pulse { animation: auth-code-pulse .6s ease; }
@keyframes auth-code-pulse {
  0% { border-color: var(--accent); transform: scale(1); }
  35% { border-color: var(--accent); transform: scale(1.04); }
  100% { border-color: var(--line); transform: scale(1); }
}

.save-pulse { animation: auth-code-pulse .5s ease; }

.field-pending { animation: field-pending-pulse 1s ease-in-out infinite; }
@keyframes field-pending-pulse {
  0%, 100% { border-color: var(--line); }
  50% { border-color: var(--accent); }
}
@media (prefers-reduced-motion: reduce) {
  .save-pulse, #auth-code.pulse { animation: none; }
  .field-pending { animation: none; opacity: .65; }
}

button.primary, .btn.primary {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500;
}
button.primary:hover { filter: brightness(1.08); }

.log-line { display: block; }
.log-warn { color: var(--warn); }
.log-error { color: var(--bad); }
.log-info { color: inherit; }

details.how { margin: 10px 0; }
details.how > summary {
  cursor: pointer; color: var(--accent); font-size: 13px; list-style: none; user-select: none;
}
details.how > summary::-webkit-details-marker { display: none; }
details.how > summary::before { content: "? "; }
details.how p { max-width: 80ch; margin: 8px 0 0; }

.link-box { display: flex; gap: 6px; align-items: center; margin-top: 6px; }

.link-box.hidden { display: none; }
.link-box .link-input { min-width: 240px; }

.filters .right { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; }

.proxy-verdict { margin: 12px 0 0; }

#auth-code.failed { color: var(--muted); letter-spacing: 2px; }

.thumb-cell { display: inline-flex; align-items: center; gap: 8px; }

