body.case-modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
}

.case-modal {
  position: fixed;
  inset: 0;
  z-index: 30000;
}

.case-modal[hidden] { display: none; }

.case-modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(18, 16, 12, 0.62);
}

.case-modal__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(880px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  margin: 24px auto;
  overflow: hidden;
  border-radius: 18px;
  background: #fafaf8;
  color: #1a1a1a;
}

.case-modal__head {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(26, 26, 26, 0.08);
}

.case-modal__title { min-width: 0; flex: 1; }
.case-modal__title h2 { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 600; }
.case-modal__kicker { margin: 0; color: #7a6528; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }

.case-modal__close,
.case-modal__nav {
  flex: none;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.06);
  color: #1a1a1a;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.case-modal__close {
  background: #1a1a1a;
  color: #fafaf8;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.case-modal__body {
  min-height: 0;
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #111;
}

.case-modal__img,
.case-modal__video {
  display: block;
  width: 100%;
  height: auto;
  background: #111;
}

.case-modal__empty { margin: 0; padding: 28px 18px; background: #fafaf8; color: rgba(26, 26, 26, 0.55); }

.case-modal__foot {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(26, 26, 26, 0.08);
}

.case-modal__foot p { margin: 0; max-width: 40em; color: rgba(26, 26, 26, 0.72); font-size: 14px; }
.case-modal__foot a {
  flex: none;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: #1a1a1a;
  color: #fafaf8;
  font-size: 13px;
  font-weight: 600;
  line-height: 36px;
}

@media (max-width: 720px) {
  .case-modal__dialog {
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }
  .case-modal__head {
    min-height: 56px;
    padding: calc(8px + env(safe-area-inset-top)) 62px 8px 14px;
  }
  .case-modal__close {
    position: fixed;
    top: calc(8px + env(safe-area-inset-top));
    right: 10px;
    z-index: 3;
  }
  .case-modal__nav { display: none; }
  .case-modal__title h2 { font-size: 16px; }
}
