/* Patient body map, beside the figure (2026-10-19): the hint, the Whole
   body row, a spot's problems, and the best fit as a ticket whose stub
   tears off at the perforation. Loaded after public/body-map.css; the
   sheet, the card and the figure's box live there. */
/* ------------------------------------------------- beside the figure */
.bodymap-pane {
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-width: 0;
}
.bodymap-sheet[data-mode="spot"] .bodymap-pane {
  gap: 20px;
}
.bodymap-q {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.bodymap-sub {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.bodymap-whole-head {
  margin-bottom: 12px;
}
.bodymap-whole-open {
  display: none;
}
.bodymap-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.bodymap-chip {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--ground);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.12s ease,
    background-color 0.12s ease;
}
@media (hover: hover) {
  .bodymap-chip:hover,
  .bodymap-also-row:hover {
    background: var(--surface);
  }
}
.bodymap-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--bm-tint);
  color: var(--ink);
  font-weight: 600;
}
.bodymap-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.bodymap-result {
  display: grid;
  gap: 20px;
}
.bodymap-result:empty {
  display: none;
}

/* --------------------------------------- the ticket and its perforation */
.bodymap-ticket {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background: var(--ground);
}
.bodymap-ticket-top {
  padding: 16px 20px 18px;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  background: var(--bm-tint);
  color: var(--ink);
}
.bodymap-reason {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}
.bodymap-about {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.5;
}
.bodymap-ticket-stub {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 18px 20px 20px;
  border-top: 2px dashed var(--line-strong);
}
.bodymap-ticket-stub::before,
.bodymap-ticket-stub::after {
  content: "";
  position: absolute;
  top: -12px;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--ground);
}
.bodymap-ticket-stub::before {
  left: -12px;
  clip-path: inset(0 0 0 11px);
}
.bodymap-ticket-stub::after {
  right: -12px;
  clip-path: inset(0 11px 0 0);
}
.bodymap-label {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
}
.bodymap-person {
  display: grid;
  grid-template-columns: 56px 1fr;
  column-gap: 12px;
  align-items: center;
}
.bodymap-who {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.bodymap-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}
.bodymap-role {
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink-soft);
}
.bodymap-book {
  flex: none;
  width: 100%;
  min-height: 48px;
}
.bodymap-also {
  display: grid;
  gap: 12px;
}
.bodymap-also-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  column-gap: 12px;
  align-items: center;
  width: 100%;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--ground);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease;
}
.bodymap-also-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.bodymap-also-row .bodymap-name {
  font-size: 15px;
}
.bodymap-face {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--bm-tint);
  color: var(--ink);
  font-weight: 600;
}
.bodymap-face--lg {
  width: 56px;
  height: 56px;
  font-size: 16px;
}
.bodymap-face--sm {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-control);
  font-size: 14px;
}
.bodymap-face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
}
.bodymap-also-go {
  font-size: 14px;
  font-weight: 600;
  color: var(--bm-accent-text);
  white-space: nowrap;
}

/* A long list scrolls under its question; the question stays in view. */
@media (min-width: 641px) {
  .bodymap-sheet[data-mode="spot"] .bodymap-q {
    position: sticky;
    top: -28px;
    z-index: 1;
    margin: -28px 0 -8px;
    padding: 28px 0 8px;
    background: var(--ground);
  }
}

/* ------------------------------------------------------------ motion */
@media (prefers-reduced-motion: no-preference) {
  .bodymap-dialog[open] .bodymap-sheet {
    animation: bodymap-in 0.22s ease-out;
  }
  .bodymap-sheet[data-mode="spot"] .bodymap-pane > * {
    animation: bodymap-fade 0.24s ease-out both;
  }
  .bodymap-ticket {
    animation: bodymap-rise 0.28s ease-out both;
  }
  .bodymap-also {
    animation: bodymap-rise 0.28s 0.06s ease-out both;
  }
}
@keyframes bodymap-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }
}
@keyframes bodymap-fade {
  from {
    opacity: 0;
  }
}
@keyframes bodymap-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* -------------------------------------------------------- the phone */
@media (max-width: 640px) {
  .bodymap-hint {
    display: none;
  }
  .bodymap-whole {
    order: 2;
  }
  .bodymap-whole-head,
  .bodymap-whole .bodymap-chips {
    display: none;
  }
  .bodymap-whole-open {
    display: grid;
    gap: 2px;
    width: 100%;
    min-height: 64px;
    padding: 12px 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-card);
    background: var(--ground);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
  .bodymap-whole-open:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
  }
  .bodymap-whole-open .bodymap-sub {
    margin: 0;
  }
  .bodymap-whole-label {
    font-size: 16px;
    font-weight: 600;
  }
  .bodymap-q {
    font-size: 18px;
  }
  .bodymap-sub,
  .bodymap-chip,
  .bodymap-about,
  .bodymap-label,
  .bodymap-role,
  .bodymap-also-go,
  .bodymap-also-row .bodymap-name {
    font-size: 16px;
  }
  .bodymap-also-row {
    grid-template-columns: 40px 1fr;
    row-gap: 4px;
    padding: 12px;
  }
  .bodymap-also-go {
    grid-column: 2;
  }
  .bodymap-ticket-top,
  .bodymap-ticket-stub {
    padding-left: 16px;
    padding-right: 16px;
  }
}
