:root { --z-annotation-mark: 1210; --z-annotation-popover: 1220; }
/* Annotation UI uses the chat's existing font and palette. */
.annotation-composer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; width: 100%; padding: 0 2px; }
.annotation-composer:not(:has(> :not([hidden]))) { display: none; }
.annotation-chip, .annotation-recovery, .annotation-selection-action, .annotation-panel button { font: inherit; font-size: 12px; cursor: pointer; border: 1px solid var(--border-color, #d8dce2); color: #25282d; background: #fff; border-radius: 9px; padding: 7px 10px; }
.annotation-chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.annotation-chip::before { content: '▤'; color: #555c64; }
.annotation-chip[hidden], .annotation-selection-action[hidden], .annotation-panel[hidden], .annotation-save-status[hidden] { display: none; }
.annotation-chip:hover, .annotation-recovery:hover, .annotation-panel button:hover, .annotation-selection-action:hover { background: var(--light-gray, #f4f6f8); }
.annotation-chip:focus-visible, .annotation-recovery:focus-visible, .annotation-marker:focus-visible, .annotation-selection-action:focus-visible, .annotation-panel :focus-visible { outline: 2px solid var(--accent-color, #0073df); outline-offset: 3px; }
.annotation-save-status { font-size: 11px; color: #515964; }
.annotation-save-error { color: #a22a25; }
.annotation-save-status button { font: inherit; text-decoration: underline; border: 0; background: none; color: inherit; cursor: pointer; }
.annotation-selection-action, .annotation-panel { position: fixed; z-index: var(--z-annotation-popover); box-shadow: 0 3px 18px #18243420; }
.annotation-selection-action { max-width: calc(100vw - 16px); }
.annotation-selection-action.is-mobile { box-sizing: border-box; min-height: 44px; padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; }
@media (max-width: 768px) {
  body.canvas-mobile-open { --z-annotation-mark: 2010; --z-annotation-popover: 2020; }
}
.annotation-panel { box-sizing: border-box; width: 400px; max-width: calc(100vw - 16px); max-height: min(60vh, 560px); overflow-y: auto; background: #fff; color: #25282d; border: 1px solid var(--border-color, #d8dce2); border-radius: 14px; padding: 13px; font: 13px/1.5 Inter, sans-serif; animation: annotation-reveal 150ms ease-out; overflow-wrap: anywhere; }
.annotation-row + .annotation-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-color, #d8dce2); }
.annotation-row-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.annotation-source, .annotation-comment-caption, .annotation-unavailable, .annotation-comment-label { color: #565d66; font-size: 12px; }
.annotation-row-actions { display: flex; flex-shrink: 0; gap: 4px; }
.annotation-row-actions button { padding: 3px 5px; font-size: 11px; }
.annotation-quote { margin: 6px 0 10px; padding: 0 0 0 10px; border-left: 2px solid var(--border-color, #d8dce2); white-space: pre-wrap; max-height: 180px; overflow: auto; }
/* Keep focused text at 16px to avoid automatic zoom in mobile browsers. */
.annotation-comment { box-sizing: border-box; width: 100%; min-height: 80px; max-height: 220px; resize: vertical; border: 1px solid var(--border-color, #d8dce2); border-radius: 8px; padding: 9px; font: inherit; font-size: 16px; margin-top: 5px; background: #fff; color: #25282d; }
.annotation-comment::placeholder { color: #626974; }
.annotation-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 10px; }
.annotation-actions button { appearance: none; display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 16px; border-radius: 999px; border-color: rgba(148, 163, 184, 0.32); background: #fff; color: #151e2b; font-size: 13px; font-weight: 600; }
.annotation-actions button:hover { background: #f8fafc; border-color: rgba(148, 163, 184, 0.48); }
.annotation-panel .annotation-primary { background: #111318; color: #fff; border-color: #111318; }
.annotation-panel .annotation-primary:hover { background: #0b0d11; border-color: #0b0d11; }
.annotation-comment-text, .annotation-message-prompt { white-space: pre-wrap; margin: 4px 0 8px; overflow-wrap: anywhere; }
.annotation-overlay { pointer-events: none; position: fixed; inset: 0; z-index: var(--z-annotation-mark); }
body.annotation-navigation-suspended .annotation-overlay,
body.annotation-navigation-suspended .annotation-marker,
body.annotation-navigation-suspended .annotation-panel,
body.annotation-navigation-suspended .annotation-selection-action { visibility: hidden; }
@media (max-width: 768px) {
  body:has(#app-wrapper.expanded) .annotation-overlay,
  body:has(#app-wrapper.expanded) .annotation-marker,
  body:has(#app-wrapper.expanded) .annotation-panel,
  body:has(#app-wrapper.expanded) .annotation-selection-action { visibility: hidden; }
}
.annotation-highlight { position: fixed; background: #1687e32b; pointer-events: none; border-radius: 2px; }
.annotation-highlight[hidden] { display: none; }
.annotation-marker { pointer-events: auto; position: fixed; min-width: 25px; height: 25px; padding: 0 5px; border: 2px solid white; border-radius: 11px 11px 11px 3px; background: #0073df; color: white; cursor: pointer; font: 600 12px Inter, sans-serif; }
article.legal-assistant-message:has(> .annotation-marker) { position: relative; }
.annotation-marker.is-source-anchored { position: absolute; z-index: 1; }
@media (pointer: coarse), (max-width: 768px) {
  .annotation-marker::before { content: ''; position: absolute; inset: -10px; }
}
.annotation-message-prompt:empty { display: none; }
@keyframes annotation-reveal { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .annotation-panel { animation: none; } }
@media (max-width: 600px) { .annotation-panel { width: min(400px, calc(100vw - 16px)); max-height: 55dvh; } .annotation-row-actions button { min-height: 36px; } }
