/* What gets zoomed: the conversation subject and each message body.
   content.js sets each one's zoom inline (per sender); this var is only the
   default for a body it hasn't reached yet. Keep selectors non-nested: zoom
   multiplies. */
h2.hP,
.a3s {
  zoom: var(--gpz-zoom, 1);
}

/* Zoomed bodies: reflow fixed-width layouts (600px newsletters, receipts) to
   the pane width instead of letting them run off the side. */
.a3s.gpz-fit { overflow-wrap: break-word; }
.a3s.gpz-fit * { max-width: 100% !important; }
.a3s.gpz-fit table,
.a3s.gpz-fit div { min-width: 0 !important; }
.a3s.gpz-fit img[width],
.a3s.gpz-fit img[style*="width"] { height: auto !important; }
.a3s.gpz-fit pre { white-space: pre-wrap !important; }

/* Still too wide (content.js adds .gpz-fit2): drop fixed pixel/pt widths on
   tables and cells (Outlook writes width="702" style="width:526.85pt") and
   let no-wrap cells wrap. Percentage widths are left alone. */
.a3s.gpz-fit2 :is(table, td, th, col)[width]:not([width$="%"]),
.a3s.gpz-fit2 :is(table, td, th)[style*="width:"],
.a3s.gpz-fit2 :is(table, td, th)[style*="width: "] { width: auto !important; }
.a3s.gpz-fit2 [nowrap],
.a3s.gpz-fit2 [style*="nowrap"] { white-space: normal !important; }

/* Floating control, positioned by content.js at the pane's top-left. Fixed
   small size; faint until hovered. */
#gpz-bar {
  position: fixed;
  z-index: 2147483000;
  display: none;
  user-select: none;
}
#gpz-bar.gpz-on { display: block; }

#gpz-row {
  display: flex;
  gap: 2px;
  opacity: 0.45;
  transition: opacity 0.15s;
}
#gpz-row:hover { opacity: 1; }

#gpz-row button {
  all: unset;
  box-sizing: border-box;
  height: 24px;
  min-width: 24px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border: 1.5px solid #6b21a8;          /* dark purple */
  border-radius: 0;
  background: rgba(216, 180, 254, 0.5); /* light mauve */
  color: #4c1d95;
  font: 700 16px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  transition: background 0.15s;
}
#gpz-row button:hover { background: rgba(216, 180, 254, 0.9); }
#gpz-row button:disabled { opacity: 0.4; cursor: default; }
#gpz-row button.gpz-pct { min-width: 42px; font-size: 11px; }

/* Hover help: sender, shortcuts, version. Shown instantly (native title
   tooltips take ~1s and are easy to miss). */
#gpz-tip {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 4px;
  display: none;
  padding: 4px 7px;
  border: 1.5px solid #6b21a8;
  background: #4c1d95;
  color: #fff;
  font: 500 11px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  white-space: pre;
  pointer-events: none;
}
#gpz-bar:hover #gpz-tip { display: block; }
