.portal-feedback { margin-block: 14px; }
.form-error { color: #862419; border-color: #a03628; }
.form-error ul { margin: 0; padding-inline-start: 20px; }
.preserve-lines { white-space: pre-line; overflow-wrap: anywhere; }
.archive-item { margin-block-end: 12px; }
.archive-item summary { cursor: pointer; }
.portal-photo { margin-block-start: 14px; object-fit: cover; border-radius: 8px; }
.small-gap { gap: 8px; }
.tabletools { align-items: end; margin-block: 14px; }
.card-actions { margin-block: 16px; }
.qrbox { width: 105px; height: 105px; }
.field input[type="file"] { min-width: 0; width: 100%; }
.panel .actions, .form-card .actions { margin-block-start: 12px; }
.form-card input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible,
button:focus-visible, summary:focus-visible { outline: 2px solid #a76520; outline-offset: 3px; }
@media (max-width: 460px) {
    .qrbox { width: 92px; height: 92px; }
    .statrow { grid-template-columns: 1fr; }
    .tabletools > .field { width: 100%; }
    .info-row { align-items: start; overflow-wrap: anywhere; }
}
@media print {
    body:has(#member-card) * { visibility: hidden; }
    #member-card, #member-card * { visibility: visible; }
    #member-card {
        position: absolute; inset: 8mm auto auto 8mm; width: 125mm;
        color: #111; border: 1px solid #333; background: #fff;
        print-color-adjust: exact;
    }
    #member-card small, #member-card .cardlabel, #member-card .cardbrand { color: #111; }
}
.auth-side img { height: auto; aspect-ratio: 1; }
@media (max-width: 1040px) {
    .mobile-toggle { min-width: 44px; min-height: 44px; }
    .navmain.open { max-height: min(560px, 72dvh); overflow-y: auto; }
}

.legacy-table { min-width: 690px; }
.legacy-person { display: flex; align-items: center; gap: 12px; min-width: 170px; }
.legacy-thumb {
    display: block; width: 48px; height: 48px; flex: 0 0 48px;
    border-radius: 8px; object-fit: cover; background: #edf1f4;
}
.legacy-placeholder { display: grid; place-items: center; color: #526675; }
.legacy-sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0;
    white-space: nowrap; overflow: hidden; clip-path: inset(50%);
}
.legacy-back { margin-block-end: 18px; }
.legacy-detail-grid {
    display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 3fr);
    gap: 18px; align-items: start;
}
.legacy-portrait-link { display: block; margin-block-start: 12px; }
.legacy-portrait {
    display: block; width: 100%; height: auto; aspect-ratio: 1;
    border-radius: 8px; object-fit: contain; background: #edf1f4;
}
.legacy-data { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.legacy-data > div { padding-block: 10px; border-bottom: 1px solid var(--line); min-width: 0; }
.legacy-data dt, .legacy-documents small { color: #526675; font-size: .875rem; }
.legacy-data dd { margin: 3px 0 0; overflow-wrap: anywhere; white-space: pre-line; }
.legacy-documents { padding: 0; list-style: none; }
.legacy-documents li { padding-block: 10px; border-bottom: 1px solid var(--line); }
.legacy-documents small { display: block; }
@media (max-width: 700px) {
    .legacy-detail-grid { grid-template-columns: minmax(0, 1fr); }
    .legacy-portrait-link { max-width: 230px; }
}
@media (max-width: 440px) {
    .legacy-data { grid-template-columns: minmax(0, 1fr); }
}
.document-pdf { display: block; width: 100%; min-height: 65vh; border: 1px solid var(--line); border-radius: 8px; }
.document-image { margin: 0; text-align: center; }
.document-image img { display: block; max-width: 100%; max-height: 75vh; margin-inline: auto; object-fit: contain; }

.file-dialog {
    box-sizing: border-box; inset: 0; margin: auto; padding: 0;
    width: min(1040px, calc(100% - 28px)); max-width: none; max-height: 90dvh;
    border: 1px solid #d2dee6; border-radius: 12px; color: #142638; background: #fff;
}
.file-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.file-dialog::backdrop { background: #071a2bbb; }
.file-dialog [hidden] { display: none; }
.file-dialog-header, .file-dialog-footer {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 12px 16px;
}
.file-dialog-header h2 { font: 650 1.04rem/1.35 var(--sans); overflow-wrap: anywhere; }
.file-dialog-header form { margin: 0; }
.file-dialog-footer { justify-content: flex-end; flex-wrap: wrap; }
.file-dialog-body {
    min-height: min(180px, 35dvh); background: #eef3f7;
    display: grid; place-items: center; overflow: auto;
}
.file-dialog-body iframe { display: block; width: 100%; height: min(68dvh, 820px); border: 0; }
.file-dialog-body img { display: block; max-width: 100%; max-height: 68dvh; width: auto; height: auto; object-fit: contain; }
.file-dialog-message { padding: 16px; color: #526675; }
@media (max-width: 480px) {
    .file-dialog-header, .file-dialog-footer { padding-inline: 10px; }
    .file-dialog-header .btn, .file-dialog-footer .btn { min-height: 44px; }
}

.announcement {
    position: fixed; inset: 0; width: min(600px, calc(100% - 28px)); max-width: none;
    max-height: 90dvh; padding: 0; margin: auto; overflow: hidden;
    border: 1px solid #d2dee6; border-radius: 12px; color: #142638; background: #fff;
}
.announcement[open] { display: flex; flex-direction: column; }
.announcement::backdrop { background: #071a2bbb; }
.announcement [hidden] { display: none; }
.announcement-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #e1e8ed; }
.announcement-header h2 { font: 660 1rem/1.3 var(--sans); overflow-wrap: anywhere; }
.announcement-close { border: 1px solid #a2b1bc; border-radius: 6px; min-height: 38px; padding: 5px 10px; background: #fff; color: #233848; font-weight: 600; cursor: pointer; }
.announcement-content { display: grid; gap: 11px; padding: 18px; overflow-wrap: anywhere; }
.announcement-content > a { justify-self: start; }
.announcement-header, .announcement-pagination { flex: none; background: #fff; }
#announcement-slides { min-height: 0; overflow: hidden auto; overscroll-behavior: contain; }
.announcement-slides { touch-action: pan-y pinch-zoom; }
.announcement-featured { color: #684b24; font-size: .8rem; font-weight: 700; }
.announcement-pagination {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    padding: 10px 18px; border-top: 1px solid #e1e8ed; font-size: .875rem;
}
.announcement-pagination button { min-height: 44px; }
.announcement-pagination button:hover { background: #eff3f6; }
.announcement-content h3 { font: 660 clamp(1.1rem, 4vw, 1.5rem)/1.3 var(--sans); }
.announcement-content p { margin: 0; color: #465968; }
.announcement-image {
    display: block; width: 100%; height: min(42dvh, 316px);
    object-fit: contain; border-radius: 7px; background: #eff3f6;
}
@media (max-width: 520px) {
    .announcement-content, .announcement-header, .announcement-pagination { padding-inline: 13px; }
    .announcement-close, .announcement-content .btn { min-height: 44px; }
    .announcement-image { height: min(38dvh, 78vw); }
}
.utility-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.utility-announcement {
    border: 0; padding: 4px 0; min-height: 32px; background: transparent; color: #ffe1b7;
    font: inherit; cursor: pointer; overflow: hidden; text-overflow: ellipsis;
    max-width: clamp(70px, 24vw, 186px); white-space: nowrap;
}
.utility-announcement:hover { text-decoration: underline; }
@media (max-width: 450px) { .utility-actions { gap: 8px; } }

.major-image.publication-poster { height: auto; max-width: 680px; }
.story-media-poster img { object-fit: contain; }
.major-image.publication-documentation { height: auto; }
.publication-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 20px; }
.publication-gallery figure { margin: 0; }
.publication-gallery img { display: block; width: 100%; height: auto; border-radius: 8px; }
.publication-gallery figcaption { margin-top: 8px; font-size: .875rem; line-height: 1.5; color: var(--muted); }

.live-dock {
    position: fixed; z-index: 40;
    right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom));
    width: min(380px, calc(100vw - 36px)); max-height: calc(100dvh - 36px); overflow: auto;
    border: 1px solid #9caebc; border-radius: 10px; color: #142638; background: #fff;
    box-shadow: 0 10px 34px #071a2b30;
}
.live-dock:not([open]) { width: min(220px, calc(100vw - 36px)); }
.live-dock-heading {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    min-height: 44px; padding: 8px 12px; list-style: none; cursor: pointer;
    background: #102637; color: #fff; border-radius: 9px 9px 0 0; font-size: .85rem;
}
.live-dock-heading::-webkit-details-marker { display: none; }
.live-dock-heading:focus-visible { outline: 2px solid #efc896; outline-offset: -4px; }
.live-dock-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; }
.live-dock-dot { width: 8px; height: 8px; border-radius: 50%; background: #fa7377; }
.live-dock-toggle { color: #deebf4; }
.live-dock:not([open]) .live-dock-collapse, .live-dock[open] .live-dock-expand { display: none; }
.live-dock-content { display: grid; gap: 9px; padding: 10px 12px; }
.live-dock-content h2 { font: 660 .94rem/1.35 var(--sans); overflow-wrap: anywhere; }
.live-dock-content p { margin: 0; font-size: .83rem; color: #465968; }
.live-dock-player { display: block; border: 0; width: 100%; aspect-ratio: 16 / 9; background: #0e1920; border-radius: 5px; }
iframe.live-dock-player { min-height: 200px; }
@media (max-width: 540px) {
    .live-dock { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); width: min(340px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
    .live-dock:not([open]) { width: min(200px, calc(100vw - 24px)); }
}
@media (min-width: 521px) and (max-width: 900px) {
    .live-dock[open] { width: min(330px, calc(100vw - 36px)); }
}
@media (max-width: 375px) {
    .utility .shell, .utility-actions { gap: 6px; }
    .utility-actions a { white-space: nowrap; }
    .utility-actions a .ico { display: none; }
    .utility a, .utility-announcement { font-size: .72rem; }
    .site-header .navwrap { padding-inline: 12px; gap: 6px; }
    .site-header .brand { flex: 0 1 auto; min-width: 0; gap: 6px; }
    .site-header .brand img { flex: 0 0 35px; width: 35px; height: 35px; }
    .site-header .brand-names { min-width: 0; }
    .site-header .brand-letters { font-size: 1.55rem; }
    .site-header .brand-name { font-size: .53rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .site-header .navactions { flex: none; gap: 4px; }
    .site-header .navactions .btn { white-space: nowrap; padding-inline: 8px; min-height: 44px; font-size: .74rem; }
}
