:root {
    color-scheme: light;
    --bs-primary: #425e50;
    --bs-primary-rgb: 66, 94, 80;
    --bs-secondary: #65716a;
    --bs-secondary-rgb: 101, 113, 106;
    --bs-body-color: #303c35;
    --bs-body-color-rgb: 48, 60, 53;
    --bs-body-bg: #fafaf8;
    --bs-body-bg-rgb: 250, 250, 248;
    --bs-secondary-color: #626d65;
    --bs-secondary-bg: #eaece5;
    --bs-secondary-bg-rgb: 234, 236, 229;
    --bs-tertiary-bg: #f0f1eb;
    --bs-tertiary-bg-rgb: 240, 241, 235;
    --bs-border-color: #dce0d7;
    --bs-border-color-translucent: rgba(55, 75, 61, .14);
    --bs-link-color: #425e50;
    --bs-link-color-rgb: 66, 94, 80;
    --bs-link-hover-color: #273e31;
    --bs-link-hover-color-rgb: 39, 62, 49;
    --bs-emphasis-color: #273a2e;
    --bs-emphasis-color-rgb: 39, 58, 46;
    --bs-border-radius: .65rem;
    --bs-border-radius-sm: .45rem;
    --bs-border-radius-lg: 1rem;
    --bs-box-shadow-sm: none;
    --diary-serif: "Bitter", Georgia, serif;
    --diary-paper: #fff;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    background-image: radial-gradient(rgba(86, 108, 89, .02) .6px, transparent .6px);
    background-size: 7px 7px;
}
main { flex: 1; width: 100%; }
main.container-xxl { padding-top: 1.5rem !important; padding-bottom: 3rem !important; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--bs-emphasis-color);
    font-family: var(--diary-serif);
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}
a { text-underline-offset: .2em; }
button, a, input, select, textarea { -webkit-tap-highlight-color: rgba(66, 94, 80, .12); }
:focus-visible { outline: 3px solid #7e6950; outline-offset: 4px; }
::selection { background: #dce6d6; color: #273a2e; }
[id] { scroll-margin-top: 7rem; }
.skip-link { position: fixed; top: .75rem; left: .75rem; transform: translateY(-180%); z-index: 2000; padding: .7rem 1rem; background: var(--diary-paper); border: 2px solid var(--bs-primary); border-radius: .5rem; }
.skip-link:focus { transform: translateY(0); }
.family-header { background: rgba(250, 250, 248, .98); border-bottom: 1px solid var(--bs-border-color); box-shadow: none; }
.navbar { --bs-navbar-color: #58685d; --bs-navbar-hover-color: #273a2e; --bs-navbar-active-color: #273a2e; }
.navbar-brand { font-family: var(--diary-serif); font-size: 1.15rem; line-height: 1.3; letter-spacing: -.025em; color: var(--bs-emphasis-color); }
.family-brand-mark { display: inline-flex; width: 2rem; height: 2rem; flex: 0 0 2rem; align-items: center; justify-content: center; border: 1px solid #b9c4b5; border-radius: 50%; background: #eef1e8; color: #425e50; font-family: var(--diary-serif); font-size: 1.05rem; font-weight: 600; line-height: 1; }
.nav-link { min-height: 44px; display: flex; align-items: center; padding: .55rem .9rem !important; border-radius: .5rem; font-size: .95rem; }
.nav-link.active { text-decoration: underline; text-underline-offset: .4em; font-weight: 600; }
.nav-link:hover { background: #eceee7; }
.navbar-nav { gap: .3rem; }
.navbar-toggler { min-height: 44px; border: 1px solid transparent; display: flex; gap: .35rem; align-items: center; padding: .5rem; color: var(--bs-body-color); }
.navbar-toggler-icon { width: 1.1em; height: 1.1em; }
.menu-label { font-size: .82rem; }
.btn { min-height: 44px; padding: .6rem 1.05rem; border-radius: .55rem; font-size: .95rem; font-weight: 500; line-height: 1.4; align-content: center; }
.btn-sm { min-height: 44px; padding: .5rem .8rem; font-size: .875rem; }
.btn-primary { --bs-btn-bg: #425e50; --bs-btn-border-color: #425e50; --bs-btn-hover-bg: #304b3d; --bs-btn-hover-border-color: #304b3d; --bs-btn-active-bg: #273e31; --bs-btn-active-border-color: #273e31; --bs-btn-disabled-bg: #6d8274; --bs-btn-disabled-border-color: #6d8274; }
.btn-outline-primary { --bs-btn-color: #425e50; --bs-btn-border-color: #9bab9a; --bs-btn-hover-bg: #425e50; --bs-btn-hover-border-color: #425e50; --bs-btn-active-bg: #304b3d; --bs-btn-active-border-color: #304b3d; }
.btn-outline-secondary { --bs-btn-color: #536259; --bs-btn-border-color: #d2d9cf; --bs-btn-hover-bg: #e8ece3; --bs-btn-hover-color: #273e31; --bs-btn-hover-border-color: #9bab9a; --bs-btn-active-bg: #e0e6d9; --bs-btn-active-color: #273e31; --bs-btn-active-border-color: #9bab9a; }
.btn-link { --bs-btn-color: #425e50; --bs-btn-hover-color: #273e31; }
.btn-close { min-width: 24px; min-height: 24px; padding: 10px !important; }
.form-control, .form-select { background-color: var(--diary-paper); min-height: 48px; font-size: 1rem; padding: .7rem .85rem; border-color: #bfc9bc; }
.form-select { padding-right: 2.5rem; }
.form-label { font-size: .95rem; font-weight: 500; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: #7d9481; box-shadow: 0 0 0 .2rem rgba(66, 94, 80, .17); }
.form-check-input { width: 1.2em; height: 1.2em; }
.form-check-input:checked { background-color: #425e50; border-color: #425e50; }
.form-check-label { padding-left: .25rem; }
.card, .modal-content, .list-group { background-color: var(--diary-paper); }
.card.rounded-0, .modal-content.rounded-0 { border-radius: .85rem !important; }
.card-header { background: #eef1e8; }
.table { --bs-table-bg: var(--diary-paper); }
.table-light { --bs-table-bg: #eef1e8; }
/* Keep badges independent of parent typography and flex-row height. */
.badge {
    display: inline-block;
    align-self: center;
    vertical-align: middle;
    max-width: 100%;
    min-height: 1.5rem;
    padding: .1875rem .5rem;
    border: 1px solid transparent;
    border-radius: .35rem;
    font-family: var(--bs-font-sans-serif);
    font-size: .75rem;
    font-weight: 500;
    line-height: 1rem;
    letter-spacing: normal;
    white-space: normal;
    overflow-wrap: anywhere;
}
.inbox-avatar, .inbox-activity-marker { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 50%; font-weight: 500; line-height: 1; }
.inbox-avatar { width: 44px; height: 44px; font-size: 1rem; }
.inbox-activity-marker { width: 32px; height: 32px; font-size: 1.25rem; }
.text-bg-success { color: #fff !important; background-color: #536f59 !important; }
.text-bg-secondary { color: #fff !important; background-color: #65716a !important; }
.text-bg-light { color: #405047 !important; background-color: #f0f2ed !important; }
.text-bg-warning { color: #493c25 !important; background-color: #ebdbb6 !important; }
.text-bg-danger { color: #fff !important; background-color: #884c4c !important; }
.text-bg-pending { color: #405047 !important; background-color: #dfe6dc !important; border-color: #c6d1c2; }
.alert-success { --bs-alert-color: #334b38; --bs-alert-bg: #eaf0e4; --bs-alert-border-color: #cbd8c3; }
.alert-warning { --bs-alert-color: #594727; --bs-alert-bg: #f5edd9; --bs-alert-border-color: #dfcea7; }
.alert-danger { --bs-alert-color: #653b3b; --bs-alert-bg: #f3e6e4; --bs-alert-border-color: #d9bdbc; }
.btn-danger { --bs-btn-bg: #884c4c; --bs-btn-border-color: #884c4c; --bs-btn-hover-bg: #713d3d; --bs-btn-hover-border-color: #713d3d; --bs-btn-active-bg: #633535; --bs-btn-active-border-color: #633535; --bs-btn-disabled-bg: #a77b7b; --bs-btn-disabled-border-color: #a77b7b; }
.btn-outline-danger { --bs-btn-color: #7a4545; --bs-btn-border-color: #b98f8f; --bs-btn-hover-bg: #884c4c; --bs-btn-hover-border-color: #884c4c; --bs-btn-active-bg: #713d3d; --bs-btn-active-border-color: #713d3d; }
.btn-dark { --bs-btn-bg: #354a3e; --bs-btn-border-color: #354a3e; --bs-btn-hover-bg: #273a30; --bs-btn-hover-border-color: #273a30; --bs-btn-active-bg: #1f3027; --bs-btn-active-border-color: #1f3027; }
.text-danger { color: #7a4545 !important; }
.border-danger { border-color: #c99f9f !important; }
.member-preview-banner { padding: .75rem 1rem; border: 1px solid #d5ddd0; border-radius: .5rem; background: #eef1e8; color: #405047; font-size: .9rem; }
.diary-shell { width: 100%; margin-inline: auto; }
.diary-intro { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0 1.5rem; margin-bottom: 2rem; border-bottom: 1px solid var(--bs-border-color); }
.diary-intro h1 { font-size: clamp(1.85rem, 4vw, 2.5rem); margin: 0; font-weight: 400; }
.diary-toolbar-actions { justify-content: flex-end; }
.active-filters { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .7rem; padding: .8rem 1rem; margin: -1rem 0 1.5rem; background: #eaf0e4; border-radius: .5rem; font-size: .9rem; }
.active-filters a { min-height: 44px; display: inline-flex; align-items: center; }
.active-filters span { align-content: center; }
#timelineFilterModal table { table-layout: fixed; width: 100%; }
#timelineFilterModal th { padding-inline: .15rem; font-weight: 500; }
#timelineFilterModal td .btn { padding-inline: .1rem; }
.post-calendar th { color: var(--bs-secondary-color); font-size: .75rem; }
.calendar-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-height: 52px; border: 1px solid transparent; border-radius: .45rem; text-decoration: none; line-height: 1.2; }
.calendar-day-with-posts { color: #354e3b; background: #e5eddd; border-color: #c4d3b9; font-weight: 600; }
.calendar-day-with-posts:hover { color: #273e31; background: #d3e2c8; border-color: #809773; }
.calendar-day-selected, .calendar-day-selected:hover { color: #fff; background: #425e50; border-color: #425e50; }
.calendar-day-empty { color: #6e766f; }
.calendar-day-outside { color: #939a92; }
.calendar-post-marker { display: flex; align-items: center; gap: .2rem; height: .7rem; font-size: .65rem; }
.calendar-post-dot { display: inline-block; width: 5px; height: 5px; flex-shrink: 0; border-radius: 50%; background: currentColor; }
.calendar-legend { display: flex; align-items: center; gap: .45rem; font-size: .8rem; color: #425e50; }
[data-calendar-preview][aria-busy="true"] { opacity: .5; pointer-events: none; }
.diary-entry { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 28px; padding-bottom: 2.5rem; }
.diary-rail { position: relative; padding-top: .3rem; }
.diary-rail::after { content: ""; position: absolute; width: 1px; background: #e4e7df; top: 114px; bottom: -1.7rem; left: 50%; }
.diary-entry:last-child .diary-rail::after { display: none; }
.diary-date { display: flex; flex-direction: column; width: 64px; align-items: center; border: 1px solid #dce0d7; border-radius: .3rem; overflow: hidden; background: transparent; text-align: center; line-height: 1; flex-shrink: 0; }
.diary-date-month { display: block; width: 100%; background: #f0f2ed; padding: .6rem .2rem; text-transform: uppercase; font-size: .7rem; font-weight: 500; letter-spacing: .08em; color: #4f634a; }
.diary-date-day { font-family: var(--diary-serif); font-size: 1.9rem; padding-top: .55rem; color: #3d513a; }
.diary-date-year { color: #6b755f; font-size: .68rem; padding: .45rem .2rem .65rem; }
.diary-entry-content { min-width: 0; }
.story-card { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.story-card > .card-body { padding: 0; }
.story-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.2rem; }
.story-title { font-size: clamp(1.5rem, 3vw, 2rem); }
.story-title a:hover { color: #5a7151 !important; }
.story-byline { color: var(--bs-secondary-color); font-size: .83rem; line-height: 1.6; }
.story-prose { max-width: 80ch; font-size: 1.0625rem; line-height: 1.8; overflow-wrap: anywhere; }
.story-tags .badge { background: #eef1e8 !important; color: #536548 !important; }
.story-tags a:hover { text-decoration: underline !important; }
.story-tags a { min-height: 44px; display: inline-flex; align-items: center; }
.story-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; padding-top: .5rem; margin-top: 1rem; border-top: 1px solid var(--bs-border-color); }
.story-read-link { display: inline-flex; align-items: center; gap: .65rem; padding-inline: 0; text-decoration: none; }
.story-copy-link { padding-inline: .25rem; color: var(--bs-secondary-color); font-weight: 400; text-decoration: none; }
.story-read-link span { font-size: 1.25rem; }
.story-admin-tools { font-size: .85rem; }
.story-admin-tools a { display: inline-flex; align-items: center; min-height: 44px; }
.story-admin-tools .badge { white-space: normal; text-align: left; }
.post-paper { background: transparent; padding: 0; }
.post-heading { display: flex; align-items: flex-start; gap: 1.6rem; margin-bottom: 1.8rem; padding-bottom: 1.8rem; border-bottom: 1px solid var(--bs-border-color); }
.post-heading-content { min-width: 0; flex: 1; }
.post-title { font-size: clamp(1.75rem, 4vw, 2.7rem); }
.diary-post .story-prose { max-width: 80ch; }
.gallery-hint { display: block; color: var(--bs-secondary-color); font-size: .78rem; margin-top: .1rem; }
.family-gallery { --bs-gutter-x: .75rem; --bs-gutter-y: .75rem; margin-top: .25rem !important; margin-bottom: 1rem !important; }
.media-tile { display: block; min-height: 0; border-radius: .25rem !important; background: #eaece5; }
.media-tile img { transition: opacity .18s; }
.media-tile:hover img { opacity: .92; }
.media-tile:focus-visible { outline: 3px solid #425e50; outline-offset: 3px; box-shadow: none; }
.video-play-label { pointer-events: none; position: absolute; bottom: .65rem; left: .65rem; background: rgba(28, 40, 33, .88); color: white; border-radius: 30px; padding: .3rem .65rem; font-size: .75rem; }
.family-lightbox .modal-content { background: #18221d !important; }
.family-lightbox .modal-header { padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) .8rem max(1rem, env(safe-area-inset-left)); }
.family-lightbox .modal-footer { padding-bottom: max(1rem, env(safe-area-inset-bottom)); background: #202d24; }
.family-lightbox-caption { max-width: 70ch; align-self: center; color: #f1f3ef; font-size: .95rem; line-height: 1.5; white-space: pre-line; }
.family-lightbox-caption-editor { max-width: 42rem; }
.family-lightbox [data-gallery-previous], .family-lightbox [data-gallery-next] { width: 44px; height: 44px; font-size: 1.8rem; border-radius: 50%; padding: 0; background: rgba(255, 255, 255, .9); }
.access-card { max-width: 480px; border-radius: .9rem; margin-top: 1.5rem; margin-bottom: 3rem; }
.access-card > .card-body { padding: 1.8rem !important; }
.access-card h1 { font-size: 1.5rem; }
.access-card input[name="code"] { text-align: center; letter-spacing: .3em; font-size: 1.6rem; }
summary { min-height: 44px; align-content: center; }
.enrollment-qr summary { font-size: .9rem; color: var(--bs-secondary-color); }
.home-intro { padding-block: 2.5rem; }
.home-intro .display-5 { font-weight: 400; }
.family-footer { padding: 1.25rem 1rem max(1.25rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--bs-border-color); text-align: center; background: transparent; }
.family-footer a { min-height: 44px; display: inline-flex; align-items: center; }
.family-footer .container-xxl > span { align-content: center; }
.pagination { --bs-pagination-color: #425e50; --bs-pagination-hover-color: #273e31; --bs-pagination-active-bg: #425e50; --bs-pagination-active-border-color: #425e50; --bs-pagination-bg: #fffefa; }
.page-link { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 991.98px) {
    #familyNavigation { padding-top: .7rem; padding-bottom: .5rem; }
    .navbar-nav { border-top: 1px solid var(--bs-border-color); padding-top: .6rem; }
    .diary-toolbar-actions { justify-content: flex-start; }
}
@media (max-width: 575.98px) {
    main.container-xxl { padding-top: 1rem !important; padding-bottom: 2rem !important; }
    .family-header .container-xxl { padding-top: .25rem !important; padding-bottom: .25rem !important; }
    .navbar-brand { font-size: 1rem; gap: .4rem !important; margin-right: .25rem; }
    .family-brand-mark { width: 1.75rem; height: 1.75rem; flex-basis: 1.75rem; font-size: .95rem; }
    .admin-page > .container { max-width: none; padding: 0; }
    .admin-page .admin-page-header { align-items: stretch !important; }
    .admin-page .admin-page-header > :first-child { width: 100%; }
    .admin-page .admin-page-header > .btn, .admin-page .admin-page-header > a { width: 100%; }
    .admin-page .admin-page-actions { display: grid !important; grid-template-columns: 1fr; width: 100%; }
    .admin-page .admin-page-actions > *, .admin-page .admin-page-actions .btn { width: 100%; }
    .admin-page .btn-group { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .admin-page .admin-card-actions form { width: 100%; }
    .admin-page [data-thumbnail-item] { flex-wrap: wrap; align-items: flex-start !important; }
    .admin-mobile-table { overflow: visible; border: 0; background: transparent; }
    .admin-mobile-table table, .admin-mobile-table tbody { display: block; }
    .admin-mobile-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
    .admin-mobile-table tr { display: block; margin-bottom: .75rem; border: 1px solid var(--bs-border-color); border-radius: .65rem; background: var(--diary-paper); overflow: hidden; }
    .admin-mobile-table td { display: grid; grid-template-columns: minmax(6.5rem, 38%) minmax(0, 1fr); align-items: start; gap: .75rem; width: 100%; padding: .7rem .85rem !important; border-bottom: 1px solid var(--bs-border-color); text-align: left !important; overflow-wrap: anywhere; }
    .admin-mobile-table td:last-child { border-bottom: 0; }
    .admin-mobile-table td::before { content: attr(data-label); color: var(--bs-secondary-color); font-size: .75rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
    .admin-mobile-table td [class*="justify-content-end"] { justify-content: flex-start !important; }
    .admin-mobile-table td[data-label="Actions"] .btn { flex: 1 1 8rem; }
    .member-preview-banner { align-items: stretch !important; padding: .75rem; }
    .member-preview-banner .btn { width: 100%; }
    .diary-intro { padding: .5rem 0 1.25rem; margin-bottom: 1.5rem; }
    .diary-toolbar-actions .btn { font-size: .85rem; padding-inline: .75rem; }
    .diary-entry { display: block; padding-bottom: 1.75rem; }
    .diary-rail { display: none; }
    .story-card > .card-body { padding: 0; }
    .story-title-row { flex-wrap: wrap; gap: .6rem; }
    .story-title-row > h1, .story-title-row > h2 { flex: 1 1 100%; }
    .story-title-row > button { font-size: .8rem; min-height: 44px; padding: .35rem .7rem; }
    .story-byline { font-size: .78rem; }
    .story-prose { font-size: 1rem; line-height: 1.8; }
    .family-gallery { --bs-gutter-x: .375rem; --bs-gutter-y: .375rem; }
    .post-paper { padding: 0; }
    .post-heading { margin-bottom: 1.1rem; padding-bottom: 1.1rem; }
    .post-heading .diary-date { display: none; }
    .post-heading .story-byline { font-size: .75rem; }
    .post-title { font-size: 1.65rem; }
    .access-card > .card-body { padding: 1.4rem !important; }
    .home-intro { padding-block: 1.25rem; }
    .family-footer .container-xxl > span { width: 100%; }
    .family-lightbox .modal-footer { align-items: stretch !important; }
    .family-lightbox [data-gallery-download-actions] { display: grid !important; grid-template-columns: 1fr 1fr; }
    .family-lightbox [data-gallery-download-actions][hidden] { display: none !important; }
    .family-lightbox [data-gallery-download-actions] a { justify-content: center; padding-inline: .55rem; font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
