/* Rapira keeps the exact visual system of broker-walk-bot.ru.
   This file contains only exchange-specific layout additions. */

[hidden] {
  display: none !important;
}

.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,
.rapira-fast-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-fast-badge,
.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: Inter, Segoe UI, Arial, sans-serif;
  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.is-fast {
  white-space: nowrap;
}

.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;
}

.rapira-fast-badge {
  line-height: 1;
}

.rapira-fast-badge img,
.rapira-api-fast-badge img {
  display: block;
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.rapira-api-fast-badge {
  display: inline-grid;
  place-items: center;
  margin-left: 3px;
  line-height: 1;
  cursor: help;
}

.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;
}

.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;
  }
}
