.terms-trigger {
  min-height: 44px;
  padding: .48rem .85rem;
  border: 1px solid #a8bfb5;
  border-radius: 999px;
  background: transparent;
  color: #183d36;
  font-size: .85rem;
  font-weight: 650;
  cursor: pointer;
}
.terms-trigger:hover { background: #f8fbf5; border-color: #4f8070; }
.terms-dialog {
  box-sizing: border-box;
  width: min(770px, calc(100% - 1.5rem));
  max-width: none;
  max-height: calc(100dvh - 1.5rem);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #819990;
  border-radius: 18px;
  background: #fbfcf8;
  color: #182e30;
  box-shadow: 0 24px 80px #071c1e6e;
}
.terms-dialog[open] { display: flex; flex-direction: column; }
.terms-dialog::backdrop { background: #091f23c9; }
body:has(.terms-dialog[open]) { overflow: hidden; }
.terms-header {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2rem);
  background: #103c36;
  color: #fff;
}
.terms-header h2 { margin: 0; font: 650 clamp(1.25rem, 3vw, 1.85rem)/1.15 var(--font); letter-spacing: -.035em; }
.terms-header form { margin: 0; }
.terms-close {
  min-height: 44px;
  padding: .4rem .9rem;
  border: 1px solid #9abcb2;
  border-radius: 999px;
  background: #26584e;
  color: #fff;
  font: 650 .9rem/1.2 var(--font);
  cursor: pointer;
}
.terms-close:hover { background: #337466; }
.terms-scroll {
  min-height: 0;
  padding: clamp(1rem, 4vw, 2rem);
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-block: .75rem;
  font-size: 1rem;
  line-height: 1.65;
}
.terms-scroll:focus-visible { outline: 2px solid #c47742; outline-offset: -3px; }
.terms-scroll :is(p,h3,h4) { max-width: 68ch; }
.terms-scroll p { margin: .45rem 0 1rem; }
.terms-scroll .terms-version { color: #52645c; font-size: .86rem; }
.terms-contents { margin: 1.3rem 0 .4rem; padding: .7rem 1rem; background: #e9f0e7; border: 1px solid #d1dfd3; border-radius: .7rem; }
.terms-contents ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1.8rem; margin: .25rem 0; padding-inline-start: 1.35rem; }
.terms-scroll a { color: #086854; text-decoration: underline; text-underline-offset: .17em; overflow-wrap: anywhere; }
.terms-scroll section { margin-top: 1.6rem; padding-top: 1.35rem; border-top: 1px solid #d6e0d6; }
.terms-scroll section:focus-visible { outline: 2px solid #c47742; outline-offset: 3px; }
.terms-scroll h3 { margin: 0 0 .9rem; color: #123d38; font: 700 clamp(1.2rem, 3vw, 1.6rem)/1.25 var(--font); letter-spacing: -.025em; }
.terms-scroll h4 { margin: .9rem 0 .2rem; font: 680 1rem/1.3 var(--font); }
@media (max-width: 560px) {
  .site-footer > .shell { flex-wrap: wrap; }
  .terms-dialog { border-radius: 12px; }
  .terms-contents ol { grid-template-columns: 1fr; }
}
@media print {
  @page { size: A4; margin: 18mm; }
  body:has(.terms-dialog[open]) { overflow: visible; }
  body:has(.terms-dialog[open]) > :not(.terms-dialog) { display: none !important; }
  .terms-dialog[open] { display: block; position: static; width: auto; max-height: none; overflow: visible; margin: 0; border: 0; box-shadow: none; }
  .terms-dialog[open]::backdrop { display: none; }
  .terms-header { padding: 0 0 8mm; color: #000; background: transparent; }
  .terms-header form, .terms-contents { display: none; }
  .terms-scroll { overflow: visible; padding: 0; font-size: 11pt; line-height: 1.45; }
  .terms-scroll section { margin: 0; padding: 0; border: 0; }
  .terms-scroll section + section { break-before: page; }
  .terms-scroll h3, .terms-scroll h4 { break-after: avoid; }
}
