:root {
  --bg0: #0b0c10;
  --bg1: #0e1017;
  --card: rgba(255, 255, 255, 0.06);
  --card2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.66);
  --muted2: rgba(255, 255, 255, 0.52);
  --accent: #7c5cff;
  --accent2: #33d6a6;
  --danger: #ff5c7c;
  --panelBg: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.045));
  --tableHeadBg: linear-gradient(180deg, #171a22, #12141a);
  --radius: 18px;
  --radius2: 14px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol";
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: none;
  overflow-x: hidden;
}

.pageSearch {
  height: 100vh;
  overflow: hidden;
  --selBarH: 0px;
  --footerGap: 12px;
  --footerLine: 14px;
  --footerReserve: calc(var(--footerGap) * 2 + var(--footerLine));
  --contentBottomPad: var(--footerReserve);
  --sbSize: 12px;
  --rowH: 58px;
  --thumbH: calc(var(--rowH) - 5px);
  --wSel: 34px;
  --wPhoto: 66px;
  --wName: 320px;
  --wArt: 112px;
  --wBrand: 120px;
  --wSeller: 180px;
  --wLeft: calc(var(--wSel) + var(--wPhoto) + var(--wName) + var(--wArt));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(1200px 700px at 15% 10%, rgba(124, 92, 255, 0.18), transparent 55%),
    radial-gradient(900px 600px at 85% 15%, rgba(51, 214, 166, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  transform: translateZ(0);
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 18px 48px;
  position: relative;
  z-index: 2;
}

.pageSearch .container {
  max-width: none;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 24px calc(var(--selBarH) + var(--contentBottomPad));
}

.pageSearch .selBar {
  padding-left: 24px;
  padding-right: 24px;
}

.pageSearch .selBarInner {
  max-width: none;
  margin: 0;
}

.pageSearch header {
  margin-bottom: 0;
}

.pageSearch .panel {
  margin-bottom: 0;
}

.pageSearch #searchPanel {
  position: relative;
  z-index: 25;
}

.pageLoader {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 0 18px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.pageLoader.hide {
  opacity: 0;
  transform: translateY(6px);
}

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

.spinnerLg {
  width: 22px;
  height: 22px;
  border-width: 3px;
}

.pageAuth .container {
  max-width: 560px;
  min-height: 100vh;
  display: grid;
  align-content: center;
}

.pageProfile .container {
  max-width: 920px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brandLogo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex: 0 0 auto;
}

.headerRight {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.headerRight .a {
  min-width: 104px;
  justify-content: center;
}

.title {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subtitle {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.3;
}

.panel {
  background: var(--panelBg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  backdrop-filter: blur(10px);
  margin-bottom: 14px;
}

.authStack {
  display: grid;
  gap: 14px;
}

.authPanel {
  margin-bottom: 0;
}

.authTitle {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.2px;
  margin-bottom: 4px;
}

.authSub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
  margin-bottom: 12px;
}

form {
  margin: 0;
}

.formStack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: end;
}

.formStack .btnPrimary {
  margin-top: 10px;
}

.formStack .a {
  justify-self: start;
}

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

input,
select,
button {
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding: 0 40px 0 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%2712%27 viewBox=%270 0 24 24%27%3E%3Cpath fill=%27%23ffffff%27 fill-opacity=%270.68%27 d=%27M7 10l5 5 5-5z%27/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 12px;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

input[readonly] {
  opacity: 0.86;
  cursor: default;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text) !important;
  transition: background-color 9999s ease-out 0s;
  -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.06) inset !important;
  box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.06) inset !important;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

input:focus,
select:focus,
button:focus-visible {
  border-color: rgba(124, 92, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
}

button {
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease, border-color 0.12s ease;
}

button:active {
  transform: translateY(1px);
}

button[disabled] {
  cursor: not-allowed;
  filter: grayscale(0.3) brightness(0.9);
}

.btnPrimary {
  border: 1px solid rgba(124, 92, 255, 0.6);
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.95), rgba(124, 92, 255, 0.72));
  font-weight: 800;
  letter-spacing: 0.2px;
  padding: 0 16px;
}

.btnSecondary {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  font-weight: 750;
  padding: 0 16px;
}

.btnPrimary,
.btnSecondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btnSecondary:hover {
  border-color: rgba(124, 92, 255, 0.55);
}

.btnBlock {
  width: 100%;
}

.a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  cursor: pointer;
}

.a:hover {
  border-color: rgba(124, 92, 255, 0.55);
}

.msg {
  display: none;
  margin-bottom: 12px;
  padding: 11px 12px 11px 42px;
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(51, 214, 166, 0.28);
  background: linear-gradient(180deg, rgba(51, 214, 166, 0.12), rgba(255, 255, 255, 0.04));
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  line-height: 1.35;
}

.msg::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(51, 214, 166, 0.9);
  box-shadow: 0 0 0 4px rgba(51, 214, 166, 0.12);
}

.msg.warn {
  border-color: rgba(255, 92, 124, 0.36);
  background: linear-gradient(180deg, rgba(255, 92, 124, 0.14), rgba(255, 255, 255, 0.04));
}

.msg.warn::before {
  background: rgba(255, 92, 124, 0.9);
  box-shadow: 0 0 0 4px rgba(255, 92, 124, 0.12);
}

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.mpPanel {
  position: relative;
  z-index: 20;
}

.mpWrap {
  position: relative;
}

.mpSelect {
  width: 100%;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.mpSelect #mpSelectText {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mpSelect:focus-visible {
  border-color: rgba(124, 92, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
  outline: none;
}

.mpIcon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex: 0 0 auto;
}

.mpChev {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
}

.mpMenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 200;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 17, 25, 0.96);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
}

.mpOpt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
}

.mpOpt:hover {
  background: rgba(255, 255, 255, 0.06);
}

.mpOpt.disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.mpOpt.disabled:hover {
  background: transparent;
}

.mpBadge {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted2);
}

#searchForm {
  display: grid;
  grid-template-columns: minmax(145px, 0.75fr) minmax(280px, 2fr) minmax(150px, 0.62fr) minmax(150px, 0.62fr) auto;
  gap: 10px;
  align-items: end;
}

@media (max-width: 860px) {
  #searchForm {
    grid-template-columns: 1fr 1fr;
  }
  #searchForm button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  #searchForm {
    grid-template-columns: 1fr;
  }
  #searchForm button {
    grid-column: auto;
  }
}

.bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.pill b {
  color: var(--text);
  font-weight: 700;
}

.pill.warn {
  border-color: rgba(255, 92, 124, 0.35);
  background: rgba(255, 92, 124, 0.08);
  color: rgba(255, 255, 255, 0.78);
}

.searchStatusRow {
  display: flex;
  justify-content: center;
}

.resultsPanel {
  padding: 0;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.resultsToolsPanel {
  padding: 0;
}

.resultsToolsInner {
  width: min(760px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.btnTool {
  width: 100%;
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

.pageFooter {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--footerGap);
  z-index: 10;
  height: var(--footerLine);
  line-height: var(--footerLine);
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
  pointer-events: none;
}

.tableSplit {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow: hidden;
  border-radius: calc(var(--radius) - 1px);
}

.tableLeftOuter {
  flex: 0 0 var(--wLeft);
  min-width: var(--wLeft);
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr var(--sbSize);
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.tableLeftWrap {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-width: none;
}

.tableLeftWrap::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.tableLeftSpacer {
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tableRightOuter {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr var(--sbSize);
  grid-template-rows: 1fr var(--sbSize);
  grid-template-areas:
    "viewport vbar"
    "hbar corner";
  overflow: hidden;
}

.tableRightWrap {
  grid-area: viewport;
  min-width: 0;
  min-height: 0;
  overflow: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.tableRightWrap::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.tblSb {
  position: relative;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.tblSbX {
  grid-area: hbar;
  margin: 2px;
  height: calc(var(--sbSize) - 4px);
  align-self: center;
}

.tblSbY {
  grid-area: vbar;
  margin: 2px;
  width: calc(var(--sbSize) - 4px);
  justify-self: center;
}

.tblSbThumb {
  position: absolute;
  inset: 0 auto auto 0;
  width: 40%;
  height: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transform: translate3d(0, 0, 0);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.tblSbThumb:active {
  cursor: grabbing;
}

.tblSbY .tblSbThumb {
  width: 100%;
  height: 40%;
}

.tblSbCorner {
  grid-area: corner;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.skuTable {
  border-collapse: collapse;
}

.skuTableLeft {
  width: 100%;
  table-layout: fixed;
}

.skuTableRight {
  width: max-content;
  min-width: 100%;
}

.skuTable th,
.skuTable td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
}

.skuTable td {
  white-space: nowrap;
}

.skuTable tbody td {
  height: var(--rowH);
}

.skuTableLeft td.colPhoto {
  padding-top: 2px;
  padding-bottom: 2px;
  padding-left: 4px;
  padding-right: 6px;
}

.skuTableLeft td.colPhoto .photoCell {
  justify-content: flex-start;
}

.skuTableLeft thead th.colPhoto {
  padding-left: 4px;
  padding-right: 6px;
}

.skuTable thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  background: var(--tableHeadBg);
  white-space: nowrap;
}

.thSort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: auto;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.thSort:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
  border-radius: 10px;
}

.thSort:hover {
  color: rgba(255, 255, 255, 0.9);
}

.thSort.active {
  color: rgba(255, 255, 255, 0.92);
}

.thSort .arr {
  display: inline-block;
  width: 14px;
  text-align: center;
  margin-left: 6px;
  color: rgba(255, 255, 255, 0.72);
}

.thSort.active .arr {
  color: rgba(255, 255, 255, 0.92);
}

.skuTable thead th.colSel {
  text-align: center;
}

.skuTable tbody tr {
  background: #12141a;
}

.skuTable tbody tr:nth-child(odd) {
  background: #15171d;
}

.skuTable tbody tr:hover {
  background: #1a1c23;
}

.skuTable tbody tr.isHover {
  background: #1a1c23;
}

.skuTable tbody tr.isSelected {
  background: rgba(124, 92, 255, 0.14);
}

.skuTable tbody tr.isSelected.isHover {
  background: rgba(124, 92, 255, 0.2);
}

.skuTable td.num {
  text-align: right;
  white-space: nowrap;
}

.skuTable th.num {
  text-align: right;
}

.skuTable .colSel {
  width: var(--wSel);
  text-align: center;
}

.skuTable th.colSel,
.skuTable td.colSel {
  padding-left: 4px;
  padding-right: 4px;
}

.skuTable .selWrap {
  margin-top: 0;
}

.skuTable .colPhoto {
  width: var(--wPhoto);
}

.skuTable .colName {
  width: var(--wName);
  max-width: var(--wName);
}

.skuTable .colArt {
  width: var(--wArt);
  max-width: var(--wArt);
}

.skuTable .colActions {
  min-width: 110px;
}

.skuTable td.colActions {
  text-align: right;
}

.skuTable .colBrand {
  width: var(--wBrand);
  max-width: var(--wBrand);
}

.skuTable td.colBrand {
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skuTable td.colCategory {
  font-size: 13.5px;
}

.skuTable .colSeller {
  width: var(--wSeller);
  max-width: var(--wSeller);
}

.skuTable td.colSeller {
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hideColCategory .skuTableRight th.colCategory,
.hideColCategory .skuTableRight td.colCategory {
  display: none;
}

.hideColSeller .skuTableRight th.colSeller,
.hideColSeller .skuTableRight td.colSeller {
  display: none;
}

.hideColRating .skuTableRight th.colRating,
.hideColRating .skuTableRight td.colRating {
  display: none;
}

.hideColReviews .skuTableRight th.colReviews,
.hideColReviews .skuTableRight td.colReviews {
  display: none;
}

.hideColBasePrice .skuTableRight th.colBasePrice,
.hideColBasePrice .skuTableRight td.colBasePrice {
  display: none;
}

.hideColDiscount .skuTableRight th.colDiscount,
.hideColDiscount .skuTableRight td.colDiscount {
  display: none;
}

.photoCell {
  width: 100%;
  height: var(--thumbH);
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumbBtn {
  height: var(--thumbH);
  aspect-ratio: 516 / 688;
  width: auto;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
}

.thumbBtn:focus-visible {
  outline: none;
}

.thumbBtn:focus-visible .imgbox {
  border-color: rgba(124, 92, 255, 0.65);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
}

.thumbCell {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  border-color: rgba(255, 255, 255, 0.14);
}

.skuTitle {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.15px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.tblActions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

.tblBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.12s ease;
}

.tblBtn:hover {
  border-color: rgba(124, 92, 255, 0.55);
}

.tblBtn:active {
  transform: translateY(1px);
}

.tblBtn.ok {
  border-color: rgba(51, 214, 166, 0.55);
}

.selWrap {
  display: inline-flex;
  position: relative;
  cursor: pointer;
  user-select: none;
  flex: 0 0 auto;
  margin-top: 2px;
}

.selInp {
  position: absolute;
  inset: 0;
  width: 22px;
  height: 22px;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.selBox {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
  transition: transform 0.08s ease, border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.selWrap:hover .selBox {
  border-color: rgba(124, 92, 255, 0.55);
}

.selBox::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid rgba(255, 255, 255, 0.92);
  border-bottom: 2px solid rgba(255, 255, 255, 0.92);
  transform: rotate(-45deg);
  margin-top: -1px;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.selInp:focus-visible + .selBox {
  border-color: rgba(124, 92, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
}

.selInp:checked + .selBox {
  border-color: rgba(124, 92, 255, 0.85);
  background: rgba(124, 92, 255, 0.28);
}

.selInp:checked + .selBox::after {
  opacity: 1;
}

.imgFill {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.imgbox {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.imgbox::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.09) 35%, rgba(255, 255, 255, 0.03) 70%);
  background-size: 250% 100%;
  animation: shimmer 1.1s ease-in-out infinite;
}

.imgbox.loaded::before {
  opacity: 0;
  animation: none;
}

.imgbox.error::before {
  opacity: 0.35;
  animation: none;
}

.imgbox.error::after {
  content: "нет изображения";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted2);
  font-size: 12px;
  letter-spacing: 0.2px;
}

@keyframes shimmer {
  0% {
    background-position: 0% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.cfgModal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 22px 18px;
}

.cfgModalOverlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(6px);
}

.cfgModalBox {
  position: relative;
  z-index: 1;
  width: min(620px, 92vw);
  max-height: min(82vh, 760px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 17, 25, 0.97);
  box-shadow: 0 22px 68px rgba(0, 0, 0, 0.72);
}

.cfgModalHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cfgModalTitle {
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0.15px;
  color: rgba(255, 255, 255, 0.92);
}

.cfgModalClose {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.cfgModalClose:hover {
  border-color: rgba(124, 92, 255, 0.55);
}

.cfgModalBody {
  padding: 12px 14px 14px;
  overflow: auto;
}

.cfgGroup + .cfgGroup {
  margin-top: 14px;
}

.cfgGroupTitle {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 8px;
}

.cfgList {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cfgItem.selWrap {
  width: 100%;
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.cfgItem.selWrap:hover {
  border-color: rgba(124, 92, 255, 0.45);
}

.cfgItem.isLocked {
  opacity: 0.7;
  cursor: default;
}

.cfgItem.isLocked:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.cfgItemText {
  min-width: 0;
  font-size: 12px;
  font-weight: 750;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cfgModalFooter {
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.cfgModalFooter .btnTool {
  width: auto;
  min-width: 140px;
}

.imgModal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 22px 18px;
}

.imgModalOverlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(6px);
}

.imgModalBox {
  position: relative;
  z-index: 1;
  width: max-content;
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 17, 25, 0.97);
  box-shadow: 0 22px 68px rgba(0, 0, 0, 0.72);
  padding: 16px;
}

.imgModalHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.imgModalTitle {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  overflow: hidden;
}

.imgModalTitleName {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0.15px;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.imgModalTitleArt {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 750;
  color: var(--muted);
  font-family: var(--mono);
  white-space: nowrap;
}

.imgModalClose {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.imgModalClose:hover {
  border-color: rgba(124, 92, 255, 0.55);
}

.imgModalGrid {
  --heroH: min(76vh, 688px, 133vw);
  --thumbW: 84px;
  display: grid;
  grid-template-columns: auto var(--thumbW);
  gap: 12px;
  align-items: start;
}

.imgModalHero {
  height: var(--heroH);
  aspect-ratio: 516 / 688;
  justify-self: center;
  border-radius: var(--radius2);
}

.imgModalThumbs {
  max-height: var(--heroH);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.imgModalHero .imgFill,
.imgModalThumbBox .imgFill {
  object-fit: contain;
}

.imgModalThumb {
  height: auto;
  width: 100%;
  display: block;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.imgModalThumbBox {
  width: var(--thumbW);
  aspect-ratio: 516 / 688;
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.14);
}

.imgModalThumb.active .imgbox {
  border-color: rgba(124, 92, 255, 0.75);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
}

.aiModal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px 18px;
}

.aiModalOverlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(6px);
}

.aiModalBox {
  position: relative;
  z-index: 1;
  width: min(760px, 92vw);
  max-height: min(86vh, 820px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 17, 25, 0.97);
  box-shadow: 0 22px 68px rgba(0, 0, 0, 0.72);
}

.aiModalHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.aiModalTitle {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.aiModalTitleText {
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0.15px;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aiModalMeta {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 750;
  color: var(--muted);
  font-family: var(--mono);
  white-space: nowrap;
}

.aiModalClose {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.aiModalClose:hover {
  border-color: rgba(124, 92, 255, 0.55);
}

.aiModalBody {
  padding: 12px 14px 14px;
  overflow: auto;
}

.aiView {
  display: grid;
  gap: 10px;
}

.aiHelp {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

.aiTextarea {
  min-height: 140px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
  font-family: var(--sans);
  line-height: 1.35;
}

.aiTextarea:focus {
  border-color: rgba(124, 92, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
}

.aiChips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -2px;
}

.aiChip {
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.1px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.aiChip:hover {
  border-color: rgba(124, 92, 255, 0.5);
  background: rgba(124, 92, 255, 0.16);
}

.aiChip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
}

.aiActions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.aiActions .btnTool {
  width: 100%;
}

.aiActionsRow {
  grid-template-columns: 1fr 1fr;
}

.aiLoadingBox {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 22px 0 10px;
}

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

.aiResultBox {
  --aiHeroH: min(66vh, 688px, 133vw);
  height: var(--aiHeroH);
  aspect-ratio: 516 / 688;
  border-radius: var(--radius2);
  justify-self: center;
}

.aiResultBox .imgFill {
  object-fit: contain;
}

body.modalOpen {
  overflow: hidden;
}

@media (max-width: 720px) {
  .imgModalGrid {
    --heroH: min(62vh, 640px, 133vw);
    --thumbW: 68px;
    grid-template-columns: 1fr;
  }
  .imgModalThumbs {
    max-height: none;
    overflow-y: hidden;
    overflow-x: auto;
    flex-direction: row;
  }
}

.selBar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 6px 14px calc(12px + env(safe-area-inset-bottom));
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms ease, opacity 220ms ease;
}

.selBar.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.selBarInner {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 17, 25, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
}

.selBarLeft {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.selBarCount {
  font-size: 13px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .selBarInner {
    flex-direction: column;
    align-items: stretch;
  }
  .selBarLeft {
    justify-content: space-between;
  }
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
}

.strike {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(255, 255, 255, 0.35);
}

.empty {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  color: var(--muted);
}

.pageSearch .empty {
  margin-top: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: rgba(255, 255, 255, 0.85);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
