/* QuicklerShare styling — the single Share control look.
 * Pink indigo->purple->pink gradient (recovered from the original assess output
 * page): gradient TEXT at rest, gradient FILL + white on hover, for both the
 * toggle pill and each dropdown item. */

.qk-share { display: inline-block; }

/* Primary SHARE-ICON button (Philip 2026-07-18): the low-friction way to grab the
   shareable link. Gradient-filled pill so it reads as the main action; the
   Download button beside it is the secondary, higher-friction path. */
.qk-share-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 999px; cursor: pointer;
  border: none; background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
  transition: filter 0.15s, transform 0.05s;
}
.qk-share-icon-btn svg { color: #fff; }
.qk-share-icon-btn:hover { filter: brightness(1.08); }
.qk-share-icon-btn:active { transform: scale(0.95); }

/* Toggle pill */
.qk-share-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  /* Smaller than the share icon beside it (Philip 2026-07-20). */
  width: 31px; height: 31px; padding: 0; border-radius: 999px;
  font-size: 0.84rem; font-weight: 600; cursor: pointer;
  background: #fff; border: 1.5px solid #e7d3ee;
  transition: background 0.15s, border-color 0.15s;
}
.qk-share-toggle svg { color: #a855f7; transition: color 0.15s; }
.qk-share-toggle:hover {
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
  border-color: transparent;
}
.qk-share-toggle:hover svg { color: #fff; }

/* Dropdown */
.qk-share-popup {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid var(--line, #e2e6ef); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(13, 26, 58, 0.12); padding: 6px; z-index: 200;
  min-width: 168px; box-sizing: border-box; flex-direction: column; gap: 2px;
}
/* The popup hangs LEFT from the button (right:0), so on a narrow screen a
   button near the left of a card puts the menu off the side of the page --
   Philip's screenshot: a white panel escaping the viewport and covering the
   row beneath it. Anchor it to the LEFT of the button instead once there is
   not enough room to its left, and never let it exceed the screen width
   (Philip 2026-07-21). */
   The nudge itself is done in JS (clampToViewport) because CSS cannot do it:
   flipping to left:0 only moves the problem to the other edge for a button on
   the right. CSS just guarantees the panel is never wider than the screen. */
@media (max-width: 640px) {
  .qk-share-popup { max-width: calc(calc(100 * var(--vw, 1vw)) - 32px); }
}
.qk-share-popup.open { display: flex; }

/* Items */
.qk-share-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; box-sizing: border-box; min-width: 0;
  justify-content: flex-start;
  padding: 8px 12px; border-radius: 8px;
  font-size: 0.86rem; font-weight: 600;
  cursor: pointer; border: none; background: transparent; text-decoration: none;
  transition: background 0.15s;
}
.qk-share-item svg { color: #a855f7; transition: color 0.15s; }
.qk-share-item:hover {
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
  text-decoration: none;
}
.qk-share-item:hover svg { color: #fff; }

/* Gradient text label (both toggle and items) */
.qk-share-label {
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.qk-share-toggle:hover .qk-share-label,
.qk-share-item:hover .qk-share-label {
  background: none; -webkit-text-fill-color: #fff; color: #fff;
}

/* Secondary exports (PDF, Excel file): plain (non-gradient) ink, quieter and
   smaller than the primary HTML item. Stepped down a further 10% and the Excel
   item brought onto the identical treatment (Philip 2026-07-20) -- HTML is the
   real report, these two are side exports and should read as a matched pair. */
.qk-share-item-pdf,
.qk-share-item-csv { font-size: 0.69rem; }
.qk-share-item-pdf svg,
.qk-share-item-csv svg { color: var(--ink-soft, #6b7280); width: 10px; height: 10px; }
.qk-share-item-pdf .qk-share-label,
.qk-share-item-csv .qk-share-label {
  background: none; -webkit-background-clip: initial;
  -webkit-text-fill-color: var(--ink-soft, #6b7280); color: var(--ink-soft, #6b7280);
}
/* Keep the white-on-hover treatment for legibility over the gradient. */
.qk-share-item-pdf:hover svg,
.qk-share-item-csv:hover svg { color: #fff; }

/* Copied toast */
.qk-share-toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e3a5f; color: #fff; padding: 10px 22px; border-radius: 10px;
  font-size: 0.88rem; font-weight: 500; opacity: 0; pointer-events: none;
  transition: opacity 0.18s, transform 0.18s; z-index: 9999;
}
.qk-share-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Touch devices: 25% bigger share toggle + dropdown items so they are easy to
   tap with gloves on. Gated on pointer type, not width, so big landscape
   tablets/foldables count too (Philip 2026-07-14). */
@media (pointer: coarse), (max-width: 820px) {
  .qk-share-toggle { width: 39px; height: 39px; padding: 0; font-size: 1.05rem; }
  .qk-share-toggle svg { width: 18px; height: 18px; }
  .qk-share-popup { min-width: 210px; }
  .qk-share-item { padding: 12px 15px; font-size: 1.05rem; }
  .qk-share-item svg { width: 20px; height: 20px; }
  .qk-share-item-pdf,
  .qk-share-item-csv { font-size: 0.85rem; }
  .qk-share-item-pdf svg,
  .qk-share-item-csv svg { width: 16px; height: 16px; }
  .qk-share-icon-btn { width: 46px; height: 46px; }
  .qk-share-icon-btn svg { width: 20px; height: 20px; }
}

/* Whose Records the menu holds (Philip 20 Oct 2026: "make this clear this
   is just a download of those ones in that subject"). */
.qk-share-head { padding: 8px 14px 6px; font-size: 0.74rem; font-weight: 700; color: var(--ink-soft, #6b7280);
  border-bottom: 1px solid var(--line, #e2e6ef); margin-bottom: 4px; max-width: 260px;
  overflow-wrap: anywhere; }

.qk-share-item .qk-share-warn { display:block; font-size:0.7rem; font-weight:500; margin-top:1px;
  color:#b45309; -webkit-text-fill-color:#b45309; background:none; }
.qk-share-item:hover .qk-share-warn { color:#fff; -webkit-text-fill-color:#fff; }

/* A zip item says how far it has got on a line of its own, under its name. */
.qk-share-item-zip { flex-wrap: wrap; text-align: left; }
.qk-share-item-zip .qk-zip-note { flex-basis: 100%; padding-left: 20px; }
.qk-share-item-zip .qk-zip-note:empty { display: none; }
/* Room for "Templated document (Word)" on one line beside its icon. */
.qk-share-popup:has(.qk-share-item-zip) { min-width: 250px; }
.qk-share-item-zip .qk-share-label { flex: 1; min-width: 0; }

/* The zip items small and grey, as the PDF and Excel items are (Philip 20
   Oct 2026: "make these all small and grey"); their notes grey too. */
.qk-share-item-zip { font-size: 0.78rem; padding: 6px 12px; }
.qk-share-item-zip svg { color: var(--ink-soft, #6b7280); width: 11px; height: 11px; }
.qk-share-item-zip .qk-share-label {
  background: none; -webkit-background-clip: initial;
  -webkit-text-fill-color: var(--ink-soft, #6b7280); color: var(--ink-soft, #6b7280);
}
.qk-share-item-zip .qk-zip-note { color: #9ca3af; -webkit-text-fill-color: #9ca3af; font-size: 0.68rem; }
.qk-share-item-zip:hover svg, .qk-share-item-zip:hover .qk-zip-note { color: #fff; -webkit-text-fill-color: #fff; }
@media (pointer: coarse), (max-width: 820px) {
  .qk-share-item-zip { font-size: 0.9rem; padding: 10px 14px; }
}
