/* Red keeps annotations visibly separate from the product's cyan and blue. */
:root { --cm-red: oklch(0.55 0.21 27); --cm-red-dark: oklch(0.45 0.18 27); }
.cm-start {
  flex: none; font-size: 0.8125rem; font-weight: 600; padding: 5px 12px; border-radius: 6px;
  background: var(--cm-red); color: var(--paper); transition: background 0.15s;
}
.cm-start:hover { background: var(--cm-red-dark); }
.cm-start[aria-pressed="true"] { background: var(--paper); color: var(--cm-red-dark); }
.cm-count[hidden] { display: none; }
.cm-count {
  display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; text-align: center;
  background: var(--cm-red); color: var(--paper); font-size: 0.6875rem; font-weight: 700; line-height: 18px;
}

body.commenting #app, body.commenting #app * { cursor: crosshair !important; }
.cm-hover { outline: 2px solid var(--cm-red) !important; outline-offset: 2px; }

.cm-banner {
  position: fixed; z-index: 30; top: 52px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center;
  width: max-content; max-width: calc(100vw - 32px);
  padding: 9px 16px; border-radius: 10px; background: var(--ink); color: var(--paper); font-size: 0.875rem;
}
.cm-banner button { color: inherit; text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }

#cm-layer { position: absolute; top: 0; left: 0; width: 0; height: 0; z-index: 15; }
.cm-pin {
  position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border-radius: 50% 50% 50% 2px; background: var(--cm-red); color: var(--paper);
  border: 2px solid var(--paper); font-size: 0.75rem; font-weight: 700; line-height: 22px; text-align: center;
  transition: background 0.15s;
}
.cm-pin:hover, .cm-pin[aria-expanded="true"] { background: var(--cm-red-dark); }
body.commenting .cm-pin { pointer-events: none; opacity: 0.5; }

.cm-pop {
  position: absolute; width: 320px; max-width: calc(100vw - 24px); padding: 14px; display: grid; gap: 10px;
  border-radius: 12px; background: var(--paper); border: 1px solid var(--cm-red);
  box-shadow: 0 10px 32px oklch(0.2 0.018 240 / 0.18); font-size: 0.9375rem; z-index: 2;
}
.cm-pop textarea { min-height: 96px; font-size: 0.9375rem; }
.cm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cm-pop .btn { padding: 8px 16px; font-size: 0.875rem; }
.cm-who { font-weight: 600; }
.cm-when { color: var(--ink-3); font-size: 0.8125rem; font-weight: 400; }
.cm-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-quote { color: var(--ink-2); font-size: 0.8125rem; overflow-wrap: anywhere; }
.cm-error { color: oklch(0.45 0.15 30); font-size: 0.875rem; }
.cm-list { display: grid; gap: 14px; max-height: 50vh; overflow-y: auto; }
.cm-item { display: grid; gap: 4px; }
.cm-item + .cm-item { border-top: 1px solid var(--line); padding-top: 12px; }

.cm-chip {
  position: fixed; z-index: 16; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px));
  padding: 8px 14px; border-radius: 999px; background: var(--cm-red); color: var(--paper); font-size: 0.8125rem; font-weight: 600;
}

.cm-page { display: grid; gap: 32px; margin-top: 28px; }
.cm-group { display: grid; gap: 12px; }
.cm-group > h2 { font: 600 1rem/1.3 var(--body); }
.cm-card { display: grid; gap: 6px; padding: 14px 0; border-top: 1px solid var(--line); max-width: 46rem; }
.cm-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 0.875rem; margin-top: 4px; }
.cm-empty { color: var(--ink-2); max-width: 40rem; margin-top: 20px; }
