/* The candidate list scrolls; the selected party and confirmation stay visible. */
html[data-theme] dialog.party-picker-dialog {
  width: min(480px, calc(100vw - 24px));
  max-width: none;
  height: min(600px, calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom)));
  max-height: none;
  margin: auto;
  padding: 16px;
  border: 2px solid #fff8e6;
  border-radius: 24px;
  background: #fff8eb;
  color: #294b46;
  box-shadow: 0 6px 0 #aa9372, 0 16px 48px #10272d55;
  overflow: hidden;
}
html[data-theme] .party-picker-dialog .dialog-content {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 100%;
  max-height: none;
  min-height: 0;
  gap: 12px;
  overflow: hidden;
}
html[data-theme] .party-picker-dialog .dialog-close {
  top: 9px;
  right: 9px;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border: 1px solid #d1c6af;
  border-radius: 50%;
  background: #fffdf4;
  box-shadow: none;
  color: #47655b;
}
.party-picker-dialog .dialog-close::before { display: none; }
.party-picker-heading { min-width: 0; padding-right: 30px; }
.party-picker-heading .eyebrow { color: #7b8572; font-size: 10px; letter-spacing: 1px; }
html[data-theme] .party-picker-dialog h2 { margin: 4px 0 0; color: #294b46; font-size: 22px; line-height: 1.3; letter-spacing: 0; }
.party-picker-status { margin: 6px 0 0; color: #68796e; font-size: 11px; line-height: 1.5; }
.party-picker-slots { display: grid; grid-template-columns: repeat(var(--party-count), minmax(0, 1fr)); gap: 8px; }
.party-picker-slot { min-width: 0; min-height: 60px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px; border: 1px solid #c3cec0; border-radius: 14px; background: #eef0e3; color: #34544c; text-align: left; }
.party-picker-slot.active { border: 2px solid #327b78; padding: 5px; background: #dcece3; box-shadow: 0 0 0 2px #327b7814; }
html[data-theme] .party-picker-slot .cat-sprite { display: block; flex: 0 0 38px; width: 38px; height: 38px; aspect-ratio: 1; }
.party-picker-slot > span:last-child { min-width: 0; }
.party-picker-slot small { display: block; font-size: 9px; white-space: nowrap; }
.party-picker-slot b { display: block; margin-top: 3px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.party-picker-slots:has(> button:nth-child(3)) .party-picker-slot { flex-direction: column; gap: 0; text-align: center; }
.party-picker-slots:has(> button:nth-child(3)) .party-picker-slot small { font-size: 8px; }
.party-picker-slots:has(> button:nth-child(3)) .party-picker-slot b { font-size: 11px; }
.party-picker-options { min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 8px; padding: 3px 4px 6px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #9ab3a0 transparent; }
.party-picker-cat { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 6px 8px 9px; border: 1px solid color-mix(in srgb, var(--cat-accent) 45%, #b2aa94); border-radius: 16px; background: linear-gradient(145deg, color-mix(in srgb, var(--cat-accent) 20%, #fffdf4), color-mix(in srgb, var(--cat-accent) 35%, #fff4de)); box-shadow: 0 2px 0 #ac9a7224; color: #294b46; }
.party-picker-cat.chosen { border: 2px solid #327b78; padding: 5px 7px 8px; background: #e4eee0; box-shadow: 0 0 0 2px #327b7814; }
.party-picker-badge { align-self: flex-end; padding: 3px 6px; min-height: 18px; border-radius: 7px; background: #ffffffbd; color: #758075; font-size: 9px; line-height: 1.2; }
.chosen .party-picker-badge { background: #327b78; color: #fffdf3; font-weight: 800; }
html[data-theme] .party-picker-cat .cat-sprite { position: relative; display: block; width: clamp(56px, 10dvh, 82px); height: auto; aspect-ratio: 1; flex: none; max-height: none; margin: 0 auto 3px; }
.party-picker-cat b { font-size: 14px; line-height: 1.4; }
.party-picker-cat > small { font-size: 10px; line-height: 1.4; color: #697869; }
.party-picker-footer { min-width: 0; padding-top: 10px; border-top: 1px solid #dbe0cc; background: #fff8eb; }
.party-picker-summary { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.party-picker-summary > span { display: flex; align-items: center; gap: 3px; color: #327b78; font-size: 12px; font-weight: 800; white-space: nowrap; }
.party-picker-summary .icon { width: 14px; height: 14px; }
.party-picker-summary small { color: #7b8572; font-size: 10px; }
.party-picker-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 8px; }
.party-picker-actions button { min-width: 0; min-height: 46px; padding: 10px 6px; border-radius: 13px; font-size: 12px; font-weight: 800; }
.party-picker-photo { border: 1px solid #c6ccb7; background: #f4f2e3; color: #647465; }
.party-picker-confirm { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #e9bc79; background: linear-gradient(130deg, #ffe0a0, #ffca88); color: #674827; box-shadow: 0 2px 0 #bc955d; }
.party-picker-confirm .icon { width: 17px; height: 17px; }
.party-picker-dialog button:focus-visible { outline: 3px solid #e6a75b; outline-offset: 2px; }
@media (max-width: 350px) {
  html[data-theme] dialog.party-picker-dialog { padding: 12px; }
  html[data-theme] .party-picker-dialog .dialog-content { gap: 9px; }
  html[data-theme] .party-picker-dialog h2 { font-size: 20px; }
  .party-picker-slot { gap: 3px; }
  .party-picker-slot small { font-size: 8px; }
  .party-picker-summary small { font-size: 9px; }
  .party-picker-slot b { font-size: 12px; }
}
@media (max-height: 450px) {
  html[data-theme] dialog.party-picker-dialog { padding: 10px 14px; }
  html[data-theme] .party-picker-dialog .dialog-content { gap: 7px; }
  html[data-theme] .party-picker-dialog h2 { font-size: 18px; margin-top: 2px; }
  .party-picker-heading .eyebrow, .party-picker-status { display: none; }
  .party-picker-slot { min-height: 45px; }
  html[data-theme] .party-picker-slot .cat-sprite { width: 30px; height: 30px; flex-basis: 30px; }
  .party-picker-slots:has(> button:nth-child(3)) .party-picker-slot { flex-direction: row; }
  .party-picker-slots:has(> button:nth-child(3)) .party-picker-slot small { display: none; }
  .party-picker-footer { padding-top: 7px; }
  .party-picker-summary { margin-bottom: 5px; }
  .party-picker-actions button { min-height: 42px; }
}
