/* вёрстка под WebKit уровня Safari 14 (YurbaHTML), поэтому без gap у flex и без backdrop-filter */

/* шрифты из ui/fonts при сборке вшивает gen_ui_bundle.ps1 как data:font/woff2 */

@font-face {
  font-family: "Montserrat";
  font-weight: 400;
  src: url("fonts/montserrat-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Montserrat";
  font-weight: 400;
  src: url("fonts/montserrat-cyrillic-400.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Montserrat";
  font-weight: 600;
  src: url("fonts/montserrat-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Montserrat";
  font-weight: 600;
  src: url("fonts/montserrat-cyrillic-600.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Montserrat";
  font-weight: 700;
  src: url("fonts/montserrat-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Montserrat";
  font-weight: 700;
  src: url("fonts/montserrat-cyrillic-700.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --accent: #8f5cf5;
  --accent-2: #6d7cff;
  --accent-soft: rgba(143, 92, 245, 0.16);
  --accent-wash: rgba(143, 92, 245, 0.45);
  --accent-hover: #9d70f7;
  --accent-light: #b18cff;
  --accent-pale: #d6c9ff;
  --accent-dim: #a9a3c7;

  --bg: #14141b;
  --bg-sidebar: #101016;
  --bg-card: #1b1b25;
  --bg-control: #262633;
  --bg-control-hover: #303040;
  --border: #272735;

  --text: #e9e9f2;
  --text-muted: #8b8ba1;
  --danger: #f0597a;

  --font: "Montserrat", "Segoe UI", Tahoma, Arial, sans-serif;

  --radius: 10px;
  --menu-width: 950px;
  --menu-height: 660px;
}

/* класс accent-… на <html> ставит setAccent() в app.js */
html.accent-red {
  --accent: #e5484d;
  --accent-2: #f2784b;
  --accent-hover: #ec5d62;
  --accent-soft: rgba(229, 72, 77, 0.16);
  --accent-wash: rgba(229, 72, 77, 0.45);
  --accent-light: #ff8a8d;
  --accent-pale: #ffd0d1;
  --accent-dim: #c7a3a5;
}

html.accent-green {
  --accent: #30a46c;
  --accent-2: #3fbfa0;
  --accent-hover: #3cb87b;
  --accent-soft: rgba(48, 164, 108, 0.16);
  --accent-wash: rgba(48, 164, 108, 0.45);
  --accent-light: #6fdc9f;
  --accent-pale: #c9f2db;
  --accent-dim: #a3c7b3;
}

html.accent-blue {
  --accent: #3e8ef7;
  --accent-2: #5b6cff;
  --accent-hover: #579df8;
  --accent-soft: rgba(62, 142, 247, 0.16);
  --accent-wash: rgba(62, 142, 247, 0.45);
  --accent-light: #86b8ff;
  --accent-pale: #d0e3ff;
  --accent-dim: #a3b4c7;
}

html.accent-orange {
  --accent: #f2994a;
  --accent-2: #f2c94c;
  --accent-hover: #f4a862;
  --accent-soft: rgba(242, 153, 74, 0.16);
  --accent-wash: rgba(242, 153, 74, 0.45);
  --accent-light: #ffbf85;
  --accent-pale: #ffe3c7;
  --accent-dim: #c7b3a3;
}

* {
  box-sizing: border-box;
}

/* фон прозрачный: сквозь страницу видна игра */
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  -webkit-user-select: none;
  user-select: none;
  cursor: default;
}

#backdrop {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 6, 10, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease, visibility 0.14s;
}

#backdrop.open {
  opacity: 1;
  visibility: visible;
}

#menu {
  position: relative;
  display: flex;
  width: var(--menu-width);
  height: var(--menu-height);
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

#sidebar {
  display: flex;
  flex-direction: column;
  flex: 0 0 190px;
  padding: 18px 12px 14px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
}

#brand {
  display: flex;
  align-items: center;
  padding: 0 8px 18px;
  cursor: move;
}

#brand-logo {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  margin-right: 8px;
}

#brand-logo .logo-stop-1,
.logo-mark .logo-stop-1 {
  stop-color: var(--accent-light);
}

#brand-logo .logo-stop-2,
.logo-mark .logo-stop-2 {
  stop-color: var(--accent);
}

#brand-logo .logo-stop-3,
.logo-mark .logo-stop-3 {
  stop-color: var(--accent-2);
}

#brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

#brand-version {
  font-size: 11px;
  color: var(--text-muted);
}


#tabs {
  flex: 1 1 auto;
}

.tab {
  display: flex;
  align-items: center;
  height: 38px;
  margin-bottom: 4px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.tab:hover {
  background: var(--bg-card);
  color: var(--text);
}

.tab.active {
  background: var(--accent);
  color: #fff;
}

.tab.active .dot {
  background: rgba(255, 255, 255, 0.35);
}

.tab.active .dot.on {
  background: #fff;
  box-shadow: none;
}

.tab-title {
  flex: 1 1 auto;
}

.tab-separator {
  height: 1px;
  margin: 8px 6px 12px;
  background: var(--border);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3a3a4c;
}

.dot.on {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

#update-card {
  display: none;
  margin: 0 0 10px;
  padding: 9px 10px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.45;
}

#update-card.ready {
  border-color: var(--accent);
}

.update-card-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.update-card-text {
  color: var(--text-muted);
}

#update-card.ready .update-card-text {
  color: var(--accent-light);
}

#update-card.error .update-card-text {
  color: var(--danger);
}

.update-card-bar {
  height: 3px;
  margin-top: 7px;
  background: var(--bg-control);
  border-radius: 2px;
}

.update-card-fill {
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

#client {
  padding: 10px 8px 0;
  border-top: 1px solid var(--border);
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
}

#client b {
  color: var(--text);
  font-weight: 600;
}

#content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

#modes {
  display: flex;
  flex: 0 0 auto;
  margin: 14px 18px 0;
  padding: 3px;
  border-radius: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.mode-button {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  height: 30px;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.mode-button+.mode-button {
  margin-left: 3px;
}

.mode-button:hover {
  color: var(--text);
  background: var(--bg-control);
}

.mode-button.active {
  background: var(--accent);
  color: #fff;
}

.mode-button .dot {
  margin-left: 8px;
}

.mode-button.active .dot {
  background: rgba(255, 255, 255, 0.35);
}

.mode-button.active .dot.on {
  background: #fff;
  box-shadow: none;
}

#classes {
  display: flex;
  flex: 0 0 auto;
  padding: 10px 18px;
  flex-wrap: wrap;
  gap: 5px;
}

.class-button {
  display: flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.class-button:hover {
  color: var(--text);
  background: var(--bg-control);
}

.class-button.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.class-button .dot {
  margin-left: 7px;
}

.class-icon {
  width: 18px;
  height: 18px;
  margin: 0 6px 0 -3px;
  opacity: 0.6;
}

.class-button:hover .class-icon,
.class-button.active .class-icon {
  opacity: 1;
}

.class-button.active .dot.on {
  background: #fff;
  box-shadow: none;
}

#page {
  flex: 1 1 auto;
  padding: 14px 18px 18px;
  overflow-y: auto;
}

#page::-webkit-scrollbar {
  width: 8px;
}

#page::-webkit-scrollbar-thumb {
  background: var(--bg-control);
  border-radius: 4px;
}

#page::-webkit-scrollbar-track {
  background: transparent;
}

.page-head {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.page-head-text {
  flex: 1 1 auto;
  min-width: 0;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
}

.page-hint {
  margin-top: 2px;
  color: var(--text-muted);
}

.notice {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 9px 12px;
  border-radius: var(--radius);
  background: rgba(240, 89, 122, 0.10);
  border: 1px solid rgba(240, 89, 122, 0.35);
}

.notice-text {
  flex: 1 1 auto;
}

/* две независимые колонки, чтобы карточки разной высоты не оставляли пустот */
.columns {
  display: flex;
  align-items: flex-start;
}

.column {
  flex: 1 1 0;
  min-width: 0;
}

.column+.column {
  margin-left: 12px;
}

.card {
  margin-bottom: 12px;
  padding: 12px 14px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent);
}

.card-hint {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}

.card-body {
  margin-top: 6px;
}

.card-note {
  margin: 2px 0 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.field-label {
  margin-top: 8px;
}

.row {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 6px 0;
}

.row-text {
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 12px;
}

.row-label {
  line-height: 1.3;
  color: var(--text);
}

.row-hint {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-muted);
}

.row.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--bg-control);
  cursor: pointer;
  transition: background 0.14s;
}

.switch::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #9a9ab0;
  transition: left 0.14s, background 0.14s;
}

.switch.on {
  background: var(--accent);
}

.switch.on::after {
  left: 19px;
  background: #fff;
}

.slider {
  padding: 8px 0 10px;
}

.slider.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.slider-head {
  display: flex;
  align-items: baseline;
  margin-bottom: 7px;
}

.slider-label {
  flex: 1 1 auto;
}

.slider-value {
  color: var(--accent);
  font-weight: 600;
}

.slider-head .slider-value+.slider-step,
.slider-head .slider-step+.slider-value {
  margin-left: 8px;
}

.slider-step {
  align-self: center;
  width: 22px;
  height: 20px;
  line-height: 19px;
  border-radius: 6px;
  background: var(--bg-control);
  color: var(--text);
  text-align: center;
  cursor: pointer;
}

.slider-step:hover {
  background: var(--bg-control-hover);
}

.slider-track {
  position: relative;
  height: 14px;
  /* отступ в половину ручки, чтобы в крайних положениях она не вылезала за карточку */
  margin: 0 7px;
  cursor: pointer;
}

.slider-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 5px;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-control);
}

.slider-fill {
  position: absolute;
  left: 0;
  top: 5px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.slider-thumb {
  position: absolute;
  top: 0;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.segmented {
  display: flex;
  margin: 8px 0 6px;
  padding: 3px;
  border-radius: 8px;
  background: var(--bg-control);
}

.segment {
  flex: 1 1 0;
  height: 24px;
  line-height: 24px;
  padding: 0 10px;
  border-radius: 6px;
  text-align: center;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.segment:hover {
  color: var(--text);
}

.segment.active {
  background: var(--accent);
  color: #fff;
}

/* той же ширины, что и кнопки в строке */
.row .segmented {
  flex: 0 0 auto;
  width: 132px;
  margin: 0;
}

.row .segment {
  padding: 0;
}

.row .segmented.bind,
.row .button.bind {
  width: 176px;
}

.chips {
  display: grid;
  grid-gap: 8px;
  margin: 8px 0 6px;
}

.chips-2 {
  grid-template-columns: 1fr 1fr;
}

.chips-2 .chip:last-child:not(:nth-child(2n)) {
  grid-column: 1 / -1;
}

.chips-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.chips-5 {
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
}

.chip {
  height: 30px;
  line-height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--bg-control);
  border: 1px solid transparent;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.chip:hover {
  color: var(--text);
  background: var(--bg-control-hover);
}

.chip.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

.chip.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.button {
  flex: 0 0 auto;
  height: 30px;
  line-height: 28px;
  min-width: 72px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--bg-control);
  border: 1px solid transparent;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

/* одной ширины, чтобы правый край был ровным */
.row .button {
  width: 132px;
}

.button:hover {
  background: var(--bg-control-hover);
}

.button.primary {
  background: var(--accent);
  color: #fff;
}

.button.primary:hover {
  background: var(--accent-hover);
}

.button.danger:hover {
  background: rgba(240, 89, 122, 0.2);
  border-color: var(--danger);
}

/* выгрузка ждёт второго нажатия */
.button.danger.armed {
  background: rgba(240, 89, 122, 0.2);
  border-color: var(--danger);
  color: var(--danger);
}

.button.waiting {
  border-color: var(--accent);
  color: var(--accent);
}

.button+.button {
  margin-left: 8px;
}

.page-actions {
  display: flex;
  justify-content: flex-end;
}

.page-head .button {
  margin-right: 14px;
}

.hitboxes {
  display: flex;
  align-items: flex-start;
  margin: 8px 0 4px;
}

.mannequin-side {
  flex: 0 0 auto;
  width: 132px;
  margin-right: 16px;
}

/* рисунок 120 x 250, left / top точек костей берутся из BONES в app.js */
.mannequin-box {
  position: relative;
  width: 120px;
  height: 250px;
  margin: 0 auto;
}

.mannequin {
  position: absolute;
  left: 0;
  top: 0;
  width: 120px;
  height: 250px;
}

.part .solid {
  fill: var(--bg-control-hover);
}

.part .limb {
  fill: none;
  stroke: var(--bg-control-hover);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.part.on .solid {
  fill: var(--accent);
}

.part.on .limb {
  stroke: var(--accent);
}

.part.some .solid {
  fill: var(--accent-wash);
}

.part.some .limb {
  stroke: var(--accent-wash);
}

.bone-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--bg-card);
  background: #5a5a70;
  cursor: pointer;
}

.bone-dot:hover {
  background: var(--text);
  border-color: var(--accent);
}

.bone-dot.on {
  background: #fff;
}

.bone-hover {
  margin-top: 8px;
  min-height: 15px;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  color: var(--text-muted);
}

.bone-hover.active {
  color: var(--text);
  font-weight: 600;
}

.hitboxes-card-narrow .mannequin-side {
  margin-right: 12px;
}

.part-list {
  flex: 1 1 auto;
  min-width: 0;
  margin-top: 2px;
}

.part-row {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--bg-control);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.part-row+.part-row {
  margin-top: 7px;
}

.part-row:hover {
  background: var(--bg-control-hover);
}

.part-row.on {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.part-row-name {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.part-row:hover .part-row-name,
.part-row.on .part-row-name {
  color: var(--text);
}

.part-row-bones {
  margin-left: 12px;
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bone-groups {
  flex: 1 1 auto;
  min-width: 0;
}

.bone-row {
  display: flex;
  align-items: flex-start;
}

.bone-part {
  flex: 1 1 0;
  min-width: 0;
  margin-bottom: 12px;
}

.bone-part+.bone-part {
  margin-left: 18px;
}

.bone-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bone-part .chip.bone-all {
  height: 24px;
  line-height: 22px;
  padding: 0 10px;
  font-size: 11px;
}

.bone-part .chips {
  grid-gap: 6px;
  margin: 8px 0 0;
}

.bone-part .chip {
  height: 28px;
  line-height: 26px;
  padding: 0 6px;
  font-size: 12px;
}

.bone-sides {
  display: flex;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.bone-sides div {
  flex: 1 1 0;
  text-align: center;
}

.bone-sides div+div {
  margin-left: 6px;
}

.bone-pairs {
  margin-top: 4px;
}

.presets {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-gap: 10px;
  margin: 8px 0 4px;
}

.preset {
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.preset-name {
  font-size: 14px;
  font-weight: 600;
}

.preset-hint {
  flex: 1 1 auto;
  margin: 4px 0 12px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-muted);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  margin: 6px -3px 6px;
}

.swatch {
  width: 22px;
  height: 22px;
  margin: 3px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}

.swatch.active {
  border-color: #fff;
}

.swatches.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.config-list {
  max-height: 228px;
  margin: 0 -6px 10px;
  overflow-y: auto;
}

.config-list::-webkit-scrollbar {
  width: 8px;
}

.config-list::-webkit-scrollbar-thumb {
  background: var(--bg-control);
  border-radius: 4px;
}

.config-item {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 8px 0 12px;
  border-radius: 8px;
}

.config-item:hover {
  background: var(--bg-control);
}

.config-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-empty {
  padding: 14px 10px;
  color: var(--text-muted);
}

.config-new {
  display: flex;
  align-items: center;
  padding: 12px 0 4px;
  border-top: 1px solid var(--border);
}

.text-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 30px;
  margin-right: 8px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  outline: none;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  -webkit-user-select: text;
  user-select: text;
  cursor: text;
}

.text-input:focus {
  border-color: var(--accent);
}

.stepper {
  display: flex;
  align-items: center;
}

.stepper-value {
  width: 52px;
  text-align: center;
  color: var(--accent);
  font-weight: 600;
}

.accents {
  display: flex;
  align-items: center;
}

.accent-dot {
  width: 18px;
  height: 18px;
  margin-left: 8px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}

.accent-dot.active {
  border-color: #fff;
}

#toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  padding: 9px 16px;
  border-radius: 9px;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.18s;
  pointer-events: none;
  /* выше экрана активации */
  z-index: 60;
}

#toast.show {
  opacity: 1;
}

#toast.error {
  border-color: var(--danger);
}

/* миниатюры тем — вёрстка, а не картинки, чтобы цвет акцента менялся вместе с выбором.
   Шрифт и цвета заданы явно, чтобы миниатюра не наследовала вид темы, в которой лежит */
.theme-picker {
  display: flex;
  margin: 6px 0 4px;
}

.theme-card {
  flex: 1;
  min-width: 0;
  margin-right: 10px;
  cursor: pointer;
}

.theme-card:last-child {
  margin-right: 0;
}

.theme-name {
  display: flex;
  align-items: center;
  margin-top: 7px;
  color: var(--text-muted);
}

.theme-card.active .theme-name {
  color: var(--text);
}

/* кружок рисуется стилями, а не символом галочки, чтобы не сползал относительно текста */
.theme-check {
  position: relative;
  flex: 0 0 12px;
  height: 12px;
  margin-right: 7px;
  border: 2px solid var(--bg-control-hover);
  border-radius: 50%;
}

.theme-card:hover .theme-check {
  border-color: #4a4a5e;
}

.theme-card.active .theme-check {
  border-color: var(--accent);
}

.theme-card.active .theme-check::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.theme-hint {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 14px;
}

.tp {
  position: relative;
  display: flex;
  height: 135px;
  border: 2px solid #303040;
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--font);
  font-size: 11px;
  font-weight: normal;
  line-height: 15px;
  color: #e9e9f2;
}

.theme-card:hover .tp {
  border-color: #44445a;
}

.theme-card.active .tp {
  border-color: var(--accent);
}

.tp-line {
  display: flex;
  align-items: center;
  height: 16px;
}

.tp-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.tp-accent {
  color: var(--accent-light);
}

/* размеры подобраны под миниатюру ~190 x 135 */
.tp-modern {
  background: var(--bg);
  font-size: 10px;
  line-height: 12px;
}

.tp-side {
  display: flex;
  flex-direction: column;
  flex: 0 0 32%;
  padding: 6px 4px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
}

.tp-brand {
  display: flex;
  align-items: center;
  height: 14px;
  padding-left: 2px;
  margin-bottom: 8px;
  font-weight: bold;
}

.tp-logo {
  flex: 0 0 9px;
  height: 9px;
  margin-right: 4px;
  border-radius: 3px;
  background: var(--accent);
}

.tp-tab {
  display: flex;
  align-items: center;
  height: 15px;
  padding: 0 4px;
  margin-bottom: 4px;
  border-radius: 3px;
  color: var(--text-muted);
}

.tp-tab.active {
  background: var(--accent);
  color: #fff;
}

.tp-tab-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.tp-dot {
  flex: 0 0 4px;
  height: 4px;
  margin-left: 3px;
  border-radius: 50%;
  background: #3a3a4a;
}

.tp-tab.active .tp-dot {
  background: #fff;
}

.tp-sep {
  height: 1px;
  margin: 1px 3px 5px;
  background: var(--border);
}

.tp-main {
  flex: 1;
  min-width: 0;
  padding: 6px 6px 0;
}

.tp-modes {
  display: flex;
  padding: 1px;
  margin-bottom: 4px;
  border-radius: 4px;
  background: var(--bg-sidebar);
}

.tp-mode {
  flex: 1;
  height: 13px;
  padding: 0 4px;
  border-radius: 3px;
  color: var(--text-muted);
  font-size: 8px;
  line-height: 13px;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
}

.tp-mode.active {
  background: var(--accent);
  color: #fff;
}

.tp-classes {
  display: flex;
  margin-bottom: 5px;
}

.tp-class {
  width: 22px;
  height: 11px;
  margin-right: 3px;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--bg-card);
  font-size: 8px;
  line-height: 11px;
  white-space: nowrap;
}

.tp-class.active {
  width: auto;
  background: var(--accent);
  color: #fff;
}

.tp-page-head {
  display: flex;
  align-items: center;
  height: 14px;
  margin-bottom: 5px;
}

.tp-page-title {
  flex: 1;
  font-size: 11px;
  font-weight: bold;
}

.tp-switch {
  position: relative;
  width: 18px;
  height: 10px;
  border-radius: 5px;
  background: var(--accent);
}

.tp-switch::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

.tp-columns {
  display: flex;
}

.tp-card {
  flex: 1;
  min-width: 0;
  height: 46px;
  margin-right: 4px;
  padding: 4px 4px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.tp-card:last-child {
  margin-right: 0;
}

.tp-card-title {
  height: 11px;
  color: var(--accent);
  font-size: 7px;
  font-weight: bold;
  text-transform: uppercase;
  overflow: hidden;
  white-space: nowrap;
}

.tp-seg {
  display: flex;
  padding: 1px;
  margin-top: 2px;
  border-radius: 3px;
  background: var(--bg-control);
}

.tp-seg div {
  flex: 1;
  height: 8px;
  border-radius: 2px;
}

.tp-seg div.active {
  background: var(--accent);
}

.tp-bar {
  width: 70%;
  height: 3px;
  margin-top: 6px;
  border-radius: 2px;
  background: #2a2a38;
}

.tp-chips {
  display: flex;
  flex-wrap: wrap;
  margin-top: 1px;
}

.tp-chip {
  width: 30%;
  height: 9px;
  margin: 2px 3% 0 0;
  border-radius: 2px;
  background: var(--bg-control);
}

.tp-chip.active {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}

.tp-retro,
.tp-classic {
  justify-content: center;
  padding-top: 8px;
  background: #3a3f4a;
}

.tp-window {
  width: 88%;
  align-self: flex-start;
  background: #16161c;
  border: 1px solid #000;
  font-family: var(--font);
}

.tp-wtitle {
  display: flex;
  align-items: center;
  height: 16px;
  padding: 0 5px;
  background: #101015;
  border-bottom: 1px solid #000;
  font-weight: bold;
}

.tp-wmark {
  width: 6px;
  height: 6px;
  margin-right: 5px;
  background: var(--accent);
}

.tp-head {
  height: 16px;
  padding: 2px 5px 0;
  color: var(--accent-light);
  font-weight: bold;
}

.tp-window .tp-line {
  padding: 0 4px 0 5px;
  margin-bottom: 1px;
}

.tp-window .tp-in {
  padding-left: 15px;
}

.tp-group {
  display: flex;
  align-items: center;
  color: var(--accent-pale);
}

.tp-box {
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border: 1px solid var(--accent);
  font-size: 9px;
  line-height: 7px;
  text-align: center;
  color: #fff;
}

.tp-cell {
  flex: 0 0 50px;
  height: 13px;
  line-height: 13px;
  text-align: center;
  background: #262633;
  color: #c9c9d6;
}

.tp-cell.tp-accent {
  color: var(--accent-light);
}

.tp-number {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3px;
}

.tp-arrow {
  font-size: 7px;
  color: #8b8ba1;
}

.tp-plate {
  width: 88%;
  align-self: flex-start;
  padding: 4px 7px 6px;
  background: rgba(0, 0, 0, 0.84);
  font-family: var(--font);
  font-weight: bold;
}

.tp-ptitle {
  height: 18px;
  color: var(--accent-light);
  font-size: 14px;
  line-height: 18px;
}

.tp-gold {
  height: 15px;
  color: #e1c68c;
}

.tp-gold.tp-gap {
  margin-top: 3px;
}

.tp-plate .tp-hover {
  color: var(--accent-light);
}

.tps {
  display: flex;
  height: 48px;
  border: 2px solid #303040;
  overflow: hidden;
}

.tps-modern {
  background: var(--bg);
}

.tps-retro,
.tps-classic {
  justify-content: center;
  padding-top: 5px;
  background: #3a3f4a;
}

.tps-bar {
  height: 3px;
  margin-bottom: 3px;
}

.tps-thick {
  height: 4px;
}

.tps-accent {
  background: var(--accent);
}

.tps-gold {
  background: #e1c68c;
}

.tps-light {
  background: #bbbbbb;
}

.tps-white {
  background: #ffffff;
}

.tps-dim {
  background: #2a2a38;
}

.tps-w15 {
  width: 15%;
}

.tps-w30 {
  width: 30%;
}

.tps-w45 {
  width: 45%;
}

.tps-w50 {
  width: 50%;
}

.tps-w60 {
  width: 60%;
}

.tps-w70 {
  width: 70%;
}

.tps-side {
  flex: 0 0 30%;
  padding: 5px 4px;
  background: var(--bg-sidebar);
}

.tps-main {
  flex: 1;
  padding: 5px;
}

.tps-card {
  height: 15px;
  margin-bottom: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.tps-window {
  width: 62%;
  align-self: flex-start;
  padding: 0 4px 2px;
  background: #16161c;
  border: 1px solid #000;
}

.tps-wtitle {
  height: 5px;
  margin: 0 -4px 4px;
  background: #101015;
  border-bottom: 1px solid #000;
}

.tps-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 6px;
  margin-bottom: 2px;
}

.tps-row .tps-bar {
  margin-bottom: 0;
}

.tps-cell {
  width: 32%;
  height: 5px;
  background: #262633;
}

.tps-plate {
  width: 64%;
  align-self: flex-start;
  padding: 4px 5px;
  background: rgba(0, 0, 0, 0.84);
}

#license-gate {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 14, 0.92);
  border-radius: 14px;
}

.license-card {
  width: 520px;
  max-width: 80%;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.license-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.license-reason {
  color: var(--danger);
  margin-bottom: 18px;
}

.license-reason.checking {
  color: var(--accent);
}

.license-update {
  color: var(--text);
  font-size: 13px;
}

.license-update.error {
  color: var(--danger);
}

.license-form {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.license-key {
  height: 34px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  text-align: center;
  letter-spacing: 1px;
}

.license-key:disabled {
  opacity: 0.5;
}

.button.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.license-hwid {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 18px;
  background: var(--bg-control);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: left;
}

.license-hwid-text {
  flex: 1 1 auto;
  min-width: 0;
  margin-right: 12px;
}

.license-hwid .button {
  background: var(--bg-card);
}

.license-hwid .button:hover {
  background: var(--bg-control-hover);
}

.license-hwid-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.license-hwid-value {
  display: block;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  color: var(--text);
  word-break: break-all;
  line-height: 1.5;
}

.license-help {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* #hud — нулевая точка в углу кадра, панели стоят от неё (left / top ставит app.js) */
#hud {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  overflow: visible;
}

.hp {
  position: absolute;
  width: 230px;
}

/* переключатели в панели не нажимаются, поэтому курсор не «рука» */
#hud .hp-switch {
  cursor: default;
}

#hud.editing .hp,
#hud.editing .hp-switch {
  cursor: move;
}

.hp-head,
.hp-row {
  display: flex;
  align-items: center;
}

.hp-title,
.hp-label {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}

.hp-key {
  flex: 0 0 auto;
  margin: 0 8px;
}

.hud-logo {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-right: 7px;
}

.hud-modern .hp {
  padding: 6px 6px 5px;
  background: rgba(20, 20, 27, 0.94);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
}
.hud-modern .hp-head { height: 26px; padding: 0 6px 4px; }
.hud-modern .hp-quick .hp-title { font-size: 14px; font-weight: 600; }
.hud-modern .hp-binds .hp-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent);
}
.hud-modern .hp-head-key { color: var(--text-muted); font-size: 12px; }
.hud-modern .hp-row { height: 26px; padding: 0 6px; border-radius: 7px; }
.hud-modern .hp-row.selected { background: var(--accent-soft); color: #fff; }
.hud-modern .hp-key {
  padding: 0 6px;
  height: 19px;
  line-height: 19px;
  border-radius: 5px;
  background: var(--bg-control);
  color: var(--text-muted);
  font-size: 11px;
}
.hud-modern .hp-quick .hp-key { background: transparent; padding: 0; }
.hud-modern .hp-switch { width: 30px; height: 17px; border-radius: 9px; }
.hud-modern .hp-switch::after { left: 3px; top: 3px; width: 11px; height: 11px; }
.hud-modern .hp-switch.on::after { left: 16px; }
.hud-modern .hp-value {
  padding: 0 7px;
  height: 19px;
  line-height: 19px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-light);
  font-size: 11px;
}
.hud-modern .hp-empty { height: 26px; line-height: 26px; padding: 0 6px; color: var(--text-muted); }

.hud-retro .hp {
  background: rgba(16, 16, 21, 0.85);
  border: 1px solid #000;
  color: #e9e9f2;
  font-family: var(--font);
  font-size: 13px;
}
.hud-retro .hp-head {
  height: 24px;
  padding: 0 8px;
  background: #0a0a0e;
  border-bottom: 1px solid #000;
  color: var(--accent-light);
}
.hud-retro .hud-logo { flex-basis: 14px; width: 14px; height: 14px; margin-right: 6px; }
.hud-retro .hp-head-key { color: #8b8ba1; }
.hud-retro .hp-row { height: 21px; padding: 0 8px; }
.hud-retro .hp-row.selected { background: var(--accent-soft); color: #fff; }
.hud-retro .hp-key { color: #8b8ba1; }
.hud-retro .hp-value { width: 40px; text-align: right; color: #5c5c70; }
.hud-retro .hp-value.on { color: var(--accent-light); }
.hud-retro .hp-empty { height: 21px; line-height: 21px; padding: 0 8px; color: #8b8ba1; }
.hud-retro .hp-binds .hp-head { border-bottom: none; }

.hud-classic .hp {
  padding: 4px 12px 7px;
  background: rgba(0, 0, 0, 0.74);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: bold;
}
.hud-classic .hp-head { height: 32px; }
.hud-classic .hp-quick .hp-title { font-size: 20px; color: var(--accent-light); }
.hud-classic .hp-binds .hp-head { height: 26px; }
.hud-classic .hp-binds .hp-title { font-size: 14px; color: #e1c68c; }
.hud-classic .hp-head-key { color: #8f8f8f; font-weight: normal; }
.hud-classic .hp-row { height: 21px; }
.hud-classic .hp-row.selected .hp-label { color: #e1c68c; }
.hud-classic .hp-row.selected .hp-label::before { content: "> "; }
.hud-classic .hp-key { color: #8f8f8f; font-weight: normal; }
.hud-classic .hp-value { color: #8f8f8f; }
.hud-classic .hp-value.on { color: var(--accent-light); }
.hud-classic .hp-empty { height: 21px; line-height: 21px; color: #8f8f8f; font-weight: normal; }
