/* Share a moment — approved v3. All styles are scoped to this flow. */
#app-dialog[data-kind^="share-"] {
  --share-pink: #dc90a7;
  --share-pink-hover: #d67d99;
  --share-paper: #fcfaf8;
  --share-muted: #797779;
  width: min(420px, calc(100vw - 32px));
  height: min(640px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  max-width: none;
  padding: 0;
  border: 1px solid #e8e1df;
  border-radius: 27px;
  background: var(--share-paper);
  color: #282831;
  overflow: hidden;
  box-shadow: 0 24px 88px #261c2929;
  font-family: var(--font);
}
#app-dialog[data-kind^="share-"]::backdrop {
  background: #30283066;
  backdrop-filter: blur(7px);
}
#app-dialog[data-kind^="share-"] .dialog-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 26px 25px 24px;
}
#app-dialog[data-kind^="share-"] #dialog-content { height: 100%; min-height: 0; }
#app-dialog[data-kind^="share-"] .dialog-close {
  top: 19px;
  right: 17px;
  width: 30px;
  height: 30px;
  background: transparent;
  color: #737079;
}
#app-dialog[data-kind^="share-"] .dialog-close .icon { width: 17px; height: 17px; }
#app-dialog[data-kind="share-preview"] .dialog-close,
#app-dialog[data-kind="share-complete"] .dialog-close { display: none; }
.share-step { height: 100%; min-height: 0; display: flex; flex-direction: column; }
.share-header { flex: none; display: flex; align-items: center; justify-content: space-between; min-height: 29px; gap: 12px; }
.share-title { font-size: 21px; line-height: 1.25; font-weight: 650; letter-spacing: -.55px; margin: 0; outline: none; }
.share-flower { width: 14px; height: 14px; margin-left: 6px; vertical-align: 1px; fill: var(--share-pink); }
.share-preview-label { font-size: 11px; line-height: 1.4; font-weight: 400; color: #8a8585; }
.share-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.share-upload-body { display: flex; flex-direction: column; align-items: center; margin-top: 25px; gap: 12px; }
.share-dropzone {
  width: min(100%, calc(100dvh - 245px));
  aspect-ratio: 1;
  flex: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 1px dashed #ecc3cf;
  border-radius: 20px;
  background: #fbf0f3;
  cursor: pointer;
  overflow: hidden;
}
.share-dropzone:hover, .share-dropzone.is-dragging { border-color: #d57b97; background: #f9e8ee; }
/* v7: pointer clicks keep only the original dashed border.
   Keyboard navigation still gets one unclipped, visible focus indicator. */
.share-dropzone { -webkit-tap-highlight-color: transparent; }
.share-dropzone:focus-within { outline: none; }
.share-dropzone:has(input:focus-visible) { outline: 2px solid #af4565; outline-offset: -4px; }
.share-dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.share-dropzone input:focus, .share-dropzone input:focus-visible { outline: none; box-shadow: none; }
.share-dropzone-placeholder { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 17px; color: #b96580; text-align: center; }
.share-dropzone-placeholder .icon { width: 33px; height: 33px; color: #df94ab; stroke-width: 1.35; }
.share-dropzone-placeholder span { font-size: 13px; line-height: 1.45; font-weight: 500; }
.share-selected-media { width: 100%; height: 100%; display: block; object-fit: contain; border-radius: 13px; }
.share-dropzone.has-file { padding: 10px; }
.share-file-caption { max-width: 100%; display: flex; justify-content: center; align-items: center; gap: 8px; }
.share-file-name { max-width: 235px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; color: #8c8284; }
.share-change { border: 0; padding: 3px 0; background: transparent; color: #a45a73; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.share-footer { flex: none; padding-top: 14px; }
.share-flow-button {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 46px; padding: 12px 18px;
  color: #fff; background: var(--share-pink); border: 0; border-radius: 999px;
  font: inherit; font-size: 13px; font-weight: 550; line-height: 1.45; cursor: pointer;
  transition: background .16s ease;
}
.share-flow-button:hover:not(:disabled) { background: var(--share-pink-hover); }
.share-flow-button:focus-visible, .share-inline:focus-visible, .share-change:focus-visible, .share-replace:focus-visible { outline: 2px solid #a94362; outline-offset: 4px; }
.share-flow-button .icon { width: 16px; height: 16px; stroke-width: 1.6; }
.share-flow-button:disabled { cursor: not-allowed; opacity: .62; }
.share-preview-body {
  margin-top: 16px; padding-bottom: 14px; padding-right: 5px;
  overflow-x: hidden; scrollbar-gutter: stable;
}
.share-preview-frame { position: relative; width: 100%; aspect-ratio: 6 / 5; border-radius: 15px; overflow: hidden; background: #f3efec; }
.share-preview-frame > img, .share-preview-frame > video { display: block; width: 100%; height: 100%; object-fit: contain; }
.share-replace { position: absolute; top: 9px; right: 9px; width: 29px; height: 29px; padding: 6px; border: 1px solid #ffffff99; border-radius: 50%; color: #5c5356; background: #fffcf5e8; opacity: 0; transition: opacity .15s; }
.share-replace .icon { width: 15px; height: 15px; }
.share-preview-frame:hover .share-replace, .share-replace:focus-visible { opacity: 1; }
@media (hover:none) { .share-replace { opacity: 1; } }
.share-details { margin-top: 10px; }
.share-detail { margin: 0; }
.share-inline { display: flex; align-items: center; min-height: 36px; max-width: 100%; gap: 9px; border: 0; background: transparent; padding: 4px 0; color: #7a7579; font-size: 12px; text-align: left; }
.share-inline > .icon { width: 15px; height: 15px; flex: none; color: #969095; stroke-width: 1.4; }
.share-inline .share-detail-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 290px; }
.share-inline .share-plus { margin-left: 1px; font-size: 14px; color: #969095; }
.share-editor { margin: 0 10px 8px 23px; min-width: 0; scroll-margin-block: 8px; }
.share-editor input, .share-editor textarea { box-sizing: border-box; display: block; width: 100%; min-width: 0; max-width: 100%; padding: 10px 11px; border: 1px solid #e5d9dc; border-radius: 10px; background: #fffdfc; color: #4a454c; font: inherit; font-size: 13px; line-height: 1.5; }
.share-editor textarea { resize: vertical; min-height: 70px; max-height: 140px; }
.share-editor input:focus, .share-editor textarea:focus { outline: 2px solid #d796ab; outline-offset: 1px; }
.share-editor input::placeholder, .share-editor textarea::placeholder { color: #a39b9d; }
.share-submit-footer { border-top: 1px solid #eee7e5; padding-top: 13px; }
.share-consent { display: flex; align-items: flex-start; gap: 8px; min-height: 20px; margin-bottom: 13px; color: #888085; font-size: 10.5px; line-height: 1.55; cursor: pointer; }
.share-consent input { width: 13px; height: 13px; margin: 1px 0 0; flex: none; accent-color: #bf7189; }
.share-error { color: #a83c59; font-size: 11px; line-height: 1.55; margin: 0 0 9px; }
.share-error:empty { display: none; }
.share-notice { color: #806c74; font-size: 11px; line-height: 1.55; margin: 0 0 10px; }
.share-status { color: #8d6d79; font-size: 11px; line-height: 1.5; margin: 0 0 9px; }
.share-status:empty { display: none; }
.share-cancel { display: block; margin: 7px auto 0; padding: 3px 5px; color: #8d6d79; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
#app-dialog[data-kind="share-complete"] { width: min(420px, calc(100vw - 32px)); height: 260px; }
#app-dialog[data-kind="share-complete"] .dialog-shell { padding: 25px 24px 22px; }
.share-complete { text-align: center; }
.share-complete-top { flex: none; }
.share-heart { display: block; width: 29px; height: 29px; color: #e37c9e; stroke: currentColor; fill: none; stroke-width: 1.5; margin: 0 auto 16px; }
.share-complete-title { font-size: 19px; font-weight: 650; line-height: 1.4; letter-spacing: -.5px; margin: 0; outline: none; }
.share-complete-bottom { margin-top: auto; padding-top: 24px; }
.share-review-note { margin: 0 0 11px; font-size: 12px; color: #888184; font-weight: 400; line-height: 1.5; }
.share-demo-banner { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); background: #fff7f9; border: 1px solid #e7c6d2; border-radius: 99px; padding: 7px 13px; color: #8e5068; font-size: 11px; line-height: 1.4; white-space: nowrap; z-index: 5; box-shadow: 0 3px 15px #36212a12; }
@media (max-width: 480px) {
  #app-dialog[data-kind^="share-"] .dialog-shell { padding: 23px 21px 22px; }
  .share-title { font-size: 20px; }
  .share-upload-body { margin-top: 23px; }
  .share-dropzone { border-radius: 17px; }
  .share-editor input, .share-editor textarea { font-size: 16px; }
  .share-complete-title { font-size: 18px; }
  #app-dialog[data-kind="share-complete"] { height: 260px; }
  #app-dialog[data-kind="share-complete"] .dialog-shell { padding: 24px 20px 20px; }
  .share-review-note { font-size: 11.5px; }
}
@media (max-height: 540px) {
  #app-dialog[data-kind^="share-"] .dialog-shell { padding-top: 18px; padding-bottom: 18px; }
  .share-upload-body { margin-top: 13px; }
  .share-dropzone { width: min(100%, calc(100dvh - 220px)); }
  .share-preview-body { margin-top: 10px; }
  .share-preview-frame { max-height: 220px; }
  .share-submit-footer { padding-top: 8px; }
  .share-consent { margin-bottom: 8px; }
  .share-complete-bottom { padding-top: 14px; }
  .share-demo-banner { left: 8px; top: 3px; transform: none; font-size: 9px; padding: 3px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  #app-dialog[data-kind^="share-"] * { transition: none !important; animation: none !important; }
}

/* v8 — scoped local preview player. Outer dialogs / step 1 / step 3 unchanged. */
.share-preview-frame { isolation: isolate; flex-shrink: 0; }
.share-preview-frame > .share-preview-backdrop {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.16); filter: blur(21px) saturate(.55) brightness(.82);
  opacity: .82; pointer-events: none; user-select: none;
}
.share-preview-frame > .share-preview-media {
  position: relative; z-index: 1;
  width: 100%; height: 100%; object-fit: contain; background: transparent;
}
.share-preview-frame.has-share-player .share-replace { z-index: 4; }
.share-player-controls {
  position: absolute; z-index: 3; inset: auto 0 0;
  display: flex; align-items: center; gap: 6px;
  padding: 19px 8px 7px; min-width: 0;
  color: #fff; background: linear-gradient(transparent, rgb(25 22 25 / 62%));
  -webkit-tap-highlight-color: transparent;
}
.share-player-button {
  appearance: none; -webkit-appearance: none;
  flex: 0 0 34px; display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 7px;
  color: #fff; background: transparent; border: 0; border-radius: 50%;
  box-shadow: none; cursor: pointer; touch-action: manipulation;
}
.share-player-button:hover { background: rgb(255 255 255 / 16%); }
.share-player-button:focus { outline: none; }
.share-player-button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; background: rgb(255 255 255 / 16%); }
.share-control-icon { width: 20px; height: 20px; flex: none; }
.share-player-seek {
  --share-progress: 0%;
  appearance: none; -webkit-appearance: none;
  display: block; flex: 1 1 0; min-width: 0; width: 0;
  height: 34px; margin: 0 3px; padding: 0;
  border: 0; border-radius: 0; background: transparent;
  color: #dc90a7; cursor: pointer; outline: none; touch-action: pan-y;
  box-shadow: none;
}
.share-player-seek::-webkit-slider-runnable-track {
  height: 3px; border: 0; border-radius: 99px;
  background: linear-gradient(to right, #e3a2b7 0%, #e3a2b7 var(--share-progress), rgb(255 255 255 / 42%) var(--share-progress), rgb(255 255 255 / 42%) 100%);
}
.share-player-seek::-moz-range-track {
  height: 3px; border: 0; border-radius: 99px;
  background: linear-gradient(to right, #e3a2b7 0%, #e3a2b7 var(--share-progress), rgb(255 255 255 / 42%) var(--share-progress), rgb(255 255 255 / 42%) 100%);
}
.share-player-seek::-moz-range-progress { height: 3px; background: transparent; }
.share-player-seek::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none; width: 10px; height: 10px;
  margin-top: -3.5px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0003;
}
.share-player-seek::-moz-range-thumb {
  width: 10px; height: 10px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0003;
}
.share-player-seek:focus-visible { outline: 2px solid #fff; outline-offset: 0; border-radius: 5px; }
.share-player-seek:disabled { opacity: .5; cursor: default; }
.share-player-status:not(.sr-only) {
  position: absolute; z-index: 4; left: 12px; right: 12px; top: 12px;
  padding: 10px; border-radius: 8px; background: #fcfaf8ed; color: #704151;
  font-size: 12px; line-height: 1.5; margin: 0;
}
/* Fullscreen the wrapper, never the bare video: our four controls stay intact. */
.share-preview-frame:fullscreen {
  width: 100%; height: 100%; max-height: none; aspect-ratio: auto;
  border-radius: 0; background: #29262a;
}
.share-preview-frame:-webkit-full-screen {
  width: 100%; height: 100%; max-height: none; aspect-ratio: auto;
  border-radius: 0; background: #29262a;
}
.share-preview-frame.is-native-fullscreen .share-player-controls,
.share-preview-frame.is-expanded .share-player-controls {
  gap: 12px; padding: 32px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.share-preview-frame.is-native-fullscreen .share-player-button,
.share-preview-frame.is-expanded .share-player-button { flex-basis: 44px; width: 44px; height: 44px; }
.share-preview-frame.is-native-fullscreen .share-player-seek,
.share-preview-frame.is-expanded .share-player-seek { height: 44px; }
.share-preview-frame.is-native-fullscreen .share-replace,
.share-preview-frame.is-expanded .share-replace { display: none; }
/* Viewport fullscreen fallback (e.g. mobile browsers without element fullscreen). */
#app-dialog[data-kind="share-preview"].share-video-expanded {
  width: 100vw; height: 100dvh; max-width: none; max-height: 100dvh;
  inset: 0; margin: 0; border: 0; border-radius: 0; background: #29262a;
}
#app-dialog.share-video-expanded .dialog-shell { padding: 0; }
#app-dialog.share-video-expanded .share-header,
#app-dialog.share-video-expanded .share-details,
#app-dialog.share-video-expanded .share-footer,
#app-dialog.share-video-expanded .share-demo-banner { display: none; }
#app-dialog.share-video-expanded .share-preview-body { margin: 0; padding: 0; overflow: hidden; scrollbar-gutter: auto; }
.share-preview-frame.is-expanded { width: 100%; height: 100%; max-height: none; aspect-ratio: auto; border-radius: 0; }
@media (pointer: coarse) {
  .share-player-button { flex-basis: 40px; width: 40px; height: 40px; }
  .share-player-seek { height: 40px; }
  .share-player-controls { gap: 4px; padding-left: 6px; padding-right: 6px; }
}
@media (forced-colors: active) {
  .share-player-controls { background: Canvas; color: CanvasText; }
  .share-player-button { color: ButtonText; }
  .share-player-seek { forced-color-adjust: none; }
}
