/* Legal and recovery documents use the same fixed card surface as the app. */
html:has(body.document-cards) { height: 100%; overflow: hidden; }
body.document-cards { height: 100dvh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.document-cards .masthead { flex: 0 0 auto; position: static; }
.document-cards .masthead .shell { min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
.document-cards .doc { flex: 1; min-height: 0; width: min(960px, calc(100% - 32px)); margin: 16px auto; padding: 20px; display: grid; grid-template-rows: minmax(0,1fr) auto; gap: 16px; border: 1px solid #ece9dd; border-radius: 24px; background: white; }
.document-window { overflow: hidden; min-height: 0; }
.document-flow { height: 100%; column-count: 1; column-gap: 32px; column-fill: auto; }
.document-cards .doc h1 { font-size: 32px; line-height: 1.15; margin: 8px 0 16px; }
.document-cards .doc h2 { font-size: 22px; margin: 20px 0 10px; break-after: avoid; }
.document-cards .doc :is(p,li) { font-size: 16px; line-height: 1.65; orphans: 3; widows: 3; }
.document-cards .doc .updated { font-size: 14px; }
.document-pagination { display: flex; justify-content: center; align-items: center; gap: 20px; border-top: 1px solid #ece9dd; padding-top: 12px; font-size: 14px; }
.document-pagination button { min-height: 44px; padding: 8px 16px; border: 1px solid #bed0c7; border-radius: 16px; background: #fffdf5; color: #10504f; font: 700 16px 'Nunito',sans-serif; cursor: pointer; }
.document-pagination button:disabled { opacity: .45; cursor: default; }
.document-cards > footer { flex: 0 0 auto; padding: 8px 0; font-size: 14px; }
.document-cards > footer .shell { flex-wrap: wrap; gap: 8px 16px; }
@media (max-width: 500px) {
 .document-cards .doc { padding: 16px; margin: 12px auto; }
 .document-pagination { gap: 12px; }
 .document-pagination button { padding: 8px 12px; }
 .document-cards > footer .shell { justify-content: center; }
}
@media (max-height: 520px) {
 .document-cards .masthead .shell { min-height: 52px; padding-top: 4px; padding-bottom: 4px; }
 .document-cards .doc { margin: 8px auto; padding: 12px 20px; gap: 8px; }
 .document-pagination { padding-top: 8px; }
}
@media print {
 html:has(body.document-cards),body.document-cards { height: auto; overflow: visible; display: block; }
 .document-cards .doc { display: block; margin: 0; border: 0; width: 100%; }
 .document-flow { height: auto; columns: auto; }
 .document-pagination { display: none; }
}
.document-pagination { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px 64px; gap: 16px; align-items: center; }
.document-pagination .document-arrow { min-width: 44px; width: 44px; height: 44px; padding: 0; border-radius: 50%; background: white; color: #10504f; border-color: #d8dace; }
.document-stops { display: flex; position: relative; min-width: 0; padding-left: 24px; }
.document-stops::before { content: ''; position: absolute; top: 11px; left: 40px; right: 30px; border-top: 1px dashed #c5c4ad; }
.document-pagination .document-stop { position: relative; flex: 1; display: grid; grid-template-rows: 14px 24px; gap: 4px; justify-items: center; min-width: 0; min-height: 48px; padding: 6px 4px 0; border: 0; background: none; color: #3e5a57; font-size: 14px; line-height: 1.3; }
.document-dot { width: 10px; height: 10px; background: white; border: 1px solid #c5c4ad; border-radius: 50%; }
.document-stop[aria-current] .document-dot { background: #10504f; border-color: #10504f; }
.document-stop-label { width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.document-pencil { position: absolute; width: 24px; height: 42px; top: -9px; left: calc(50% - 45px); transform: rotate(90deg); pointer-events: none; }
.document-count { text-align: center; white-space: nowrap; font-weight: 800; }
@media (max-width:600px) {
 .document-pagination { grid-template-columns: 44px minmax(0,1fr) 44px; gap: 0 8px; }
 .document-pagination .document-count { grid-column: 2; line-height: 18px; }
 .document-stops { padding-left: 16px; }
}
@media print { .document-pagination { display: none; } }
