/* ============================================================
   Bot Performance — 1:1 with design screenshot
   ============================================================ */
.bp {
  --bp-page: #0B0E11;
  --bp-card: #14171C;
  --bp-line: #21262E;
  --bp-muted: #848E9C;
  --bp-dim: #6C7480;
  --bp-white: #EAECEF;
  --bp-gold: #F0B90B;
  --bp-green: #0ECB81;
  --bp-red: #F6465D;
  /* the design's gutter is 16px, the shared shell supplies 14px */
  margin: 0 2px;
  padding-bottom: 78px;
}

.bp .bp-i {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  margin-left: 6px;
  color: var(--bp-dim);
  vertical-align: -1px;
}
.bp .dim { color: var(--bp-muted); font-weight: 400; }

/* ---------- Title ---------- */
.bp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
}
.bp-head h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #fff;
}
.bp-share {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--bp-gold);
}
.bp-share svg { width: 17px; height: 17px; }

/* ---------- Bot identity ---------- */
.bp-id {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 18px;
}
.bp-id .crypto-avatar {
  width: 44px;
  height: 44px;
  font-size: 19px;
}
.bp-id-m { flex: 1; min-width: 0; }
.bp-id-top {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.15;
}
.bp-id-top .nm {
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.bp-tag {
  flex-shrink: 0;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(240, 185, 11, 0.32);
  background: rgba(240, 185, 11, 0.1);
  color: var(--bp-gold);
  font-size: 9.5px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
}
.bp-id-sub {
  margin-top: 1px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--bp-muted);
  white-space: nowrap;
}
.bp-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  padding: 4px 7px;
  border-radius: 5px;
  background: rgba(14, 203, 129, 0.12);
  color: var(--bp-green);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.bp-state i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.bp-range {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 31px;
  margin-top: 14px;
  padding: 0 10px;
  border: 1px solid #262B33;
  border-radius: 10px;
  background: transparent;
  color: var(--bp-white);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.bp-range .i-cal { width: 13px; height: 13px; color: var(--bp-white); }
.bp-range .i-chev { width: 12px; height: 12px; color: var(--bp-muted); }

/* ---------- Headline stats ---------- */
.bp-stats {
  display: grid;
  /* column widths are hand-set in the design, not equal fractions */
  grid-template-columns: 115fr 121fr 107fr 97fr;
  margin-top: 13px;
  padding: 16px 0 14px;
  background: var(--bp-card);
  border: 1px solid var(--bp-line);
  border-radius: 12px;
}
.bp-stat {
  position: relative;
  min-width: 0;
  padding-left: 22px;
}
.bp-stat:first-child { padding-left: 12px; }
.bp-stat + .bp-stat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1px;
  width: 1px;
  height: 40px;
  background: var(--bp-line);
}
.bp-stat .k,
.bp-stat .v,
.bp-stat .d {
  display: block;
  white-space: nowrap;
  line-height: 1.4;
}
.bp-stat .k {
  font-size: 10px;
  font-weight: 400;
  color: var(--bp-muted);
}
.bp-stat .v {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.bp-stat .d {
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 500;
}

/* ---------- Cards ---------- */
.bp-card {
  margin-top: 11px;
  padding: 10px 12px 12px;
  background: var(--bp-card);
  border: 1px solid var(--bp-line);
  border-radius: 12px;
}
.bp-card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 27px;
}
.bp-card-h h2,
.bp-h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
}

/* segmented range control */
.bp-seg {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  width: 141px;
  height: 27px;
  border: 1px solid var(--bp-line);
  border-radius: 8px;
  overflow: hidden;
}
.bp-seg button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--bp-muted);
}
.bp-seg button span {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 7px;
}
.bp-seg button.is-on { color: var(--bp-gold); font-weight: 600; }
.bp-seg button.is-on span {
  border: 1px solid var(--bp-gold);
  border-radius: 6px;
}

/* ---------- Cumulative P&L plot ---------- */
.bp-plot {
  position: relative;
  height: 158px;
  margin: 23px 0 26px;
}
.bp-plot-y {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 20px;
}
.bp-plot-y span {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  font-size: 9px;
  font-weight: 400;
  line-height: 1;
  color: var(--bp-muted);
  white-space: nowrap;
}
.bp-plot-g,
.bp-plot-c {
  position: absolute;
  left: 26px;
  right: 0;
  top: 0;
  bottom: 0;
}
.bp-plot-g i {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.07) 0 2px, transparent 2px 5px);
  background-size: 5px 1px;
  background-repeat: repeat-x;
}
.bp-plot-g i.zero { background: rgba(132, 142, 156, 0.2); }
.bp-plot-c { z-index: 1; }
.bp-plot-x {
  position: absolute;
  left: 26px;
  right: 0;
  top: 100%;
  margin-top: 13px;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  line-height: 1.4;
  color: var(--bp-muted);
}
.bp-tip {
  position: absolute;
  right: 0;
  top: 45%;
  z-index: 2;
  padding: 7px 9px;
  border-radius: 8px;
  background: #111318;
  pointer-events: none;
}
.bp-tip .d,
.bp-tip .v { display: block; white-space: nowrap; }
.bp-tip .d {
  font-size: 9px;
  line-height: 1.4;
  color: #B7BDC6;
}
.bp-tip .v {
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
}
.bp-tip .v em {
  font-style: normal;
  font-weight: 400;
  color: var(--bp-white);
}

/* ---------- Performance overview grid ---------- */
.bp-metrics {
  display: grid;
  grid-template-columns: 149fr 144fr 123fr;
  row-gap: 13px;
  margin-top: 12px;
}
.bp-metric { min-width: 0; }
.bp-metric .k,
.bp-metric .v { display: block; white-space: nowrap; }
.bp-metric .k {
  font-size: 9.5px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--bp-muted);
}
.bp-metric .k .bp-i { width: 9.5px; height: 9.5px; }
.bp-metric .v {
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
}

/* ---------- Distribution / hours ---------- */
.bp-split {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  margin: 19px -12px 0;
  padding: 15px 12px 0;
  border-top: 1px solid var(--bp-line);
}
.bp-split h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  white-space: nowrap;
}
.bp-dist {
  min-width: 0;
  padding-right: 12px;
}
.bp-dist-b {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 18px;
}
.bp-donut {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}
.bp-legend {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.bp-legend li {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr);
  column-gap: 6px;
}
.bp-legend i {
  width: 7px;
  height: 7px;
  margin-top: 3px;
  border-radius: 50%;
}
.bp-legend .k,
.bp-legend .v {
  grid-column: 2;
  white-space: nowrap;
}
.bp-legend .k {
  font-size: 8.5px;
  line-height: 1.35;
  color: var(--bp-muted);
}
.bp-legend .v {
  font-size: 9px;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
}

.bp-hours {
  min-width: 0;
  padding-left: 15px;
  border-left: 1px solid var(--bp-line);
}
.bp-hours-b {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 13px;
  column-gap: 3px;
  margin: 24px 0 16px;
}
.bp-hplot {
  position: relative;
  height: 73px;
  padding: 0 4px;
}
.bp-hplot .gl {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.07) 0 2px, transparent 2px 5px);
  background-size: 5px 1px;
  background-repeat: repeat-x;
}
.bp-hbars {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 3.4px;
  height: 100%;
}
.bp-hbars i {
  flex: 1 1 0;
  min-width: 0;
  background: var(--bp-gold);
}
.bp-hx {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 0;
}
.bp-hx span {
  position: absolute;
  top: 3px;
  transform: translateX(-50%);
  font-size: 9px;
  line-height: 1.4;
  color: var(--bp-muted);
}
.bp-hy {
  position: relative;
  height: 73px;
}
.bp-hy span {
  position: absolute;
  left: 0;
  transform: translateY(-50%);
  font-size: 9px;
  line-height: 1;
  color: var(--bp-muted);
  white-space: nowrap;
}

/* ---------- Section tabs ---------- */
.bp-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.bp-tab {
  position: relative;
  padding: 14px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--bp-muted);
}
.bp-tab span { position: relative; display: inline-block; }
.bp-tab.is-on { color: var(--bp-gold); font-weight: 600; }
.bp-tab.is-on span::after {
  content: '';
  position: absolute;
  left: -5px;
  right: -5px;
  bottom: -14px;
  height: 2px;
  border-radius: 2px;
  background: var(--bp-gold);
}

/* ---------- Fixed actions ---------- */
.bp-actions {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--phone-w);
  z-index: 90;
  display: grid;
  grid-template-columns: 0.885fr 1fr;
  gap: 15px;
  padding: 13px 16px 23px;
  background: var(--bp-page);
}
.bp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 30px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.bp-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.bp-btn-ghost {
  color: var(--bp-gold);
  border: 1px solid var(--bp-gold);
}
.bp-btn-gold {
  background: var(--bp-gold);
  color: #0B0E11;
}

@media (max-width: 400px) {
  .bp-head h1 { font-size: 18px; }
  .bp-id .crypto-avatar { width: 40px; height: 40px; font-size: 17px; }
  .bp-id-top .nm { font-size: 13.5px; }
  .bp-range { font-size: 10px; gap: 6px; padding: 0 8px; }
  .bp-stat { padding-left: 16px; }
  .bp-stat:first-child { padding-left: 10px; }
  .bp-stat .k { font-size: 9px; }
  .bp-stat .v { font-size: 13px; }
  .bp-metric .k { font-size: 9px; }
  .bp-donut { width: 64px; height: 64px; }
  .bp-dist-b { gap: 10px; }
}
