/* Contact-projection results section (#projection). Colours match the figures in the paper;
   the "ours" tint and header colour follow the site's comparison classes (#c0cef5 / #7a9be8). */
:root {
  --cp-a: #1f5fbf;          /* arm 1 / top press */
  --cp-b: #e0741a;          /* arm 2 / side press */
  --cp-goal: #555555;
  --cp-ok: #1e8449;
  --cp-bad: #c0392b;
  --cp-ours: #3f5fc4;       /* "ours" header text */
  --cp-ours-bg: #e9eefb;    /* "ours" panel tint */
  --cp-muted: #6b6b6b;
  --cp-line: #e2e2e2;
}

#projection .cp-intro p { margin-bottom: 1rem; }
#projection h3.title { margin-top: 2.75rem; margin-bottom: 1rem; }
#projection .cp-sub {
  text-align: center; color: var(--cp-muted); font-size: 0.95rem;
  max-width: 720px; margin: -0.5rem auto 1.5rem;
}

/* ── aggregate success rates ─────────────────────────────────────────────── */
.cp-rates {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem;
  margin: 1.5rem 0 2.5rem;
}
.cp-rate { background: #fff; border-radius: 10px; padding: 0.9rem 1rem 0.8rem; }
.cp-rate h4 {
  font-family: 'Google Sans', 'Noto Sans', sans-serif; font-weight: 600; font-size: 1.05rem;
  margin: 0 0 0.6rem; color: #363636;
}
.cp-bar { display: grid; grid-template-columns: 4.6rem 1fr 3rem; align-items: center; gap: 0.5rem; margin: 0.32rem 0; }
.cp-bar .lbl { font-size: 0.82rem; color: #4a4a4a; }
.cp-bar .trk { height: 0.62rem; background: #f0f0f0; border-radius: 999px; overflow: hidden; }
.cp-bar .fil { height: 100%; border-radius: 999px; background: #b5b5b5; }
.cp-bar.is-normal .fil { background: #8d8d8d; }
.cp-bar.is-ours .fil { background: #7a9be8; }
.cp-bar.is-ours .lbl { color: var(--cp-ours); font-weight: 600; }
.cp-bar .val { font-size: 0.82rem; text-align: right; font-variant-numeric: tabular-nums; color: #363636; }
.cp-bar.is-ours .val { font-weight: 600; }

/* ── paper metrics, revealed by the "Additional metrics" link ────────────── */
.cp-metrics { margin: -1.5rem 0 2.5rem; }
.cp-metrics > summary {
  display: block; width: fit-content; margin: 0 auto; padding: 0.3rem 0.2rem;
  font-size: 0.9rem; color: var(--cp-ours); cursor: pointer; list-style: none;
}
.cp-metrics > summary::-webkit-details-marker { display: none; }
.cp-metrics > summary::after {
  content: '\25BE'; display: inline-block; margin-left: 0.35em; font-size: 0.8em;
  transition: transform 0.15s ease;
}
.cp-metrics[open] > summary::after { transform: rotate(180deg); }
.cp-metrics > summary:hover { text-decoration: underline; }
.cp-metrics > summary:focus-visible { outline: 2px solid var(--cp-ours); outline-offset: 2px; border-radius: 4px; }
.cp-metrics .cp-sub { margin-top: 1.1rem; margin-bottom: 1.1rem; }
.cp-metrics table {
  width: 100%; max-width: 680px; margin: 0 auto; border-collapse: collapse;
  background: #fff; border-radius: 10px; overflow: hidden;
  font-variant-numeric: tabular-nums; table-layout: fixed;
}
.cp-metrics table th { width: 22%; }
.cp-metrics table th:first-child { width: 34%; }
.cp-metrics th, .cp-metrics td {
  padding: 0.45rem 0.7rem; font-size: 0.88rem; border-bottom: 1px solid var(--cp-line);
}
.cp-metrics thead th {
  font-family: 'Google Sans', 'Noto Sans', sans-serif; font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.02em; color: #7a7a7a; text-align: right;
}
.cp-metrics thead th:first-child { text-align: left; }
.cp-metrics thead th.is-ours { color: var(--cp-ours); }
.cp-metrics table tbody th { text-align: left; font-weight: 400; color: #363636; }
.cp-metrics table td { text-align: right; color: #363636; }  /* beats bulma's td:not([align]) */
.cp-metrics tr.grp th {
  background: #f7f7f5; font-size: 0.8rem; font-weight: 600; color: var(--cp-muted); text-align: left;
}
.cp-metrics td.is-ours { background: var(--cp-ours-bg); }
.cp-metrics td.is-best { font-weight: 600; }
.cp-metrics tbody tr:last-child th, .cp-metrics tbody tr:last-child td { border-bottom: 0; }
.cp-note { text-align: center; color: var(--cp-muted); font-size: 0.78rem; margin: 0.6rem 0 0; }

/* ── static figure: 2 objects x 3 methods per task ───────────────────────── */
.cp-figure {
  display: grid; grid-template-columns: 1fr; gap: 1.4rem 1.6rem; margin: 0.5rem 0 0.75rem;
}
@media screen and (min-width: 1200px) {
  .cp-figure {
    grid-template-columns: 1fr 1fr;
    /* break out of the 960px column so six panels stay legible */
    width: min(1240px, 100vw - 3rem); margin-left: calc(50% - min(620px, 50vw - 1.5rem));
  }
}
.cp-block { background: #fff; border-radius: 10px; padding: 0.8rem 0.9rem 0.6rem; }
.cp-block .hdr {
  display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.35rem;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
}
.cp-block .hdr b { font-size: 1rem; color: #363636; }
.cp-block .hdr span { font-size: 0.85rem; color: var(--cp-muted); }
.cp-block .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.cp-block .col h5 {
  font-size: 0.74rem; letter-spacing: 0.04em; text-transform: uppercase; text-align: center;
  color: #7a7a7a; margin: 0 0 0.25rem; font-weight: 600;
}
.cp-block .col.is-ours h5 { color: var(--cp-ours); }

.cp-panel { position: relative; aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden; background: #fff; }
.cp-panel.is-ours { background: var(--cp-ours-bg); }
.cp-panel img, .cp-panel svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cp-panel svg { overflow: visible; }

.cp-cap {
  display: flex; justify-content: center; align-items: center; gap: 0.3rem;
  margin-top: 0.3rem; font-size: 0.86rem; line-height: 1.2; min-height: 1.2em;
}
.cp-cap.is-ok { color: var(--cp-ok); }
.cp-cap.is-bad { color: var(--cp-bad); }
.cp-cap svg { width: 0.8em; height: 0.8em; flex: none; }
.cp-cap svg path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ── legend ──────────────────────────────────────────────────────────────── */
.cp-legend {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.4rem;
  font-size: 0.82rem; color: #4a4a4a; margin: 0.6rem 0 0.25rem;
}
.cp-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.cp-legend svg { width: 1.6rem; height: 0.9rem; overflow: visible; }

/* ── 3-D explorer ────────────────────────────────────────────────────────── */
.cp-explorer { background: #fff; border-radius: 10px; padding: 1rem 1rem 0.9rem; max-width: 720px; margin: 0 auto; }
.cp-tabs { display: flex; justify-content: center; gap: 0.35rem; margin-bottom: 0.9rem; }
.cp-tabs button {
  border: 1px solid #dcdcdc; background: #fafafa; color: #4a4a4a; border-radius: 999px;
  padding: 0.35rem 1rem; font: inherit; font-size: 0.9rem; cursor: pointer;
}
.cp-tabs button.is-active { background: #c0cef5; border-color: #7a9be8; color: #1a1a2e; font-weight: 600; }
.cp-objects { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-bottom: 0.9rem; }
.cp-objects button {
  border: 2px solid transparent; border-radius: 8px; padding: 0.2rem; background: #f5f5f5;
  cursor: pointer; width: 5.4rem; font: inherit;
}
.cp-objects button img { width: 100%; aspect-ratio: 1 / 1; display: block; border-radius: 5px; }
.cp-objects button span { display: block; font-size: 0.7rem; color: #4a4a4a; margin-top: 0.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-objects button.is-active { border-color: #7a9be8; background: #e9eefb; }
.cp-objects button:hover { border-color: #c0cef5; }
.cp-case { text-align: center; font-size: 0.9rem; color: #4a4a4a; margin-bottom: 0.5rem; }
.cp-case b { color: #363636; }
.cp-views { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.cp-view h5 {
  font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; text-align: center;
  color: #7a7a7a; margin: 0 0 0.25rem; font-weight: 600;
}
.cp-view.is-ours h5 { color: var(--cp-ours); }
.cp-view .stage {
  position: relative; aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden;
  background: #fff; border: 1px solid var(--cp-line); touch-action: none; cursor: grab;
}
.cp-view.is-ours .stage { background: var(--cp-ours-bg); border-color: #d7dff5; }
.cp-view .stage:active { cursor: grabbing; }
.cp-view canvas { display: block; width: 100% !important; height: 100% !important; }
.cp-hint { display: flex; justify-content: center; align-items: center; gap: 0.75rem; margin-top: 0.7rem; font-size: 0.78rem; color: var(--cp-muted); }
.cp-hint button {
  border: 1px solid #dcdcdc; background: #fff; border-radius: 999px; padding: 0.15rem 0.7rem;
  font: inherit; font-size: 0.76rem; color: #4a4a4a; cursor: pointer;
}
.cp-loading { text-align: center; color: var(--cp-muted); font-size: 0.85rem; padding: 2rem 0; }

/* ── where ours fails ────────────────────────────────────────────────────── */
.cp-fails { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; max-width: 860px; margin: 0 auto; }
.cp-fail { background: #fff; border-radius: 10px; padding: 0.55rem 0.6rem 0.5rem; }
.cp-fail .hdr { font-size: 0.78rem; color: #363636; margin-bottom: 0.25rem; font-family: 'Google Sans', 'Noto Sans', sans-serif; }
.cp-fail .hdr span { color: var(--cp-muted); }
.cp-fail .base { text-align: center; font-size: 0.7rem; color: var(--cp-muted); margin-top: 0.15rem; }
.cp-fail .base i { font-style: normal; }
.cp-fail .base .ok { color: var(--cp-ok); }
.cp-fail .base .bad { color: var(--cp-bad); }
.cp-more { text-align: center; margin-top: 1.4rem; font-size: 0.92rem; }

.cp-short { display: none; }
@media screen and (max-width: 768px) {
  .cp-long { display: none; }
  .cp-short { display: inline; }
  .cp-rates { grid-template-columns: 1fr; }
  .cp-fails { grid-template-columns: repeat(2, 1fr); }
  .cp-views { gap: 0.35rem; }
  .cp-view h5 { font-size: 0.66rem; }
  .cp-cap { font-size: 0.76rem; }
}
@media screen and (max-width: 480px) {
  .cp-fails { grid-template-columns: 1fr; }
}
