/* earnings.css — bottom-left earningscall fetcher window + AI-power marquee
   gradient border labels. Reuses the .fab base from chatbot.css.
   Enhanced (2026-07-08): multi-row toolbar, single-peer & sector dropdowns,
   rate-limit indicator, pause/continue UI. */

.fab--earn {
  left: 22px; bottom: 22px;
  background: linear-gradient(135deg, #00b894 0%, #0a84ff 100%);
  box-shadow: 0 8px 24px rgba(0, 184, 148, 0.32), 0 2px 6px rgba(0,0,0,0.2);
}

/* The window: desktop = fixed to the LEFT, half height. */
.earnwin {
  position: fixed;
  left: 22px; bottom: 90px;
  width: 420px;
  height: 62vh;
  max-height: 700px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-md), 0 20px 50px rgba(15,23,42,0.18);
  display: flex; flex-direction: column;
  overflow: hidden;
  z-index: 41;
  opacity: 0; transform: translateY(12px) scale(0.98);
  transform-origin: bottom left;
  transition: opacity 220ms ease, transform 240ms cubic-bezier(0.2,0.8,0.2,1);
}
.earnwin.is-open { opacity: 1; transform: translateY(0) scale(1); }

.earnwin__hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--card-2);
  flex-shrink: 0;
}
.earnwin__title { font-size: 13.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.earnwin__sub { font-weight: 600; font-size: 11.5px; color: var(--brand); }
.earnwin__x {
  border: 0; background: transparent; font-size: 20px; line-height: 1;
  color: var(--ink-mute); cursor: pointer; padding: 2px 6px; border-radius: 8px;
}
.earnwin__x:hover { background: var(--bg-soft); color: var(--ink); }

/* ---- Main toolbar row ---- */
.earnwin__bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.earnwin__bar--main { border-bottom-style: solid; }
.earnwin__bar--adv {
  border-bottom-style: dashed;
  border-bottom-color: rgba(15, 23, 42, 0.06);
  padding-top: 6px; padding-bottom: 8px;
  gap: 10px;
  justify-content: flex-start;
}

.earnwin__adv-group {
  display: inline-flex; align-items: center; gap: 5px;
}
.earnwin__lbl {
  font-size: 11px; font-weight: 600; color: var(--ink-mute);
  white-space: nowrap; text-transform: uppercase; letter-spacing: 0.3px;
}

.earnwin__meta {
  font-size: 11.5px; color: var(--ink-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1 1 auto; min-width: 40px;
}

/* Rate-limit indicator */
.earnwin__limit {
  font-size: 10.5px; font-weight: 600;
  color: var(--ink-mute);
  padding: 2px 8px; border-radius: 999px;
  background: var(--bg-soft);
  white-space: nowrap;
  transition: color 200ms ease, background 200ms ease;
}
.earnwin__limit.is-limit {
  color: var(--bad);
  background: rgba(229,72,77,0.10);
}

/* Continue button */
.btn--continue {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff; border-color: transparent;
  font-weight: 600; font-size: 12px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  animation: continue-pulse 1.8s ease-in-out infinite;
}
.btn--continue:hover {
  background: linear-gradient(135deg, #e69009, #ea580c);
}
.btn--continue:disabled {
  opacity: 0.5; animation: none;
}
@keyframes continue-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(245,158,11,0); }
}

/* Small button variant */
.btn--sm {
  font-size: 11.5px; padding: 5px 10px;
  min-width: auto;
}

/* ---- Pause banner inside body ---- */
.earn-pause {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245,158,11,0.06), rgba(249,115,22,0.04));
  border: 2px dashed rgba(245,158,11,0.3);
}
.earn-pause__icon { font-size: 24px; line-height: 1; flex: none; }
.earn-pause__text {
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  line-height: 1.5;
}
.earn-pause__sub {
  font-size: 11px; font-weight: 400; color: var(--ink-mute);
}

/* ---- Body ---- */
.earnwin__body {
  flex: 1 1 auto; overflow-y: auto;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 10px;
}
.earn-empty { color: var(--ink-mute); font-size: 12.5px; line-height: 1.5; padding: 8px 4px; }

/* ---- AI-power marquee gradient border label ---- */
@property --ev-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
.ev-label {
  position: relative;
  isolation: isolate;
  border-radius: 14px;
  padding: 2px;
  background: conic-gradient(
    from var(--ev-angle),
    #ff3b30, #0a84ff, #ffcc00, #00b894, #ff3b30
  );
  animation: ev-spin 4s linear infinite;
}
.ev-label::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  background: conic-gradient(
    from var(--ev-angle),
    #ff3b30, #0a84ff, #ffcc00, #00b894, #ff3b30
  );
  filter: blur(6.7px);
  opacity: 0.75;
  z-index: -1;
  animation: ev-spin 4s linear infinite;
}
.ev-label::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 22px;
  background: conic-gradient(
    from var(--ev-angle),
    #ff3b30, #0a84ff, #ffcc00, #00b894, #ff3b30
  );
  filter: blur(13.3px);
  opacity: 0.35;
  z-index: -2;
  animation: ev-spin 4s linear infinite;
}
@keyframes ev-spin {
  to { --ev-angle: 360deg; }
}
@supports not (background: conic-gradient(from 0deg, #000, #fff)) {
  .ev-label,
  .ev-label::before,
  .ev-label::after { background: linear-gradient(135deg, #ff3b30, #0a84ff, #ffcc00, #00b894); animation: none; }
}

.ev-label__inner {
  display: flex; align-items: center; gap: 10px;
  background: var(--card);
  border-radius: 12px;
  padding: 11px 12px;
}
.ev-label__main { flex: 1 1 auto; min-width: 0; }
.ev-label__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ev-label__tk {
  font-size: 11px; font-weight: 500; color: var(--ink-mute);
  letter-spacing: 0.4px; text-transform: uppercase;
}
.ev-label__zh {
  font-size: 17px; font-weight: 800; color: var(--ink);
  line-height: 1.15;
}
.ev-label__time {
  margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2);
  word-break: break-all;
}
.ev-label__time2 { margin-top: 2px; font-size: 11px; color: var(--ink-mute); }

.ev-label__add {
  flex: none;
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  border: 0; border-radius: 10px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #0a84ff, #6c5ce7);
  color: #fff;
  white-space: nowrap;
  align-self: stretch;
  display: inline-flex; align-items: center;
}
.ev-label__add:hover { filter: brightness(1.07); }
.ev-label__add:active { transform: translateY(1px); }

/* ---- Lock card inside body ---- */
.lockcard {
  background: var(--card-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px;
  text-align: center;
}
.lockcard h4 { margin: 0 0 8px; font-size: 15px; }
.lockcard p  { margin: 0 0 14px; font-size: 12.5px; color: var(--ink-mute); }
.lockcard input {
  display: block; width: 100%; margin-bottom: 10px;
  padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font: inherit; outline: none;
}
.lockcard input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10,132,255,0.18); }
.lockcard button {
  font: inherit; cursor: pointer;
  padding: 9px 22px; border: 0; border-radius: var(--radius-sm);
  background: var(--brand); color: #fff; font-weight: 600;
}
.lockcard button:hover { background: var(--brand-strong); }
.lockcard button:disabled { opacity: 0.5; }
.lockcard__msg { margin-top: 10px; font-size: 12px; color: var(--ink-mute); }
.lockcard__msg.is-err { color: var(--bad); }
.lockcard__msg.is-ok  { color: var(--good); }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .earnwin {
    left: 12px; right: 12px; width: auto;
    bottom: auto; top: 70px;
    height: 60vh;
    transform-origin: top center;
  }
  .fab--earn { left: 16px; bottom: 16px; }

  .earnwin__bar--adv { flex-direction: column; align-items: flex-start; gap: 6px; }
  .earnwin__adv-group { width: 100%; }
  .earnwin__adv-group .select { flex: 1 1 auto; min-width: 0; }
}
