#detail-dialog {
  width: min(650px, calc(100% - 36px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: 13px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  overflow: hidden;
  box-shadow: 0 20px 75px rgb(0 0 0 / 18%);
}
#detail-dialog::backdrop { background: rgb(0 0 0 / 42%); }
.detail-shell {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 48px);
  text-align: left;
}
.detail-bar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  padding: 18px 25px 8px 32px;
}
.detail-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
}
.detail-close:hover { color: var(--ink); background: var(--bg); }
.detail-body {
  padding: 5px 32px 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.53;
}
.detail-body h2 {
  margin: 0 0 16px;
  color: var(--ink);
  font: 650 clamp(23px, 3.6vw, 32px)/1.22 var(--sans);
  letter-spacing: -.025em;
  text-wrap: balance;
}
.detail-body p { margin: 0 0 12px; }
.detail-body .detail-law-name { margin-bottom: 4px; }
.detail-location { font-size: 13px; color: var(--muted); }
.detail-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin: 22px 0 14px;
  padding: 13px 0;
  border-block: 1px solid var(--line);
}
.detail-dates dt, .detail-document small { color: var(--muted); font-size: 13px; }
.detail-dates dd { margin: 3px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.detail-documents { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.detail-document {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--accent);
  text-decoration: none;
  line-height: 1.32;
}
.detail-document:hover { background: var(--tint); border-color: var(--accent); }
.detail-document strong, .detail-document small { display: block; }
.detail-document strong { font-size: 14px; }
.detail-document small { margin-top: 3px; }
.detail-section-title { margin: 23px 0 9px; color: var(--ink); font-size: 15px; }
.detail-quote {
  margin: 0 0 13px;
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 15px;
  font: 400 16px/1.6 var(--sans);
}
.detail-quote p:last-child, .detail-body > p:last-child { margin-bottom: 0; }
.detail-source { display: inline-flex; align-items: center; gap: 6px; padding-block: 5px; font-size: 13px; color: var(--accent); text-underline-offset: .18em; }
.detail-wordmark { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); font-size: 17px; font-weight: 650; }
.detail-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 16px 0; margin: 20px 0; border-block: 1px solid var(--line); }
.detail-stats strong, .detail-stats span { display: block; }
.detail-stats strong { font: 650 27px/1.15 var(--sans); font-variant-numeric: tabular-nums; }
.detail-stats span { color: var(--muted); font-size: 13px; }
#detail-dialog :is(button,a):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 540px) {
  #detail-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 24px); }
  .detail-shell { max-height: calc(100dvh - 24px); }
  .detail-bar { padding: 10px 13px 6px 19px; }
  .detail-body { padding: 4px 19px 22px; }
  .detail-documents { grid-template-columns: 1fr; gap: 6px; }
  .detail-dates { gap: 8px; }
}
