/* Export menu (stage 7 Reports & files): "Export" button with a glass popover of PDF / Excel / CSV. */

.export-menu { position: relative; display: inline-block; }
.panel .export-menu > summary { margin: 0; list-style: none; cursor: pointer; user-select: none; -webkit-user-select: none; gap: 6px; }
.export-menu > summary::-webkit-details-marker { display: none; }
.export-menu > summary::marker { content: ''; }
.export-caret { display: inline-block; font-size: .8em; line-height: 1; opacity: .7; transition: transform var(--dur) var(--ease); }
.export-menu[open] > summary .export-caret { transform: rotate(180deg); }
.export-menu[open] > summary { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }

.export-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  display: grid; gap: 2px; min-width: 11.5rem; max-width: calc(100vw - 32px); padding: 6px;
  background: var(--glass-strong, var(--surface));
  /* glass-strong over a little surface, so the cards underneath never show through the menu text */
  background: linear-gradient(var(--glass-strong), var(--glass-strong)), color-mix(in srgb, var(--surface) 70%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-deep);
  transform-origin: top left;
}
.export-pop.end { left: auto; right: 0; transform-origin: top right; }
.panel .export-menu[open] > .export-pop { animation: export-pop-in var(--dur) var(--ease) both; }
@keyframes export-pop-in { from { opacity: 0; transform: translateY(-4px) scale(.97); } to { opacity: 1; transform: none; } }

.export-pop a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 8px 10px; border-radius: 9px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 550; line-height: 1.2;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.export-pop a small { color: var(--text-2); font-size: 12px; font-weight: 450; }
.export-pop a:hover, .export-pop a:focus-visible { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); outline: none; text-decoration: none; }
.export-pop a:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent) inset; }

/* .panel scrolls sideways (overflow-x: auto) and so would clip the popover: let the reports panel overflow,
   and lift the card with the open menu above the panels that follow. */
.panel:has(.export-menu) { overflow: visible; }
.panel:has(.export-menu[open]) { position: relative; z-index: 30; }
.report-item:has(.export-menu[open]) { position: relative; z-index: 2; }

@media (prefers-reduced-motion: reduce) {
  .panel .export-menu[open] > .export-pop { animation: none; }
  .export-caret { transition: none; }
}
@media print { .export-menu { display: none; } }
