#dialog:has(.pick-deck) {
  width: min(460px, calc(100vw - 24px));
  max-height: min(91dvh, calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px));
  border: 1px solid #f8f4ee;
  border-radius: 29px;
  background: #fffdf9;
  box-shadow: 0 18px 65px #2c201e35;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
#dialog:has(.pick-deck) .dialog-head {
  padding: 12px 18px 7px;
  border: 0;
  background: #fffdf9;
}
#dialog:has(.pick-deck) .dialog-head h2 { color: #312922; font-size: 18px; }
#dialog:has(.pick-deck) #dialog-body { padding: 0 14px 8px; }
.pick-deck {
  --pick-ink: #312922;
  --pick-muted: #6b5b4e;
  --pick-honey: #916421;
  display: grid;
  gap: 9px;
  color: var(--pick-ink);
  text-align: left;
}
.pick-deck button { touch-action: manipulation; }
.pick-deck :is(button, a):focus-visible { outline: 2px solid #93601e; outline-offset: 2px; }
.pick-toolbar, .pick-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pick-toolbar button, .pick-detail, .pick-footer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--pick-muted);
  font-size: 12px;
  font-weight: 600;
}
.pick-toolbar button { min-height: 37px; padding: 6px 9px; border-radius: 99px; }
.pick-toolbar button[data-pick="saved"] { background: #f1e9dd; color: #61482f; }
.pick-toolbar b {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding-inline: 4px;
  border-radius: 50%;
  background: #fffdf9;
  font: 700 11px/1 system-ui, sans-serif;
}
.pick-subtitle { margin: 0; color: var(--pick-muted); font-size: 12px; }
.pick-stage { overflow: hidden; overflow: clip; border-radius: 25px; background: #dbcec0; }
.pick-card {
  --pick-window: clamp(148px, 27dvh, 243px);
  display: grid;
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: var(--pick-window) auto;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: inherit;
  background: #a58f79;
  transform: translateX(var(--pick-x, 0px)) rotate(var(--pick-angle, 0deg));
  transform-origin: 50% 85%;
  transition: transform 160ms ease-out, opacity 140ms ease-in;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.pick-card.pick-dragging { transition: none; cursor: grabbing; }
.pick-card.pick-leaving { opacity: .14; pointer-events: none; }
.pick-card.pick-leaving[data-direction="want"] { transform: translateX(70%) rotate(8deg); }
.pick-card.pick-leaving[data-direction="pass"] { transform: translateX(-70%) rotate(-8deg); }
.pick-visual {
  position: relative;
  grid-area: 1 / 1 / 3 / 2;
  min-height: 0;
  margin: 0;
  background: linear-gradient(130deg, #bea88f, #967c67 60%, #746154);
}
.pick-visual img {
  position: absolute;
  inset: 0 0 auto;
  display: block;
  width: 100%;
  height: calc(var(--pick-window) + 46px);
  object-fit: cover;
  object-position: center 55%;
  mask-image: linear-gradient(black calc(100% - 30px), transparent);
}
.pick-visual figcaption {
  position: absolute;
  top: var(--pick-window);
  right: 9px;
  max-width: calc(100% - 18px);
  padding: 3px 7px;
  border-radius: 8px;
  transform: translateY(calc(-100% - 6px));
  background: rgb(255 252 245 / 93%);
  color: #514437;
  font-size: 10px;
  line-height: 1.35;
}
.pick-visual figcaption a { color: inherit; text-underline-offset: 2px; }
.pick-visual figcaption .ico { margin-inline-start: 2px; }
.pick-no-photo { height: var(--pick-window); display: grid; place-content: center; justify-items: center; gap: 7px; color: #4d3d2a; font-size: 12px; }
.pick-motion-label {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  padding: 6px 16px;
  border-radius: 99px;
  opacity: 0;
  color: white;
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
}
.pick-card[data-direction] .pick-motion-label { opacity: 1; }
.pick-card[data-direction="want"] .pick-motion-label { background: #835716; }
.pick-card[data-direction="want"] .pick-motion-label::before { content: "行きたい →"; }
.pick-card[data-direction="pass"] .pick-motion-label { background: #65564d; }
.pick-card[data-direction="pass"] .pick-motion-label::before { content: "← 興味なし"; }
.pick-copy {
  position: relative;
  grid-area: 2 / 1 / 3 / 2;
  padding: 16px 19px 8px;
  border-radius: 23px 23px 0 0;
  color: #fffdf8;
  background: linear-gradient(150deg, rgb(93 73 57 / 86%), rgb(65 50 43 / 94%));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.pick-place-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 11px; color: #fcf5ea; }
.pick-place-meta span { display: inline-flex; align-items: center; gap: 3px; }
.pick-place-meta span:first-child { padding: 2px 8px; border: 1px solid #fff2dd6b; border-radius: 99px; }
.pick-copy h3, .pick-empty h3 {
  margin: 7px 0 13px;
  font: 720 clamp(21px, 5.6vw, 27px)/1.33 "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
#pick-name:focus { outline: none; }
.pick-copy h4 { display: flex; align-items: center; gap: 5px; margin: 0 0 4px; color: #fff5df; font-size: 12px; }
.pick-copy h4 .ico { color: #ffe3a9; }
.pick-copy ul { margin: 0; padding-left: 1.05em; }
.pick-copy li { margin-block: 2px; color: #fffaf1; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.pick-copy li::marker { color: #e3cba7; font-size: .8em; }
.pick-caution { margin: 8px 0 0; padding-block-start: 7px; border-top: 1px solid #f6e7d842; color: #f8ecda; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.pick-caution strong { font-size: 11px; }
.pick-detail { min-height: 33px; padding: 0; color: #fff8ee; text-decoration: underline; text-underline-offset: 3px; }
.pick-copy .pick-detail:focus-visible { outline-color: #f9deb1; }
.pick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pick-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  padding: 6px;
  border: 1px solid #e5dbce;
  border-radius: 99px;
  background: #f5efe7;
  color: #5c4e43;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}
.pick-actions button[data-pick="want"] { border-color: var(--pick-honey); color: white; background: var(--pick-honey); }
.pick-actions button small { display: block; margin-top: 2px; font-size: 10px; font-weight: 500; }
.pick-arrow { font: 500 23px/1 system-ui, sans-serif; }
.pick-footer { min-height: 30px; color: var(--pick-muted); font-size: 12px; }
.pick-footer button { min-height: 37px; padding: 0 4px; }
.pick-footer button span { font-size: 18px; }
.pick-footer button:disabled { opacity: .55; }
.pick-footer b { color: var(--pick-ink); font-variant-numeric: tabular-nums; }
.pick-error { margin: 0; color: #8a352e; font-size: 13px; line-height: 1.6; }
.pick-error:empty { display: none; }
.pick-empty { padding: 30px 16px; border-radius: 23px; background: #f4ede4; text-align: center; }
.pick-empty > .ico { color: var(--pick-honey); }
.pick-empty h3 { margin: 8px 0; font-size: 21px; }
.pick-empty p { margin: 6px 0 0; color: var(--pick-muted); font-size: 13px; line-height: 1.65; }
@media (max-width: 375px), (max-height: 700px) {
  #dialog:has(.pick-deck) #dialog-body { padding: 0 10px 5px; }
  #dialog:has(.pick-deck) .dialog-head { padding: 8px 13px 4px; }
  .pick-deck { gap: 6px; }
  .pick-card { --pick-window: clamp(113px, 23dvh, 162px); }
  .pick-copy { padding: 12px 14px 5px; }
  .pick-copy h3 { margin: 5px 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .pick-card { transition: none; }
  .pick-card.pick-leaving { opacity: 1; }
}
