/* The document bubble's ring, and the full screen viewer for files (docViewer.tsx, pdfView.tsx). */

/* ── the ring on the bubble: round the file's mark while it downloads ─────────────────────────────────────────── */
.gd-ring {
  position: relative;
}
.gd-ring > svg {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 40px;
  height: 40px;
  transform: rotate(-90deg);
}
.gd-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.32);
  stroke-width: 3;
}
.gd-ring-fg {
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.18s linear;
}
.gd-ring[data-turn] > svg {
  animation: gd-turn 0.95s linear infinite;
}
.gd-ring > .gd-x {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: #fff;
  padding: 0;
}
.gd-ring > .gd-x .ico {
  width: 16px;
  height: 16px;
}
@keyframes gd-turn {
  to {
    transform: rotate(270deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .gd-ring[data-turn] > svg {
    animation-duration: 2.4s;
  }
  .gd-ring-fg {
    transition: none;
  }
}

/* ── the viewer ───────────────────────────────────────────────────────────────────────────────────────────────── */
.dvw {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
  color: #fff;
  overscroll-behavior: contain;
}
.dvw-top {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 8px 6px 4px;
  background: #0a0a0a;
}
.dvw-ic {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #fff;
  padding: 0;
}
.dvw-ic:active {
  background: rgba(255, 255, 255, 0.14);
}
.dvw-ic .ico {
  width: 22px;
  height: 22px;
}
.dvw-ic[data-off] {
  opacity: 0.45;
}
.dvw-who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-left: 2px;
}
.dvw-who b {
  font-weight: 650;
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dvw-who span {
  font-size: 0.78rem;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}
.dvw-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.dvw-wait {
  margin: auto;
  opacity: 0.7;
}
.dvw-img {
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: contain;
}
.dvw-toast {
  position: absolute;
  left: 50%;
  bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(40, 40, 40, 0.96);
  color: #fff;
  font-size: 0.9rem;
  text-align: center;
  animation: dvw-up 0.2s cubic-bezier(0.22, 0.8, 0.24, 1) both;
}
@keyframes dvw-up {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

/* the menu: the photo and video viewer's own (mediaViewer.css on feat/media-viewer) */
.dvw-menu-wrap {
  position: absolute;
  inset: 0;
  z-index: 5;
}
.dvw-menu {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 52px);
  right: 10px;
  width: 220px;
  padding: 6px;
  border-radius: 16px;
  background: #232725;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
  transform-origin: top right;
  animation: dvw-pop 0.18s cubic-bezier(0.22, 0.8, 0.24, 1) both;
}
.dvw-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 1rem;
  text-align: start;
}
.dvw-menu button:active {
  background: rgba(255, 255, 255, 0.1);
}
.dvw-menu button[data-danger] {
  color: #ff7b72;
}
.dvw-menu .ico {
  flex: none;
  width: 20px;
  height: 20px;
}
@keyframes dvw-pop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
}

/* the card for files that are not a PDF or a picture */
.dvw-card {
  margin: auto;
  width: 100%;
  max-width: 420px;
  padding: 24px 24px calc(40px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.dvw-mark {
  width: 96px;
  height: 116px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.dvw-mark small {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.dvw-card h2 {
  margin: 22px 0 0;
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.dvw-meta {
  margin: 6px 0 0;
  opacity: 0.75;
  font-size: 0.92rem;
}
.dvw-sent {
  margin: 4px 0 0;
  opacity: 0.6;
  font-size: 0.86rem;
}
.dvw-fail {
  margin: 14px 0 0;
  font-size: 0.88rem;
  color: #ffb4a8;
}
.dvw-go,
.dvw-alt {
  width: 100%;
  height: 50px;
  border-radius: 999px;
  font: inherit;
  font-size: 1rem;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.dvw-go {
  margin-top: 28px;
  border: 0;
  background: var(--lime, #dcef4e);
  color: #0b3d2e;
}
.dvw-alt {
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: none;
  color: #fff;
}
.dvw-go:active,
.dvw-alt:active {
  transform: scale(0.98);
}

/* ── the PDF reader ───────────────────────────────────────────────────────────────────────────────────────────── */
.pv {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #1c1c1e;
}
.pv-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  /* Our own pinch: the browser keeps the scrolling, not its page zoom. */
  touch-action: pan-x pan-y;
}
.pv-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}
.pv-page {
  flex: none;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.pv-canvas {
  width: 100%;
  height: 100%;
}
.pv-wait {
  margin: 40px 0;
  text-align: center;
  opacity: 0.7;
}
.pv-count {
  position: absolute;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(30, 30, 30, 0.88);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  transition: opacity 0.4s;
}
.pv-count[data-still] {
  opacity: 0.8;
}

/* a document bubble: the whole row is a tap target; Open and Save wait while it downloads */
.gd-row[data-tap] {
  cursor: pointer;
}
.gd-act button:disabled {
  opacity: 0.5;
}

/* the Media page's row: the ring alone, round, in place of the small document glyph */
.ci17-ic .gd-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
