/* ==========================================================================
   Share your win (js/win-share.js, Peter 30 Sep 2026)
   The drawer is the standard right-docked .filter-panel--drawer with the
   --drawer-* rhythm; only its width, the preview stage and the two logo tiles
   are its own. The offer card is the settle modal's shape.
   ========================================================================== */

.win-share.filter-panel--drawer {
  width: min(540px, 100vw);
  z-index: 9996;
}
/* 641 to 900: filter-panel.css lays a page drawer in the flow; this one is added to <body>
   at runtime, so it stays docked right like it does on a desktop */
@media (min-width: 641px) and (max-width: 900px) {
  .win-share.filter-panel--drawer {
    position: fixed; top: 0; right: 0; bottom: 0; height: auto;
    overflow-y: auto; border-top: none;
    border-left: var(--border-width) solid var(--color-border);
    animation: drawerOpen 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}

.win-share__lede {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* the preview: the canvas IS the frame, drawn at 960x540 (or 720x720) and scaled to fit */
.win-share__stage {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: var(--border-width) solid var(--color-border);
  background: #f3f1ed;
}
.win-share__canvas {
  display: block;
  width: 100%;
  height: auto;
}
.win-share__stage.is-square { max-width: 360px; }
.win-share__preview { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.win-share__preview .win-share__stage { width: 100%; }
.win-share__play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-surface);
}
.win-share__play svg { width: 14px; height: 14px; }

.win-share__group { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.win-share__lbl {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.win-share__hl { margin-top: 2px; }

.win-share__logos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--drawer-row-gap);
}
.win-share__logo { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.win-share__thumb {
  width: 100%;
  height: 72px;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  overflow: hidden;
}
.win-share__thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.win-share__word {
  font-weight: var(--weight-bold);
  color: #0b1d3a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.win-share__mono { font-weight: var(--weight-bold); font-size: 28px; letter-spacing: -0.02em; }
.win-share__logobtns { display: flex; flex-wrap: wrap; gap: 8px; }

.win-share__caption { min-height: 120px; resize: vertical; line-height: 1.5; padding-top: 10px; }

.win-share__note {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.win-share__actions { display: flex; flex-direction: column; gap: 10px; }
.win-share__row { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.win-share__row .btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.win-share__row .btn svg { width: 16px; height: 16px; }

@media (max-width: 640px) {
  .win-share__row .btn { flex: 1 1 0; justify-content: center; }
  .win-share__logos { grid-template-columns: 1fr; }
}

/* the toast when the page has no ui.js (the signing page) */
.win-share__toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: var(--color-text); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: var(--text-sm); z-index: 99999;
}

/* ---- the offer, after the invoices step ---- */
.win-offer {
  position: fixed; inset: 0; z-index: 99990;
  background: var(--modal-scrim);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.win-offer__card {
  background: #fff;
  border: var(--border-width) solid var(--color-border);
  border-radius: 12px;
  width: min(440px, 100%);
  padding: 28px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  animation: winOfferIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.win-offer__title { font-size: 19px; font-weight: var(--weight-regular); margin: 0 0 8px; }
.win-offer__lede { color: var(--color-text-muted); margin: 0 0 22px; line-height: 1.6; }
.win-offer__btns { display: flex; gap: 12px; justify-content: flex-end; }
@keyframes winOfferIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* the card on the proposals board's detail pane */
.pb-winshare { margin-top: 14px; width: 100%; text-align: left; font: inherit; }

@media (prefers-reduced-motion: reduce) {
  .win-offer__card { animation: none; }
  .win-share.filter-panel--drawer { animation: none; }
}
