/* ============================================================
   Home — 1:1 with the dashboard screenshot, scoped under .hm
   ============================================================ */
.hm {
  --hm-card: #14171C;
  --hm-line: #21262E;
  --hm-muted: #848E9C;
  --hm-white: #EAECEF;
  --hm-gold: #F0B90B;
  --hm-green: #0ECB81;
  --hm-red: #F6465D;
}

/* ---------- Balance card ---------- */
.hm-bal {
  position: relative;
  background:
    radial-gradient(ellipse at 78% 38%, rgba(240, 185, 11, 0.16), transparent 55%),
    var(--hm-card);
  border: 1px solid var(--hm-line);
  border-radius: 14px;
  padding: 12px 12px 0;
  overflow: hidden;
}
.hm-bal::before {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--hm-gold), transparent);
  opacity: 0.75;
}
.hm-bal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.hm-bal-k {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--hm-muted);
}
.hm-eye {
  width: 16px;
  height: 16px;
  padding: 0;
  color: #EAECEF;
}
.hm-eye svg { width: 15px; height: 15px; }
.hm-ccy {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border-radius: 7px;
  background: #1B1F26;
  border: 1px solid var(--hm-line);
  color: var(--hm-white);
  font-size: 10px;
  font-weight: 600;
}
.hm-ccy svg { width: 10px; height: 10px; color: var(--hm-muted); }

.hm-bal-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  min-height: 96px;
  margin-top: 4px;
}
.hm-bal-copy {
  position: relative;
  z-index: 2;
  flex: 0 1 52%;
  min-width: 0;
  padding-bottom: 8px;
}
.hm-bal-v {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: #fff;
  line-height: 1.1;
}
.hm-bal-chg {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hm-bal-chg .up {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--hm-gold);
}
.hm-bal-chg .up .arr { color: var(--hm-gold); font-size: 13px; line-height: 1; }
.hm-bal-chg .lbl {
  font-size: 10px;
  color: var(--hm-muted);
}
.hm-bal-chart {
  position: relative;
  flex: 1 1 48%;
  height: 96px;
  min-width: 0;
  margin-right: -4px;
  pointer-events: none;
}
.hm-bal-chart > div { width: 100%; height: 96px; }

.hm-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 10px -12px 0;
  border-top: 1px solid var(--hm-line);
}
.hm-met {
  padding: 9px 6px 10px;
  text-align: center;
}
.hm-met + .hm-met { border-left: 1px solid var(--hm-line); }
.hm-met .ico {
  display: inline-grid;
  place-items: center;
  color: var(--hm-gold);
  margin-bottom: 3px;
}
.hm-met .ico svg { width: 13px; height: 13px; }
.hm-met .k {
  display: block;
  font-size: 8.5px;
  color: var(--hm-muted);
  white-space: nowrap;
}
.hm-met .v {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.hm-met .v::after {
  content: '';
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px auto 0;
  border-radius: 2px;
  background: rgba(240, 185, 11, 0.35);
}
.hm-met .v.gold {
  color: var(--hm-gold);
}
.hm-met .v.gold::after {
  width: 28px;
  background: var(--hm-gold);
}

/* ---------- Quick actions ---------- */
.hm-acts {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin: 14px 0 12px;
}
.hm-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: inherit;
}
.hm-act-ico {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--hm-card);
  border: 1px solid var(--hm-line);
  color: var(--hm-gold);
}
.hm-act-ico svg { width: 18px; height: 18px; }
.hm-act-l {
  font-size: 8.5px;
  font-weight: 500;
  color: var(--hm-white);
  text-align: center;
  line-height: 1.25;
}
.hm-new {
  position: absolute;
  top: -4px;
  right: -8px;
  padding: 1px 4px;
  border-radius: 6px;
  background: var(--hm-gold);
  color: #0B0E11;
  font-size: 7px;
  font-weight: 800;
  font-style: normal;
  letter-spacing: 0.02em;
}

/* ---------- Invite ---------- */
.hm-invite {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background:
    radial-gradient(circle at 12% 80%, rgba(240, 185, 11, 0.16), transparent 42%),
    linear-gradient(105deg, #1A1608 0%, var(--hm-card) 55%, #16120A 100%);
  border: 1px solid rgba(240, 185, 11, 0.22);
  border-radius: 12px;
  margin-bottom: 14px;
}
.hm-gift { width: 46px; height: 46px; }
.hm-gift svg { width: 46px; height: 46px; display: block; }
.hm-invite-copy .ttl {
  font-size: 13px;
  font-weight: 700;
  color: var(--hm-gold);
}
.hm-invite-copy .sub {
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.35;
  color: var(--hm-white);
}
.hm-invite-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}
.hm-invite-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--hm-gold);
  color: #0B0E11;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.hm-invite-more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 600;
  color: var(--hm-gold);
}
.hm-invite-more svg { width: 11px; height: 11px; }

/* ---------- Markets ---------- */
.hm-sec-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.hm-sec-h h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.hm-see {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 500;
  color: var(--hm-gold);
  white-space: nowrap;
}
.hm-see svg { width: 12px; height: 12px; }

.hm-tabs {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hm .chip {
  padding: 0 0 6px;
  background: none;
  border: 0;
  border-radius: 0;
  color: var(--hm-muted);
  font-size: 13px;
  font-weight: 500;
}
.hm .chip.active {
  color: var(--hm-gold);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--hm-gold);
}

.hm-mk { margin-bottom: 14px; }
.hm-mrow {
  display: grid;
  grid-template-columns: 28px minmax(0, 1.1fr) minmax(0, 0.9fr) 56px 18px;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--hm-line);
  color: inherit;
}
.hm-mrow .crypto-avatar { width: 28px; height: 28px; font-size: 12px; }
.hm-flags {
  position: relative;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.hm-flags i {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  color: #fff;
  border: 1.5px solid var(--hm-card);
}
.hm-flags i:first-child { left: 0; top: 0; z-index: 1; }
.hm-flags i:last-child { right: 0; bottom: 0; }
.hm-mrow .nm {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.hm-mrow .tp {
  margin-top: 2px;
  font-size: 10px;
  color: var(--hm-muted);
}
.hm-mprice { text-align: right; }
.hm-mprice .px {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.hm-mprice .ch {
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 600;
}
.hm-mspark { height: 22px; }
.hm-mspark svg { display: block; width: 100%; height: 22px; }
.hm-star {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: #3A404A;
}
.hm-star svg { width: 14px; height: 14px; fill: currentColor; }
.hm-star.on { color: var(--hm-gold); }

/* ---------- Active bot ---------- */
.hm-bot { margin-bottom: 8px; }
.hm-bot-card {
  background: var(--hm-card);
  border: 1px solid var(--hm-line);
  border-radius: 14px;
  padding: 12px;
}
.hm-bot-id {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto 22px;
  align-items: center;
  gap: 8px;
}
.hm-bot-id .crypto-avatar { width: 32px; height: 32px; }
.hm-bot-id .nm {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.hm-bot-id .tag {
  font-size: 8px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(240, 185, 11, 0.14);
  color: var(--hm-gold);
}
.hm-bot-id .sub {
  margin-top: 2px;
  font-size: 10px;
  color: var(--hm-muted);
}
.hm-bot-st {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(14, 203, 129, 0.12);
  color: var(--hm-green);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.hm-bot-st i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.hm-more {
  width: 22px;
  height: 22px;
  padding: 0;
  color: var(--hm-muted);
}
.hm-more svg { width: 16px; height: 16px; }

.hm-bot-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin-top: 12px;
}
.hm-bot-grid .cell .k {
  display: block;
  font-size: 8.5px;
  color: var(--hm-muted);
  white-space: nowrap;
}
.hm-bot-grid .cell .v {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.hm-bot-grid .cell.chart { align-self: end; }
.hm-candles { width: 100%; height: 28px; display: block; }
.hm-bot-grid .gold { color: var(--hm-gold); }

.hm-bot-meta {
  display: grid;
  grid-template-columns: 1.45fr 0.7fr 0.7fr 1.05fr 0.6fr;
  gap: 4px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--hm-line);
}
.hm-bot-meta .ico {
  display: grid;
  place-items: center;
  color: var(--hm-gold);
  margin-bottom: 3px;
}
.hm-bot-meta .ico svg { width: 13px; height: 13px; }
.hm-bot-meta .k {
  display: block;
  font-size: 8px;
  color: var(--hm-muted);
  white-space: nowrap;
}
.hm-bot-meta .v {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.hm-bot-btns {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 7px;
  margin-top: 12px;
}
.hm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.hm-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.hm-btn.gold { background: var(--hm-gold); color: #0B0E11; }
.hm-btn.ghost {
  background: transparent;
  border: 1px solid #3A404A;
  color: var(--hm-white);
}
.hm-btn.stop {
  background: transparent;
  border: 1px solid var(--hm-red);
  color: var(--hm-red);
}

@media (max-width: 400px) {
  .hm-bal-v { font-size: 23px; }
  .hm-met .v { font-size: 9.5px; }
  .hm-act-ico { width: 40px; height: 40px; }
  .hm-bot-grid .cell .v { font-size: 10.5px; }
  .hm-bot-meta .v { font-size: 8.5px; }
  .hm-btn { font-size: 10px; }
}
