/* ══════════════════════════════════════════════════════════════
   QH STICKY NOTES WIDGET — standalone stylesheet
   Extracted verbatim from qh-pages.css (source: QuantumHandshake site).
   Self-contained: no shared CSS variables, no external font/icon deps.
   Pair with qh-sticky.js (also self-contained, no build step).
══════════════════════════════════════════════════════════════ */
.qh-sticky-widget {
  position: fixed;
  right: 18px;
  top: 96px;
  z-index: 880;
  width: 232px;
  height: 250px;
  pointer-events: none;
}
.qh-sticky-widget.is-dragging { user-select: none; -webkit-user-select: none; }
/* Homepage only: hidden over the full-height hero, revealed from section 01.
   visibility as well as opacity, so it is out of the tab order while hidden
   rather than an invisible focus stop. */
.qh-sticky-widget.qh-hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
}
.qh-sticky-widget { transition: opacity .35s ease, transform .35s ease, visibility .35s; }

.qh-sticky-note {
  position: absolute;
  top: 0;
  left: 0;
  width: 216px;
  padding: 14px 17px 17px;
  border-radius: 3px;
  box-shadow: 2px 4px 14px rgba(0,0,0,.22), 0 1px 3px rgba(0,0,0,.14);
  transition: transform .28s cubic-bezier(.34,1.46,.64,1), box-shadow .2s;
  will-change: transform;
  pointer-events: auto;
}

/* Fold crease top-right */
.qh-sticky-note::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 14px 14px 0;
  border-color: transparent rgba(0,0,0,.1) transparent transparent;
}

/* Yellow note — question (FRONT by default) */
.qh-sticky-note--a {
  background: #fef3c7;
  transform: rotate(-1.5deg);
  z-index: 2;
  cursor: default;
}
.qh-sticky-note--a:hover { box-shadow: 3px 6px 20px rgba(0,0,0,.26), 0 1px 4px rgba(0,0,0,.16); }

/* Blue note — reaction (BACK by default; fanned UP so its header peeks above) */
.qh-sticky-note--b {
  background: #dbeafe;
  transform: rotate(2.8deg) translate(9px, -38px);
  z-index: 1;
  cursor: pointer;
}
.qh-sticky-note--b:hover { box-shadow: 4px 8px 22px rgba(0,0,0,.28); }

/* ── Flipped state (2-card layout only — see JS §"Layout A") ── */
.qh-sticky-widget.is-flipped .qh-sticky-note--a {
  transform: rotate(3deg) translate(9px, -38px);
  z-index: 1;
  cursor: pointer;
}
.qh-sticky-widget.is-flipped .qh-sticky-note--b {
  transform: rotate(-1.5deg) translate(0, 0);
  z-index: 2;
  cursor: default;
}

/* ── Note internals ─────────────────────────────────────── */
.qh-sticky-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 9px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(0,0,0,.09);
  cursor: grab;
}
.qh-sticky-widget.is-dragging .qh-sticky-header { cursor: grabbing; }
.qh-sticky-drag-hint {
  margin-left: auto;
  font-size: .82rem;
  color: rgba(10,20,40,.28);
  line-height: 1;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.qh-sticky-icon {
  display: flex;
  flex-shrink: 0;
}
.qh-sticky-icon svg {
  width: 12px; height: 12px;
  stroke: rgba(15,25,45,.55);
}
.qh-sticky-title {
  font-size: .71rem;
  font-weight: 800;
  color: rgba(10,20,40,.72);
  letter-spacing: -.01em;
  line-height: 1.2;
}

/* Textarea (Ask note) */
.qh-sticky-ta {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(0,0,0,.13);
  border-radius: 4px;
  padding: 7px 8px;
  font-size: .74rem;
  font-family: inherit;
  background: rgba(255,255,255,.58);
  color: #18293f;
  resize: none;
  line-height: 1.52;
  margin-bottom: 8px;
  outline: none;
  transition: border-color .14s;
}
/* The rule above kills the outline, and a border-colour shift alone is a
   1px hint on a pastel card — the weakest focus signal on the site. Give the
   only free-text field a real ring. The notes are self-coloured, so this one
   is hard-coded rather than themed. */
.qh-sticky-ta:focus-visible {
  border-color: rgba(11,111,214,.75);
  box-shadow: 0 0 0 3px rgba(11,111,214,.22);
}
.qh-sticky-ta:focus { border-color: rgba(11,111,214,.38); }
.qh-sticky-ta::placeholder { color: rgba(30,50,80,.38); }

.qh-sticky-send {
  display: block;
  width: 100%;
  padding: 7px 0;
  border: none;
  border-radius: 4px;
  background: rgba(15,25,45,.13);
  color: rgba(15,25,45,.72);
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .14s;
  font-family: inherit;
}
.qh-sticky-send:hover { background: rgba(15,25,45,.22); }
.qh-sticky-send.is-sent { background: rgba(0,140,70,.14); color: rgba(0,100,50,.8); }

/* Reaction buttons — legacy thumbs markup, unused by current JS (kept for
   compatibility if you revert to a thumbs-up/down reaction instead of stars) */
.qh-react-row {
  display: flex;
  gap: 7px;
  margin-bottom: 8px;
}
.qh-react-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 5px;
  border: 1px solid rgba(0,0,0,.11);
  border-radius: 6px;
  background: rgba(255,255,255,.46);
  cursor: pointer;
  transition: background .14s, border-color .14s;
  font-family: inherit;
}
.qh-react-btn:hover { background: rgba(255,255,255,.74); }
.qh-react-btn.is-active { border-color: rgba(11,111,214,.42); background: rgba(11,111,214,.09); }
.qh-react-btn svg { width: 15px; height: 15px; stroke: rgba(30,50,80,.58); }
.qh-react-btn.is-active svg { stroke: #0b6fd6; }
.qh-react-count {
  font-size: .68rem;
  font-weight: 800;
  color: rgba(10,20,40,.52);
  line-height: 1;
}
.qh-react-btn.is-active .qh-react-count { color: #0b6fd6; }

.qh-sticky-msg {
  font-size: .61rem;
  color: rgba(10,20,40,.38);
  text-align: center;
  margin: 0;
  line-height: 1.4;
}

/* ── star rating (Rate note) ──────────────────────────────── */
.qh-rate-stars { display: flex; justify-content: center; gap: 3px; margin: 6px 0 11px; }
.qh-star { background: none; border: 0; padding: 3px; cursor: pointer; line-height: 0; border-radius: 6px; transition: transform .12s; }
.qh-star:hover { transform: scale(1.16); }
.qh-star:focus-visible { outline: 2px solid rgba(11,111,214,.5); outline-offset: 1px; }
.qh-star svg { width: 27px; height: 27px; fill: rgba(15,25,45,.13); stroke: rgba(15,25,45,.32); stroke-width: 1; transition: fill .12s, stroke .12s, filter .12s; }
.qh-star.on svg { fill: #f5c842; stroke: #dca81c; filter: drop-shadow(0 1px 3px rgba(224,168,28,.6)); }

/* ── Hide on narrow screens (desktop-only widget) ───────────── */
@media (max-width: 1100px) { .qh-sticky-widget { display: none; } }

/* ---- mobile bar ----
   Shown only where the deck is hidden. Bottom-right rather than top-right:
   a thumb reaches the bottom of a phone, and the top is where the sticky
   header already is. */
.qh-mini { display: none; }
@media (max-width: 1100px) {
  .qh-mini {
    /* Bottom-LEFT, not right. The back-to-top button is fixed bottom-right at
       the same offset and they would sit on top of each other — .to-top is
       z-index 90, this is 880, so the collision would have been silent. */
    position: fixed;
    inset-block-end: calc(env(safe-area-inset-bottom, 0px) + 14px);
    inset-inline-start: 14px;
    z-index: 880;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    border-radius: 100px;
    background: rgba(10, 13, 18, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 6px 26px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  :root[data-theme="light"] .qh-mini {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(18, 22, 28, 0.12);
    box-shadow: 0 6px 26px rgba(18, 22, 28, 0.18);
  }
}
.qh-mini-stars { display: flex; gap: 1px; }
.qh-mini .qh-star {
  background: none; border: 0; padding: 4px 2px; cursor: pointer; line-height: 0;
}
.qh-mini .qh-star svg { width: 17px; height: 17px; fill: rgba(255,255,255,.28); }
:root[data-theme="light"] .qh-mini .qh-star svg { fill: rgba(18,22,28,.2); }
.qh-mini .qh-star.on svg { fill: #ffb020; }
.qh-mini-share {
  display: grid; place-items: center;
  inline-size: 34px; block-size: 34px;
  margin-inline-start: 6px;
  border: 0; border-radius: 50%;
  background: #ff4040; color: #fff;
  cursor: pointer;
}
.qh-mini-share svg { width: 16px; height: 16px; }

/* ── Light-mode overrides — ONLY apply if your site toggles a
   `html.light-mode` class the way the source site does. Safe to delete
   this block entirely if your page has no such toggle; the notes are
   already self-coloured (yellow/blue/mint) and read fine on any body
   background without it. ── */
:root[data-theme="light"] .qh-sticky-ta { background: rgba(255,255,255,.72); }
:root[data-theme="light"] .qh-sticky-send { background: rgba(15,25,45,.10); }
:root[data-theme="light"] .qh-sticky-send:hover { background: rgba(15,25,45,.18); }
:root[data-theme="light"] .qh-react-btn { background: rgba(255,255,255,.62); }
:root[data-theme="light"] .qh-react-btn:hover { background: rgba(255,255,255,.9); }

/* ── 3-card deck + Share note (current default layout) ──────── */
.qh-sticky-widget.deck3 { top: 110px; height: 262px; }
.qh-sticky-note--c { background: #d1fae5; }           /* mint — share */
.qh-sticky-widget.deck3 .qh-sticky-note.is-pos-0 { transform: rotate(-1.5deg) translate(0, 0);      z-index: 3; cursor: default; }
.qh-sticky-widget.deck3 .qh-sticky-note.is-pos-1 { transform: rotate(2.6deg)  translate(8px, -36px); z-index: 2; cursor: pointer; }
.qh-sticky-widget.deck3 .qh-sticky-note.is-pos-2 { transform: rotate(-3.4deg) translate(-7px, -70px);z-index: 1; cursor: pointer; }
.qh-sticky-widget.deck3 .qh-sticky-note.is-pos-1:hover,
.qh-sticky-widget.deck3 .qh-sticky-note.is-pos-2:hover { box-shadow: 4px 8px 22px rgba(0,0,0,.28); }

.qh-share-caption { font-size: .63rem; font-weight: 600; color: rgba(10,20,40,.52); text-align: center; line-height: 1.45; margin: 1px 0 10px; }
.qh-share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 7px; }
.qh-share-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 3px; border: 1px solid rgba(0,0,0,.1); border-radius: 6px;
  background: rgba(255,255,255,.5); cursor: pointer; font-family: inherit;
  transition: background .14s, border-color .14s, transform .12s;
}
.qh-share-btn:hover { background: rgba(255,255,255,.86); border-color: rgba(0,0,0,.17); transform: translateY(-1px); }
.qh-share-btn svg { width: 16px; height: 16px; display: block; }
.qh-share-lbl { font-size: .55rem; font-weight: 800; color: rgba(10,20,40,.6); letter-spacing: .01em; }
.qh-share-copy {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  padding: 7px 0; border: 1px solid rgba(0,0,0,.12); border-radius: 4px;
  background: rgba(15,25,45,.09); color: rgba(15,25,45,.74);
  font-size: .68rem; font-weight: 700; cursor: pointer; font-family: inherit; transition: background .14s;
}
.qh-share-copy svg { width: 13px; height: 13px; }
.qh-share-copy:hover { background: rgba(15,25,45,.17); }
.qh-share-copy.is-done { background: rgba(0,140,70,.16); color: rgba(0,100,50,.85); }
.qh-share-toast {
  position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 5;
  background: rgba(12,20,38,.94); color: #eaf2ff;
  font-size: .62rem; font-weight: 600; line-height: 1.4;
  padding: 8px 11px; border-radius: 7px; text-align: center;
  opacity: 0; transform: translateY(6px); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.qh-share-toast.show { opacity: 1; transform: none; }

/* The consent banner is fixed across the bottom until it is answered; the site
   already lifts .to-top clear of it and this needs the same. */
@media (max-width: 1100px) {
  body:has(#consent:not([hidden])) .qh-mini {
    inset-block-end: calc(env(safe-area-inset-bottom, 0px) + 14px + 9rem);
  }
}
