:root {
  color-scheme: light;
  --bg: #f3f6fa;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --text: #06152d;
  --muted: #607092;
  --line: #d9e3f0;
  --line-soft: #e9eef6;
  --blue: #1f66ff;
  --blue-soft: #eef5ff;
  --green: #09a66d;
  --green-soft: #e9f8f1;
  --red: #f04438;
  --red-soft: #fff0ef;
  --orange: #f79009;
  --focus: #0b4fd4;
  --shadow: 0 18px 45px rgba(28, 45, 74, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.login-page {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  background: #f4f7fb;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  border: 1px solid #dfe6ef;
  border-radius: 16px;
  background: #ffffff;
  padding: 28px;
  box-shadow: 0 18px 46px rgba(24, 33, 47, 0.1);
}

.login-card h1 {
  margin: 0;
  color: #101827;
  font-size: 28px;
  line-height: 1.15;
}

.login-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #66758d;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-eyebrow img {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  box-shadow: 0 2px 7px rgba(24, 33, 47, 0.14);
}

.login-card label {
  display: grid;
  gap: 7px;
  color: #52627a;
  font-size: 13px;
  font-weight: 500;
}

.login-card input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d5deec;
  border-radius: 10px;
  background: #ffffff;
  color: #101827;
  padding: 0 12px;
  font-family: inherit;
  font-size: 16px;
  outline: none;
}

.login-card input:focus {
  border-color: #b8cdf8;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.1);
}

.login-card input[aria-invalid="true"] {
  border-color: #f3a7a2;
}

.login-card p {
  margin: 0;
  border: 1px solid rgba(240, 68, 56, 0.18);
  border-radius: 9px;
  background: rgba(240, 68, 56, 0.08);
  color: #b42318;
  padding: 9px 10px;
  font-size: 13px;
}

.login-card button {
  min-height: 44px;
  border: 1px solid #1f5fea;
  border-radius: 10px;
  background: #1f5fea;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  box-shadow: none;
}

.login-card button:not(:disabled):hover,
.login-card button:not(:disabled):focus-visible {
  border-color: #1557df;
  background: #1557df;
  outline: none;
}

.login-card button:disabled {
  border-color: #6f98ee;
  background: #6f98ee;
  color: #ffffff;
  cursor: default;
}

.session-chip {
  display: grid;
  grid-template-rows: 26px 1px 25px;
  align-content: center;
  gap: 0;
  min-width: 190px;
  flex: 0 1 190px;
  max-width: 230px;
  min-height: 68px;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  border-color: #cfd8e6;
  background: #ffffff;
  color: #344054;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(6, 21, 45, 0.03);
}

.session-login,
.session-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  line-height: 1;
}

.session-login {
  color: #07111f;
  font-size: 14px;
  font-weight: 600;
}

.session-logout {
  width: 100%;
  min-height: 25px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #52627a;
  padding: 0;
  font-size: 13px;
  font-weight: 400;
  box-shadow: none;
  transition: background 160ms ease, color 160ms ease;
}

.session-divider {
  height: 1px;
  margin: 0 10px;
  background: #edf1f6;
}

.session-logout:hover,
.session-logout:focus-visible {
  background: #f8fbff;
  color: #155eef;
  outline: none;
}

.shell {
  width: min(1780px, 100%);
  margin: 0 auto;
  padding: 24px 32px 36px;
}

.appHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 14px;
}

.brand {
  min-width: 0;
}

.brandLogo {
  display: block;
  width: 41px;
  height: 41px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 2px 7px rgba(24, 33, 47, 0.16);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #586780;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 6px;
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
}

p,
label,
td,
th,
.logMeta,
.chip {
  font-size: 14px;
}

p,
label,
.logMeta {
  color: var(--muted);
}

.actions,
.chips,
.switchRow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

button,
input,
select,
textarea {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

button {
  cursor: pointer;
  padding: 0 14px;
  color: #2d4165;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(6, 21, 45, 0.03);
}

button:hover {
  border-color: #b8c8dd;
  background: var(--panel-soft);
}

button.primary {
  border-color: #7da2ff;
  background: var(--blue-soft);
  color: #0757ff;
}

.searchAdBtn {
  font-weight: 400;
}

.auth-loading-page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background: #f4f7fb;
  color: #66758d;
  font-size: 13px;
  font-weight: 600;
}

.auth-loading-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid #d9e5f7;
  border-top-color: #2f6bff;
  border-radius: 50%;
  animation: auth-loading-spin 700ms linear infinite;
}

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

/* Bybit-style ad editor */
.ad-edit-backdrop:has(.bybit-editor) {
  padding: 18px;
  background: rgba(23, 27, 33, 0.58);
}

.ad-edit-dialog.bybit-editor {
  width: min(840px, 100%);
  max-height: calc(100vh - 36px);
  border: 0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 20px 64px rgba(22, 28, 36, 0.2);
  color: #111820;
}

.bybit-editor .bybit-editor-header {
  min-height: 76px;
  padding: 18px 28px;
  border-bottom: 1px solid #e5e8ec;
  background: #fff;
}

.bybit-editor .bybit-editor-header h2 {
  margin: 0 0 7px;
  color: #15191f;
  font-size: 20px;
  font-weight: 600;
}

.bybit-editor .bybit-editor-header .ad-edit-meta {
  display: flex;
  gap: 14px;
  color: #7e8794;
  font-size: 12px;
}

.bybit-editor .bybit-editor-header .ad-edit-meta strong {
  color: #525b68;
  font-weight: 500;
}

.bybit-editor .ad-edit-close,
.bybit-submodal-card > header button {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #8d949e;
  font-size: 26px;
  font-weight: 300;
  cursor: pointer;
}

.bybit-editor .bybit-editor-content {
  display: block;
  padding: 0 28px;
  overflow: auto;
  background: #fff;
}

.bybit-editor .bybit-editor-content[hidden] {
  display: none;
}

.bybit-editor .bybit-editor-content > .ad-edit-warning {
  margin: 18px 0 0;
  border-color: #ffd592;
  background: #fff6e5;
  color: #8b5a13;
}

.bybit-form-row {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 18px;
  padding: 28px 0 24px;
  border-bottom: 1px solid #e4e7eb;
}

.bybit-form-row:last-child {
  border-bottom: 0;
}

.bybit-form-row > h3 {
  margin: 4px 0 0;
  color: #080c11;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.bybit-form-body {
  min-width: 0;
}

.bybit-price-types {
  display: flex;
  align-items: center;
  gap: 22px;
}

.bybit-price-types label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #10151b;
  font-size: 14px;
  cursor: pointer;
}

.ad-edit-dialog.bybit-editor .bybit-price-types input[type="radio"] {
  appearance: none;
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  border: 1px solid #939ba5;
  border-radius: 50%;
  background: #fff;
}

.ad-edit-dialog.bybit-editor .bybit-price-types input[type="radio"]:checked {
  border: 5px solid #ff9f2d;
}

.bybit-help {
  margin: 8px 0 18px;
  color: #8c95a3;
  font-size: 13px;
}

.bybit-field {
  display: block;
  margin: 0 0 16px;
  color: #111820;
  font-size: 13px;
}

.bybit-field > span:first-child {
  display: block;
  margin-bottom: 7px;
}

.bybit-input,
.bybit-editor .bybit-field select {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #f3f4f6;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.bybit-editor .bybit-field select {
  padding: 0 36px 0 12px;
  color: #111820;
  font-size: 13px;
}

.bybit-editor .bybit-input input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #080c11;
  font-size: 13px;
  font-weight: 500;
}

.bybit-input:focus-within,
.bybit-editor .bybit-field select:focus {
  border-color: #ff9f2d;
  background: #fff;
  outline: 0;
}

.bybit-input b {
  padding: 0 12px;
  color: #080c11;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.bybit-field > small {
  display: block;
  margin-top: 6px;
  color: #a0a7b2;
  font-size: 12px;
}

.bybit-price-card {
  margin-top: 10px;
  padding: 11px 12px;
  border-radius: 4px;
  background: #fff3dc;
  color: #747d89;
  font-size: 12px;
}

.bybit-price-card p {
  margin: 0 0 8px;
}

.bybit-price-card p:first-child {
  color: #ff9824;
}

.bybit-price-card p:last-child {
  margin: 0;
  color: #262c33;
}

.bybit-price-card strong {
  color: #0a0f14;
  font-weight: 600;
}

.bybit-price-card p:last-child strong {
  margin-left: 7px;
  color: #078b3e;
}

.bybit-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid #929aa5;
  border-radius: 50%;
  color: #7f8894;
  font-size: 9px;
  line-height: 1;
}

.bybit-two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bybit-compact-row {
  min-height: 86px;
}

.bybit-inline-action {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bybit-text-button {
  padding: 0;
  border: 0;
  background: none;
  color: #ff8f13;
  font-size: 16px;
  cursor: pointer;
}

.bybit-text-button span {
  margin-right: 6px;
  font-size: 21px;
  font-weight: 300;
}

.bybit-selection-summary {
  color: #8d96a3;
  font-size: 12px;
}

.ad-edit-dialog.bybit-editor textarea[name="remark"] {
  width: 100%;
  min-height: 114px;
  padding: 16px;
  border: 1px solid transparent;
  border-radius: 5px;
  outline: 0;
  resize: vertical;
  background: #f3f4f6;
  color: #111820;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.ad-edit-dialog.bybit-editor textarea[name="remark"]:focus {
  border-color: #ff9f2d;
  background: #fff;
}

.bybit-counter {
  margin: 7px 0 8px;
  text-align: right;
  color: #828b98;
  font-size: 12px;
}

.bybit-muted-copy {
  margin: 0;
  color: #a5adba;
  font-size: 12px;
  line-height: 1.65;
}

.bybit-payment-help {
  margin: 0 0 14px;
  color: #161c23;
  font-size: 13px;
  line-height: 1.55;
}

.bybit-payment-help .bybit-info {
  margin-right: 6px;
}

.bybit-payment-cards {
  display: grid;
  gap: 9px;
  margin-bottom: 10px;
}

.bybit-payment-card {
  overflow: hidden;
  border: 1px solid #e7e9ec;
  border-radius: 8px;
  background: #fff;
}

.bybit-payment-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 10px;
  background: #f3f4f6;
}

.bybit-payment-card header strong {
  position: relative;
  padding-left: 8px;
  color: #111820;
  font-size: 13px;
}

.bybit-payment-card header strong::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  bottom: 1px;
  width: 2px;
  background: #ff9f2d;
}

.bybit-payment-card header button {
  border: 0;
  background: none;
  color: #ff8f13;
  font-size: 12px;
  cursor: pointer;
}

.bybit-payment-card p {
  margin: 0;
  padding: 14px 16px;
  color: #858e9a;
  font-size: 12px;
}

.bybit-outline-button {
  min-height: 42px;
  padding: 0 22px;
  border: 1px solid #d7dbe1;
  border-radius: 22px;
  background: #fff;
  color: #080c11;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.bybit-outline-button span {
  margin-right: 6px;
  font-size: 20px;
  font-weight: 300;
}

.bybit-editor .bybit-editor-footer {
  min-height: 70px;
  padding: 12px 28px;
  border-top: 1px solid #e5e8ec;
  background: #fff;
}

.bybit-editor .bybit-editor-footer > div:last-child {
  display: flex;
  gap: 10px;
}

.bybit-editor .bybit-editor-footer .secondary-button,
.bybit-primary-button {
  min-width: 118px;
  height: 42px;
  padding: 0 22px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.bybit-editor .bybit-editor-footer .secondary-button {
  border: 1px solid #d9dde2;
  background: #fff;
  color: #262c33;
}

.bybit-primary-button {
  border: 0;
  background: #ff9f2d;
  color: #111820;
}

.bybit-primary-button:hover,
.bybit-primary-button:focus-visible {
  background: #ffad48;
}

.bybit-primary-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.login-step {
  display: grid;
  gap: 14px;
}

.login-card .login-help {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #66758d;
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
}

.mfa-qr {
  display: grid;
  place-items: center;
  width: fit-content;
  margin: 0 auto;
  border: 1px solid #d9e3f0;
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
}

.mfa-qr img {
  display: block;
  width: 168px;
  height: 168px;
}

.mfa-secret {
  display: block;
  overflow-wrap: anywhere;
  border-radius: 8px;
  background: #f4f7fb;
  color: #344054;
  padding: 9px 10px;
  text-align: center;
  letter-spacing: 0.04em;
  font-size: 12px;
}

.recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid #d9e3f0;
  border-radius: 10px;
  background: #f8fbff;
  padding: 12px;
}

.recovery-codes code {
  color: #233b62;
  font-size: 12px;
}

.login-card .login-back,
.login-card .login-back:not(:disabled) {
  min-height: auto;
  border: 0;
  background: transparent;
  color: #52627a;
  padding: 3px;
  font-size: 13px;
  font-weight: 400;
}

.login-card .login-back:hover:not(:disabled),
.login-card .login-back:focus-visible:not(:disabled) {
  border: 0;
  background: transparent;
  color: #1557df;
}

.bybit-submodal[hidden] {
  display: none;
}

.bybit-submodal {
  position: fixed;
  z-index: 1002;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 29, 35, 0.48);
}

.bybit-submodal-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 26px 30px 22px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(20, 25, 31, 0.24);
}

.bybit-submodal-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.bybit-submodal-card > header h3 {
  margin: 0;
  color: #171c22;
  font-size: 19px;
  font-weight: 600;
}

.bybit-submodal-card > p {
  margin: 0 0 22px;
  color: #343b44;
  font-size: 13px;
  line-height: 1.65;
}

.bybit-requirement-list {
  display: grid;
  gap: 2px;
}

.bybit-check-row {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr) 120px auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  color: #2a3038;
  font-size: 13px;
}

.ad-edit-dialog.bybit-editor .bybit-check-row > input[type="checkbox"],
.ad-edit-dialog.bybit-editor .bybit-payment-option > input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  border: 1px solid #929ba6;
  border-radius: 2px;
  background: #fff;
}

.ad-edit-dialog.bybit-editor .bybit-check-row > input[type="checkbox"]:checked,
.ad-edit-dialog.bybit-editor .bybit-payment-option > input[type="checkbox"]:checked {
  border-color: #ff9f2d;
  background: #ff9f2d;
  box-shadow: inset 0 0 0 3px #fff;
}

.bybit-check-row > input:not([type="checkbox"]) {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  outline: 0;
  background: #f3f4f6;
  color: #111820;
}

.bybit-check-row > input:not([type="checkbox"]):focus {
  box-shadow: 0 0 0 1px #ff9f2d;
  background: #fff;
}

.bybit-check-row > input:disabled {
  color: #c5cad1;
  cursor: not-allowed;
}

.bybit-check-only {
  grid-template-columns: 17px minmax(0, 1fr);
}

.bybit-country-row {
  grid-template-columns: 17px minmax(0, 1fr);
}

.bybit-country-row > input:last-child {
  grid-column: 2;
}

.bybit-confirm-button {
  width: 100%;
  min-height: 46px;
  margin-top: 16px;
  border-radius: 24px;
}

.bybit-kyc-note {
  display: block;
  margin-top: 12px;
  color: #9ba3af;
  font-size: 11px;
  line-height: 1.55;
}

.bybit-payment-picker {
  display: grid;
  gap: 8px;
}

.bybit-payment-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #e4e7eb;
  border-radius: 6px;
  cursor: pointer;
}

.bybit-payment-option:has(input:checked) {
  border-color: #ffb053;
  background: #fff8ec;
}

.bybit-payment-option span {
  display: grid;
  gap: 3px;
}

.bybit-payment-option strong {
  color: #111820;
  font-size: 13px;
}

.bybit-payment-option small {
  color: #8e97a3;
  font-size: 11px;
}

@media (max-width: 680px) {
  .ad-edit-backdrop {
    padding: 0;
  }

  .ad-edit-dialog.bybit-editor {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .bybit-editor .bybit-editor-header,
  .bybit-editor .bybit-editor-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .bybit-editor .bybit-editor-content {
    padding: 0 18px;
  }

  .bybit-form-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .bybit-form-row > h3 br {
    display: none;
  }

  .bybit-two-columns {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .bybit-submodal-card {
    padding: 22px 18px;
  }

  .bybit-check-row {
    grid-template-columns: 17px minmax(0, 1fr) 94px auto;
  }
}

.searchAdBtn:disabled {
  border-color: #d8e0eb;
  background: #f6f8fb;
  color: #9aa8ba;
  cursor: default;
  opacity: 1;
}

input,
select,
textarea {
  width: 100%;
  padding: 7px 10px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #7da2ff;
  box-shadow: 0 0 0 3px rgba(31, 102, 255, 0.1);
}

textarea {
  resize: vertical;
  min-height: 88px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.sectionTitle,
.panelHead {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pulse {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px var(--green-soft);
}

.headerStatus.api-missing .pulse {
  animation: apiPulseWarning 1.15s ease-in-out infinite;
  background: #f59e0b;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.14);
}

.headerStatus.api-error .pulse,
.headerStatus.api-guard .pulse {
  background: #f04438;
  box-shadow: 0 0 0 5px rgba(240, 68, 56, 0.12);
}

@keyframes apiPulseWarning {
  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.24);
    transform: scale(1.08);
  }
}

.headerRight {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 820px;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
  margin-left: auto;
}

.headerStatus {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 360px;
  width: auto;
  min-width: 320px;
  max-width: 512px;
  min-height: 68px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.headerStatus > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  flex: 1 1 auto;
  column-gap: 12px;
  row-gap: 2px;
  min-width: 0;
}

.headerStatus strong {
  display: block;
  flex: 0 0 100%;
  font-size: 14px;
  line-height: 1.15;
}

.headerStatus p {
  flex: 0 0 auto;
  overflow: hidden;
  margin: 0;
  max-width: 100%;
  color: #66758d;
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.headerStatus .cycleLine,
.headerStatus .apiLoadLine,
.headerStatus .connectionLine {
  color: #50627d;
  font-size: 12px;
}

.headerStatus .apiLoadLine {
  order: 2;
}

.headerStatus .cycleLine {
  order: 3;
}

.headerStatus .connectionLine {
  order: 4;
}

.headerStatus .connectionLine[data-state="online"] {
  color: #067647;
}

.headerStatus .connectionLine[data-state="offline"],
.headerStatus .connectionLine[data-state="degraded"] {
  color: #b42318;
}

.headerStatus .cycleLine.has-tooltip {
  position: relative;
  overflow: visible;
  max-width: max-content;
  cursor: help;
}

.headerStatus .cycleLine.has-tooltip .cycleText {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.headerStatus .cycleLine.has-tooltip:hover .cycleText,
.headerStatus .cycleLine.has-tooltip:focus-visible .cycleText,
.headerStatus .cycleLine.has-tooltip:focus-within .cycleText {
  text-decoration-color: #50627d;
}

.headerStatus .cycleLine.has-tooltip::before {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 59;
  width: 340px;
  max-width: calc(100vw - 40px);
  height: 8px;
  content: "";
}

.headerStatus .cycleTooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: max-content;
  min-width: 260px;
  max-width: min(380px, calc(100vw - 40px));
  padding: 10px 12px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
  color: #10213f;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  white-space: pre-line;
  transform: translateY(-2px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.headerStatus .cycleLine.has-tooltip:hover .cycleTooltip,
.headerStatus .cycleLine.has-tooltip:focus-within .cycleTooltip,
.headerStatus .cycleLine.has-tooltip.tooltip-open .cycleTooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.headerStatus .cycleLine.has-tooltip.tooltip-dismissed .cycleTooltip {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
}

.api-reset-error-btn {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid #f7b4ad;
  border-radius: 7px;
  background: #fff1f0;
  color: #d92d20;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.1;
}

.api-reset-error-btn:hover:not(:disabled) {
  border-color: #f04438;
  background: #ffe3e0;
}

.api-reset-error-btn:disabled {
  cursor: default;
  opacity: 0.65;
}

.api-reset-error-btn[hidden] {
  display: none;
}

.accountStatus {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  flex: 0 1 190px;
  align-content: center;
  align-items: center;
  gap: 8px;
  min-width: 190px;
  max-width: 230px;
  min-height: 68px;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.accountStatus[hidden] {
  display: none;
}

.accountLabel,
.accountUid {
  overflow: hidden;
  color: #66758d;
  font-size: 12px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accountSummary {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.accountMerchant {
  max-width: 100%;
}

.accountMerchant .merchant-link,
.accountMerchant strong {
  flex: 0 1 auto;
  min-width: 0;
}

.accountMerchant .auth-badge {
  flex: 0 0 16px;
}

.account-settings-menu {
  justify-self: end;
}

.account-settings-button {
  display: grid;
  place-items: center;
  width: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #66758d;
  padding: 0;
  box-shadow: none;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease;
}

.account-settings-button svg {
  width: 17px;
  height: 17px;
  transform-origin: center;
  transition: transform 180ms ease;
}

.account-settings-button:hover,
.account-settings-button:focus-visible,
.account-settings-button.active {
  transform: translateY(-1px) scale(1.04);
  background: #eef6ff;
  color: #155eef;
  outline: none;
}

.account-settings-button:hover svg,
.account-settings-button:focus-visible svg,
.account-settings-button.active svg {
  transform: rotate(42deg);
}

.account-settings-button:active {
  transform: translateY(0) scale(0.98);
}

.account-settings-popover {
  display: grid;
  gap: 10px;
  width: min(320px, calc(100vw - 32px));
}

.account-settings-popover[hidden] {
  display: none;
}

.account-connect-button,
.account-unlink-button {
  width: 100%;
  min-height: 34px;
  font-size: 14px;
  font-weight: 400;
}

.account-settings-popover input {
  font-size: 13px;
  font-weight: 400;
}

.account-connect-button {
  border-color: #9dbcf7;
  background: #eaf1ff;
  color: #155eef;
}

.account-settings-popover input:disabled,
.account-connect-button:disabled {
  border-color: #d8e0eb;
  background: #f3f6fa;
  color: #9aa8ba;
  cursor: default;
}

.account-settings-popover input:disabled::placeholder {
  color: #9aa8ba;
}

.account-unlink-button {
  border-color: #f7b5af;
  background: #fff0ef;
  color: #b42318;
}

.account-unlink-button:disabled {
  border-color: #d8e0eb;
  background: #f6f8fb;
  color: #9aa8ba;
  cursor: default;
}

.iconBox {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 0;
  background: transparent;
  color: #111827;
  font-weight: 900;
  box-shadow: none;
}

.panel {
  padding: 18px;
}

.settingsPanel {
  margin-bottom: 14px;
}

.sectionTitle {
  margin-bottom: 14px;
}

.settingsTop,
.miniPanelHead {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settingsTop {
  justify-content: space-between;
  margin-bottom: 14px;
}

.settingsTop .sectionTitle {
  margin-bottom: 0;
}

.settingsActions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.sectionTitle.compact {
  margin-top: 2px;
}

.sectionTitle h2,
.panelHead h2 {
  font-size: 20px;
}

.sectionDivider {
  height: 1px;
  margin: 8px 0 16px;
  background: var(--line-soft);
}

.formGrid {
  display: grid;
  gap: 10px;
}

.adSearchField {
  min-width: 0;
  width: 300px;
}

.ownAdBlock {
  container-type: inline-size;
  width: 100%;
  max-width: none;
  margin-top: 14px;
  overflow: visible;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: #ffffff;
}

.miniPanelHead {
  justify-content: space-between;
  min-height: 54px;
  padding: 10px 14px;
  border-bottom: 1px solid #e7edf5;
}

.terminalIcon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
}

.terminalIcon svg,
.terminalIcon img {
  width: 32px;
  height: 32px;
  opacity: 0.74;
}

.terminalIcon img {
  display: block;
}

.miniPanelHead h3 {
  font-size: 17px;
  font-weight: 600;
}

.miniPanelHead p {
  margin-top: 3px;
  font-size: 13px;
}

.own-ad-tabs {
  display: flex;
  align-items: stretch;
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid #e7edf5;
  background: #ffffff;
}

.own-ad-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: #66758d;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.own-ad-tab::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: -1px;
  left: 14px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: #155eef;
  opacity: 0;
  transform: scaleX(0.7);
  transition: opacity 160ms ease, transform 160ms ease;
}

.own-ad-tab:hover,
.own-ad-tab.active {
  color: #1d2939;
}

.own-ad-tab.active::after {
  opacity: 1;
  transform: scaleX(1);
}

.own-ad-tab span {
  color: #98a2b3;
  font-size: 11px;
  font-weight: 600;
}

.own-ads-bot-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-left: auto;
  padding: 0 10px;
  color: #66758d;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 160ms ease;
}

.own-ads-bot-filter:hover {
  color: #155eef;
}

.own-ads-bot-filter input {
  width: 15px;
  height: 15px;
  min-height: 0;
  margin: 0;
  accent-color: #155eef;
  cursor: pointer;
}

.own-ad-list {
  display: grid;
  gap: 10px;
  padding: 10px;
  background: #f8fbff;
  overflow: visible;
}

.own-ads-pagination {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: flex-end;
  padding: 0 32px;
  border-top: 1px solid #e7edf5;
  background: #f8fbff;
}

.own-ads-pagination[hidden] {
  display: none;
}

.own-ads-page-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.own-ads-page-controls button {
  display: grid;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #f5f7fa;
  color: #121214;
  font-size: 14px;
  font-weight: 400;
  line-height: 32px;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.own-ads-page-controls button:first-child,
.own-ads-page-controls button:last-child {
  font-size: 16px;
}

.own-ads-page-controls button:hover,
.own-ads-page-controls button:focus-visible {
  border-color: #b9ceff;
  background: #eef6ff;
  color: #155eef;
}

.own-ads-page-controls button.active {
  background: #155eef;
  color: #fff;
  font-weight: 600;
}

.own-ads-page-controls button:active:not(:disabled) {
  transform: scale(0.96);
}

.own-ads-page-controls button:disabled {
  background: #f5f7fa;
  color: #adb1b8;
  cursor: not-allowed;
}

.own-ads-page-ellipsis {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #81858c;
  font-size: 8px;
  letter-spacing: 2px;
  line-height: 32px;
}

@media (max-width: 520px) {
  .own-ads-pagination {
    min-height: 64px;
    padding: 0 12px;
  }

  .own-ads-page-controls {
    width: 100%;
    justify-content: center;
  }
}

.own-ad-card {
  position: relative;
  overflow: visible;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: #ffffff;
}

.own-ad-card.is-listing-updating {
  overflow: hidden;
  min-height: 112px;
}

.own-ad-card.is-listing-updating .own-ad-id-chip {
  z-index: 22;
}

.own-ad-listing-progress {
  position: absolute;
  z-index: 90;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  border-radius: inherit;
  background: rgba(248, 251, 255, 0.9);
  backdrop-filter: blur(1.5px);
  color: #155eef;
  animation: own-ad-listing-progress-in 180ms ease-out;
}

.own-ad-listing-progress strong {
  font-size: 13px;
  font-weight: 600;
}

.own-ad-listing-spinner {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 2px solid rgba(21, 94, 239, 0.18);
  border-top-color: #155eef;
  border-right-color: #7da2ff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(21, 94, 239, 0.04);
  animation: own-ad-listing-spin 620ms linear infinite !important;
  animation-iteration-count: infinite !important;
}

@keyframes own-ad-listing-progress-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes own-ad-listing-spin {
  to { transform: rotate(360deg); }
}

.own-ad-card.own-ad-card-search-match {
  border-color: #155eef;
  box-shadow: 0 0 0 1px rgba(21, 94, 239, 0.22);
  animation: own-ad-search-pulse 800ms ease-out 2;
}

@keyframes own-ad-search-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(21, 94, 239, 0.22); }
  50% { box-shadow: 0 0 0 2px rgba(21, 94, 239, 0.34); }
}

.own-ad-id-chip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  max-width: 245px;
  overflow: hidden;
  padding: 7px 28px 7px 14px;
  border-radius: 8px 0 22px 0;
  background: linear-gradient(135deg, #f7f9fc 0%, #eef2f7 100%);
  color: #66758d;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  box-shadow: inset -1px -1px 0 rgba(255, 255, 255, 0.74);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.own-ad-id-chip::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 18px;
  border-radius: 0 0 0 18px;
  background: rgba(255, 255, 255, 0.68);
  opacity: 0.72;
}

.own-ad-card-deleted {
  border-color: #d9e1ec;
  background: #f3f6fa;
}

.own-ad-card-deleted .own-ad-row > * {
  opacity: 0.68;
}

.own-ad-card-deleted .card-filter-button,
.own-ad-card-deleted .bot-toggle {
  cursor: default;
}

.own-ad-card-deleted .listing-action-button:not(:disabled) {
  cursor: pointer;
  opacity: 1;
}

.own-ad-card-deleted .card-filter-button {
  opacity: 0.55;
}

.own-ad-card-liquidity-hidden {
  border-color: #d9e1ec;
  background: #f3f6fa;
}

.own-ad-card-liquidity-hidden .own-ad-row > * {
  opacity: 0.68;
}

.own-ad-card-liquidity-hidden .card-filter-button {
  opacity: 0.55;
}

.own-ad-card-liquidity-hidden .listing-action-button:not(:disabled) {
  opacity: 1;
}

.own-ad-card:has(.ad-filter-popover:not([hidden])) {
  z-index: 60;
}

.bot-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #344054;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}

.bot-toggle input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.bot-toggle span {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #d5dbe6;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(102, 117, 141, 0.12);
  transition: background 220ms ease, box-shadow 220ms ease, transform 160ms ease;
}

.bot-toggle input:disabled + span,
.bot-toggle:has(input:disabled) {
  cursor: default;
}

.bot-toggle span::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(24, 33, 47, 0.24);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease;
}

.bot-toggle:active span {
  transform: scale(0.96);
}

.bot-toggle input:checked + span {
  background: #155eef;
  box-shadow: inset 0 0 0 1px rgba(21, 94, 239, 0.18), 0 0 0 3px rgba(21, 94, 239, 0.08);
}

.bot-toggle input:checked + span::before {
  transform: translateX(16px);
  box-shadow: 0 2px 6px rgba(21, 94, 239, 0.28);
}

.bot-toggle input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.bot-toggle b {
  font-weight: 600;
}

.own-ad-direction strong {
  font-size: 15px;
}

.own-ad-direction .own-ad-direction-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}

.own-ad-direction .pill {
  line-height: 1.2;
}

.own-ad-direction-token {
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

.own-ad-direction em {
  overflow: hidden;
  color: #66758d;
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-telemetry {
  display: grid;
  gap: 2px;
  width: 100%;
  min-width: 0;
  margin-top: 6px;
  color: #66758d;
  font-size: 11px;
  line-height: 1.25;
}

.ad-telemetry span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-telemetry .telemetry-decision {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  cursor: help;
  outline: none;
}

.ad-telemetry .telemetry-decision-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-telemetry .telemetry-decision-tooltip {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 0;
  z-index: 80;
  width: max-content;
  max-width: min(430px, calc(100vw - 32px));
  overflow: visible;
  padding: 10px 12px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
  color: #10213f;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translateY(3px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  visibility: hidden;
  white-space: normal;
}

.ad-telemetry .telemetry-decision-tooltip::after {
  position: absolute;
  bottom: -5px;
  left: 18px;
  width: 10px;
  height: 10px;
  border-right: 1px solid rgba(203, 213, 225, 0.95);
  border-bottom: 1px solid rgba(203, 213, 225, 0.95);
  background: #ffffff;
  content: "";
  transform: rotate(45deg);
}

.telemetry-decision:hover .telemetry-decision-tooltip,
.telemetry-decision:focus-visible .telemetry-decision-tooltip,
.telemetry-decision:focus-within .telemetry-decision-tooltip {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.own-ad-telemetry-cell .ad-telemetry {
  margin-top: 0;
  font-size: 12px;
  gap: 3px;
}

.ad-telemetry .price-update-wait {
  color: #7a3b00;
  font-weight: 600;
}

.own-control-label {
  display: none;
  color: #66758d;
  font-size: 12px;
  font-weight: 500;
}

.own-info-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.own-info-cell span {
  color: #66758d;
  font-size: 12px;
}

.own-info-cell strong {
  overflow: hidden;
  color: #66758d;
  font-size: 13px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.own-info-cell .status-listed {
  color: #067647;
}

.own-info-cell .status-hidden {
  color: #9299a4;
}

.own-info-cell strong.listing-status {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 4px;
}

.own-info-cell .listing-status-label {
  color: inherit;
  font: inherit;
}

.own-info-cell .listing-status-help {
  position: relative;
  width: 14.4px;
  height: 14.4px;
  display: inline-grid;
  flex: 0 0 14.4px;
  place-items: center;
  color: #7f8794;
  cursor: help;
  outline: none;
}

.listing-status-help > svg {
  width: 14.4px;
  height: 14.4px;
  display: block;
}

.own-info-cell .listing-status-tooltip {
  position: absolute;
  right: -24px;
  bottom: calc(100% + 13px);
  z-index: 80;
  width: 280px;
  max-width: calc(100vw - 32px);
  padding: 12px 13px;
  border-radius: 12px;
  background: #edf0f4;
  box-shadow: 0 4px 12px rgba(24, 33, 47, 0.04);
  color: #151a23;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  visibility: hidden;
  white-space: normal;
}

.own-info-cell .listing-status-tooltip::after {
  content: "";
  position: absolute;
  right: 26px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  background: #edf0f4;
  transform: rotate(45deg);
}

.listing-status-help:hover .listing-status-tooltip,
.listing-status-help:focus-visible .listing-status-tooltip,
.listing-status-help:focus-within .listing-status-tooltip {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.listing-status-help:focus-visible > svg {
  border-radius: 50%;
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.own-info-cell .status-deleted {
  color: #66758d;
}

.own-info-cell .status-completed {
  color: #98a2b3;
}

.own-toggle-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.own-filter-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.own-filter-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}

.own-empty {
  padding: 13px 14px;
}

.own-empty button {
  margin-left: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #155eef;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.own-ad-card > .own-empty {
  min-height: 58px;
  padding: 34px 48px 13px 14px;
}

.filterMenu {
  position: relative;
}

.filter-disabled-fieldset {
  display: contents;
  border: 0;
  margin: 0;
  padding: 0;
}

.ad-filter-menu {
  z-index: 40;
}

.filter-button.open {
  border-color: #b9ceff;
  background: #eef5ff;
  color: #0757ff;
}

.filter-button.card-filter-button {
  width: 34px;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: #18212f;
  padding: 0;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.filter-button.card-filter-button:hover,
.filter-button.card-filter-button:focus-visible {
  transform: translateY(-1px) scale(1.04);
  background: #eef6ff;
  color: #155eef;
  outline: none;
}

.filter-button.card-filter-button:active {
  transform: translateY(0) scale(0.98);
}

.filter-button.card-filter-button.active {
  background: #eef6ff;
  color: #155eef;
}

.filter-button.card-filter-button.listing-action-button {
  color: #667085;
}

.filter-button.card-filter-button.listing-action-button:hover,
.filter-button.card-filter-button.listing-action-button:focus-visible,
.filter-button.card-filter-button.listing-action-button:active {
  background: #eef6ff;
  color: #155eef;
}

.filter-button.card-filter-button.listing-action-button:disabled {
  background: transparent;
  color: #98a2b3;
  cursor: default;
  opacity: 0.48;
  transform: none;
}

.filter-button.card-filter-button.edit-ad-action-button {
  border: 1px solid #e4e7ec;
  background: #fff;
  color: #667085;
}

.filter-button.card-filter-button.edit-ad-action-button:hover,
.filter-button.card-filter-button.edit-ad-action-button:focus-visible,
.filter-button.card-filter-button.edit-ad-action-button:active {
  border-color: #b9ceff;
  background: #eef6ff;
  color: #155eef;
}

body.modal-open {
  overflow: hidden;
}

.ad-edit-backdrop[hidden] {
  display: none;
}

.ad-edit-dialog [hidden] {
  display: none !important;
}

.ad-edit-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(12, 25, 44, 0.48);
  padding: 20px;
  backdrop-filter: blur(2px);
}

.ad-edit-dialog {
  width: min(820px, 100%);
  max-height: min(880px, calc(100vh - 40px));
  max-height: min(880px, calc(100dvh - 40px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid #d8e0eb;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(10, 26, 48, 0.24);
  overflow: hidden;
}

.ad-edit-header,
.ad-edit-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: #ffffff;
}

.ad-edit-header {
  border-bottom: 1px solid #e6ebf2;
}

.ad-edit-header h2,
.ad-edit-section h3 {
  margin: 0;
  color: #101828;
}

.ad-edit-header h2 {
  margin-top: 3px;
  font-size: 19px;
}

.ad-edit-header p {
  margin: 4px 0 0;
  color: #667085;
  font-size: 12px;
}

.ad-edit-eyebrow {
  color: #155eef;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ad-edit-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #667085;
  cursor: pointer;
  font: 400 25px/1 Arial, sans-serif;
}

.ad-edit-close:hover,
.ad-edit-close:focus-visible {
  background: #f2f4f7;
  color: #155eef;
  outline: none;
}

.ad-edit-loading,
.ad-edit-content {
  overflow: auto;
  overscroll-behavior: contain;
}

.ad-edit-loading {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: #667085;
  font-size: 13px;
}

.ad-edit-content {
  padding: 16px 20px 20px;
}

.ad-edit-warning {
  margin: 0 0 12px;
  border: 1px solid #f9d7a1;
  border-radius: 8px;
  background: #fff8eb;
  color: #9a5b00;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.45;
}

.ad-edit-section {
  display: grid;
  gap: 11px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  padding: 14px;
}

.ad-edit-section + .ad-edit-section {
  margin-top: 12px;
}

.ad-edit-section h3 {
  font-size: 14px;
}

.ad-edit-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ad-edit-section-title > span {
  color: #98a2b3;
  font-size: 11px;
}

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

.ad-edit-grid label,
.ad-edit-section > label {
  display: grid;
  gap: 6px;
  color: #52627a;
  font-size: 12px;
  font-weight: 600;
}

.ad-edit-dialog input:not([type="checkbox"]),
.ad-edit-dialog select,
.ad-edit-dialog textarea {
  width: 100%;
  border: 1px solid #d5deec;
  border-radius: 8px;
  background: #ffffff;
  color: #101828;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.ad-edit-dialog input:not([type="checkbox"]),
.ad-edit-dialog select {
  min-height: 38px;
}

.ad-edit-dialog textarea {
  min-height: 86px;
  resize: vertical;
}

.ad-edit-dialog input:focus,
.ad-edit-dialog select:focus,
.ad-edit-dialog textarea:focus {
  border-color: #8eb4ff;
  box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.1);
}

.ad-edit-payments,
.ad-edit-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ad-edit-payment-option,
.ad-edit-check-grid label,
.ad-edit-rule {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #344054;
  padding: 9px 10px;
  font-size: 12px;
}

.ad-edit-payment-option:has(input:checked),
.ad-edit-check-grid label:has(input:checked),
.ad-edit-rule:has(> input:first-child:checked) {
  border-color: #b9ceff;
  background: #f4f8ff;
}

.ad-edit-payment-option span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ad-edit-payment-option strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.own-ad-id-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.own-ad-id-chip.is-favorite {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #7a4b00;
}

.own-ad-favorite-star {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  color: #f79009;
  font-size: 14px;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(181, 71, 8, 0.18));
}

.ad-edit-payment-option small {
  color: #98a2b3;
}

.ad-edit-dialog input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: #155eef;
}

.ad-edit-rules {
  display: grid;
  gap: 8px;
}

.ad-edit-rule {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) 90px auto;
}

.ad-edit-country-rule {
  grid-template-columns: auto minmax(180px, 1fr) minmax(180px, 1fr);
}

.ad-edit-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: #667085;
  font-size: 12px;
}

.ad-edit-footer {
  border-top: 1px solid #e6ebf2;
}

.ad-edit-footer > div {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.ad-edit-footer button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}

.ad-edit-footer .secondary-button {
  border: 1px solid #d5deec;
  background: #ffffff;
  color: #344054;
}

.ad-edit-footer .primary-button {
  border: 1px solid #155eef;
  background: #155eef;
  color: #ffffff;
}

.ad-edit-footer button:disabled {
  cursor: default;
  opacity: 0.55;
}

.ad-edit-error {
  color: #b42318;
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .ad-edit-backdrop {
    padding: 8px;
  }

  .ad-edit-dialog {
    max-height: calc(100dvh - 16px);
  }

  .ad-edit-grid,
  .ad-edit-payments,
  .ad-edit-check-grid {
    grid-template-columns: 1fr;
  }

  .ad-edit-rule,
  .ad-edit-country-rule {
    grid-template-columns: auto 1fr;
  }

  .ad-edit-rule input:not([type="checkbox"]) {
    grid-column: 2;
  }

  .ad-edit-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .ad-edit-footer > div {
    width: 100%;
  }

  .ad-edit-footer button {
    flex: 1;
  }
}

.ad-edit-heading {
  min-width: 0;
}

.ad-edit-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 7px;
}

.ad-edit-pair,
.ad-edit-id-label {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 11px;
}

.ad-edit-pair {
  background: #eef5ff;
  color: #155eef;
  font-weight: 700;
}

.ad-edit-id-label {
  max-width: 360px;
  gap: 5px;
  background: #f2f4f7;
  color: #667085;
}

.ad-edit-id-label strong {
  overflow: hidden;
  color: #344054;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-edit-content {
  padding: 0;
  background: #f8fafc;
}

.ad-edit-content > .ad-edit-warning {
  margin: 14px 18px 0;
}

.ad-edit-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-bottom: 1px solid #e4e9f0;
  background: #ffffff;
  padding: 14px 18px;
}

.ad-edit-tab {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 9px;
  border: 1px solid #e1e7ef;
  border-radius: 9px;
  background: #ffffff;
  color: #475467;
  cursor: pointer;
  padding: 9px 10px;
  text-align: left;
}

.ad-edit-tab > span {
  grid-row: 1 / 3;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  align-self: center;
  border-radius: 999px;
  background: #f2f4f7;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.ad-edit-tab strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-edit-tab small {
  overflow: hidden;
  color: #98a2b3;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-edit-tab:hover,
.ad-edit-tab:focus-visible {
  border-color: #b9ceff;
  background: #f8fbff;
  outline: none;
}

.ad-edit-tab.active {
  border-color: #8eb4ff;
  background: #eef5ff;
  color: #155eef;
  box-shadow: 0 0 0 1px rgba(21, 94, 239, 0.08);
}

.ad-edit-tab.active > span {
  background: #155eef;
  color: #ffffff;
}

.ad-edit-tab.active small {
  color: #5374ad;
}

.ad-edit-panel {
  min-height: 420px;
  padding: 20px 22px 24px;
}

.ad-edit-panel-head {
  margin-bottom: 16px;
}

.ad-edit-panel-head h3 {
  margin: 0;
  color: #101828;
  font-size: 16px;
}

.ad-edit-panel-head p {
  margin: 5px 0 0;
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
}

.ad-edit-panel .ad-edit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.ad-edit-field {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  color: #344054;
  font-size: 12px;
  font-weight: 600;
}

.ad-edit-field-wide {
  grid-column: 1 / -1;
}

.ad-edit-field > small {
  color: #98a2b3;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.4;
}

.ad-edit-input-unit {
  min-width: 0;
  display: flex;
  align-items: stretch;
  border: 1px solid #d5deec;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.ad-edit-dialog .ad-edit-input-unit input {
  min-width: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.ad-edit-input-unit:focus-within {
  border-color: #8eb4ff;
  box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.1);
}

.ad-edit-input-unit b {
  min-width: 50px;
  display: grid;
  place-items: center;
  border-left: 1px solid #e4e9f0;
  background: #f8fafc;
  color: #667085;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 600;
}

.ad-edit-block {
  border: 1px solid #e1e7ef;
  border-radius: 10px;
  background: #ffffff;
  padding: 14px;
}

.ad-edit-block + .ad-edit-block {
  margin-top: 12px;
}

.ad-edit-section-title > div {
  display: grid;
  gap: 3px;
}

.ad-edit-section-title strong {
  color: #101828;
  font-size: 13px;
}

.ad-edit-section-title small {
  color: #98a2b3;
  font-size: 10px;
}

.ad-edit-block .ad-edit-payments {
  margin-top: 11px;
}

.ad-edit-block textarea {
  margin-top: 11px;
}

.ad-edit-switch-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.ad-edit-switch-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid #e1e7ef;
  border-radius: 9px;
  background: #ffffff;
  cursor: pointer;
  padding: 11px;
}

.ad-edit-switch-row > input,
.ad-edit-condition-toggle > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ad-edit-switch-ui,
.ad-edit-condition-toggle > span {
  position: relative;
  width: 34px;
  height: 19px;
  display: block;
  border-radius: 999px;
  background: #d0d5dd;
  transition: background 140ms ease;
}

.ad-edit-switch-ui::after,
.ad-edit-condition-toggle > span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.18);
  content: "";
  transition: transform 140ms ease;
}

.ad-edit-switch-row > input:checked + .ad-edit-switch-ui,
.ad-edit-condition-toggle > input:checked + span {
  background: #155eef;
}

.ad-edit-switch-row > input:checked + .ad-edit-switch-ui::after,
.ad-edit-condition-toggle > input:checked + span::after {
  transform: translateX(15px);
}

.ad-edit-switch-row:has(input:checked),
.ad-edit-condition-row:has(.ad-edit-condition-toggle input:checked) {
  border-color: #b9ceff;
  background: #f8fbff;
}

.ad-edit-switch-row > span:last-child,
.ad-edit-condition-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ad-edit-switch-row strong,
.ad-edit-condition-row strong {
  color: #344054;
  font-size: 12px;
}

.ad-edit-switch-row small,
.ad-edit-condition-row small {
  color: #98a2b3;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.35;
}

.ad-edit-conditions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.ad-edit-condition-row {
  display: grid;
  grid-template-columns: 34px minmax(220px, 1fr) minmax(130px, 0.46fr);
  align-items: center;
  gap: 11px;
  border: 1px solid #e1e7ef;
  border-radius: 9px;
  background: #ffffff;
  padding: 10px 11px;
}

.ad-edit-condition-toggle {
  cursor: pointer;
}

.ad-edit-condition-value {
  min-width: 0;
  display: flex;
  align-items: center;
  border: 1px solid #d5deec;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.ad-edit-dialog .ad-edit-condition-value input {
  min-width: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.ad-edit-condition-value span {
  align-self: stretch;
  display: grid;
  place-items: center;
  border-left: 1px solid #e4e9f0;
  background: #f8fafc;
  color: #667085;
  padding: 0 9px;
  font-size: 10px;
  white-space: nowrap;
}

.ad-edit-footer-note {
  min-width: 0;
  display: grid;
  gap: 3px;
  color: #98a2b3;
  font-size: 10px;
}

.ad-edit-footer-note .ad-edit-error:not(:empty) {
  font-size: 11px;
}

@media (max-width: 760px) {
  .ad-edit-tabs {
    gap: 5px;
    padding: 10px;
  }

  .ad-edit-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 5px;
  }

  .ad-edit-tab > span,
  .ad-edit-tab small {
    display: none;
  }

  .ad-edit-panel {
    padding: 16px 12px 20px;
  }

  .ad-edit-panel .ad-edit-grid,
  .ad-edit-switch-list {
    grid-template-columns: 1fr;
  }

  .ad-edit-field-wide {
    grid-column: auto;
  }

  .ad-edit-condition-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .ad-edit-condition-value {
    grid-column: 2;
  }
}

.filter-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(560px, calc(100vw - 64px));
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  box-shadow: 0 18px 45px rgba(28, 45, 74, 0.14);
  max-height: min(720px, calc(100vh - 32px));
  max-height: min(720px, calc(100dvh - 32px));
  overflow: auto;
  overscroll-behavior: contain;
}

.ad-filter-popover {
  width: min(560px, calc(100vw - 64px));
}

.ad-filter-field {
  color: #66758d;
  font-size: 12px;
  font-weight: 500;
}

.ad-filter-field + .ad-filter-field,
.ad-filter-checks,
.ad-filter-checks + .competitorBox {
  margin-top: 10px;
}

.ad-filter-field select,
.ad-filter-field input {
  min-height: 34px;
  color: #18212f;
  font-size: 13px;
}

.ad-filter-checks {
  display: grid;
  gap: 8px;
  margin-inline: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.ad-filter-checks legend {
  padding: 0 5px;
  color: #66758d;
  font-size: 12px;
}

.price-follow-checks {
  background: #f8fbff;
}

.template-mode-checks {
  background: #f5fbf7;
  border-color: #cfe8d8;
}

.template-mode-checks small {
  color: #5f6f66;
  font-size: 11px;
  line-height: 1.4;
}

.template-mode-checks [data-delay-mode-option] {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #dbe9df;
}

.template-mode-checks [data-delay-mode-option][hidden] {
  display: none;
}

.price-mode-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 25px;
  border-radius: 999px;
  background: #edf4ff;
  color: #155eef;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

.price-mode-pill.floating {
  background: #fff4e5;
  color: #7a3b00;
}

.mini-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #26364d;
  font-size: 12px;
  font-weight: 500;
}

.mini-check input {
  width: auto;
  min-height: auto;
}

.filterSummaryGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.filterItem {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid #dce6f2;
  border-radius: 8px;
  background: #ffffff;
}

.filterItem span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.filterItem strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.checkGroup {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.checkGroup legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 14px;
}

.competitorBox {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.competitorPicker {
  display: grid;
  gap: 8px;
}

.competitorPicker > span {
  color: #52627a;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.15;
}

.competitorAddRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 8px;
}

.competitorAddRow input {
  min-height: 34px;
  border: 1px solid #d5deec;
  border-radius: 8px;
  background: #ffffff;
  color: #101827;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 400;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.competitorAddRow input:focus {
  border-color: #b8cdf8;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.1);
}

.competitorAddRow input::placeholder {
  color: #6b778c;
  font-size: 13px;
  font-weight: 400;
}

.filter-button.competitor-add-button {
  width: 100%;
  min-height: 34px;
  border: 1px solid #b8cdf8;
  border-radius: 8px;
  background: rgba(47, 107, 255, 0.06);
  color: #155eef;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 500;
  justify-content: center;
}

.filter-button.competitor-add-button:disabled {
  border-color: #d8e0eb;
  background: #f6f8fb;
  color: #9aa8ba;
  cursor: default;
  opacity: 1;
}

.competitorChipList {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.competitor-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 24px;
  border: 1px solid #dfe6ef;
  border-radius: 999px;
  background: #f8fbff;
  color: #26364d;
  padding: 3px 5px 3px 9px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.competitor-chip:hover {
  border-color: #b8cdf8;
  background: #eef6ff;
  color: #155eef;
}

.competitor-chip button {
  display: grid;
  place-items: center;
  width: 18px;
  min-height: 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #66758d;
  padding: 0;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.competitor-chip button:hover,
.competitor-chip button:focus-visible {
  background: #ffffff;
  color: #155eef;
  transform: scale(1.06);
  outline: none;
}

.competitor-chip svg {
  width: 12px;
  height: 12px;
}

.merchant-tags .price-type-tag {
  color: #155eef;
  background: #edf4ff;
}

.merchant-tags .price-type-tag.floating {
  color: #7a3b00;
  background: #fff4e5;
}

.favorite-filter-box {
  border-color: #fedf89;
  background: #fffaeb;
}

.favorite-filter-box legend,
.favorite-filter-box .mini-check {
  color: #9a4b08;
}

.favorite-filter-box input {
  accent-color: #f79009;
}

.merchant-tags .private-ad-tag {
  color: #f79009;
  background: #fff4e5;
}

.merchant-tags .template-mode-tag {
  color: #087443;
  background: #e8f7ee;
}

.merchant-tags .delay-mode-tag {
  color: #3154a4;
  background: #eaf0ff;
}

.premium-line {
  display: block;
  flex-basis: 100%;
  margin-top: 2px;
  color: #66758d;
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
  white-space: nowrap;
}

.filter-button.filter-apply-button {
  justify-content: center;
  width: 100%;
  min-height: 34px;
  margin-top: 10px;
  border: 1px solid #9dbcf7;
  border-radius: 8px;
  background: #eaf1ff;
  color: #155eef;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.filter-button.filter-apply-button:hover,
.filter-button.filter-apply-button:focus-visible {
  border-color: #7da2ff;
  background: #ddeaff;
  transform: translateY(-1px);
  outline: none;
}

.filter-button.filter-apply-button:disabled {
  border-color: #d8e0eb;
  background: #f6f8fb;
  color: #9aa8ba;
  cursor: default;
  opacity: 1;
  transform: none;
}

label {
  display: grid;
  gap: 6px;
  margin: 0;
}

.autoMarket {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid #bdebd8;
  border-radius: 8px;
  background: #f6fffb;
}

.autoMarket span {
  color: var(--muted);
  font-size: 13px;
}

.autoMarket strong {
  color: #0b4f39;
  font-size: 14px;
}

.switchRow {
  margin-top: 14px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: #2d4165;
  font-weight: 700;
}

.switch input {
  width: auto;
  min-height: auto;
}

.workspaceGrid {
  display: grid;
  grid-template-columns: minmax(360px, 650px) minmax(500px, 500px);
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.workspaceGrid > * {
  min-width: 0;
}

.panelHead {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.orderbookPanel {
  justify-self: start;
  width: 100%;
  max-width: 650px;
  overflow: hidden;
  padding: 0;
  border-radius: 8px;
  box-shadow: none;
}

.logsPanel {
  justify-self: start;
  width: 500px;
  max-width: 100%;
  overflow: hidden;
  padding: 0;
  border-color: #dfe6ef;
  border-radius: 8px;
  box-shadow: none;
}

.orderbookPanel .panelHead {
  margin-bottom: 0;
  border-bottom: 1px solid #e7edf5;
  padding: 13px 14px;
}

.logsPanel .panelHead {
  margin-bottom: 0;
  border-bottom: 1px solid #e7edf5;
  padding: 13px 14px;
}

.logsPanel .panelHead > div {
  order: 1;
}

.logsPanel .logs-update-label {
  order: 3;
}

.logsPanel .panelHead p {
  display: none;
}

.collectionPanel {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 1164px;
  padding: 0;
  overflow: hidden;
  border-color: #dfe6ef;
  border-radius: 8px;
  box-shadow: none;
}

.collectionHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border-bottom: 1px solid #e7edf5;
  background: linear-gradient(135deg, #ffffff 0%, #f7fbf9 100%);
}

.collectionHead h2 {
  margin: 3px 0 4px;
  font-size: 21px;
  font-weight: 600;
}

.collectionHead p {
  max-width: 720px;
  margin: 0;
  color: #66758d;
  font-size: 13px;
  line-height: 1.45;
}

.collectionEyebrow {
  color: #16845b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.collectionState {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid #dfe6ef;
  border-radius: 999px;
  background: #ffffff;
  color: #66758d;
  font-size: 12px;
  font-weight: 700;
}

.collectionStateDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #98a2b3;
}

.collectionState[data-collection-state="active"] {
  border-color: #b7e4d2;
  background: #effaf5;
  color: #067647;
}

.collectionState[data-collection-state="active"] .collectionStateDot {
  background: #12b76a;
  box-shadow: 0 0 0 4px rgba(18, 183, 106, 0.12);
  animation: collectionPulse 1.8s ease-in-out infinite;
}

.collectionState[data-collection-state="error"] {
  border-color: #fecdca;
  background: #fff4f3;
  color: #b42318;
}

.collectionState[data-collection-state="error"] .collectionStateDot {
  background: #f04438;
}

@keyframes collectionPulse {
  50% { opacity: 0.5; }
}

.collectionMetrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid #e7edf5;
}

.collectionMetric {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 15px 20px;
  border-right: 1px solid #e7edf5;
}

.collectionMetric:last-child {
  border-right: 0;
}

.collectionMetric span,
.collectionLabel,
.collectionPrice span {
  color: #66758d;
  font-size: 11px;
}

.collectionMetric strong {
  color: #1d2939;
  font-size: 18px;
  font-weight: 650;
}

.collectionLatest {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(2, minmax(190px, 0.8fr));
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid #e7edf5;
  background: #f8fafc;
}

.collectionLatest > div {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #e1e8f0;
  border-radius: 10px;
  background: #ffffff;
}

.collectionLatest > div:first-child strong {
  overflow-wrap: anywhere;
  color: #1d2939;
  font-size: 14px;
}

.collectionLatest > div:first-child > span:last-child {
  color: #66758d;
  font-size: 12px;
}

.collectionPrice strong {
  color: #0b4f39;
  font-size: 19px;
}

.collectionPrice small {
  overflow: hidden;
  color: #66758d;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collectionEventsBlock {
  padding: 16px 18px 18px;
}

.collectionEventsHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 11px;
}

.collectionEventsHead strong {
  font-size: 13px;
}

.collectionEventsHead span {
  color: #66758d;
  font-size: 11px;
}

.collectionEvents {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 350px;
  overflow: auto;
  overscroll-behavior: contain;
}

.collectionEvent {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #e1e8f0;
  border-radius: 9px;
  background: #ffffff;
}

.collectionEventMeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #66758d;
  font-size: 10px;
}

.collectionEventMeta strong {
  color: #16845b;
  font-size: 10px;
  text-align: right;
}

.collectionEventValues {
  display: grid;
  gap: 4px;
  color: #475467;
  font-size: 11px;
  line-height: 1.4;
}

.collectionEventValues span {
  overflow-wrap: anywhere;
}

.collectionEventValues strong {
  color: #1d2939;
}

@media (min-width: 1501px) {
  .workspaceGrid {
    grid-template-columns: minmax(360px, 650px) 500px minmax(360px, 1fr);
  }

  .collectionPanel {
    grid-column: auto;
    align-self: start;
    max-width: none;
  }

  .collectionHead {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
    padding: 14px;
  }

  .collectionHead h2 {
    margin: 2px 0 3px;
    font-size: 19px;
  }

  .collectionHead p {
    font-size: 12px;
  }

  .collectionState {
    align-self: flex-start;
    min-height: 30px;
    padding: 6px 10px;
  }

  .collectionMetrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collectionMetric {
    padding: 12px 14px;
  }

  .collectionMetric:nth-child(2) {
    border-right: 0;
  }

  .collectionMetric:nth-child(-n + 2) {
    border-bottom: 1px solid #e7edf5;
  }

  .collectionMetric strong {
    font-size: 16px;
  }

  .collectionLatest {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
  }

  .collectionLatest > div {
    padding: 11px 12px;
  }

  .collectionPrice strong {
    font-size: 17px;
  }

  .collectionEventsBlock {
    padding: 13px 14px 14px;
  }

  .collectionEventsHead {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .collectionEvents {
    grid-template-columns: minmax(0, 1fr);
    max-height: 520px;
  }

  .collectionEventMeta {
    align-items: flex-start;
  }
}

.orderbookHead h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}

.book-request-label,
.book-change-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #66758d;
  font-size: 13px;
}

.filters {
  display: grid;
  gap: 12px;
  align-items: end;
}

.book-settings {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #edf1f6;
}

.book-ad-filter {
  display: grid;
  gap: 4px;
  color: #66758d;
  font-size: 12px;
  font-weight: 500;
}

.book-select-wrap {
  position: relative;
  display: block;
}

.book-ad-filter select {
  width: 100%;
  min-height: 30px;
  appearance: none;
  -webkit-appearance: none;
  color: #18212f;
  font-size: 12px;
  padding-right: 34px;
}

.book-select-arrow {
  position: absolute;
  top: 50%;
  right: 9px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: #18212f;
  pointer-events: none;
  transform: translateY(-50%) rotate(-90deg);
  transition: transform 180ms ease, color 180ms ease;
}

.book-select-wrap.select-open .book-select-arrow {
  color: #155eef;
  transform: translateY(-50%) rotate(0deg);
}

.settings-pills {
  display: flex;
  align-items: end;
  gap: 5px;
  min-width: 0;
}

.settings-pills .pill {
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
  white-space: nowrap;
}

.settings-pills .mode-pill {
  min-height: 30px;
  max-width: 42%;
  overflow: hidden;
  padding: 0 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 7px;
  background: #eef6ff;
  color: #155eef;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 500;
}

.panel-menu-wrap {
  position: relative;
  z-index: 20;
}

.filter-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 30px;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  background: #ffffff;
  color: #18212f;
  cursor: pointer;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
}

.chip,
.counter {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: #0757ff;
  font-weight: 700;
}

.chip.danger {
  background: var(--red-soft);
  color: var(--red);
}

.chip.active {
  border: 1px solid #b9ceff;
}

.counter {
  border-radius: 10px;
}

.orderbook-list {
  display: grid;
  max-height: min(calc(100vh - 245px), 1500px);
  max-height: min(calc(100dvh - 245px), 1500px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.orderbook-list,
.logs {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.log-empty {
  padding: 14px;
}

.orderbook-list::-webkit-scrollbar,
.logs::-webkit-scrollbar {
  width: 4px;
}

.orderbook-list::-webkit-scrollbar-track,
.logs::-webkit-scrollbar-track {
  background: transparent;
}

.orderbook-list::-webkit-scrollbar-thumb,
.logs::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgb(174 185 200 / 0%);
  transition: background 180ms ease;
}

.orderbook-list:hover,
.logs:hover {
  scrollbar-color: #aeb9c8 transparent;
}

.orderbook-list:hover::-webkit-scrollbar-thumb,
.logs:hover::-webkit-scrollbar-thumb {
  background: rgb(174 185 200 / 92%);
}

.region-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 14px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f1f4f8;
  color: #18212f;
  font-size: 13px;
}

.region-note svg {
  flex: 0 0 auto;
}

.orderbook-empty {
  display: grid;
  place-items: center;
  min-height: 112px;
  margin: 0;
  color: #66758d;
  font-size: 13px;
  text-align: center;
}

.ad-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(110px, 0.55fr) minmax(210px, 1fr) minmax(190px, 0.95fr) 74px;
  gap: 14px;
  align-items: center;
  min-height: 86px;
  padding: 13px 14px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
}

.ad-row.watched {
  background: #fffaf0;
}

.ad-row.own-orderbook-ad {
  background: #fffaf0;
}

.ad-row:last-child {
  border-bottom: 0;
}

.merchant-cell,
.amount-cell,
.payment-cell,
.action-cell {
  min-width: 0;
}

.merchant-line {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.merchant-line strong,
.merchant-link {
  overflow: hidden;
  color: #07111f;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merchant-link:hover {
  color: #07111f;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
}

.online-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #18b26b;
  box-shadow: 0 0 0 2px #e8fff3;
}

.auth-badge {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  display: block;
  object-fit: contain;
}

.merchant-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: #66758d;
  font-size: 12px;
}

.merchant-stats i {
  width: 1px;
  height: 11px;
  background: #b8c2d2;
}

.merchant-stat-stale {
  text-decoration: underline dotted;
  text-decoration-color: #9aa7ba;
  text-underline-offset: 3px;
  cursor: help;
}

.merchant-stat-note {
  color: #52627a;
  font-size: 10px;
  font-weight: 500;
}

.merchant-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.merchant-tags span {
  border-radius: 3px;
  background: #fff0f0;
  color: #b42318;
  padding: 2px 5px;
  font-size: 11px;
  font-weight: 500;
}

.price-cell {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
}

.price-main-line {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}

.price-cell strong {
  color: #07111f;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}

.price-cell span {
  color: #07111f;
  font-size: 13px;
}

.amount-cell {
  display: grid;
  gap: 7px;
}

.amount-cell strong,
.amount-cell span {
  overflow-wrap: anywhere;
}

.amount-cell strong {
  color: #07111f;
  font-weight: 500;
  font-size: 13px;
}

.amount-cell span {
  color: #07111f;
  font-size: 13px;
}

.payment-cell {
  display: grid;
  gap: 6px;
}

.payment-line {
  position: relative;
  color: #07111f;
  font-size: 13px;
  line-height: 1.2;
  padding-left: 10px;
}

.payment-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 2px;
  height: 0.9em;
  background: #ff9f2d;
}

.payment-line.color-1::before {
  background: #12b76a;
}

.payment-line.color-2::before {
  background: #f04455;
}

.action-cell {
  display: grid;
  justify-items: center;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 600;
}

.side-0 {
  color: #067647;
  background: #ecfdf3;
}

.side-1 {
  color: #b42318;
  background: #fef3f2;
}

.orderbookPanel .ad-row {
  grid-template-columns: minmax(170px, 1fr) minmax(128px, 0.62fr) minmax(168px, 0.86fr);
  gap: 14px;
  min-height: 72px;
  padding: 10px 12px;
}

.ownAdBlock .own-ad-row {
  grid-template-columns:
    minmax(112px, 0.58fr)
    minmax(224px, 1.08fr)
    minmax(200px, 0.9fr)
    minmax(136px, 0.64fr)
    minmax(148px, 0.76fr)
    minmax(122px, 0.56fr)
    minmax(112px, 0.5fr)
    108px
    42px;
  gap: 13px;
  min-height: 82px;
  padding: 32px 48px 12px 14px;
}

.orderbookPanel .payment-cell,
.orderbookPanel .action-cell,
.ownAdBlock .action-cell {
  display: none;
}

.orderbookPanel .price-cell,
.ownAdBlock .price-cell {
  min-width: 0;
  justify-content: flex-end;
}

.ownAdBlock .price-cell {
  justify-self: end;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
}

.ownAdBlock .premium-line {
  flex-basis: auto;
  margin-top: 0;
}

.ownAdBlock .amount-cell {
  padding-left: 10px;
}

.ownAdBlock .own-ad-status-cell strong {
  overflow: visible;
  text-overflow: clip;
}

.ownAdBlock .own-ad-status-cell {
  overflow: visible;
}

.own-ad-card:has(.listing-status-help:hover),
.own-ad-card:has(.listing-status-help:focus),
.own-ad-card:has(.listing-status-help:focus-within),
.own-ad-card:has(.telemetry-decision:hover),
.own-ad-card:has(.telemetry-decision:focus),
.own-ad-card:has(.telemetry-decision:focus-within) {
  z-index: 70;
}

.ownAdBlock .merchant-tags {
  align-items: flex-start;
  flex-wrap: wrap;
  overflow: visible;
  row-gap: 3px;
}

.ownAdBlock .merchant-tags span {
  flex: 0 0 auto;
  white-space: nowrap;
}

@container (max-width: 1320px) {
  .ownAdBlock .own-ad-row {
    grid-template-areas:
      "direction telemetry merchant price filter toggle"
      "direction amount payment status filter toggle";
    grid-template-columns:
      minmax(106px, 0.74fr)
      minmax(240px, 1.28fr)
      minmax(184px, 0.94fr)
      minmax(132px, 0.7fr)
      108px
      42px;
    gap: 8px 14px;
    align-items: center;
    padding-right: 46px;
  }

  .ownAdBlock .own-ad-direction {
    grid-area: direction;
  }

  .ownAdBlock .own-ad-telemetry-cell {
    grid-area: telemetry;
  }

  .ownAdBlock .merchant-cell {
    grid-area: merchant;
  }

  .ownAdBlock .price-cell {
    grid-area: price;
  }

  .ownAdBlock .amount-cell {
    grid-area: amount;
    padding-left: 0;
  }

  .ownAdBlock .payment-cell {
    grid-area: payment;
  }

  .ownAdBlock .own-ad-status-cell {
    grid-area: status;
  }

  .ownAdBlock .own-filter-cell {
    grid-area: filter;
  }

  .ownAdBlock .own-toggle-cell {
    grid-area: toggle;
  }
}

.orderbookPanel .price-cell strong,
.ownAdBlock .price-cell strong {
  font-size: 17px;
  white-space: nowrap;
}

.orderbookPanel .amount-cell strong,
.orderbookPanel .amount-cell span,
.ownAdBlock .amount-cell strong,
.ownAdBlock .amount-cell span {
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.ownAdBlock .merchant-stats,
.ownAdBlock .merchant-tags,
.ownAdBlock .payment-cell,
.ownAdBlock .own-info-cell {
  overflow: hidden;
}

.ownAdBlock .own-info-cell.own-ad-status-cell {
  overflow: visible;
}

.ownAdBlock .own-info-cell.own-ad-telemetry-cell {
  overflow: visible;
}

.logs {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-height: min(1120px, calc(100vh - 260px));
  max-height: min(1120px, calc(100dvh - 260px));
  padding: 12px 10px 14px 14px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.log {
  display: grid;
  gap: 9px;
  min-width: 0;
  max-width: 100%;
  padding: 14px 16px;
  border: 1px solid #dfe6ef;
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(24, 33, 47, 0.04);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.log > div {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.log::before {
  content: "Завершена";
  width: fit-content;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--green-soft);
  color: #067647;
  font-size: 12px;
  font-weight: 400;
}

.log.fail::before {
  content: "Ошибка";
  background: var(--red-soft);
  color: #b42318;
}

.logMeta {
  padding-top: 6px;
  border-top: 1px solid var(--line-soft);
}

.logsPanel .panelHead h2 {
  font-weight: 400;
}

@media (max-width: 1120px) {
  .workspaceGrid,
  .filterSummaryGrid {
    grid-template-columns: 1fr;
  }

  .workspaceGrid,
  .workspaceGrid > *,
  .orderbookPanel,
  .logsPanel,
  .collectionPanel {
    min-width: 0;
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }

  .settingsTop {
    align-items: flex-start;
    flex-direction: column;
  }

  .settingsActions {
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 100%;
  }

  .adSearchField {
    width: min(300px, 100%);
  }

  .ad-row,
  .orderbookPanel .ad-row {
    grid-template-areas: none;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .ownAdBlock .own-ad-row {
    grid-template-areas:
      "direction telemetry"
      "merchant price"
      "amount payment"
      "status status"
      "filter toggle";
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
    align-items: start;
    padding: 38px 48px 14px 14px;
  }

  .ownAdBlock .own-ad-direction {
    grid-area: direction;
  }

  .ownAdBlock .own-ad-telemetry-cell {
    grid-area: telemetry;
  }

  .ownAdBlock .merchant-cell {
    grid-area: merchant;
  }

  .ownAdBlock .price-cell {
    grid-area: price;
    justify-self: start;
  }

  .ownAdBlock .amount-cell {
    grid-area: amount;
    padding-left: 0;
  }

  .ownAdBlock .payment-cell {
    grid-area: payment;
  }

  .ownAdBlock .own-ad-status-cell {
    grid-area: status;
  }

  .ownAdBlock .own-filter-cell {
    grid-area: filter;
    justify-content: space-between;
  }

  .ownAdBlock .own-toggle-cell {
    grid-area: toggle;
    justify-content: space-between;
  }

  .own-control-label {
    display: inline;
  }

  .own-filter-cell .ad-filter-popover {
    right: max(12px, env(safe-area-inset-right));
    left: max(12px, env(safe-area-inset-left));
  }

  .filter-popover,
  .ad-filter-popover,
  .account-settings-popover {
    position: fixed;
    top: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    z-index: 100;
    width: auto;
    max-width: none;
    max-height: min(82vh, 720px);
    max-height: min(82dvh, 720px);
    padding: 14px;
    overscroll-behavior: contain;
  }

  input,
  select,
  textarea,
  .ad-filter-field input,
  .ad-filter-field select,
  .competitorAddRow input,
  .book-ad-filter select,
  .account-settings-popover input {
    min-height: 44px;
    font-size: 16px;
  }

  button,
  .filter-button,
  .account-settings-button,
  .filter-button.card-filter-button,
  .filter-button.filter-apply-button,
  .competitor-chip button,
  .session-logout {
    min-height: 44px;
  }

  .account-settings-button,
  .filter-button.card-filter-button,
  .competitor-chip button {
    width: 44px;
  }

  .mini-check {
    min-height: 44px;
  }

  .mini-check input {
    width: 20px;
    height: 20px;
  }

  .price-cell,
  .orderbookPanel .price-cell,
  .ownAdBlock .price-cell,
  .amount-cell,
  .payment-cell {
    grid-column: auto;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }

  .appHeader {
    align-items: flex-start;
    flex-direction: column;
  }

  .collectionHead,
  .collectionEventsHead {
    align-items: flex-start;
    flex-direction: column;
  }

  .collectionState {
    max-width: 100%;
  }

  .collectionMetrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collectionMetric:nth-child(2) {
    border-right: 0;
  }

  .collectionMetric:nth-child(-n + 2) {
    border-bottom: 1px solid #e7edf5;
  }

  .collectionLatest,
  .collectionEvents {
    grid-template-columns: minmax(0, 1fr);
  }

  .collectionEvents {
    max-height: none;
    overflow: visible;
  }

  .headerRight {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    flex: 0 0 auto;
    width: 100%;
    margin-left: 0;
  }

  .headerStatus,
  .accountStatus,
  .session-chip {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .headerStatus p {
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }

  .headerStatus .cycleTooltip {
    position: fixed;
    top: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: min(60vh, 440px);
    max-height: min(60dvh, 440px);
    overflow: auto;
  }

  .headerStatus .cycleLine.has-tooltip::before {
    display: none;
  }

  .settingsPanel {
    padding: 14px;
  }

  .settingsActions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .adSearchField {
    width: 100%;
  }

  .miniPanelHead,
  .panelHead {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .own-ad-list {
    padding: 8px;
  }

  .filter-popover,
  .ad-filter-popover,
  .account-settings-popover {
    position: fixed;
    top: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    z-index: 100;
    width: auto;
    max-width: none;
    max-height: min(82vh, 720px);
    max-height: min(82dvh, 720px);
    padding: 14px;
    overscroll-behavior: contain;
  }

  .own-filter-cell .ad-filter-popover {
    right: max(12px, env(safe-area-inset-right));
    left: max(12px, env(safe-area-inset-left));
  }

  .orderbook-list,
  .logs {
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
    scrollbar-gutter: auto;
  }

  input,
  select,
  textarea,
  .ad-filter-field input,
  .ad-filter-field select,
  .competitorAddRow input,
  .book-ad-filter select,
  .account-settings-popover input {
    min-height: 44px;
    font-size: 16px;
  }

  button,
  .filter-button,
  .account-settings-button,
  .filter-button.card-filter-button,
  .filter-button.filter-apply-button,
  .competitor-chip button,
  .session-logout {
    min-height: 44px;
  }

  .account-settings-button,
  .filter-button.card-filter-button,
  .competitor-chip button {
    width: 44px;
  }

  .mini-check {
    min-height: 44px;
  }

  .mini-check input {
    width: 20px;
    height: 20px;
  }

  .ad-telemetry span {
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }

  .settings-pills {
    flex-wrap: wrap;
  }

  .session-chip {
    grid-template-rows: 21px 1px 44px;
    min-height: 68px;
  }

  h1 {
    font-size: 26px;
  }
}

@media (max-width: 560px) {
  .ownAdBlock .own-ad-row {
    grid-template-areas:
      "direction"
      "telemetry"
      "merchant"
      "price"
      "amount"
      "payment"
      "status"
      "filter"
      "toggle";
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
  }

  .ownAdBlock .price-cell,
  .ownAdBlock .amount-cell,
  .ownAdBlock .payment-cell {
    justify-self: stretch;
  }

  .login-page {
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  .login-card {
    padding: 20px;
  }

  .login-card h1 {
    font-size: 24px;
  }

  .sectionTitle h2,
  .panelHead h2 {
    font-size: 18px;
  }
}

@media (max-width: 420px) {
  .settingsActions {
    grid-template-columns: minmax(0, 1fr);
  }

  .searchAdBtn {
    width: 100%;
  }
}

@media (hover: none), (pointer: coarse) {
  button,
  .filter-button,
  .account-settings-button,
  .filter-button.card-filter-button,
  .competitor-chip button,
  .session-logout {
    min-height: 44px;
  }

  .account-settings-button,
  .filter-button.card-filter-button,
  .competitor-chip button {
    width: 44px;
  }

  .mini-check {
    min-height: 44px;
  }

  .mini-check input {
    width: 20px;
    height: 20px;
  }

}

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 1px solid var(--focus) !important;
  outline-offset: 1px !important;
}

.telegramCompact {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  height: 68px;
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(6, 21, 45, 0.03);
}

.telegramCompactToggle {
  width: 100%;
  height: 100%;
  min-height: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  border-radius: 7px;
  padding: 4px;
  background: transparent;
  color: #344054;
  text-align: left;
  box-shadow: none;
}

.telegramCompactToggle:hover,
.telegramCompactToggle:focus-visible,
.telegramCompactToggle[aria-expanded="true"] {
  background: #f5fbfe;
  color: #137fb2;
}

.telegramCompactIcon {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #229ed9;
}

.telegramBellIcon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  color: #66758d;
}

.telegramCompact[data-state="active"] .telegramBellIcon {
  color: #087750;
}

.telegramCompact[data-state="warning"] .telegramBellIcon {
  color: #a15c00;
}

.telegramCompact[data-state="error"] .telegramBellIcon {
  color: var(--red);
}

.telegramCompact[data-state="active"] .telegramCompactIcon {
  box-shadow: 0 0 0 3px rgba(9, 166, 109, 0.12);
}

.telegramCompact[data-state="warning"] .telegramCompactIcon {
  background: #f79009;
}

.telegramCompact[data-state="error"] .telegramCompactIcon {
  background: var(--red);
}

.telegramCompactSummary {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.telegramCompactSummary strong,
.telegramCompactSummary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telegramCompactSummary strong {
  color: #07111f;
  font-size: 13px;
  line-height: 1.1;
}

.telegramCompactSummary small {
  color: #66758d;
  font-size: 11px;
  line-height: 1.15;
}

.telegramCompact[data-state="active"] .telegramCompactSummary small {
  color: #087750;
}

.telegramCompact[data-state="warning"] .telegramCompactSummary small {
  color: #a15c00;
}

.telegramCompact[data-state="error"] .telegramCompactSummary small {
  color: #bd2f26;
}

.telegramCompactChevron {
  color: #98a2b3;
  transition: transform 150ms ease;
}

.telegramCompactToggle[aria-expanded="true"] .telegramCompactChevron {
  transform: rotate(180deg);
}

.telegramPopover {
  display: block;
  width: min(470px, calc(100vw - 32px));
  padding: 0;
  border-color: #dfe6ef;
  border-radius: 16px;
  box-shadow: 0 22px 54px rgba(28, 45, 74, 0.16);
}

.telegramPopover[hidden] {
  display: none;
}

.telegramPopoverHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line-soft);
}

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

.telegramPopoverIdentity > div {
  min-width: 0;
}

.telegramPopoverLogo {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #ffffff;
  background: #2f6df6;
  box-shadow: 0 6px 14px rgba(47, 109, 246, 0.2);
}

.telegramPopoverLogo svg {
  width: 18px;
  height: 18px;
}

.telegramPopoverHead h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
}

.telegramPopoverHead p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.telegramPopoverConnect {
  min-height: 40px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 14px;
  color: #155eef;
  background: #eef4ff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
  cursor: pointer;
}

.telegramPopoverConnect:hover {
  background: #e4edff;
}

.telegramPopoverConnect svg {
  width: 16px;
  height: 16px;
}

.telegramPopoverConnect:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.telegramPopoverSection {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 18px;
}

.telegramExclusionsSection {
  padding-top: 2px;
}

.telegramPopoverSectionHead {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.telegramPopoverSectionHead > div {
  min-width: 0;
}

.telegramPopoverSectionHead p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.telegramPopoverLabel {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.telegramExcludedCount {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 9px;
  color: #66758d;
  background: #f3f6fa;
  font-size: 11px;
  line-height: 1.2;
}

.telegramAccounts,
.telegramExcludedNicks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.telegramAccount,
.telegramNickChip {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #dfe6ef;
  border-radius: 999px;
  padding: 4px 6px 4px 11px;
  background: #f6f8fb;
  color: #26364d;
  font-size: 12px;
  line-height: 1.2;
}

.telegramAccount {
  width: auto;
  min-height: 38px;
  padding-left: 5px;
  border-color: transparent;
  background: #eef4ff;
}

.telegramAccount:hover,
.telegramNickChip:hover {
  border-color: #b8cdf8;
  background: #eef4ff;
}

.telegramAccountAvatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #2f6df6;
  font-size: 12px;
  font-weight: 700;
}

.telegramAccountText {
  min-width: 0;
  display: block;
}

.telegramAccountText strong,
.telegramNickChip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telegramNickChip span {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.telegramNickChip {
  min-height: 34px;
}

.telegramAccountText strong {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.telegramAccount button,
.telegramNickChip button {
  width: 26px;
  height: 26px;
  min-height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: #8795a9;
  background: transparent;
  cursor: pointer;
}

.telegramAccount button svg,
.telegramNickChip button svg {
  width: 14px;
  height: 14px;
}

.telegramAccount button:hover,
.telegramNickChip button:hover {
  color: var(--red);
  background: #ffffff;
}

.telegramEmpty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

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

.telegramNickField {
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 12px;
  background: #ffffff;
  color: #7a889e;
}

.telegramNickField:focus-within {
  border-color: #8db0ff;
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.1);
}

.telegramNickField svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.telegramNickField input {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 40px;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.telegramExclusionForm button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #2f6df6;
  border-radius: 11px;
  padding: 0 16px;
  color: #ffffff;
  background: #2f6df6;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.telegramExclusionForm button:hover {
  border-color: #155eef;
  background: #155eef;
}

.telegramExclusionForm button svg {
  width: 16px;
  height: 16px;
}

.telegramHintWrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-top: 1px solid var(--line-soft);
  padding: 14px 18px;
  color: var(--muted);
  background: #f6f8fb;
}

.telegramHintWrap > svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 1px;
  color: #2f6df6;
}

.telegramHint {
  min-width: 0;
  min-height: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.telegramHint[data-state="error"] {
  color: var(--red);
}

@media (max-width: 760px) {
  .telegramCompact {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
  }

  .own-ad-tabs {
    flex-wrap: wrap;
    padding-bottom: 7px;
  }

  .own-ads-bot-filter {
    flex-basis: 100%;
    min-height: 34px;
    margin-left: 0;
    padding: 0 14px;
  }

  .telegramPopoverHead {
    align-items: flex-start;
  }

  .telegramPopover {
    width: auto;
    border-radius: 16px;
  }

  .telegramNickField input {
    font-size: 16px;
  }
}

@media (min-width: 761px) and (max-width: 1120px) {
  .telegramPopover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    bottom: auto;
    left: auto;
    width: min(470px, calc(100vw - 32px));
    max-width: min(470px, calc(100vw - 32px));
    max-height: min(720px, calc(100vh - 100px));
    max-height: min(720px, calc(100dvh - 100px));
    padding: 0;
  }
}

@media (max-width: 480px) {
  .telegramPopoverHead,
  .telegramPopoverSection,
  .telegramHintWrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  .telegramPopoverConnect {
    width: 40px;
    padding: 0;
  }

  .telegramPopoverConnect span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .telegramPopoverIdentity {
    gap: 10px;
  }

  .telegramPopoverLogo {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .telegramExclusionForm {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .telegramExclusionForm button {
    width: 42px;
    padding: 0;
  }

  .telegramExclusionForm button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

}

/* Dashboard-blue overrides and Bybit-compatible controls */
.ad-edit-dialog.bybit-editor .bybit-price-types input[type="radio"]:checked {
  border-color: #155eef;
}

.ad-edit-dialog.bybit-editor .bybit-input:focus-within,
.ad-edit-dialog.bybit-editor .bybit-field select:focus,
.ad-edit-dialog.bybit-editor textarea[name="remark"]:focus {
  border-color: #155eef;
}

.ad-edit-dialog.bybit-editor .bybit-text-button,
.ad-edit-dialog.bybit-editor .bybit-limit-row button,
.ad-edit-dialog.bybit-editor .bybit-payment-card header button {
  color: #155eef;
}

.ad-edit-dialog.bybit-editor .bybit-primary-button {
  background: #155eef;
  color: #fff;
}

.ad-edit-dialog.bybit-editor .bybit-primary-button:hover,
.ad-edit-dialog.bybit-editor .bybit-primary-button:focus-visible {
  background: #0757ff;
}

.ad-edit-dialog.bybit-editor .bybit-outline-button:hover,
.ad-edit-dialog.bybit-editor .bybit-outline-button:focus-visible {
  border-color: #b9ceff;
  background: #eef6ff;
  color: #155eef;
}

.ad-edit-dialog.bybit-editor .bybit-check-row > input[type="checkbox"]:checked,
.ad-edit-dialog.bybit-editor .bybit-payment-option > input[type="checkbox"]:checked,
.ad-edit-dialog.bybit-editor .bybit-country-option > input[type="checkbox"]:checked {
  border-color: #155eef;
  background: #155eef;
}

.ad-edit-dialog.bybit-editor .bybit-payment-option:has(input:checked) {
  border-color: #b9ceff;
  background: #f4f7ff;
}

.ad-edit-dialog.bybit-editor .bybit-payment-card header strong::before {
  background: #155eef;
}

.ad-edit-dialog.bybit-editor .bybit-limit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 22px;
  margin-top: 4px;
}

.ad-edit-dialog.bybit-editor .bybit-limit-row button {
  min-height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.ad-edit-dialog.bybit-editor .bybit-limit-row button:hover,
.ad-edit-dialog.bybit-editor .bybit-limit-row button:focus-visible {
  color: #0757ff;
  text-decoration: underline;
}

.ad-edit-dialog.bybit-editor .bybit-check-row > select {
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  outline: 0;
  background: #f3f4f6;
  color: #111820;
  font: inherit;
}

.ad-edit-dialog.bybit-editor .bybit-check-row > select:focus {
  border-color: #155eef;
  background: #fff;
}

.ad-edit-dialog.bybit-editor .bybit-check-row > select:disabled {
  color: #c5cad1;
  cursor: not-allowed;
}

.ad-edit-dialog.bybit-editor .bybit-field-error {
  display: block;
  margin-top: 6px;
  color: #e5484d;
  font-size: 12px;
}

.ad-edit-dialog.bybit-editor .bybit-field-error[hidden] {
  display: none;
}

.ad-edit-dialog.bybit-editor .bybit-input.has-error {
  border-color: #e5484d;
  background: #fff;
}

.ad-edit-dialog.bybit-editor .bybit-country-row {
  grid-template-columns: 17px minmax(0, 1fr);
}

.ad-edit-dialog.bybit-editor .bybit-country-select {
  position: relative;
  grid-column: 2;
  min-width: 0;
}

.ad-edit-dialog.bybit-editor .bybit-country-select > button {
  position: relative;
  width: 100%;
  min-height: 42px;
  padding: 0 38px 0 12px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #f3f4f6;
  color: #a3aab4;
  font: inherit;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-edit-dialog.bybit-editor .bybit-country-select > button::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 14px;
  border-right: 5px solid transparent;
  border-bottom: 6px solid #8e97a3;
  border-left: 5px solid transparent;
  transition: transform 150ms ease;
}

.ad-edit-dialog.bybit-editor .bybit-country-select > button[aria-expanded="true"] {
  border-color: #b9ceff;
  background: #fff;
}

.ad-edit-dialog.bybit-editor .bybit-country-select > button[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.ad-edit-dialog.bybit-editor .bybit-country-select > button.has-value {
  color: #111820;
}

.ad-edit-dialog.bybit-editor .bybit-country-select > button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ad-edit-dialog.bybit-editor .bybit-country-dropdown {
  position: absolute;
  z-index: 12;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  padding: 8px;
  border: 1px solid #e2e7ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(27, 39, 61, 0.16);
}

.ad-edit-dialog.bybit-editor .bybit-country-dropdown[hidden] {
  display: none;
}

.ad-edit-dialog.bybit-editor .bybit-country-dropdown > input[type="search"] {
  width: 100%;
  min-height: 38px;
  margin: 0 0 7px;
  padding: 0 10px;
  border: 1px solid #dbe2ec;
  border-radius: 6px;
  outline: 0;
  background: #fff;
}

.ad-edit-dialog.bybit-editor .bybit-country-dropdown > input[type="search"]:focus {
  border-color: #7da2ff;
  box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.08);
}

.ad-edit-dialog.bybit-editor .bybit-country-options {
  max-height: 190px;
  overflow: auto;
}

.ad-edit-dialog.bybit-editor .bybit-country-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 5px 7px;
  border-radius: 5px;
  cursor: pointer;
}

.ad-edit-dialog.bybit-editor .bybit-country-option:hover {
  background: #f3f6fb;
}

.ad-edit-dialog.bybit-editor .bybit-country-option > input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  border: 1px solid #929ba6;
  border-radius: 2px;
}

.ad-edit-dialog.bybit-editor .bybit-country-option small {
  color: #98a2b3;
  font-size: 10px;
}

.ad-edit-dialog.bybit-editor .bybit-payment-group-title {
  margin: 12px 0 4px;
  color: #155eef;
  font-size: 12px;
  font-weight: 600;
}

.ad-edit-dialog.bybit-editor .bybit-payment-option.is-unavailable {
  border-color: #e7e9ec;
  background: #f7f8fa;
  color: #a8afb9;
  cursor: not-allowed;
}

.ad-edit-dialog.bybit-editor .bybit-payment-option.is-unavailable strong,
.ad-edit-dialog.bybit-editor .bybit-payment-option.is-unavailable small {
  color: #a8afb9;
}

/* Unified advertisement action icons */
.filter-button.card-filter-button,
.filter-button.card-filter-button.edit-ad-action-button,
.filter-button.card-filter-button.listing-action-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
  color: #667085;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.02);
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.filter-button.card-filter-button svg {
  width: 15px;
  height: 15px;
  transition: transform 160ms ease;
}

.filter-button.card-filter-button:hover,
.filter-button.card-filter-button:focus-visible,
.filter-button.card-filter-button.edit-ad-action-button:hover,
.filter-button.card-filter-button.edit-ad-action-button:focus-visible,
.filter-button.card-filter-button.listing-action-button:hover,
.filter-button.card-filter-button.listing-action-button:focus-visible,
.filter-button.card-filter-button.open,
.filter-button.card-filter-button.active {
  border-color: #b9ceff;
  background: #eef6ff;
  color: #155eef;
  box-shadow: 0 4px 10px rgba(21, 94, 239, 0.1);
  transform: translateY(-1px);
}

.filter-button.card-filter-button:hover svg,
.filter-button.card-filter-button:focus-visible svg {
  transform: scale(1.06);
}

.filter-button.card-filter-button:active,
.filter-button.card-filter-button.edit-ad-action-button:active,
.filter-button.card-filter-button.listing-action-button:active {
  transform: translateY(0) scale(0.97);
  box-shadow: none;
}

.filter-button.card-filter-button.listing-action-button:disabled {
  border-color: #eaecf0;
  background: #f8f9fb;
  color: #b5bcc6;
  box-shadow: none;
  transform: none;
}

/* Bybit payment-method accents inside the otherwise blue editor */
.ad-edit-dialog.bybit-editor .bybit-payment-card header strong::before {
  background: #ff9f2d;
}

.ad-edit-dialog.bybit-editor .bybit-payment-card header button,
.ad-edit-dialog.bybit-editor .bybit-payment-group-title {
  color: #f28b16;
}

.ad-edit-dialog.bybit-editor .bybit-payment-card header button:hover,
.ad-edit-dialog.bybit-editor .bybit-payment-card header button:focus-visible {
  color: #d97000;
}

.ad-edit-dialog.bybit-editor .bybit-payment-option > input[type="checkbox"]:checked {
  border-color: #ff9f2d;
  background: #ff9f2d;
}

.ad-edit-dialog.bybit-editor .bybit-payment-option:has(input:checked) {
  border-color: #ffd39d;
  background: #fff8ed;
}

/* Inline counterparty requirements accordion */
.bybit-requirements-host {
  display: block;
  min-width: 0;
}

.bybit-requirements-host > .bybit-inline-action {
  min-height: 34px;
  flex-wrap: wrap;
}

.bybit-requirements-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #155eef !important;
  font-weight: 600;
}

.bybit-requirements-toggle span {
  margin-right: 2px;
}

.bybit-requirements-toggle::after {
  content: "";
  width: 7px;
  height: 7px;
  margin: -3px 0 0 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transform-origin: center;
  transition: transform 180ms ease, margin 180ms ease;
}

.bybit-requirements-toggle.is-open::after {
  margin-top: 4px;
  transform: rotate(225deg);
}

.bybit-selection-summary {
  display: flex;
  flex: 1 1 280px;
  flex-wrap: wrap;
  gap: 6px;
}

.bybit-requirements-host.is-open .bybit-selection-summary {
  display: none;
}

.bybit-requirement-chip {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border: 1px solid #d9e4ff;
  border-radius: 999px;
  background: #f2f6ff;
  color: #315bba;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
}

.bybit-requirements-inline {
  position: static;
  display: block;
  padding: 0;
  margin-top: 12px;
  background: transparent;
}

.bybit-requirements-inline[hidden] {
  display: none;
}

.bybit-requirements-inline .bybit-requirements-card {
  width: 100%;
  max-height: none;
  overflow: visible;
  padding: 16px 18px;
  border: 1px solid #e2e7ef;
  border-radius: 10px;
  background: #fbfcfe;
  box-shadow: none;
}

.bybit-requirements-inline .bybit-requirements-card > header {
  display: none;
}

.bybit-requirements-inline .bybit-requirements-card > p {
  margin-bottom: 10px;
  color: #667085;
  font-size: 12px;
}

.bybit-requirements-inline .bybit-confirm-button {
  width: auto;
  min-width: 130px;
  min-height: 38px;
  margin: 12px 0 0 auto;
  padding: 0 20px;
  border-radius: 8px;
}

@media (max-width: 680px) {
  .bybit-requirements-inline .bybit-requirements-card {
    padding: 14px;
  }

  .bybit-requirements-inline .bybit-check-row {
    grid-template-columns: 17px minmax(0, 1fr);
  }

  .bybit-requirements-inline .bybit-check-row > select,
  .bybit-requirements-inline .bybit-country-select {
    grid-column: 2;
  }
}

/* Compact advertisement editor */
.ad-edit-dialog.bybit-editor.compact-ad-editor {
  position: relative;
  width: min(960px, 100%);
  height: min(930px, calc(100dvh - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  border: 1px solid #e1e6ee;
  border-radius: 14px;
  box-shadow: 0 22px 70px rgba(18, 28, 45, 0.22);
  overflow: hidden;
  contain: layout paint;
}

.ad-edit-backdrop:has(.compact-ad-editor) {
  backdrop-filter: none;
}

.compact-ad-editor .bybit-editor-header {
  position: static;
  min-height: 72px;
  padding: 14px 56px 14px 18px;
  border-radius: 14px 14px 0 0;
}

.compact-ad-editor .bybit-editor-header h2 {
  margin-bottom: 5px;
  font-size: 18px;
}

.compact-ad-editor .bybit-editor-header .ad-edit-meta {
  gap: 8px;
  align-items: center;
}

.compact-ad-editor .bybit-editor-header .ad-edit-meta > span:first-child {
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef4ff;
  color: #155eef;
}

.compact-ad-editor .bybit-editor-header #adEditPair.is-buy {
  background: #ecfdf3;
  color: #067647;
}

.compact-ad-editor .bybit-editor-header #adEditPair.is-sell {
  background: #fef3f2;
  color: #b42318;
}

.compact-ad-editor .ad-edit-close {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 0 14px 0 26px;
  background: transparent;
  color: #66758d;
  overflow: hidden;
  transition: color 0.18s, transform 0.18s;
}

.compact-ad-editor .ad-edit-close::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, #eef1f7 0%, #e4e8f1 100%);
  opacity: 0.72;
  transform: translate(14px, -14px) scale(0.92);
  transform-origin: 100% 0;
  transition: opacity 0.18s, transform 0.22s, box-shadow 0.22s;
}

.compact-ad-editor .ad-edit-close::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 18px;
  height: 18px;
  border-radius: 0 14px 0 18px;
  background: rgba(255, 255, 255, 0.55);
  opacity: 0.65;
  transition: opacity 0.18s, transform 0.22s;
}

.compact-ad-editor .ad-edit-close svg {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  opacity: 0;
  transform: translate(8px, -8px) rotate(-35deg) scale(0.72);
  transition: opacity 0.16s, transform 0.22s;
}

.compact-ad-editor .ad-edit-close:hover,
.compact-ad-editor .ad-edit-close:focus-visible {
  color: #344054;
  outline: none;
  transform: translateY(-1px);
}

.compact-ad-editor .ad-edit-close:hover::before,
.compact-ad-editor .ad-edit-close:focus-visible::before {
  opacity: 1;
  transform: translate(0) scale(1);
  box-shadow: -10px 12px 24px rgba(24, 33, 47, 0.11);
}

.compact-ad-editor .ad-edit-close:hover::after,
.compact-ad-editor .ad-edit-close:focus-visible::after {
  opacity: 0;
  transform: translate(6px, -6px);
}

.compact-ad-editor .ad-edit-close:hover svg,
.compact-ad-editor .ad-edit-close:focus-visible svg {
  opacity: 1;
  transform: translate(0) rotate(0) scale(1);
}

.compact-ad-editor .bybit-editor-content {
  padding: 0 18px;
}

.compact-ad-editor .bybit-editor-footer {
  border-radius: 0 0 14px 14px;
}

.compact-ad-editor .bybit-editor-content > .ad-edit-warning {
  margin: 14px 0 0;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 12px;
}

.compact-ad-editor .compact-editor-section {
  display: block;
  min-height: 0;
  padding: 14px 0;
}

.compact-ad-editor .compact-editor-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.compact-ad-editor .compact-editor-section-head h3,
.compact-ad-editor .compact-editor-pane > h3,
.compact-ad-editor .compact-payment-heading h3 {
  margin: 0;
  color: #101828;
  font-size: 13px;
  font-weight: 600;
}

.compact-ad-editor .compact-editor-section-head p,
.compact-ad-editor .compact-editor-section-head .bybit-help {
  margin: 0;
  color: #7f8da3;
  font-size: 11px;
}

.compact-ad-editor .compact-price-grid {
  display: grid;
  grid-template-columns: 336px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.compact-ad-editor .bybit-price-types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  min-height: 40px;
  margin-top: 17px;
  padding: 2px;
  border-radius: 8px;
  background: #f1f3f6;
}

.compact-ad-editor .bybit-price-types label {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #667085;
  font-size: 13px;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.compact-ad-editor .bybit-price-types label:hover {
  color: #155eef;
}

.ad-edit-dialog.bybit-editor.compact-ad-editor .bybit-price-types input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  overflow: hidden;
  border: 0;
  clip-path: inset(50%);
}

.compact-ad-editor .bybit-price-types label:has(input:checked) {
  border-color: #dfe5ee;
  background: #fff;
  color: #155eef;
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.08);
}

.compact-ad-editor .compact-price-field,
.compact-ad-editor .compact-transaction-grid .bybit-field {
  margin: 0;
}

.compact-ad-editor .compact-price-field > span:first-child,
.compact-ad-editor .compact-transaction-grid .bybit-field > span:first-child {
  margin-bottom: 6px;
  color: #667085;
  font-size: 11px;
}

.compact-ad-editor .bybit-input,
.compact-ad-editor .bybit-field select {
  min-height: 40px;
  border-color: #dde3ec;
  border-radius: 8px;
  background: #fff;
}

.compact-ad-editor .bybit-input:focus-within,
.compact-ad-editor .bybit-field select:focus,
.compact-ad-editor textarea[name="remark"]:focus {
  border-color: #7da2ff;
  box-shadow: 0 0 0 1px rgba(21, 94, 239, 0.08);
}

.compact-ad-editor .bybit-input input {
  height: 38px;
}

.compact-ad-editor .compact-transaction-grid {
  display: grid;
  grid-template-columns: 170px minmax(210px, 1.15fr) minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 10px;
}

.compact-ad-editor .bybit-limit-row {
  align-items: flex-start;
  min-height: 18px;
  margin-top: 3px;
  font-size: 10px;
}

.compact-ad-editor .bybit-limit-row > span:first-child {
  min-width: 0;
}

.compact-ad-editor .bybit-limit-row .bybit-field-error {
  margin: 0;
  font-size: 10px;
  line-height: 1.35;
}

.compact-ad-editor .bybit-limit-row button {
  min-height: 18px;
  font-size: 11px;
}

.compact-ad-editor .bybit-requirements-row .compact-editor-section-head {
  margin-bottom: 8px;
}

.compact-ad-editor .bybit-inline-action {
  min-height: 28px;
  gap: 10px;
}

.compact-ad-editor .bybit-requirements-toggle,
.compact-ad-editor .compact-period-toggle,
.compact-ad-editor .compact-payment-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #155eef !important;
  font-size: 13px;
  font-weight: 600;
}

.compact-ad-editor .bybit-requirements-toggle span,
.compact-ad-editor .compact-payment-toggle span {
  margin: 0;
  font-size: 17px;
  line-height: 1;
}

.compact-ad-editor .bybit-requirement-chip {
  min-height: 23px;
  padding: 2px 8px;
}

.compact-ad-editor .bybit-requirements-inline {
  margin-top: 9px;
}

.compact-ad-editor .bybit-requirements-inline .bybit-requirements-card,
.compact-ad-editor .bybit-payment-inline .bybit-payment-picker-card {
  padding: 13px 14px;
  border: 1px solid #e3e8ef;
  border-radius: 9px;
  background: #fafcff;
}

.compact-ad-editor .bybit-requirements-inline .bybit-requirements-card > p,
.compact-ad-editor .bybit-payment-inline .bybit-payment-picker-card > p {
  margin: 0 0 8px;
  color: #667085;
  font-size: 11px;
  line-height: 1.45;
}

.compact-ad-editor .bybit-requirement-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
}

.compact-ad-editor .bybit-check-row {
  grid-template-columns: 16px minmax(0, 1fr) 82px auto;
  min-height: 38px;
  font-size: 12px;
}

.compact-ad-editor .bybit-check-only {
  grid-template-columns: 16px minmax(0, 1fr);
}

.compact-ad-editor .bybit-country-row {
  grid-column: 1 / -1;
  grid-template-columns: 16px minmax(0, 1fr);
}

.compact-ad-editor .bybit-check-row > select,
.compact-ad-editor .bybit-country-select > button {
  height: 36px;
  min-height: 36px;
}

.compact-ad-editor .bybit-requirements-inline .bybit-confirm-button,
.compact-ad-editor .bybit-payment-inline .bybit-confirm-button {
  min-width: 96px;
  min-height: 34px;
  height: 34px;
  margin-top: 10px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 12px;
}

.compact-ad-editor .compact-editor-split {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 18px;
}

.compact-ad-editor .compact-editor-pane {
  min-width: 0;
}

.compact-ad-editor .compact-editor-pane > h3,
.compact-ad-editor .compact-payment-heading {
  margin-bottom: 8px;
}

.compact-ad-editor textarea[name="remark"] {
  height: 120px !important;
  min-height: 120px !important;
  max-height: 120px !important;
  padding: 12px;
  border: 1px solid #dde3ec;
  border-radius: 8px;
  resize: none !important;
  background: #f8f9fb;
  line-height: 1.45;
  overscroll-behavior: contain;
  scrollbar-color: #98a2b3 transparent;
  scrollbar-width: thin;
}

.compact-ad-editor textarea[name="remark"]::-webkit-resizer,
.compact-ad-editor textarea[name="remark"]::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.compact-ad-editor textarea[name="remark"]::-webkit-scrollbar {
  width: 8px;
}

.compact-ad-editor textarea[name="remark"]::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #98a2b3;
  background-clip: padding-box;
}

.compact-ad-editor .compact-note-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 5px;
  color: #8a96a8;
  font-size: 10px;
}

.compact-ad-editor .compact-note-meta .bybit-counter {
  margin: 0;
  font-size: inherit;
}

.compact-ad-editor .compact-payment-heading {
  display: flex;
  align-items: center;
  gap: 7px;
}

.compact-ad-editor .bybit-payment-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 7px;
}

.compact-ad-editor .bybit-payment-card {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px 0 18px;
  border-color: #e1e6ee;
  border-radius: 8px;
  background: #f5f6f8;
}

.compact-ad-editor .bybit-payment-card::before {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 7px;
  width: 2px;
  border-radius: 2px;
  background: #98a2b3;
}

.compact-ad-editor .bybit-payment-card > strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #27364b;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-ad-editor .bybit-payment-card header {
  display: block;
  min-width: 0;
  min-height: 0;
  padding: 0 7px;
  background: transparent;
}

.compact-ad-editor .bybit-payment-card header strong {
  display: block;
  overflow: hidden;
  padding: 0;
  color: #101828;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-ad-editor .bybit-payment-card header strong::before {
  display: none;
}

.compact-ad-editor .bybit-payment-card header button {
  position: absolute;
  top: 8px;
  right: 7px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  padding: 0;
  border-radius: 6px;
  color: #8b95a5;
  font-size: 17px;
}

.compact-ad-editor .bybit-payment-card header button:hover,
.compact-ad-editor .bybit-payment-card header button:focus-visible {
  background: #eef4ff;
  color: #155eef;
}

.compact-ad-editor .bybit-payment-card p {
  grid-column: 1;
  margin: 2px 0 0;
  padding: 0 7px;
  overflow: hidden;
  color: #8a96a8;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-ad-editor .compact-payment-toggle {
  position: relative;
  padding-right: 17px;
}

.compact-ad-editor .compact-payment-toggle::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 1px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: top 180ms ease, transform 180ms ease;
}

.compact-ad-editor .compact-payment-toggle.is-open::after {
  top: 11px;
  transform: rotate(225deg);
}

.compact-ad-editor .bybit-requirements-toggle,
.compact-ad-editor .compact-payment-toggle {
  position: relative;
  width: auto;
  min-height: 32px;
  padding: 0 34px 0 12px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  background: #fff;
  color: #5f6f86 !important;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.02);
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.compact-ad-editor .bybit-requirements-toggle:hover,
.compact-ad-editor .bybit-requirements-toggle:focus-visible,
.compact-ad-editor .compact-period-toggle:hover,
.compact-ad-editor .compact-period-toggle:focus-visible,
.compact-ad-editor .compact-payment-toggle:hover,
.compact-ad-editor .compact-payment-toggle:focus-visible,
.compact-ad-editor .bybit-requirements-toggle.is-open,
.compact-ad-editor .compact-period-toggle.is-open,
.compact-ad-editor .compact-payment-toggle.is-open {
  border-color: #b9ceff;
  background: #f8fbff;
  color: #155eef !important;
  box-shadow: 0 2px 7px rgba(21, 94, 239, 0.08);
}

.compact-ad-editor .bybit-requirements-toggle::after,
.compact-ad-editor .compact-period-toggle::after,
.compact-ad-editor .compact-payment-toggle::after {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 6px;
  height: 6px;
  margin: 0;
  border-width: 0 1.5px 1.5px 0;
  border-style: solid;
  transform: translateY(-50%) rotate(-45deg);
  transition: transform 180ms ease;
}

.compact-ad-editor .bybit-requirements-toggle.is-open::after,
.compact-ad-editor .compact-period-toggle.is-open::after,
.compact-ad-editor .compact-payment-toggle.is-open::after {
  top: 50%;
  margin: 0;
  transform: translateY(-65%) rotate(45deg);
}

.compact-ad-editor .bybit-requirements-toggle:active,
.compact-ad-editor .compact-period-toggle:active,
.compact-ad-editor .compact-payment-toggle:active {
  background: #eef4ff;
  box-shadow: none;
}

.compact-ad-editor .compact-period-field {
  position: relative;
}

.compact-ad-editor .bybit-field select.compact-period-native {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip-path: inset(50%);
}

.compact-ad-editor .compact-period-select {
  position: relative;
}

.compact-ad-editor .compact-period-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  height: 40px;
  text-align: left;
  cursor: pointer;
}

.compact-ad-editor .compact-period-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 5px);
  left: 0;
  width: 100%;
  padding: 4px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.12);
  transform-origin: top;
  animation: compact-period-menu-in 160ms ease both;
}

.compact-ad-editor .compact-period-menu[hidden] {
  display: none;
}

.compact-ad-editor .compact-period-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5f6f86;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

.compact-ad-editor .compact-period-menu button:hover,
.compact-ad-editor .compact-period-menu button:focus-visible,
.compact-ad-editor .compact-period-menu button.is-selected {
  background: #eef4ff;
  color: #155eef;
  outline: none;
}

@keyframes compact-period-menu-in {
  from { opacity: 0; transform: translateY(-4px) scaleY(0.96); }
  to { opacity: 1; transform: translateY(0) scaleY(1); }
}

.compact-ad-editor .bybit-payment-inline {
  position: static;
  display: block;
  padding: 0;
  margin-top: 9px;
  background: transparent;
}

.compact-ad-editor .bybit-payment-inline[hidden] {
  display: none;
}

.compact-ad-editor .bybit-payment-inline .bybit-submodal-card {
  width: 100%;
  max-height: none;
  overflow: visible;
  box-shadow: none;
}

.compact-ad-editor .bybit-payment-inline .bybit-submodal-card > header {
  display: none;
}

.compact-ad-editor .bybit-payment-picker {
  grid-template-columns: 1fr;
  gap: 2px;
}

.compact-ad-editor .bybit-payment-option {
  min-height: 32px;
  gap: 8px;
  padding: 5px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  transition: color 150ms ease, background-color 150ms ease;
}

.compact-ad-editor .bybit-payment-option:not(.is-unavailable):hover {
  background: #f5f8ff;
}

.ad-edit-dialog.bybit-editor.compact-ad-editor .bybit-payment-option:has(input:checked) {
  border: 0;
  background: #eef4ff;
}

.ad-edit-dialog.bybit-editor.compact-ad-editor .bybit-payment-option > input[type="checkbox"]:checked {
  border-color: #155eef;
  background: #155eef;
}

.compact-ad-editor .bybit-payment-option span {
  display: block;
  gap: 0;
}

.compact-ad-editor .bybit-payment-option strong {
  color: #27364b;
  font-size: 12px;
  font-weight: 500;
}

.compact-ad-editor .bybit-payment-option small {
  margin-top: 2px;
  font-size: 9px;
}

.compact-ad-editor .bybit-editor-footer {
  min-height: 66px;
  padding: 10px 18px;
}

.compact-ad-editor .compact-editor-footer-note {
  display: grid;
  gap: 3px;
  color: #7f8da3;
  font-size: 10px;
}

.compact-ad-editor .compact-editor-footer-note .ad-edit-error {
  margin: 0;
}

.compact-ad-editor .bybit-editor-footer .secondary-button,
.compact-ad-editor .bybit-editor-footer .bybit-primary-button {
  min-width: 118px;
  height: 38px;
  border-radius: 9px;
  font-size: 13px;
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.compact-ad-editor .bybit-editor-footer #adEditSave {
  border-color: #1d2939;
  background: #1d2939;
  color: #fff;
}

.compact-ad-editor .bybit-editor-footer #adEditSave:hover,
.compact-ad-editor .bybit-editor-footer #adEditSave:focus-visible {
  border-color: #111c2b;
  background: #111c2b;
}

.compact-ad-editor .bybit-editor-footer .secondary-button:hover:not(:disabled),
.compact-ad-editor .bybit-editor-footer .bybit-primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(16, 24, 40, 0.12);
}

.compact-ad-editor .bybit-editor-footer .secondary-button:active:not(:disabled),
.compact-ad-editor .bybit-editor-footer .bybit-primary-button:active:not(:disabled) {
  transform: translateY(1px) scale(0.97);
  box-shadow: none;
}

@media (max-width: 860px) {
  .compact-ad-editor .compact-price-grid {
    grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  }

  .compact-ad-editor .compact-transaction-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .ad-edit-dialog.bybit-editor.compact-ad-editor {
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-width: 0;
    border-radius: 0;
  }

  .compact-ad-editor .bybit-editor-header,
  .compact-ad-editor .bybit-editor-footer {
    padding-right: 14px;
    padding-left: 14px;
  }

  .compact-ad-editor .bybit-editor-content {
    padding: 0 14px;
  }

  .compact-ad-editor .compact-editor-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .compact-ad-editor .compact-price-grid,
  .compact-ad-editor .compact-transaction-grid,
  .compact-ad-editor .compact-editor-split {
    grid-template-columns: 1fr;
  }

  .compact-ad-editor .bybit-price-types {
    margin-top: 0;
  }

  .compact-ad-editor .compact-editor-split {
    gap: 16px;
  }

  .compact-ad-editor .bybit-requirement-list,
  .compact-ad-editor .bybit-payment-picker {
    grid-template-columns: 1fr;
  }

  .compact-ad-editor .bybit-payment-cards {
    grid-template-columns: 1fr 1fr;
  }

  .compact-ad-editor .compact-editor-footer-note > span {
    display: none;
  }
}

@media (max-width: 430px) {
  .compact-ad-editor .bybit-payment-cards {
    grid-template-columns: 1fr;
  }

  .compact-ad-editor .bybit-editor-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-ad-editor .bybit-editor-footer > div:last-child,
  .compact-ad-editor .bybit-editor-footer .secondary-button,
  .compact-ad-editor .bybit-editor-footer .bybit-primary-button {
    width: 100%;
  }
}

/* Unified Bybit-style focus treatment in dashboard blue */
:root {
  --dashboard-control-focus: #155eef;
  --dashboard-control-focus-ring: rgba(21, 94, 239, 0.1);
  --dashboard-control-focus-shadow: 0 0 0 0.5px var(--dashboard-control-focus-ring);
}

:where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]),
  select,
  textarea,
  [contenteditable="true"]
):focus {
  border-color: var(--dashboard-control-focus) !important;
  outline: none !important;
  box-shadow: var(--dashboard-control-focus-shadow) !important;
}

:where(
  .bybit-input,
  .telegramNickField,
  .ad-edit-input-unit
):focus-within {
  border-color: var(--dashboard-control-focus) !important;
  outline: none !important;
  box-shadow: var(--dashboard-control-focus-shadow) !important;
}

:where(
  .bybit-input,
  .telegramNickField,
  .ad-edit-input-unit
) :where(input, select, textarea):focus {
  border-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
}

:where(button, a, [tabindex]):focus-visible {
  border-color: var(--dashboard-control-focus) !important;
  outline: none !important;
  box-shadow: var(--dashboard-control-focus-shadow) !important;
}

:where(input[type="checkbox"], input[type="radio"]):focus-visible {
  outline: 1px solid var(--dashboard-control-focus) !important;
  outline-offset: 1px !important;
  box-shadow: var(--dashboard-control-focus-shadow) !important;
}

.bot-toggle input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.bot-toggle input:focus-visible + span {
  outline: 1px solid var(--dashboard-control-focus) !important;
  outline-offset: 1px !important;
  box-shadow: var(--dashboard-control-focus-shadow) !important;
}

/* Authentication screen matches the Broker Order Flasher reference. */
.login-card input:focus {
  border-color: #b8cdf8 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.1) !important;
}
