.contact-sheet-viewer {
  position: fixed;
  inset: 0;
  z-index: 118;
  padding: 28px 36px 18px;
  background:
    radial-gradient(ellipse at 8% 0%, #e5e8f47d, transparent 45%),
    radial-gradient(ellipse at 96% 100%, #e3ebf86b, transparent 48%), #f7f8fc;
  color: #28354b;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr) 42px;
  gap: 18px;
  font-family: var(--sans, sans-serif);
}
.contact-sheet-viewer header {
  display: flex;
  align-items: center;
  gap: 26px;
  border-bottom: 1px solid #dce1ec;
  padding-bottom: 20px;
}
.contact-sheet-brand {
  font-size: 18px;
  line-height: 0.84;
  font-weight: 800;
  letter-spacing: -0.07em;
}
.contact-sheet-viewer small {
  font-size: 9px;
  letter-spacing: 0.22em;
  color: #8b98ae;
}
.contact-sheet-viewer h2 {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.04em;
  margin: 8px 0 0;
}
.contact-sheet-counter {
  margin-left: auto;
  font-size: 25px;
  font-weight: 300;
  color: #8797b5;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.contact-sheet-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
}
.contact-sheet-frame {
  position: absolute;
  margin: 0;
  padding: 6px;
  border: 1px solid #dce3ee;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 18px #52617b0a;
  transform-origin: top left;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  contain: layout paint;
}
.contact-sheet-frame img {
  display: block;
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: contain;
  border-radius: 6px;
  background: #f0f3f8;
}
.contact-sheet-frame figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-height: 17px;
  padding: 5px 1px 0;
  font-size: 8px;
  color: #8e9ab0;
}
.contact-sheet-frame figcaption span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.06em;
}
.contact-sheet-frame figcaption b {
  font-size: 9px;
  color: #6b7ead;
}
.contact-sheet-frame.is-picked {
  border-color: #8a9cc5;
  box-shadow:
    0 0 0 2px #8a9cc51c,
    0 8px 22px #52617b14;
}
.contact-sheet-viewer.is-composition .contact-sheet-frame {
  padding: 14px;
  border-radius: 18px;
  background: #ffffffb0;
}
.contact-sheet-viewer.is-composition figcaption {
  min-height: 26px;
  font-size: 9px;
  letter-spacing: 0.12em;
}
.contact-sheet-viewer footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #e1e6ef;
  padding-top: 15px;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: #8c99af;
}
.contact-sheet-viewer.is-composition .contact-sheet-mode {
  color: #526887;
}
.contact-sheet-open .presentation-indicator {
  opacity: 0.45;
}
.contact-sheet-open .presentation-indicator:hover {
  opacity: 1;
}
.contact-sheet-panel > header {
  justify-content: space-between;
}
.contact-sheet-panel h2 {
  margin: 8px 0;
  font-size: 19px;
}
.contact-control-count {
  font-size: 25px;
  color: #98a8c5;
  font-weight: 300;
}
.contact-album-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.contact-album-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid #e1e7f1;
  border-radius: 14px;
  margin: 0;
  background: #f9fbfe;
  cursor: pointer;
}
.contact-album-list input {
  width: auto !important;
  min-height: 0 !important;
  accent-color: #7b91ba;
}
.contact-album-list b {
  font-size: 12px;
}
.contact-album-list small {
  margin-top: 4px;
}
.contact-source-actions {
  display: flex;
  align-items: end;
  gap: 15px;
  margin-top: 10px;
}
.contact-source-actions label {
  flex: 1;
}
.contact-source-actions button {
  margin-bottom: 14px;
}
.contact-control-active[hidden] {
  display: none;
}
.contact-control-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  max-height: 480px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 4px;
}
.contact-control-grid button {
  position: relative;
  padding: 4px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #f0f3f8;
  cursor: pointer;
  overflow: hidden;
  min-height: 90px;
  color: #7183a3;
  transition:
    border-color 0.2s,
    transform 0.2s;
}
.contact-control-grid img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
  border-radius: 7px;
}
.contact-control-grid button > span {
  display: block;
  padding: 6px;
  font-size: 10px;
  text-align: left;
}
.contact-control-grid button > b {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #fffffff2;
  border-radius: 50%;
  width: 23px;
  height: 23px;
  display: none;
  place-items: center;
  font-size: 11px;
  color: #536d9b;
  box-shadow: 0 2px 8px #26354a1a;
}
.contact-control-grid [aria-pressed='true'] {
  border-color: #849bc7;
  background: #e9eff9;
}
.contact-control-grid [aria-pressed='true'] > b {
  display: grid;
}
.contact-control-grid button:disabled {
  cursor: wait;
}
.contact-picked-strip {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 84px;
  margin: 14px 0;
}
.contact-picked-strip > span {
  position: relative;
  width: 64px;
  height: 70px;
  border: 1px solid #dfe6f2;
  padding: 3px;
  border-radius: 10px;
  background: #fff;
}
.contact-picked-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
.contact-picked-strip b {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #7e94ba;
  color: #fff;
  font-size: 9px;
}
.contact-composition-settings {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 15px;
}
.contact-build-dock {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid #dce4f0;
  background: #f9fbffed;
  position: sticky;
  bottom: 12px;
  z-index: 2;
  box-shadow: 0 7px 25px #3147650c;
}
.contact-build-dock > span {
  font-size: 11px;
  color: #8c9cb5;
  margin-right: auto;
}
.contact-build-dock button {
  min-height: 44px;
  border: 1px solid #dce4f0;
  background: #fff;
  color: #6a7fa0;
  border-radius: 12px;
  padding: 10px 15px;
  font: 12px var(--sans, sans-serif);
  cursor: pointer;
}
.contact-build-dock .primary {
  background: #748bb2;
  color: white;
}
.contact-sheet-panel button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.contact-sheet-panel [role='status'] {
  min-height: 40px;
}
@media (max-width: 800px) {
  .contact-control-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .contact-sheet-viewer {
    padding: 18px;
    grid-template-rows: 65px minmax(0, 1fr) 34px;
    gap: 12px;
  }
}
@media (max-width: 600px) {
  .contact-album-list {
    grid-template-columns: 1fr 1fr;
  }
  .contact-source-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .contact-source-actions button {
    margin-bottom: 0;
  }
  .contact-control-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .contact-control-grid img {
    height: 88px;
  }
  .contact-composition-settings {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .contact-build-dock {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }
  .contact-build-dock > span {
    flex-basis: 100%;
  }
  .contact-build-dock button {
    flex: 1;
    font-size: 11px;
    padding: 11px 10px;
  }
  .contact-sheet-viewer h2 {
    font-size: 14px;
  }
  .contact-sheet-viewer header {
    gap: 15px;
  }
  .contact-sheet-viewer small {
    font-size: 8px;
  }
  .contact-sheet-counter {
    font-size: 19px;
  }
  .contact-sheet-viewer footer {
    font-size: 7px;
    letter-spacing: 0.06em;
  }
  .contact-sheet-frame {
    padding: 3px;
    border-radius: 7px;
  }
  .contact-sheet-frame figcaption {
    font-size: 6px;
    min-height: 12px;
  }
  .contact-sheet-viewer.is-composition .contact-sheet-frame {
    padding: 7px;
    border-radius: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .contact-control-grid button {
    transition: none;
  }
}
.presentation-mode-tabs {
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.presentation-mode-tabs button {
  white-space: nowrap;
}
.presentation-mode-tabs::-webkit-scrollbar {
  display: none;
}
#presentation-contact-sheet[hidden] {
  display: none;
}
