.gift-video-dialog {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: min(27rem, calc(100vw - 1.5rem));
  height: fit-content;
  max-height: calc(100vh - 1.5rem);
  max-height: calc(100dvh - 1.5rem);
  margin: auto;
  padding: 0;
  overflow: auto;
  color: var(--ink, #20231f);
  background: var(--cream, #f8f3e7);
  border: 1px solid var(--ink, #20231f);
  border-radius: 1rem;
  box-shadow: 0 1.5rem 5rem rgb(17 34 27 / 30%);
  font: inherit;
}
.gift-video-dialog::backdrop { background: rgb(15 31 25 / 72%); }
body:has(.gift-video-dialog[open]) { overflow: hidden; }
.gift-video-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem .75rem .6rem 1.25rem;
}
.gift-video-header h2 {
  margin: 0;
  font: inherit;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.045em;
}
.gift-video-close {
  position: relative;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 50%;
  cursor: pointer;
}
.gift-video-close::before, .gift-video-close::after {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 1rem;
  height: 2px;
  background: currentColor;
  content: '';
  transform: translate(-50%, -50%) rotate(45deg);
}
.gift-video-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.gift-video-close:hover { background: #e9e8dc; }
.gift-video-frame { position: relative; background: #13201c; color: white; }
.gift-video-player {
  display: block;
  width: 100%;
  height: auto;
  max-height: 75vh;
  max-height: 75dvh;
  margin: auto;
  object-fit: contain;
  aspect-ratio: 9 / 16;
  background: #13201c;
}
.gift-video-dialog .gift-video-player {
  max-height: calc(100vh - 6.7rem);
  max-height: calc(100dvh - 6.7rem);
}
.gift-video-error[hidden] { display: none; }
.gift-video-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .75rem;
  padding: 1rem;
  background: rgb(19 32 28 / 90%);
  text-align: center;
}
.gift-video-error p { margin: 0; }
.gift-video-error button {
  min-height: 2.75rem;
  padding: .45rem 1rem;
  color: var(--ink, #20231f);
  background: var(--cream, #f8f3e7);
  border: 0;
  border-radius: .4rem;
  font: inherit;
  cursor: pointer;
}
.gift-video-close:focus-visible, .gift-video-error button:focus-visible {
  outline: 3px solid #2774b1;
  outline-offset: 2px;
}
@media (max-height: 33rem) and (orientation: landscape) {
  .gift-video-dialog { width: min(34rem, calc(100vw - 1.5rem)); }
  .gift-video-header { padding-block: .25rem; }
  .gift-video-dialog .gift-video-player { max-height: calc(100dvh - 5rem); }
}

.clip-picker { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,8.5rem),1fr)); gap:.7rem; }
.clip-choice { position:relative; min-width:0; }
.clip-picker .clip-select {
  display:grid; grid-template-rows:auto 1fr; width:100%; height:100%; align-items:start;
  padding:0; overflow:hidden; color:var(--ink); background:var(--surface);
  border:1px solid #a6aa9a; border-radius:.35rem; text-align:left; font-family:var(--sans);
}
.clip-select:hover { border-color:var(--green); }
.clip-picker .clip-select[aria-pressed="true"] { border-color:var(--green); box-shadow:0 0 0 2px var(--green); background:#eef2e6; }
.clip-select:focus-visible,.clip-watch:focus-visible { outline:3px solid #2969a0; outline-offset:3px; z-index:2; }
.clip-art { position:relative; display:block; width:100%; aspect-ratio:5 / 4; background:#d1d6c8; }
.clip-art img { display:block; width:100%; height:100%; object-fit:cover; object-position:center 34%; border-radius:0; }
.clip-time { position:absolute; right:.35rem; bottom:.37rem; color:white; background:#20231fe6; border-radius:3px;
  padding:.15rem .28rem; font:650 .75rem/1.15 var(--sans); font-variant-numeric:tabular-nums; }
.clip-select[aria-pressed="true"] .clip-art::after { content:"✓"; position:absolute; top:.4rem; right:.4rem; width:1.35rem; height:1.35rem;
  display:grid; place-items:center; border:1px solid #fff8e8; border-radius:50%; background:var(--green); color:white; font:700 .9rem/1 var(--sans); }
.clip-name { display:block; padding:.55rem .56rem .65rem; width:100%; font:650 .94rem/1.2 var(--sans); }
.clip-picker .clip-watch { position:absolute; left:.27rem; top:.22rem; width:2.75rem; height:2.75rem; display:grid; place-items:center;
  padding:0; border:0; background:none; color:white; border-radius:50%; }
.clip-watch::before,.clip-watch::after { content:""; grid-area:1/1; }
.clip-watch::before { width:2rem; height:2rem; border:1px solid white; border-radius:50%; background:#15251ed9; }
.clip-watch::after { margin-left:2px; border-left:9px solid white; border-top:5px solid transparent; border-bottom:5px solid transparent; }
.clip-watch:hover::before { background:var(--green); }
@media (max-width:540px) { .clip-picker {grid-template-columns:repeat(2,minmax(0,1fr));gap:.65rem;} }
