/* ─── BYBIT P2P TAB ─── */
#bybitTab {
  height: calc(100dvh - 176px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  padding: 16px 4px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

#bybitTab[hidden] {
  display: none;
}

#bybitTab::-webkit-scrollbar {
  display: none;
}

/* ─── Header ─── */
.bybit-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

#bybitTab h1 {
  margin: 0;
  color: var(--ink);
  font-family: 'Sora', sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

/* ─── Refresh button ─── */
.bybit-refresh {
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0;
  background: var(--bg-card);
  color: var(--accent);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 150ms ease, border-color 150ms ease;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.bybit-refresh:active {
  background: var(--accent-faint);
  border-color: rgba(0, 230, 118, 0.4);
}

.bybit-refresh .icon {
  width: 20px;
  height: 20px;
  transition: transform 400ms ease;
}

.bybit-refresh.spinning .icon {
  animation: bybitSpin 700ms linear infinite;
}

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

/* ─── Last updated ─── */
.bybit-updated {
  margin: 0 0 16px;
  color: var(--ink-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-align: right;
  min-height: 14px;
}

/* ─── Skeleton ─── */
.bybit-skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bybit-skeleton-card {
  height: 148px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: var(--bg-card);
  overflow: hidden;
  position: relative;
}

.bybit-skeleton-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 230, 118, 0.05) 50%,
    transparent 100%
  );
  animation: bybitShimmer 1.4s ease infinite;
  transform: translateX(-100%);
}

@keyframes bybitShimmer {
  to { transform: translateX(200%); }
}

/* ─── Order list ─── */
.bybit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 18px;
}

/* ─── Order card ─── */
.bybit-card {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px 4px;
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
  transition: border-color 150ms ease;
}

.bybit-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 230, 118, 0.2), transparent);
}

/* Best deal */
.bybit-card--best {
  border-color: rgba(0, 230, 118, 0.45);
  background: linear-gradient(160deg, rgba(0, 230, 118, 0.05) 0%, var(--bg-card) 55%);
}

.bybit-card--best::before {
  background: linear-gradient(90deg, transparent, rgba(0, 230, 118, 0.55), transparent);
}

/* ─── Top row: nick + badge + online ─── */
.bybit-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.bybit-card__nick {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}

.bybit-card__badge {
  flex-shrink: 0;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.2;
  background: rgba(0, 230, 118, 0.13);
  color: var(--accent);
  border: 1px solid rgba(0, 230, 118, 0.25);
}

.bybit-card__online {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-3);
}

.bybit-card__online--on {
  background: var(--accent);
  box-shadow: 0 0 7px rgba(0, 230, 118, 0.65);
}

/* ─── Price row ─── */
.bybit-card__price-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 10px;
}

.bybit-card__price {
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.bybit-card__price-unit {
  color: var(--ink-2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 400;
}

/* ─── Min / Max row ─── */
.bybit-card__amt-row {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
}

.bybit-card__amt-item {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.bybit-card__amt-label {
  color: var(--ink-3);
  font-family: 'Sora', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.bybit-card__amt-value {
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
}

/* ─── Divider ─── */
.bybit-card__divider {
  height: 1px;
  background: rgba(0, 230, 118, 0.08);
  margin-bottom: 10px;
}

/* ─── Banks row ─── */
.bybit-card__banks-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}

.bybit-card__meta-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--ink-3);
}

.bybit-card__meta-text {
  color: var(--ink-2);
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Flags row: СБП + 3 лица + stats ─── */
.bybit-card__flags-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* ─── Chips ─── */
.bybit-card__chip {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 3px 8px;
  font-family: 'Sora', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.4;
  white-space: nowrap;
}

.bybit-card__chip--on {
  background: rgba(0, 230, 118, 0.12);
  color: var(--accent);
  border: 1px solid rgba(0, 230, 118, 0.25);
}

.bybit-card__chip--off {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-3);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bybit-card__chip--neutral {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-3);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ─── Inline stats (deals + rate) ─── */
.bybit-card__inline-stat {
  margin-left: auto;
  color: var(--ink-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 400;
}

.bybit-card__inline-stat:first-of-type {
  margin-left: auto;
}

.bybit-card__inline-stat + .bybit-card__inline-stat {
  margin-left: 0;
}

.bybit-card__inline-stat--accent {
  color: var(--accent);
}

/* ─── Remark accordion ─── */
.bybit-card__remark-wrap {
  border-top: 1px solid rgba(0, 230, 118, 0.08);
  margin-top: 2px;
}

.bybit-card__remark-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-3);
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: color 150ms ease;
}

.bybit-card__remark-toggle:active {
  color: var(--accent);
}

.bybit-card__remark-arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 250ms ease;
}

.bybit-card__remark-wrap.is-open .bybit-card__remark-arrow {
  transform: rotate(180deg);
}

.bybit-card__remark-body {
  display: none;
  padding: 0 0 12px;
  color: var(--ink-2);
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.6;
}

.bybit-card__remark-wrap.is-open .bybit-card__remark-body {
  display: block;
}

/* ─── Empty / Error state ─── */
.bybit-empty {
  min-height: calc(100vh - 300px);
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--ink-2);
}

.bybit-empty__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--accent-faint);
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--accent);
}

.bybit-empty__icon .icon {
  width: 28px;
  height: 28px;
}

.bybit-empty__title {
  color: var(--ink);
  font-family: 'Sora', sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
}

.bybit-empty__sub {
  color: var(--ink-2);
  font-size: 13px;
  margin: 0;
}

@media (max-width: 360px) {
  #bybitTab { padding-right: 0; padding-left: 0; }
  .bybit-card__price { font-size: 25px; }
  .bybit-card { padding: 12px 13px 4px; }
}

@media (min-width: 700px) {
  #bybitTab {
    height: calc(100vh - 210px);
  }
}
