/* Rapira keeps the exact visual system of broker-walk-bot.ru.
   This file contains only exchange-specific layout additions. */

[hidden] {
  display: none !important;
}
/* Two independent market books alongside the collapsible ad-scoped book. */
.workspaceGrid.three-book-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}

.three-book-layout > .orderbookPanel,
.three-book-layout > .logsPanel {
  justify-self: stretch;
  width: 100%;
  max-width: none;
}

.three-book-layout.scoped-book-collapsed > .logsPanel {
  order: -1;
}

.scoped-book-toggle {
  flex: 0 0 auto;
  min-height: 30px;
  white-space: nowrap;
}

.logsPanel .logs-update-label {
  order: 2;
  margin-left: auto;
}

.logsPanel .scoped-book-expand {
  order: 3;
  margin-left: 0;
  border-color: #cfd8e6;
  background: #fff;
  color: #667085;
}

.logsPanel .scoped-book-expand[hidden] {
  display: none;
}

.ordinary-orderbook-panel.orderbookPanel {
  grid-column: auto;
  overflow: visible;
}

.ordinary-book-head {
  min-height: 52px;
}

.ordinary-book-times {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.ordinary-book-back {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  background: #fff;
  color: #475467;
  text-decoration: none;
}

.ordinary-book-toolbar {
  position: relative;
  z-index: 24;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 12px;
  border-bottom: 1px solid #edf1f6;
  background: #fff;
}

.ordinary-book-pills {
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
}

.ordinary-book-pills .mode-pill {
  max-width: none;
}

.ordinary-book-pills .token-mode-pill {
  background: #eef4ff;
  color: #155eef;
  font-weight: 700;
}

.ordinary-book-pills .side-buy {
  background: #ecfdf3;
  color: #067647;
}

.ordinary-book-pills .side-sell {
  background: #fef3f2;
  color: #b42318;
}

.ordinary-book-filter-wrap {
  flex: 0 0 auto;
}

.ordinary-book-filter-popover {
  right: 0;
  left: auto;
  width: min(390px, calc(100vw - 36px));
  max-height: min(76vh, 720px);
  overflow: auto;
}

.ordinary-book-filter-popover > span {
  display: block;
  margin: 4px 0 6px;
  color: #66758d;
  font-size: 12px;
  font-weight: 600;
}

.ordinary-book-option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 11px;
}

.ordinary-book-option-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ordinary-book-option-grid button {
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid #d8e0eb;
  border-radius: 7px;
  background: #fff;
  color: #344054;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.ordinary-book-option-grid button:hover,
.ordinary-book-option-grid button:focus-visible,
.ordinary-book-option-grid button.active {
  border-color: #b9ceff;
  background: #eef6ff;
  color: #155eef;
}

.ordinary-book-option-grid button.buy.active {
  border-color: #a6e8c6;
  background: #ecfdf3;
  color: #067647;
}

.ordinary-book-option-grid button.sell.active {
  border-color: #f7b9b4;
  background: #fef3f2;
  color: #b42318;
}

.ordinary-book-filter-field {
  display: grid;
  gap: 5px;
  margin-bottom: 9px;
  color: #66758d;
  font-size: 12px;
  font-weight: 500;
}

.ordinary-book-filter-field input,
.ordinary-book-filter-field select {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #d8e0eb;
  border-radius: 7px;
  background: #fff;
  color: #18212f;
  font-size: 13px;
}

.ordinary-book-filter-popover .mini-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: #344054;
  font-size: 12px;
}

.ordinary-book-apply {
  width: 100%;
  min-height: 36px;
  margin-top: 8px;
  border-color: #155eef;
  background: #155eef;
  color: #fff;
}

.ordinary-book-apply:disabled {
  border-color: #e4e7ec;
  background: #f2f4f7;
  color: #98a2b3;
  cursor: default;
}

.ordinary-book-window-button,
.dashboard-filter-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  color: #667085;
}

.ordinary-book-window-button:hover,
.dashboard-filter-button:hover,
.dashboard-filter-button.active,
.dashboard-filter-button.dirty {
  border-color: #b9ceff;
  background: #eef6ff;
  color: #155eef;
}

.dashboard-filter-button.dirty::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #f79009;
}

.ordinary-book-status {
  padding: 9px 14px;
  border-bottom: 1px solid #fecdca;
  background: #fef3f2;
  color: #b42318;
  font-size: 12px;
}

.three-book-layout .orderbookPanel .ordinary-book-list,
.ordinary-book-window-shell .orderbookPanel .ordinary-book-list {
  max-height: 1200px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.three-book-layout > .ordinary-orderbook-panel .ordinary-book-row {
  grid-template-columns: minmax(185px, 0.95fr) minmax(190px, 1.05fr);
  grid-template-rows: auto auto auto;
  align-items: start;
  gap: 4px 16px;
  min-height: 0;
  padding: 9px 14px 7px;
  overflow: visible;
}

.ordinary-book-row .merchant-cell {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  overflow: visible;
}

.ordinary-book-row .merchant-line {
  flex-wrap: wrap;
  row-gap: 3px;
  overflow: visible;
  white-space: normal;
}

.ordinary-book-row .price-cell {
  grid-column: 1;
  grid-row: 2;
  justify-content: flex-start;
  margin-top: 8px;
}

.ordinary-book-row .amount-cell {
  grid-column: 1;
  grid-row: 3;
  gap: 7px;
  margin-top: 3px;
}

.ordinary-book-row .price-cell strong {
  font-size: 17px;
}

.ordinary-book-row .amount-cell strong,
.ordinary-book-row .amount-cell span {
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.ordinary-payment-summary {
  max-width: 100%;
  overflow: hidden;
  border: 0 !important;
  background: #f2f4f7 !important;
  color: #667085 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ordinary-verified-badge {
  display: inline-grid;
  width: 15px;
  height: 15px;
  place-items: center;
  border-radius: 50%;
  background: #2e90fa;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.ordinary-alert-badge {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: #f79009;
}

.ordinary-alert-badge svg {
  width: 16px;
  height: 16px;
}

.ordinary-fast-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  color: #f5a300;
  font-size: 15px;
  line-height: 1;
}

.ordinary-risk-badge,
.ordinary-info-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
}

.ordinary-risk-badge {
  background: #fef3f2;
  color: #b42318;
}

.ordinary-info-badge {
  background: #eef6ff;
  color: #155eef;
  cursor: default;
}

.ordinary-info-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 5000;
  display: grid;
  gap: 7px;
  width: 300px;
  border: 1px solid #dfe6ef;
  border-radius: 8px;
  background: #fff;
  color: #18212f;
  padding: 12px;
  box-shadow: 0 16px 38px rgba(24, 33, 47, 0.18);
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.ordinary-info-badge:hover .ordinary-info-popover,
.ordinary-info-badge:focus .ordinary-info-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.ordinary-info-popover b {
  font-size: 13px;
}

.ordinary-info-popover > span {
  border-radius: 7px;
  background: #f6f8fb;
  padding: 8px 9px;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ordinary-book-window-page {
  min-width: 0;
  margin: 0;
  background: #f4f7fb;
}

.ordinary-book-window-shell {
  width: 100%;
  min-height: 100dvh;
  padding: 12px;
}

.ordinary-book-window-shell .ordinary-orderbook-panel,
.ordinary-book-window-shell .ordinary-book-list {
  width: 100%;
  max-width: none;
}

.ordinary-book-window-shell .ordinary-book-list {
  max-height: calc(100dvh - 118px);
}

.ordinary-book-window-shell .ordinary-book-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 7px 10px;
  padding: 10px 12px;
}

.ordinary-book-window-shell .ordinary-book-row .merchant-cell {
  flex: 1 1 calc(100% - 112px);
}

.ordinary-book-window-shell .ordinary-book-row .price-cell {
  flex: 0 0 102px;
  justify-content: flex-end;
  margin-top: 0;
}

.ordinary-book-window-shell .ordinary-book-row .amount-cell {
  flex: 1 1 100%;
  margin-top: 0;
}

@media (max-width: 1120px) {
  .workspaceGrid.three-book-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .workspaceGrid.three-book-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .three-book-layout > .logsPanel,
  .three-book-layout > .orderbookPanel {
    grid-column: auto;
  }

  .three-book-layout > .ordinary-orderbook-panel .ordinary-book-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .ordinary-book-head,
  .ordinary-book-toolbar {
    align-items: flex-start;
  }

  .ordinary-book-times {
    width: 100%;
    justify-content: space-between;
  }

  .three-book-layout .orderbookPanel .ordinary-book-list {
    max-height: none;
    overflow: visible;
  }
}

.rapira-header-icon {
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #66758d;
  padding: 0;
  box-shadow: none;
}

.rapira-header-icon:hover,
.rapira-header-icon:focus-visible {
  background: #eef6ff;
  color: #155eef;
  outline: none;
}

.rapira-header-icon:disabled {
  cursor: default;
  opacity: 0.45;
}

.accountStatus .accountUid {
  color: #111820;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.accountStatus .accountLabel {
  color: #66758d;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
}

.account-title-line,
.account-badges {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  overflow: visible;
}

.account-title-line .accountUid {
  min-width: 0;
}

.own-ad-card .filter-button {
  min-width: 34px;
  padding: 0;
}

.rapira-telemetry {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.rapira-telemetry strong {
  color: #66758d;
  font-size: 11px;
  font-weight: 400;
  white-space: normal;
}

.rapira-telemetry span {
  overflow: hidden;
  color: #66758d;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rapira-decision-error strong {
  color: #66758d;
}

.rapira-decision-change strong {
  color: #66758d;
}

.rapira-book-summary {
  flex-wrap: wrap;
}

.rapira-book-summary .mode-pill {
  max-width: none;
}

.rapira-rub-price {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.rapira-rub-price-line {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.rapira-rub-price-line strong {
  color: #111820;
  font-size: 16px;
  font-weight: 600;
}

.price-cell .rapira-rate-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  background: #dff8ea;
  color: #079455;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 700;
}

.price-cell .rapira-fee-note {
  color: #667085;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
}

.rapira-payment-list {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
}

.rapira-payment-logo {
  display: inline-grid;
  place-items: center;
  width: 20px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  flex: 0 0 20px;
}

.rapira-payment-logo.rapira-payment-sbp {
  width: 22px;
  min-width: 22px;
  border-radius: 0;
  background: transparent;
  flex-basis: 22px;
}

.rapira-payment-sbp svg {
  width: 20px;
  height: 20px;
}

.rapira-payment-s-bank { background: #21a651; }
.rapira-payment-a-bank { background: #ed3237; }
.rapira-payment-t-bank { background: #ffd52f; color: #172133; }
.rapira-payment-v-bank { background: #0799d2; }
.rapira-payment-pochta-bank { background: #1559aa; }
.rapira-payment-g-bank { background: #16a078; }
.rapira-payment-r-bank { background: #f5c500; color: #172133; }
.rapira-payment-o-bank { background: #7357d9; }
.rapira-payment-agro-bank { background: #167644; }
.rapira-payment-mts-bank { background: #ea1c24; }
.rapira-payment-ya-bank { background: #ffcc00; color: #111820; }
.rapira-payment-generic { background: #73819a; }

.rapira-payment-name {
  overflow: hidden;
  color: #111820;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rapira-payment-more {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 20px;
  border-radius: 5px;
  background: #f1f3f6;
  color: #667085;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 600;
  cursor: help;
  flex: 0 0 auto;
}

.rapira-payment-empty {
  color: #98a2b3;
  font-size: 12px;
}

.rapira-verified-badge,
.rapira-suspicious-badge {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  cursor: help;
}

.rapira-verified-badge {
  width: 17px;
  height: 17px;
  color: #1584d8;
}

.rapira-verified-badge svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.rapira-suspicious-badge {
  width: 16px;
  height: 16px;
  color: #f05100;
}

.rapira-suspicious-badge {
  outline: none;
}

.rapira-floating-tooltip {
  position: fixed;
  z-index: 5000;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: min(350px, calc(100vw - 20px));
  border: 1px solid #eaecf0;
  border-radius: 8px;
  background: #ffffff;
  color: #18212f;
  padding: 11px 14px;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.16);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  pointer-events: none;
}

.rapira-floating-tooltip[hidden] {
  display: none;
}

.rapira-floating-tooltip img {
  display: block;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.rapira-suspicious-badge svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.pill.side-0 {
  background: var(--green-soft);
  color: #067647;
}

.own-ad-head-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rapira-trading-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.rapira-trading-status.is-running {
  background: #ecfdf3;
  color: #067647;
}

.rapira-trading-status.is-stopped {
  background: #fff0f0;
  color: #b42318;
}

.rapira-inline-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 5px;
  background: #eaf2ff;
  color: #1570ef;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.rapira-inline-verified::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1570ef;
  color: #ffffff;
  font-size: 9px;
}

.own-ad-card,
.own-ad-card:hover,
.own-ad-card:focus-within {
  border-color: #e0e6ef;
  box-shadow: none;
}

.orderbookPanel .ad-row.competitor {
  background: #eef6ff;
  box-shadow: none;
}

.own-ad-status-cell em {
  color: #66758d;
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.ownAdBlock .own-ad-direction,
.ownAdBlock .own-ad-direction em {
  overflow: visible;
}

.ownAdBlock .own-ad-direction em {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-overflow: clip;
  white-space: nowrap;
}

.orderbookPanel {
  overflow: visible;
}

.orderbookPanel .orderbook-list {
  max-height: none;
  overflow: visible;
  overscroll-behavior: auto;
  scrollbar-gutter: auto;
}

.orderbookPanel .ad-row.own-orderbook-ad {
  background: #fff8eb;
}

.orderbookPanel .merchant-tags .rapira-own-ad-badge {
  background: #fff0d5;
  color: #b54708;
}

.orderbookPanel .merchant-tags:empty {
  display: none;
}

.orderbookPanel .ad-row,
.orderbookPanel .merchant-cell,
.orderbookPanel .merchant-tags {
  overflow: visible;
}

.orderbookPanel .ad-row:has(.rapira-conditions:hover),
.orderbookPanel .ad-row:has(.rapira-conditions:focus-within) {
  position: relative;
  z-index: 30;
}

.rapira-conditions {
  position: relative;
  display: inline-flex;
}

.rapira-conditions-badge {
  min-height: 20px;
  border: 0;
  border-radius: 4px;
  background: #f2f4f7;
  color: #52627a;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  cursor: help;
  box-shadow: none;
}

.rapira-conditions-badge:hover,
.rapira-conditions-badge:focus-visible {
  background: #eaf2ff;
  color: #155eef;
  outline: none;
}

.rapira-conditions-tooltip {
  position: absolute;
  z-index: 80;
  top: calc(100% + 7px);
  left: 0;
  display: none;
  width: min(360px, calc(100vw - 48px));
  max-height: none;
  overflow: visible;
  border: 1px solid #dbe3ef;
  border-radius: 9px;
  background: #ffffff;
  color: #344054;
  padding: 12px;
  box-shadow: 0 14px 38px rgba(24, 33, 47, 0.18);
  font-size: 12px;
  line-height: 1.45;
}

.rapira-conditions:hover .rapira-conditions-tooltip,
.rapira-conditions:focus-within .rapira-conditions-tooltip {
  display: block;
}

.rapira-conditions-tooltip > strong {
  display: block;
  margin-bottom: 9px;
  color: #18212f;
  font-size: 13px;
  font-weight: 600;
}

.rapira-conditions-tooltip dl {
  display: grid;
  gap: 6px;
  margin: 0 0 9px;
}

.rapira-conditions-tooltip dl > div {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 8px;
}

.rapira-conditions-tooltip dt { color: #66758d; }
.rapira-conditions-tooltip dd { margin: 0; color: #18212f; }

.rapira-conditions-tooltip p {
  margin: 0;
  border-top: 1px solid #edf0f4;
  padding-top: 9px;
  color: #344054;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.rapira-presence {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.rapira-presence::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #98a2b3;
}

.rapira-presence.is-online {
  color: #067647;
}

.rapira-presence.is-online::before {
  background: #12b76a;
}

.merchant-tags .rapira-special-tag,
.rapira-special-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
}

.merchant-tags .rapira-special-tag.is-danger,
.rapira-special-tag.is-danger {
  background: #fff0f1;
  color: #f04455;
}

.merchant-tags .rapira-special-tag.is-exchanger,
.rapira-special-tag.is-exchanger {
  background: #fff7e8;
  color: #f79009;
}

.rapira-excluded-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  border-radius: 5px;
  background: #fff0f1;
  color: #d92d3f;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.rapira-special-filter-fieldset {
  overflow: visible;
}

.rapira-special-filter-list {
  display: grid;
  gap: 7px;
}

.rapira-special-filter-list label {
  display: grid;
  grid-template-columns: 18px max-content minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 42px;
  border: 1px solid #edf0f4;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
  cursor: pointer;
}

.rapira-special-filter-list label:hover {
  border-color: #cfd8e6;
  background: #f9fbff;
}

.rapira-special-filter-list input {
  width: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: #1677ff;
  cursor: pointer;
}

.rapira-special-filter-list small {
  color: #66758d;
  font-size: 11px;
  font-weight: 400;
  text-align: right;
}

@media (max-width: 700px) {
  .own-ad-head-meta {
    align-items: flex-end;
    flex-direction: column;
    gap: 5px;
  }

  .rapira-special-filter-list label {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .rapira-special-filter-list small {
    grid-column: 2;
    text-align: left;
  }
}

.rapira-dialog {
  width: min(620px, calc(100vw - 32px));
  max-width: none;
  max-height: min(880px, calc(100vh - 32px));
  max-height: min(880px, calc(100dvh - 32px));
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: #ffffff;
  color: #111820;
  padding: 0;
  box-shadow: 0 20px 64px rgba(22, 28, 36, 0.2);
}

.rapira-dialog-wide {
  width: min(920px, calc(100vw - 32px));
}

.rapira-dialog::backdrop {
  background: rgba(23, 27, 33, 0.58);
  backdrop-filter: blur(1px);
}

.rapira-dialog-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  max-height: inherit;
  margin: 0;
}

.rapira-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: 70px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid #eaecf0;
  background: #ffffff;
}

.rapira-dialog-header h2 {
  margin-top: 4px;
  color: #111820;
  font-size: 20px;
  font-weight: 600;
}

.rapira-dialog-eyebrow {
  color: #667085;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rapira-close {
  display: grid;
  place-items: center;
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: #667085;
  padding: 0;
  font-size: 24px;
  font-weight: 400;
  box-shadow: none;
}

.rapira-close:hover,
.rapira-close:focus-visible {
  background: #f2f4f7;
  color: #111820;
  outline: none;
}

.rapira-dialog-body {
  display: grid;
  gap: 16px;
  overflow: auto;
  padding: 20px 22px;
}

.rapira-dialog-body > label,
.rapira-form-grid label,
.rapira-fieldset label {
  display: grid;
  gap: 7px;
  color: #52627a;
  font-size: 13px;
  font-weight: 500;
}

.rapira-dialog-body input,
.rapira-dialog-body textarea,
.rapira-dialog-body select {
  width: 100%;
  min-height: 42px;
  border-color: #d5deec;
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 14px;
  outline: none;
}

.rapira-dialog-body input:focus,
.rapira-dialog-body textarea:focus,
.rapira-dialog-body select:focus {
  border-color: #b8cdf8;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.1);
}

.rapira-dialog-body input:disabled,
.rapira-dialog-body textarea:disabled {
  border-color: #e4e7ec;
  background: #f2f4f7;
  color: #98a2b3;
  cursor: not-allowed;
  opacity: 1;
}

.rapira-secret-wrap {
  position: relative;
  display: block;
}

.rapira-secret-input {
  padding-bottom: 40px !important;
  -webkit-text-security: disc;
}

.rapira-secret-input.is-visible {
  -webkit-text-security: none;
}

.rapira-secret-toggle {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-height: 28px;
  border: 1px solid #d5deec;
  border-radius: 7px;
  background: #fff;
  color: #52627a;
  padding: 4px 9px;
  font-size: 12px;
  cursor: pointer;
}

.rapira-secret-toggle:disabled {
  border-color: #e4e7ec;
  background: #e4e7ec;
  color: #98a2b3;
  cursor: not-allowed;
}

.rapira-dialog-copy {
  color: #66758d;
  line-height: 1.5;
}

.rapira-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.rapira-form-grid > label {
  align-content: start;
  align-self: start;
}

.rapira-fixed-input[readonly] {
  border-color: #e4e7ec;
  background: #f2f4f7;
  color: #667085;
  cursor: not-allowed;
  opacity: 1;
}

.rapira-checkbox-row {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 64px;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: #f8fbff;
  padding: 11px 13px;
  cursor: pointer;
}

.rapira-checkbox-row > input {
  width: 17px;
  min-height: 17px;
  margin: 0;
  accent-color: #1677ff;
  cursor: pointer;
}

.rapira-checkbox-row > span {
  display: grid;
  gap: 4px;
}

.rapira-checkbox-row strong {
  color: #66758d;
  font-size: 13px;
  font-weight: 500;
}

.rapira-checkbox-row small {
  color: #66758d;
  font-size: 12px;
  line-height: 1.35;
}

.rapira-price-range-hint {
  color: #66758d;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
}

.rapira-dialog-body input[aria-invalid="true"] {
  border-color: #f04438;
  background: #fffafa;
  color: #b42318;
  box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.1);
}

.rapira-dialog-body input[aria-invalid="true"]:focus {
  border-color: #f04438;
  box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.14);
}

.rapira-price-range-hint.is-error {
  color: #d92d20;
}

.rapira-switch-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: #f8fbff;
  padding: 11px 13px;
}

.rapira-switch-row > span:first-child {
  display: grid;
  gap: 4px;
}

.rapira-switch-row strong {
  color: #18212f;
  font-size: 13px;
}

.rapira-switch-row small {
  color: #66758d;
  font-size: 12px;
  line-height: 1.35;
}

.rapira-switch-emphasized {
  border-color: #cfe0ff;
  background: #eef6ff;
}

.rapira-fieldset {
  min-width: 0;
  margin: 0;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  padding: 13px;
}

.rapira-fieldset legend {
  color: #344054;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 600;
}

.rapira-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.rapira-choice-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 38px;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: #ffffff;
  padding: 7px 9px;
  cursor: pointer;
}

.rapira-choice-grid input[type="checkbox"] {
  width: 15px;
  min-width: 15px;
  min-height: 15px;
  margin: 0;
  padding: 0;
  accent-color: #155eef;
}

.rapira-choice-grid span {
  overflow: hidden;
  color: #344054;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rapira-choice-tall {
  max-height: 220px;
  overflow: auto;
}

.rapira-ad-payment-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rapira-filter-payment-count {
  display: inline-grid;
  place-items: center;
  min-width: 25px;
  height: 22px;
  border-radius: 6px;
  background: #f1f3f6;
  color: #667085;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 600;
}

.rapira-ad-payment-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #eaf2ff;
  color: #2f78ff;
}

.rapira-ad-payment-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rapira-exclusions-field {
  gap: 10px !important;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: #f8fbff;
  padding: 13px;
}

.rapira-exclusions-field > span {
  display: grid;
  gap: 4px;
}

.rapira-exclusions-field strong {
  color: #18212f;
  font-size: 13px;
}

.rapira-exclusions-field small {
  color: #66758d;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.rapira-exclusions-field textarea {
  min-height: 78px;
  resize: vertical;
}

.rapira-form-error {
  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;
}

.rapira-safety-note {
  border-left: 3px solid #f79009;
  background: #fffaf0;
  color: #7a3b00;
  padding: 10px 12px;
  line-height: 1.45;
}

.rapira-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-height: 66px;
  padding: 12px 22px;
  border-top: 1px solid #eaecf0;
  background: #ffffff;
}

.rapira-dialog-actions button {
  min-height: 38px;
  font-weight: 600;
}

.rapira-dialog-actions .rapira-danger {
  margin-right: auto;
  border-color: #f7b5af;
  background: #fff0ef;
  color: #b42318;
}

.rapira-dialog-actions .primary:disabled {
  border-color: #d0d5dd !important;
  background: #e4e7ec !important;
  color: #98a2b3 !important;
  cursor: not-allowed;
  opacity: 1;
  box-shadow: none;
}

#strategySubmitButton {
  min-width: 118px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-color: #1d2939;
  border-radius: 9px;
  background: #1d2939;
  color: #ffffff;
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

#strategySubmitButton:hover:not(:disabled),
#strategySubmitButton:focus-visible:not(:disabled) {
  border-color: #111c2b;
  background: #111c2b;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(16, 24, 40, 0.18);
}

#strategySubmitButton:active:not(:disabled) {
  transform: translateY(1px) scale(0.97);
  box-shadow: none;
}

#strategySubmitButton.is-loading:disabled {
  border-color: #1d2939 !important;
  background: #1d2939 !important;
  color: #ffffff !important;
  cursor: wait;
}

#strategySubmitButton.is-loading::before {
  width: 14px;
  height: 14px;
  content: "";
  flex: 0 0 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: bitpapa-save-spin 700ms linear infinite;
}

@keyframes bitpapa-save-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  #strategySubmitButton { transition: none; }
  #strategySubmitButton.is-loading::before { animation-duration: 1.4s; }
}

.rapira-toast {
  position: fixed;
  z-index: 1200;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid #b7e3cf;
  border-radius: 10px;
  background: #ecfdf3;
  color: #067647;
  padding: 12px 14px;
  box-shadow: 0 16px 36px rgba(24, 33, 47, 0.15);
  font-size: 13px;
}

.rapira-toast.error {
  border-color: #f7b5af;
  background: #fff0ef;
  color: #b42318;
}

@media (max-width: 900px) {
  .rapira-form-grid,
  .rapira-choice-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .rapira-dialog,
  .rapira-dialog-wide {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .rapira-dialog-header,
  .rapira-dialog-body,
  .rapira-dialog-actions {
    padding-right: 14px;
    padding-left: 14px;
  }

  .settingsActions {
    width: 100%;
    justify-content: space-between;
  }
}
