/* ── Annotation / Comment System ── */

.annotation-indicator {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #E69F00;
  background: rgba(230, 159, 0, 0.08);
  border: 1px solid rgba(230, 159, 0, 0.3);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  user-select: none;
  vertical-align: middle;
  margin-left: 6px;
}
.annotation-indicator:hover {
  color: #E69F00;
  background: rgba(230, 159, 0, 0.1);
}
.annotation-indicator.has-comments {
  color: #E69F00;
  font-weight: bold;
}
.annotation-indicator .ann-icon {
  font-size: 1rem;
  margin-right: 2px;
  line-height: 1;
}
.annotation-indicator .ann-count {
  font-size: 0.75rem;
  min-width: 14px;
  text-align: center;
}

.has-annotations {
  border-left: 3px solid #E69F00 !important;
}

/* ── Annotation panel ── */
.annotation-panel {
  display: none;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-left: 3px solid #E69F00;
  border-radius: 4px;
  margin: 8px 0 12px 0;
  padding: 10px 14px;
  font-size: 0.88rem;
  line-height: 1.5;
}
.annotation-panel.open {
  display: block;
}

.ann-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e0e0e0;
}
.ann-panel-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: #333;
}
.ann-panel-close {
  cursor: pointer;
  font-size: 1.1rem;
  color: #999;
  background: none;
  border: none;
  padding: 0 4px;
}
.ann-panel-close:hover {
  color: #333;
}

/* Comment list */
.ann-comments-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 10px;
}
.ann-entry {
  padding: 8px 10px;
  margin-bottom: 6px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 3px;
}
.ann-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.ann-author {
  font-weight: 600;
  font-size: 0.8rem;
  color: #555;
}
.ann-time {
  font-size: 0.72rem;
  color: #999;
}
.ann-text {
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Topic badge */
.ann-topic-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-right: 4px;
}

.ann-empty {
  color: #999;
  font-style: italic;
  font-size: 0.82rem;
  padding: 6px 0;
}

/* Input area */
.ann-input-area {
  border-top: 1px solid #e0e0e0;
  padding-top: 8px;
}
.ann-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  align-items: center;
}
.ann-input-row label {
  font-size: 0.78rem;
  color: #666;
  min-width: 50px;
}
.ann-author-input {
  flex: 1;
  padding: 3px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 0.82rem;
}
.ann-comment-topic {
  flex: 1;
  padding: 3px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 0.82rem;
}
.ann-text-input {
  width: 100%;
  min-height: 50px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 0.84rem;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}
.ann-submit-btn {
  padding: 4px 14px;
  background: #E69F00;
  color: #fff;
  border: none;
  border-radius: 3px;
  font-size: 0.82rem;
  cursor: pointer;
  float: right;
}
.ann-submit-btn:hover {
  background: #cc8c00;
}
.ann-submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Feedback message */
.ann-feedback {
  display: none;
  margin-top: 6px;
  font-size: 0.78rem;
  color: #cc0000;
}
.ann-feedback:not(:empty) {
  display: block;
}

/* ── Print styles ── */
@media print {
  .annotation-indicator,
  .ann-input-area,
  .ann-panel-close,
  .ann-feedback {
    display: none !important;
  }
  .annotation-panel.open {
    display: block !important;
    border: 1px solid #999;
    border-left: 3px solid #E69F00;
    page-break-inside: avoid;
    background: #fafafa;
    box-shadow: none;
  }
}
