/* /law.css */
/* Legal documents carried over from the live site (template law, written by tools/legal_import.py).
   The words are theirs, this layout is ours: one calm reading column on paper, boxes as sheets, tables that
   reach past the column on wide screens and become one block per row on a phone. */

.law .read__head > * { max-width: 672px; }
/* the headline may run wider than the text column, so a long legal word fits; it is hyphenated only where it cannot */
.law .read__head > .read__h1 { max-width: none; text-wrap: balance; overflow-wrap: break-word; hyphens: manual; }
@media (max-width: 1180px) {
  .law .read__head > .read__h1 { hyphens: auto; hyphenate-limit-chars: 22 8 8; -webkit-hyphenate-limit-before: 8; -webkit-hyphenate-limit-after: 8; }
}
.law .read__meta { font-variant-numeric: tabular-nums; }
.law__langs { margin-top: 10px; font-size: 0.9375rem; color: var(--ink-3); }
.law__langs b { font-weight: 600; color: var(--ink); }
.law__langs a { color: var(--ink-2); text-decoration-line: underline; text-decoration-color: var(--forest); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .law__langs a:hover { color: var(--ink); } }
.law__notice { margin-top: 22px; padding: 18px 22px 20px; border-radius: 12px; background: var(--sheet); box-shadow: inset 0 0 0 1px var(--rule); font-size: 1rem; line-height: 1.6; color: var(--ink-2); }
.law__notice p + p { margin-top: 10px; }

.law__body { overflow-wrap: anywhere; }
.law__body section { scroll-margin-top: calc(var(--stick) + 12px); }
.law__body section + section { margin-top: 56px; }
.law__body section > * + * { margin-top: 24px; }
.law__body section > h2:first-child { margin-top: 0; }
.law__body section > h2 + *, .law__body section > h3 + * { margin-top: 16px; }
.law__body section > h3 { margin-top: 40px; }
.law__body [id] { scroll-margin-top: calc(var(--stick) + 12px); }
/* a plain wrapper of the document keeps the reading rhythm inside */
.law__body :where(div:not(.lawtbl, .lawf__row, .lawf__hp)) > * + * { margin-top: 24px; }
/* a button inside the text keeps the button's own ink (the text link colour would make it dark on dark) */
.law__body a.btn { color: var(--btn-fg); text-decoration: none; }
.law__body strong { font-weight: 600; }
.law__body hr { height: 1px; border: 0; background: var(--rule); margin-block: 48px; }
.law__body code { overflow-wrap: anywhere; }

/* numbered lists keep the numbers the document gives them (start, type) */
.law__body ol { counter-reset: none; padding-left: 1.6em; list-style: decimal; }
.law__body ol[type="a"] { list-style: lower-alpha; }
.law__body ol[type="i"] { list-style: lower-roman; }
.law__body ol > li { padding-left: 6px; counter-increment: none; }
.law__body ol > li::before { content: none; }
.law__body ol > li::marker { font-weight: 600; font-variant-numeric: tabular-nums; }
.law__body li > ul, .law__body li > ol { margin-top: 12px; }
.law__body .law-plain { padding-left: 0; list-style: none; }
.law__body .law-plain > li { padding-left: 0; }
.law__body .law-plain > li::before { content: none; }
.law__body dl > * + dt { margin-top: 20px; }
.law__body dt { font-weight: 600; }
.law__body dd { margin-top: 4px; }

/* marks of the document */
.law-label { font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: var(--ink-3); }
span.law-label { display: block; margin-bottom: 2px; }
.law-meta { font-size: 0.875rem; line-height: 1.5; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.law-lead { font-family: var(--display); font-weight: 600; font-variation-settings: var(--head-axes-sm); font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.01em; }
.law-note { font-size: 0.9375rem; line-height: 1.6; font-style: italic; color: var(--ink-3); }
.law-small { font-size: 0.9375rem; line-height: 1.6; }
.nw { white-space: nowrap; }

/* a box of the document: a sheet of paper on the page */
.lawbox, .lawtoc { padding: 22px 26px 24px; border-radius: 12px; background: var(--sheet); box-shadow: inset 0 0 0 1px var(--rule); }
.lawbox > * + *, .lawtoc > * + * { margin-top: 12px; }
.lawbox--strong { box-shadow: inset 0 0 0 1.5px rgb(22 19 15 / 0.42); padding: 26px 30px 28px; }
.lawbox h2, .lawbox h3 { margin-top: 0; }
.lawbox h2 { font-size: 1.5rem; }
.lawtoc { font-size: 1rem; line-height: 1.5; }
.lawtoc li + li { margin-top: 8px; }
.lawtoc a { text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .lawtoc a:hover { text-decoration: underline; text-decoration-color: var(--forest); text-decoration-thickness: 1.5px; text-underline-offset: 3px; } }
@media (min-width: 721px) { .lawtoc .law-cols { columns: 2; column-gap: 32px; } .lawtoc .law-cols > li { break-inside: avoid; margin-top: 0; padding-bottom: 8px; } }

/* tables: wider than the reading column where there is room */
.lawtbl { --out: clamp(0px, (100vw - 672px) / 2 - var(--gutter), 264px); margin-inline: calc(-1 * var(--out)); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lawtbl table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.5; overflow-wrap: break-word; }
.lawtbl th, .lawtbl td { padding: 12px 20px 13px 0; text-align: left; vertical-align: top; }
.lawtbl th:last-child, .lawtbl td:last-child { padding-right: 0; }
.lawtbl th { font-weight: 600; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
.lawtbl td { border-bottom: 1px solid var(--rule); min-width: 9rem; }
.lawtbl td code { white-space: normal; }

/* the two duty links and the other documents, under every document */
.law__foot { margin-top: var(--c-gap); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 672px) minmax(0, 1fr); column-gap: 48px; }
.law__foot-in { grid-column: 2; padding-top: 28px; border-top: 1px solid var(--rule); }
.law__acts { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.law__act { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.0625rem; color: var(--ink); text-decoration: none; }
.law__act .ic { width: 16px; height: 16px; transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1); }
@media (hover: hover) and (pointer: fine) { .law__act:hover .ic { transform: translate3d(3px, 0, 0); } }
.law__more-h { margin-top: 30px; font-size: 0.9375rem; font-weight: 600; color: var(--ink-2); }
.law__more { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 0.9375rem; }
.law__more a { color: var(--ink-2); text-decoration: none; }
.law__more a[aria-current="page"] { color: var(--ink); font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .law__more a:hover { color: var(--ink); } }

/* the forms of the withdraw and cancel pages */
.lawf { display: grid; gap: 26px; padding: 30px 30px 32px; border-radius: 14px; background: var(--sheet); box-shadow: inset 0 0 0 1px var(--rule); }
.prose .lawf > * + * { margin-top: 0; }
.lawf__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lawf__row, .lawf__set { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.lawf__l { padding: 0; font-size: 0.9375rem; font-weight: 600; line-height: 1.4; }
.lawf__req { margin-left: 3px; color: var(--forest); }
.lawf__in { width: 100%; min-height: 52px; padding: 13px 16px; border: 0; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px rgb(22 19 15 / 0.22); font: 400 1.0625rem/1.4 var(--sans); color: var(--ink); -webkit-appearance: none; appearance: none; }
textarea.lawf__in { min-height: 120px; resize: vertical; }
.lawf__in:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
.lawf__in[aria-invalid="true"] { box-shadow: inset 0 0 0 2px #a8321f; }
.lawf__opt { display: flex; align-items: flex-start; gap: 12px; padding: 5px 0; font-size: 1.0625rem; line-height: 1.45; cursor: pointer; }
.lawf__opt input { flex: none; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--forest); }
.lawf .law-small { font-size: 0.9375rem; line-height: 1.55; color: var(--ink-3); }
.lawf__go { justify-self: start; }
.lawf__go[disabled] { opacity: 0.6; pointer-events: none; }
.lawf__msg { padding: 16px 20px; border-radius: 10px; font-size: 1rem; line-height: 1.55; background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); }
.lawf__msg[data-kind="error"] { box-shadow: inset 0 0 0 2px #a8321f; }
.lawf__more[hidden] { display: none; }

/* the typed fields wear the app's field (calm.css .ff): the label stands inside the field and moves up as a small
   caption when the field is used. The form's markup is the account system's (label, field, hint, in that order), so
   the row is read with :has(); a browser without it keeps the label above the field, as before. A date field always
   shows its own pattern, so its label stays above. */
.lawf__in { min-height: 56px; border-radius: 14px; box-shadow: inset 0 0 0 1px rgb(22 19 15 / 0.2); transition: box-shadow 120ms ease; }
.lawf__in:focus, .lawf__in:focus-visible { outline: none; box-shadow: inset 0 0 0 1.5px var(--forest); }
.lawf__in[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px #a8321f; }
@supports selector(:has(*)) {
  .lawf__row:has(> .lawf__in[placeholder=" "]) { position: relative; }
  .lawf__row:has(> .lawf__in[placeholder=" "]) > .lawf__l { position: absolute; z-index: 1; left: 16px; right: 16px; top: 28px; transform: translateY(-50%); transform-origin: 0 50%; overflow: hidden; font-size: 1.0625rem; font-weight: 400; line-height: 1.3; color: var(--ink-3); white-space: nowrap; text-overflow: ellipsis; pointer-events: none; transition: transform 160ms ease-out; }
  .lawf__row:has(> .lawf__in[placeholder=" "]:focus) > .lawf__l, .lawf__row:has(> .lawf__in[placeholder=" "]:not(:placeholder-shown)) > .lawf__l { transform: translateY(calc(-50% - 11px)) scale(0.76); }
  .lawf__in[placeholder=" "] { height: 56px; padding: 24px 16px 7px; }
  textarea.lawf__in[placeholder=" "] { height: auto; min-height: 116px; padding-top: 27px; line-height: 1.45; }
}
@media (prefers-reduced-motion: reduce) { .lawf__row > .lawf__l, .lawf__in { transition: none; } }

/* the receipt after a declaration was sent: what arrived, when, and what was said */
.lawrc { display: grid; gap: 14px; padding: 34px 34px 36px; border-radius: 14px; background: var(--sheet); box-shadow: inset 0 0 0 1.5px var(--forest); animation: lawrc-in 250ms cubic-bezier(0.23, 1, 0.32, 1); }
@keyframes lawrc-in { from { opacity: 0; transform: scale(0.98); } }
.prose .lawrc > * + * { margin-top: 0; }
.lawrc__ok { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--forest); color: #fff; }
.prose .lawrc__h { margin-top: 4px; font-size: 1.75rem; outline: none; }
.lawrc__in { font-weight: 600; font-variant-numeric: tabular-nums; }
.lawrc .law-label { margin-top: 10px; }
.lawrc__rows { display: grid; margin: 0; border-top: 1px solid var(--rule); }
.lawrc__rows > div { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 4px 20px; padding: 11px 0 12px; border-bottom: 1px solid var(--rule); }
.law__body .lawrc__rows dt { font-weight: 400; color: var(--ink-3); font-size: 1rem; }
.law__body .lawrc__rows dd { margin: 0; font-size: 1.0625rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.lawrc__p { font-size: 1.0625rem; line-height: 1.55; }
.lawrc__preview { padding: 10px 14px; border-radius: 8px; background: rgb(22 19 15 / 0.06); font-size: 0.9375rem; color: var(--ink-3); }
.lawrc__act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-top: 8px; }
.lawrc__act .btn { border: 0; cursor: pointer; }
.lawrc__copied { font-size: 0.9375rem; color: var(--ink-3); }
.lawf .lawf__go { border: 0; cursor: pointer; }
.lawf__set > .lawf__more { margin-top: 10px; }
@media (max-width: 720px) {
  .lawrc { padding: 24px 18px 26px; }
  .lawrc__rows > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (prefers-reduced-motion: reduce) { .lawrc { animation: none; } }

/* the document's own "save as PDF" button prints the page */
.lawprint { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--sheet); box-shadow: inset 0 0 0 1px rgb(22 19 15 / 0.22); font: 600 0.9375rem var(--sans); color: var(--ink); cursor: pointer; }
.lawprint:active { transform: translate3d(0, 1px, 0); }

@media (max-width: 720px) {
  .law .read__head > .read__h1 { font-size: clamp(1.75rem, 7.6vw, 2.25rem); text-wrap: wrap; }
  .law__foot { display: block; }
  .lawbox, .lawtoc { padding: 18px 18px 20px; }
  .lawf { padding: 22px 18px 24px; }
  /* a table with a head row: one block per row, each value under its column name */
  .lawtbl table:has(thead), .lawtbl table:has(thead) tbody, .lawtbl table:has(thead) tr, .lawtbl table:has(thead) td { display: block; }
  .lawtbl table:has(thead) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .lawtbl table:has(thead) tr { padding: 14px 0 16px; border-bottom: 1px solid var(--rule); }
  .lawtbl table:has(thead) tr:first-child { border-top: 1.5px solid var(--ink); }
  .lawtbl table:has(thead) td { min-width: 0; padding: 0; border: 0; }
  .lawtbl table:has(thead) td + td { margin-top: 10px; }
  .lawtbl table:has(thead) td[data-th]::before { content: attr(data-th); display: block; font-size: 0.8125rem; font-weight: 600; color: var(--ink-3); }
  .lawtbl table:not(:has(thead)) { min-width: 560px; }
}

@media print {
  .hdr, .foot, .skip, .law__foot, .lawprint, .lawprint-row, .law__langs { display: none !important; }
  .calm--read { padding-top: 0; }
  .lawtbl { margin-inline: 0; overflow: visible; }
  body { background: #fff; }
}
