/* CC TIPS: shared hover / focus / tap popup (see /static/js/cc-tips.js) */
.cc-tip {
  position: fixed;
  z-index: 3000;
  max-width: min(280px, calc(100vw - 16px));
  padding: 8px 10px 10px 12px;
  background: var(--bg-primary, #1e293b);
  color: var(--text-primary, #e2e8f0);
  border: 1px solid var(--border-medium, #475569);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  line-height: 1.45;
  box-sizing: border-box;
}
.cc-tip[hidden] { display: none; }
/* An unpinned tip never blocks a click: clicks pass through to what is underneath; only its own
   small controls (pin, close, More details, Learn more) stay clickable. A pinned tip is fully interactive. */
.cc-tip:not(.cc-tip-pinned) { pointer-events: none; }
.cc-tip:not(.cc-tip-pinned) .cc-tip-pin,
.cc-tip:not(.cc-tip-pinned) .cc-tip-close,
.cc-tip:not(.cc-tip-pinned) .cc-tip-more-btn,
.cc-tip:not(.cc-tip-pinned) .cc-tip-learn { pointer-events: auto; }
.cc-tip:focus { outline: none; }
.cc-tip.cc-tip-pinned { border-color: var(--accent-primary, #3b82f6); }
.cc-tip.cc-tip-expanded {
  max-width: min(380px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  overflow-y: auto;
}
/* "More details" grows the same popup in place */
.cc-tip.cc-tip-growing {
  overflow: hidden;
  transition: width 0.22s ease, height 0.22s ease, left 0.22s ease, top 0.22s ease;
}
.cc-tip-head { display: flex; align-items: flex-start; gap: 4px; margin-bottom: 2px; }
.cc-tip-title { flex: 1; font-weight: 600; font-size: 13px; padding-top: 2px; }
.cc-tip-pin, .cc-tip-close {
  flex: 0 0 auto;
  background: none;
  border: none;
  padding: 0 3px;
  font-size: 12px;
  line-height: 18px;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  border-radius: 4px;
}
.cc-tip-close { font-size: 16px; }
.cc-tip-pin { opacity: 0.55; filter: grayscale(1); }
.cc-tip-pin[aria-pressed="true"] { opacity: 1; filter: none; }
.cc-tip-pin:hover, .cc-tip-close:hover { color: var(--text-primary, #e2e8f0); background: var(--bg-hover, #334155); }
.cc-tip-text { color: var(--text-secondary, #cbd5e1); }
.cc-tip.cc-tip-untitled .cc-tip-head { float: right; margin: -2px -4px 0 6px; }
.cc-tip-note { margin-top: 6px; padding: 4px 6px; border-radius: 4px; background: #fef3c7; color: #92400e; font-weight: 600; }
.cc-tip-note[hidden] { display: none; }
.cc-tip-more { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-subtle, #334155); }
.cc-tip-more[hidden] { display: none; }
.cc-tip-more p { margin: 0 0 6px; }
.cc-tip-more p:last-child { margin-bottom: 0; }
.cc-tip-links { display: flex; gap: 12px; margin-top: 8px; clear: both; }
.cc-tip-links[hidden], .cc-tip-more-btn[hidden], .cc-tip-learn[hidden] { display: none; }
.cc-tip-more-btn, .cc-tip-learn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 12px;
  color: var(--accent-primary, #3b82f6);
  text-decoration: underline;
  cursor: pointer;
}

/* Header tooltip control and its options popover */
.cc-tips-control { font-weight: 700; }
.cc-tips-menu {
  position: fixed;
  z-index: 3001;
  min-width: 220px;
  max-width: calc(100vw - 16px);
  padding: 6px;
  background: var(--bg-primary, #1e293b);
  border: 1px solid var(--border-medium, #475569);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  box-sizing: border-box;
}
.cc-tips-menu[hidden] { display: none; }
.cc-tips-menu-status { padding: 4px 8px 6px; color: var(--text-muted, #94a3b8); }
.cc-tips-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 8px;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--text-primary, #e2e8f0);
  font: inherit;
  cursor: pointer;
}
.cc-tips-menu button:hover, .cc-tips-menu button:focus { background: var(--bg-hover, #334155); outline: none; }

/* "Do you want to reduce tooltips?" */
.cc-tips-reduce {
  position: fixed;
  z-index: 3001;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: calc(100vw - 16px);
  padding: 8px 12px;
  background: var(--bg-primary, #1e293b);
  border: 1px solid var(--border-medium, #475569);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  color: var(--text-primary, #e2e8f0);
  box-sizing: border-box;
}
.cc-tips-reduce[hidden] { display: none; }
.cc-tips-reduce button {
  padding: 4px 10px;
  font: inherit;
  border: 1px solid var(--border-medium, #475569);
  border-radius: 4px;
  background: var(--bg-secondary, #0f172a);
  color: var(--text-primary, #e2e8f0);
  cursor: pointer;
}
