/* peerlabel.css — Apple Card-inspired flippable peer labels */

.peers-hd { gap: 12px; flex-wrap: wrap; }
.peers-controls {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.peers-controls .input  { min-width: 220px; }
.peers-controls .select { min-width: 180px; }

.peer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding: 4px 2px;
}

/* The flip card */
.peer {
  perspective: 1400px;
  height: 116px;
}
.peer__inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 540ms cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: pointer;
}
.peer.is-flipped .peer__inner { transform: rotateY(180deg); }

.peer__face {
  position: absolute; inset: 0;
  border-radius: 18px;
  padding: 12px 14px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ---- recorded face (front when recorded) ---- */
.peer__face--recorded {
  background: var(--recorded-bg);
  color: var(--recorded-fg);
  border-color: transparent;
}
.peer__face--recorded .peer__zh    { color: #fff; }
.peer__face--recorded .peer__tk    { color: rgba(255,255,255,0.78); }
.peer__face--recorded .peer__when  { color: rgba(255,255,255,0.92); }
.peer__face--recorded .peer__badge { color: rgba(255,255,255,0.85); }

/* ---- unrecorded face ---- */
.peer__face--tba {
  background: linear-gradient(180deg, #ffffff 0%, #f3f5fa 100%);
  color: var(--ink);
}
.peer__face--tba .peer__badge { color: var(--ink-mute); }

/* ---- not-report face (peer.ignoredquartertype matches selected qt) ---- */
.peer__face--nr {
  background: linear-gradient(180deg, #f0f2f8 0%, #e6e9f1 100%);
  color: var(--notreport-fg);
}
.peer__face--nr .peer__badge { color: var(--notreport-fg); }

/* past / upcoming variants override the recorded background */
.peer__face--past     { background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%); }
.peer__face--upcoming { background: linear-gradient(135deg, #93c5fd 0%, #bfdbfe 100%); color: #0b1220; }
.peer__face--upcoming .peer__zh   { color: #0b1220; }
.peer__face--upcoming .peer__tk   { color: rgba(11,18,32,0.7); }
.peer__face--upcoming .peer__when { color: rgba(11,18,32,0.85); }

/* layout inside face */
.peer__top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px;
}
.peer__name {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.peer__zh { font-weight: 800; font-size: 15px; line-height: 1.15; }
.peer__tk { font-weight: 500; font-size: 11.5px; color: var(--ink-mute); letter-spacing: 0.3px; }

.peer__badge {
  font-size: 10.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(15,23,42,0.08);
  letter-spacing: 0.4px;
}
.peer__face--recorded .peer__badge {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.28);
}

.peer__bot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.peer__when {
  font-size: 11.5px; color: var(--ink-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.peer__sectors { display: inline-flex; gap: 4px; flex: none; }
.peer__sectors .dot { width: 9px; height: 9px; }

/* ---- back face (Apple Card flipped — descriptive) ---- */
.peer__face--back {
  transform: rotateY(180deg);
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fc 100%);
  color: var(--ink);
}
.peer__face--back h4 { margin: 0 0 4px; font-size: 13px; }
.peer__face--back p  { margin: 0; font-size: 11.5px; color: var(--ink-mute); line-height: 1.35; }
.peer__face--back .peer__cta {
  margin-top: auto;
  align-self: flex-start;
  font-size: 11.5px; font-weight: 600; color: var(--brand);
}
