/* Body schematic modal — desktop popup / mobile bottom sheet */
body.body-open { overflow: hidden; }

.body-modal {
  position: fixed; inset: 0; z-index: 65;
  display: grid; place-items: center;
}
.body-modal[hidden] { display: none; }

.body-back {
  position: absolute; inset: 0;
  background: rgba(6, 14, 34, .66);
  backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .28s ease;
}
.body-modal.in .body-back { opacity: 1; }

.body-sheet {
  position: relative;
  width: min(1120px, calc(100vw - 1.2rem));
  max-height: calc(100vh - 1.2rem);
  overflow: auto;
  background: linear-gradient(165deg, #0a1638 0%, #0f2248 42%, #122a54 100%);
  color: #eef3ff;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 32px 90px rgba(0, 0, 0, .48);
  padding: 1rem 1.1rem 1.25rem;
  transform: translateY(18px) scale(.98);
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
}
.body-modal.in .body-sheet { transform: none; opacity: 1; }

.body-handle {
  display: none;
  width: 46px; height: 4px; border-radius: 99px;
  background: rgba(255, 255, 255, .28);
  margin: .1rem auto .65rem;
}
.body-glow {
  position: absolute; pointer-events: none; border-radius: 50%;
  filter: blur(2px);
}
.body-glow-a {
  width: 220px; height: 220px; top: -60px; left: -40px;
  background: radial-gradient(circle, rgba(255, 107, 53, .22), transparent 70%);
}
.body-glow-b {
  width: 180px; height: 180px; bottom: -50px; right: -20px;
  background: radial-gradient(circle, rgba(76, 195, 255, .16), transparent 70%);
}

.body-head {
  display: flex; justify-content: space-between; gap: 1rem;
  align-items: flex-start; position: relative; z-index: 1;
}
.body-kicker {
  margin: 0; color: #ffb08a; font-weight: 800; font-size: .78rem;
}
.body-head h2 { margin: .15rem 0 .2rem; font-size: 1.35rem; }
.body-sub { margin: 0; color: #9db0d0; font-size: .86rem; }
.body-head-ops { display: flex; gap: .5rem; align-items: center; }

.body-score-ring {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  background: conic-gradient(var(--orange, #ff6b35) var(--p, 0%), rgba(255,255,255,.12) 0);
  box-shadow: 0 0 0 6px rgba(255, 107, 53, .12);
}
.body-score-ring span {
  width: 54px; height: 54px; border-radius: 50%;
  background: #0b1f4d; display: grid; place-items: center;
  font-size: 1.15rem; font-weight: 900; color: #fff;
}
.body-score-ring small {
  position: absolute; margin-top: 52px;
  font-size: .62rem; color: #9db0d0; font-weight: 700;
}
.body-x {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08); color: #fff;
  font-size: 1.35rem; cursor: pointer;
}

.body-kpis {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: .5rem; margin: 1rem 0 .85rem; position: relative; z-index: 1;
}
.body-kpi {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px; padding: .55rem .6rem;
}
.body-kpi b { display: block; font-size: 1.05rem; }
.body-kpi span { color: #9db0d0; font-size: .72rem; }

.body-stage {
  display: grid; grid-template-columns: 1.15fr .85fr;
  gap: .85rem; position: relative; z-index: 1;
}

.body-diagram-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px; padding: .75rem;
}
.body-diagram-toolbar {
  display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .55rem;
}
.body-chip {
  display: inline-flex; align-items: center; gap: .25rem;
  background: rgba(255,107,53,.18); color: #ffd0a8;
  border: 1px solid rgba(255,107,53,.35);
  border-radius: 999px; padding: .18rem .55rem;
  font-size: .72rem; font-weight: 800;
}
.body-chip.soft {
  background: rgba(255,255,255,.06); color: #c5d4ee;
  border-color: rgba(255,255,255,.1);
}

.body-diagram-wrap {
  position: relative; border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, #f4f7fc, #e8edf5);
  border: 1px solid rgba(11,31,77,.08);
  min-height: 320px;
}
.body-svg-host {
  width: 100%;
}
.body-car-svg {
  width: 100%;
  max-width: min(100%, 640px);
  height: auto;
  display: block;
  margin: 0 auto;
  background: #FAFBFC;
  border-radius: 8px;
}
.body-car-svg-schematic .body-part {
  fill-opacity: .07;
  stroke: none;
  cursor: pointer;
  transition: fill-opacity .2s ease, stroke .2s ease, filter .2s ease;
}
.body-diagram-readonly .body-car-svg-schematic .body-part:not(.body-part-marked) {
  fill-opacity: 0;
}
.body-car-svg-schematic .body-part.body-part-marked {
  fill-opacity: .5;
  stroke-width: 1.6;
}
.body-part:hover,
.body-part:focus-visible,
.body-part.body-part-active {
  fill-opacity: .32;
  stroke: #071BB0;
  stroke-width: 2;
  filter: brightness(.94) drop-shadow(0 2px 6px rgba(7,27,176,.2));
  outline: none;
}
.body-part.body-part-marked:hover,
.body-part.body-part-marked.body-part-active {
  fill-opacity: .62;
}

.body-dir {
  position: absolute; font-size: .65rem; font-weight: 900;
  color: rgba(11,31,77,.55); letter-spacing: .04em;
  background: rgba(255,255,255,.72); padding: .1rem .35rem; border-radius: 6px;
}
.body-dir-front { top: 6px; left: 50%; transform: translateX(-50%); }
.body-dir-rear { bottom: 6px; left: 50%; transform: translateX(-50%); }
.body-dir-right { top: 50%; right: 6px; transform: translateY(-50%); }
.body-dir-left { top: 50%; left: 6px; transform: translateY(-50%); }

.body-side { display: grid; gap: .65rem; align-content: start; }
.body-legend, .body-parts-card, .body-note-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px; padding: .7rem .75rem;
}
.body-legend h3, .body-parts-card h3, .body-note-card h3 {
  margin: 0 0 .5rem; font-size: .88rem; color: #ffd0a8;
}
.body-legend-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .35rem;
}
.body-legend-item {
  display: flex; align-items: center; gap: .35rem;
  font-size: .74rem; color: #d5e0f5;
}
.body-legend-swatch {
  width: 14px; height: 14px; border-radius: 4px; flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.25);
}

.body-parts-list { display: grid; gap: .32rem; max-height: 220px; overflow: auto; }
.body-part-row {
  display: flex; justify-content: space-between; align-items: center; gap: .4rem;
  padding: .35rem .45rem; border-radius: 10px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06);
  font-size: .76rem; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.body-part-row:hover,
.body-part-row-active {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,107,53,.35);
}
.body-part-row b { font-weight: 800; color: #fff; }
.body-part-badge {
  border-radius: 999px; padding: .12rem .45rem;
  font-size: .68rem; font-weight: 800; color: #0b1f4d;
}
.body-note-card p { margin: 0; color: #c5d4ee; font-size: .82rem; line-height: 1.75; }

/* Preview card on listing details */
.body-preview-card {
  margin: .85rem 0 1.1rem;
  border-radius: 22px; overflow: hidden;
  background: linear-gradient(135deg, #0b1f4d, #163a7a 55%, #ff6b35);
  color: #fff; border: 0;
  box-shadow: 0 16px 36px rgba(11,31,77,.18);
}
.body-preview-inner {
  display: grid; grid-template-columns: 1fr auto;
  gap: .8rem; align-items: center; padding: 1rem 1.05rem;
}
.body-preview-copy h2 { margin: .15rem 0 .35rem; font-size: 1.1rem; }
.body-preview-copy p { margin: 0; color: rgba(255,255,255,.82); font-size: .84rem; }
.body-preview-stats {
  display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem;
}
.body-preview-stat {
  background: rgba(255,255,255,.12); border-radius: 999px;
  padding: .18rem .5rem; font-size: .72rem; font-weight: 800;
}
.body-preview-badge {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  min-width: 108px;
}
.body-preview-visual {
  position: relative;
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
}
.body-preview-orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(255,255,255,.35);
  animation: body-orbit 9s linear infinite;
}
.body-preview-scan {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.18) 0%, transparent 68%);
  animation: body-scan-pulse 2.4s ease-in-out infinite;
}
.body-preview-score-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(#fff var(--p, 0%), rgba(255,255,255,.16) 0);
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
  animation: body-badge-float 3.2s ease-in-out infinite;
}
.body-preview-score-core {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(165deg, #0b1f4d 0%, #15356f 100%);
  border: 1px solid rgba(255,255,255,.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .1rem;
  color: #fff;
}
.body-preview-icon {
  width: 34px;
  height: 34px;
  color: #ffb08a;
  animation: body-icon-bob 2.8s ease-in-out infinite;
}
.body-preview-icon .body-preview-scan-line {
  animation: body-scan-sweep 2s ease-in-out infinite;
}
.body-preview-score-core strong {
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
}
.body-preview-label {
  font-size: .72rem;
  font-weight: 800;
  color: rgba(255,255,255,.88);
  letter-spacing: .01em;
}
.body-preview-actions { padding: 0 1.05rem 1rem; }
.body-preview-actions button {
  width: 100%; border: 0; border-radius: 14px;
  background: #fff; color: #0b1f4d;
  font: inherit; font-weight: 900; padding: .72rem 1rem;
  cursor: pointer; box-shadow: 0 10px 24px rgba(0,0,0,.18);
}
.body-preview-actions button:hover { background: #fff4ec; }

@keyframes body-pop {
  from { opacity: 0; transform: scale(.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes body-pulse {
  50% { box-shadow: 0 0 0 8px rgba(239,68,68,.12); }
}
@keyframes body-orbit {
  to { transform: rotate(360deg); }
}
@keyframes body-badge-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes body-icon-bob {
  0%, 100% { transform: translateY(0) scale(1); opacity: .92; }
  50% { transform: translateY(-2px) scale(1.04); opacity: 1; }
}
@keyframes body-scan-pulse {
  0%, 100% { opacity: .45; transform: scale(.96); }
  50% { opacity: .9; transform: scale(1.04); }
}
@keyframes body-scan-sweep {
  0%, 100% { opacity: .35; transform: translateX(-4px); }
  50% { opacity: 1; transform: translateX(4px); }
}

@media (max-width: 900px) {
  .body-kpis { grid-template-columns: repeat(3, 1fr); }
  .body-stage { grid-template-columns: 1fr; }
  .body-preview-inner { grid-template-columns: 1fr; }
  .body-preview-badge { margin: 0 auto; }
}

@media (max-width: 700px) {
  .body-modal { place-items: end center; }
  .body-sheet {
    width: 100%; max-height: min(92vh, 900px);
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    padding: .55rem .85rem 1.1rem;
  }
  .body-modal.in .body-sheet { transform: translateY(0); }
  .body-handle { display: block; }
  .body-head h2 { font-size: 1.1rem; }
  .body-score-ring { width: 62px; height: 62px; }
  .body-score-ring span { width: 46px; height: 46px; font-size: 1rem; }
  .body-kpis { grid-template-columns: repeat(2, 1fr); }
  .body-parts-list { max-height: 160px; }
}
