/* Phase-2 prototype annotation layer — review tool, not product UI */
.cis-annotation-hotspot {
  position: absolute;
  z-index: 10001;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1677ff;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.35);
  font: 700 11px/18px system-ui, sans-serif;
  text-align: center;
  cursor: pointer;
  transform: translate(-50%, -50%);
  animation: cis-note-pulse 2s infinite;
  padding: 0;
}
.cis-annotation-hotspot:hover {
  background: #0958d9;
  transform: translate(-50%, -50%) scale(1.12);
}
@keyframes cis-note-pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(22, 119, 255, 0.35); }
  50% { box-shadow: 0 2px 8px rgba(22, 119, 255, 0.35), 0 0 0 6px rgba(22, 119, 255, 0.12); }
}
.cis-annotation-panel {
  position: fixed;
  z-index: 10002;
  top: 8px;
  right: 8px;
  width: min(380px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  background: #fff;
  border: 1px solid #d9e2f2;
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(31, 56, 88, 0.2);
  font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  color: #1f1f1f;
  display: none;
  overflow: hidden;
}
.cis-annotation-panel.is-open {
  display: flex;
  flex-direction: column;
}
.cis-annotation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #f5f9ff;
  border-bottom: 1px solid #e6eef9;
  cursor: move;
  user-select: none;
  flex: 0 0 auto;
}
.cis-annotation-head strong { font-size: 14px; }
.cis-annotation-close {
  border: 0;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
}
.cis-annotation-body {
  position: relative;
  overflow: auto;
  padding: 10px 12px;
  flex: 1 1 auto;
}
.cis-annotation-note {
  border-bottom: 1px solid #f0f0f0;
  padding: 10px 4px;
  cursor: pointer;
}
.cis-annotation-note:last-child { border-bottom: 0; }
.cis-annotation-note.active {
  background: #f0f6ff;
  border-radius: 6px;
}
.cis-note-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.cis-note-num {
  flex: 0 0 20px;
  height: 20px;
  border-radius: 50%;
  background: #e6f4ff;
  color: #1677ff;
  font-weight: 700;
  font-size: 11px;
  text-align: center;
  line-height: 20px;
}
.cis-note-num.is-overlay {
  background: #f0f5ff;
  color: #597ef7;
  border: 1px dashed #adc6ff;
}
.cis-note-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cis-note-scope {
  font-size: 10px;
  color: #1d39c4;
  background: #f0f5ff;
  border: 1px solid #d6e4ff;
  padding: 0 5px;
  border-radius: 4px;
  font-weight: normal;
  line-height: 16px;
}
.cis-note-kind {
  color: #8c8c8c;
  font-size: 11px;
  margin-top: 2px;
}
.cis-note-summary {
  color: #595959;
  margin: 5px 0 0 28px;
}
/* Detail expands under selected note; left edge aligns with number column */
.cis-note-detail {
  margin: 8px 0 0 0;
  padding: 8px 10px;
  background: #fafafa;
  border-left: 2px solid #91caff;
  border-radius: 0 6px 6px 0;
}
.cis-note-detail dl {
  margin: 0;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 6px 8px;
}
.cis-note-detail dt { color: #8c8c8c; }
.cis-note-detail dd { margin: 0; word-break: break-word; }
.cis-note-detail table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 2px;
}
.cis-note-detail th,
.cis-note-detail td {
  border: 1px solid #e8e8e8;
  padding: 4px 6px;
  text-align: left;
  vertical-align: top;
}
.cis-note-detail th {
  background: #f5f5f5;
  color: #595959;
  font-weight: 600;
}
.cis-note-evidence {
  display: inline-block;
  margin-top: 8px;
  color: #1677ff;
  font-size: 11px;
}
.cis-claim-evidence {
  display: block;
  width: max-content;
  max-width: 100%;
  margin-top: 3px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #e6f4ff;
  color: #1677ff;
  font-size: 10px;
  line-height: 16px;
}
.cis-claim-evidence.is-conflict {
  background: #fff1f0;
  color: #cf1322;
}
.cis-claim-evidence.is-planned {
  background: #fff7e6;
  color: #d46b08;
}
.cis-note-conflict { color: #a8071a; }
.cis-annotation-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999;
  border: 1px solid #91caff;
  background: #fff;
  color: #1677ff;
  border-radius: 18px;
  padding: 7px 12px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  font: 12px system-ui, sans-serif;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.drawer-overlay.show ~ .cis-annotation-toggle,
.modal-overlay.show ~ .cis-annotation-toggle,
body:has(.drawer-overlay.show) .cis-annotation-toggle,
body:has(.modal-overlay.show) .cis-annotation-toggle {
  z-index: 990;
  opacity: 0.15;
  pointer-events: none;
}
.cis-annotation-highlight {
  outline: 3px solid rgba(22, 119, 255, 0.65) !important;
  outline-offset: 3px;
  scroll-margin: 80px;
}
.cis-annotation-empty {
  color: #8c8c8c;
  font-size: 12px;
  padding: 12px 4px;
}
/* Visual state flow diagram in annotations */
.cis-flow-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  padding: 10px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  font-size: 11px;
}
.cis-flow-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.cis-flow-node {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #d9d9d9;
  background: #fafafa;
  color: #262626;
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
}
.cis-flow-node small {
  display: block;
  font-size: 9px;
  color: #8c8c8c;
  font-weight: normal;
}
.cis-flow-node.is-primary {
  border-color: #91caff;
  background: #e6f4ff;
  color: #0958d9;
}
.cis-flow-node.is-success {
  border-color: #b7eb8f;
  background: #f6ffed;
  color: #389e0d;
}
.cis-flow-node.is-warning {
  border-color: #ffe58f;
  background: #fffbe6;
  color: #d46b08;
}
.cis-flow-node.is-danger {
  border-color: #ffa39e;
  background: #fff1f0;
  color: #cf1322;
}
.cis-flow-node.is-muted {
  border-color: #d9d9d9;
  background: #f5f5f5;
  color: #8c8c8c;
}
.cis-flow-arrow {
  color: #8c8c8c;
  font-weight: bold;
  font-size: 12px;
}
.cis-flow-branch-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 10px;
  border-left: 2px dashed #adc6ff;
  margin-top: 4px;
}
.cis-flow-branch-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.cis-flow-branch-label {
  font-size: 10px;
  color: #595959;
  background: #f0f0f0;
  padding: 1px 5px;
  border-radius: 3px;
}
