/* Highlight-to-ask (ask_selection.js).
 *
 * Nothing here re-enables selection: `::highlight()` paints a Range the script owns, and
 * .ask-sel-rect is an overlay of that range's client rects for the surfaces the Highlight
 * API can't reach (a shadow-rooted flash fragment). protect.css's user-select:none stays
 * exactly as it is — see the header of ask_selection.js for why that matters.
 */

::highlight(pq-ask) {
  background-color: rgba(255, 206, 84, .42);
  color: inherit;
}

.ask-sel-layer {
  position: fixed;
  inset: 0;
  z-index: 2147482000;      /* under the popover, over the page, below the print wash */
  pointer-events: none;
}
.ask-sel-rect {
  position: fixed;
  background: rgba(255, 206, 84, .38);
  border-radius: 2px;
  /* multiply keeps the words legible through the wash instead of veiling them */
  mix-blend-mode: multiply;
  pointer-events: none;
}

.ask-sel-pop {
  position: fixed;
  z-index: 2147482500;
  display: none;
  align-items: center;
  gap: 8px;
  max-width: min(420px, calc(100vw - 16px));
  padding: 7px 8px 7px 7px;
  border-radius: 11px;
  background: #16202b;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .28);
  font-family: "Hanken Grotesk", -apple-system, system-ui, sans-serif;
}
.ask-sel-pop.on { display: flex; }

.ask-sel-go {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--accent, #1f6feb);
  color: #fff;
  font: 600 13px/1.2 inherit;
  cursor: pointer;
  white-space: nowrap;
}
.ask-sel-go:hover { filter: brightness(1.08); }
.ask-sel-go:disabled { opacity: .45; cursor: default; }
.ask-sel-go .star { margin-right: 5px; }

.ask-sel-q {
  flex: 1 1 auto;
  min-width: 150px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: #f3f1ec;
  font: 400 13px/1.2 inherit;
}
.ask-sel-q::placeholder { color: #9aa5b1; }
.ask-sel-q:focus { outline: none; border-color: var(--accent, #1f6feb); }

.ask-sel-note {
  display: none;
  max-width: 300px;
  color: #b9c2cd;
  font: 400 12px/1.45 inherit;
}

/* A passage quoted into the chat transcript — the reader's own bubble shows what they
   highlighted above what they asked (deepdive.js). */
.msg.you blockquote.ask-quote {
  margin: 0 0 7px;
  padding: 4px 0 4px 10px;
  border-left: 2px solid rgba(255, 255, 255, .35);
  font-style: italic;
  opacity: .82;
}

@media print { .ask-sel-pop, .ask-sel-layer { display: none !important; } }
