* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #eef2f6;
    color: #172033;
    font: 16px/1.5 system-ui, sans-serif;
}

a {
    color: #0b4aa2;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button,
input,
select,
textarea {
    font: inherit;
}

.kin-page-wrap {
    --kin-side-padding: 18px;
    --kin-menu-gap: 10px;
    max-width: 1180px;
    margin: 0 auto;
    min-height: 100vh;
    background: #fff;
}

.kin-site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px 12px;
    padding: 10px var(--kin-side-padding);
    background: #11131a;
    color: #fff;
}

.kin-brand {
    display: flex;
    align-items: baseline;
    gap: 7px;
    color: #fff;
    white-space: nowrap;
    grid-column: 1;
    grid-row: 1;
}

.kin-brand-name {
    font: 700 29px/1 Georgia, serif;
}

.kin-beta {
    padding: 2px 6px;
    border: 1px solid #5f6b83;
    border-radius: 999px;
    color: #dbe7ff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.kin-main-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px var(--kin-menu-gap);
    overflow: visible;
    white-space: nowrap;
    grid-column: 1 / 3;
    grid-row: 2;
}

.kin-main-nav a,
.kin-main-nav span {
    color: #fff;
    font-size: 13px;
    font-weight: 400;
}

.kin-menu {
    position: relative;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
}

.kin-menu summary {
    cursor: pointer;
    list-style: none;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

.kin-menu summary::-webkit-details-marker {
    display: none;
}

.kin-menu-panel {
    position: absolute;
    right: 0;
    top: 32px;
    min-width: 180px;
    padding: 8px 0;
    border: 1px solid #dce3ed;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.kin-menu-panel a,
.kin-menu-panel span {
    display: block;
    padding: 8px 12px;
    color: #172033;
    font-size: 16px;
    font-weight: 700;
}

.kin-menu-panel span {
    color: #6b7280;
}

.kin-content {
    padding: 14px var(--kin-side-padding);
}

.kin-readable {
    max-width: 800px;
}

.kin-frontpage-section {
    margin: 0 0 18px 0;
    padding: 0 0 12px 0;
    border-bottom: 1px solid #dce3ed;
}

.kin-frontpage-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.kin-frontpage-section-head h2 {
    margin: 0 0 7px 0;
}

.kin-frontpage-edit {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.kin-frontpage-ingress {
    font-weight: 700;
}

.kin-frontpage-body p {
    margin: 0 0 0.8em 0;
}

.kin-frontpage-status {
    padding: 12px;
    border: 1px solid #d9c86e;
    border-radius: 8px;
    background: #fffbe7;
}

.kin-frontpage-missing {
    padding: 12px;
    border: 1px dashed #b7c1d0;
    border-radius: 8px;
    color: #526070;
    background: #f8fafc;
}

.kin-person-shell {
    max-width: 760px;
    margin: 0;
}

.kin-hero {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 15px;
    padding: 3px 0 17px 0;
    align-items: center;
}

.kin-hero-image {
    width: 110px;
    height: 138px;
    object-fit: cover;
    border-radius: 12px;
    background: #dce3ed;
    cursor: zoom-in;
}

.kin-hero h1 {
    margin: 3px 0;
    font: 700 28px/1.05 Georgia, serif;
}

.kin-person-extra-name {
    color: #526070;
    font-size: 15px;
}

.kin-life-years {
    display: block;
    margin-top: 4px;
    font-size: 18px;
}

.kin-tabs {
    display: flex;
    overflow-x: auto;
    margin: 0 -14px 14px -14px;
    border-block: 1px solid #dce3ed;
}

.kin-tabs a,
.kin-tabs span {
    padding: 13px 16px 10px;
    border-bottom: 3px solid transparent;
    color: #222;
    font-size: 17px;
    font-weight: 800;
    white-space: nowrap;
}

.kin-tabs .is-active {
    color: #082b61;
    border-bottom-color: #082b61;
}

.kin-vitals {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.kin-card,
.kin-vital {
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid #dce3ed;
    border-radius: 13px;
    background: #fff;
}

.kin-vital h2,
.kin-card h2 {
    margin: 0 0 7px 0;
    font-size: 20px;
    line-height: 1.2;
}

.kin-vital-text {
    font-size: 17px;
    font-weight: 400;
}

.kin-vital p,
.kin-card p {
    margin: 4px 0;
}

.kin-events-list {
    margin-top: 6px;
}

.kin-event {
    padding: 5px 0 6px 0;
    border-top: 1px solid #eef2f6;
}

.kin-event:first-child {
    border-top: 0;
    padding-top: 0;
}

#kin-events .kin-event h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

#kin-events .kin-event-meta,
#kin-events .kin-event-note,
#kin-events .kin-event-actions {
    margin: 1px 0 0 0;
    font-size: 14px;
    line-height: 1.25;
}

#kin-events .kin-event-actions {
    font-weight: 700;
}

.kin-source-actions {
    font-weight: 700;
}

.kin-source-target {
    color: #526070;
}

.kin-source-item {
    margin: 5px 0 8px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #eef2f6;
    line-height: 1.25;
}

.kin-source-item h4 {
    margin: 0;
    font-size: 16px;
    line-height: 1.15;
}

.kin-source-item p {
    margin: 0;
}

.kin-source-changedate {
    color: #526070;
    font-size: 14px;
}

.kin-source-linked-to {
    color: #526070;
    font-size: 14px;
}

.kin-edit-pencil {
    margin-left: 5px;
    color: #526070;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.kin-edit-pencil:hover {
    color: #0b4aa2;
    text-decoration: none;
}

.kin-map-link {
    display: inline-block;
    margin-left: 4px;
    font-size: 14px;
    vertical-align: baseline;
}

.kin-more summary {
    cursor: pointer;
    color: #0b4aa2;
    font-size: 18px;
    font-weight: 800;
}

.kin-family-members {
    margin: 6px 0 8px;
}

.kin-family-members h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    line-height: 1.2;
}

.kin-family-action {
    margin: 0 0 8px 0;
}

.kin-family-heading {
    margin: 16px 0 8px 0;
    font-size: 20px;
    line-height: 1.2;
}

.kin-family-member,
.kin-family-events {
    margin-bottom: 6px;
    border: 1px solid #dce3ed;
    background: #fff;
}

.kin-family-member h5 {
    margin: 0;
    padding: 5px 7px 0 7px;
    font-size: 17px;
    line-height: 1.15;
    font-weight: 800;
}

.kin-family-member h5 a {
    font-weight: 800;
}

.kin-family-row,
.kin-family-event {
    padding: 1px 7px 3px 7px;
    border-top: 1px solid #eef2f6;
    font-size: 14px;
    line-height: 1.2;
}

.kin-family-row:first-of-type,
.kin-family-event:first-child {
    border-top: 0;
    padding-top: 0;
}

.kin-family-event strong {
    display: inline;
}

.kin-image-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

.kin-image-card {
    width: 158px;
    padding: 8px;
    border: 1px solid #dce3ed;
    border-radius: 10px;
    background: #fff;
}

.kin-image-card img {
    display: block;
    max-width: 140px;
    max-height: 140px;
    width: auto;
    height: auto;
    cursor: zoom-in;
}

.kin-image-card p {
    margin: 5px 0 0 0;
    font-size: 10pt;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.kin-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: 24px;
    background: rgba(0, 0, 0, 0.82);
}

.kin-modal-inner {
    max-width: 1100px;
    max-height: 100%;
    margin: 0 auto;
    text-align: center;
}

.kin-modal img {
    max-width: 100%;
    max-height: calc(100vh - 90px);
    width: auto;
    height: auto;
    background: #fff;
}

.kin-modal-caption {
    max-width: 900px;
    margin: 8px auto 0 auto;
    color: #fff;
    line-height: 1.35;
}

@media (min-width: 760px) {
    .kin-page-wrap {
        --kin-side-padding: 22px;
        --kin-menu-gap: 18px;
    }

    .kin-content {
        padding-top: 22px;
        padding-bottom: 22px;
    }

    .kin-person-shell {
        max-width: 980px;
    }

    .kin-vitals {
        max-width: 760px;
    }

    .kin-family-member,
    .kin-family-events {
        max-width: 760px;
        margin-bottom: 8px;
    }

    .kin-family-row,
    .kin-family-event {
        padding-top: 3px;
        padding-bottom: 3px;
        line-height: 1.2;
    }
}

@media (max-width: 520px) {
    .kin-hero {
        grid-template-columns: 96px 1fr;
        gap: 13px;
    }

    .kin-hero-image {
        width: 96px;
        height: 120px;
    }

    .kin-hero h1 {
        font-size: 25px;
    }

    .kin-vitals {
        grid-template-columns: 1fr 1fr;
    }
}
