:root {
    --ink: #070707;
    --ink-soft: #12100c;
    --ink-panel: #16130e;
    --ink-elevated: #1e1a14;
    --gold: #f0c933;
    --gold-bright: #ffe566;
    --gold-deep: #b8920f;
    --cream: #f4efe4;
    --cream-dim: #d9d2c2;
    --muted: #9a917f;
    --line: rgba(240, 201, 51, 0.2);
    --line-strong: rgba(240, 201, 51, 0.45);
    --danger: #c44b3c;
    --ok: #3d8f6a;
    --font-display: "Fraunces", "Palatino Linotype", Palatino, serif;
    --font-body: "Source Sans 3", "Segoe UI", sans-serif;
    --radius: 6px;
    --max: 1100px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    color: var(--cream);
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.6;
    background:
        radial-gradient(ellipse 90% 55% at 50% -10%, rgba(240, 201, 51, 0.12), transparent 55%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(240, 201, 51, 0.05), transparent 45%),
        linear-gradient(180deg, #0c0a07 0%, var(--ink) 40%, #050504 100%);
    background-attachment: fixed;
}

body.has-shell {
    display: flex;
    flex-direction: column;
}

a {
    color: var(--gold);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--gold-bright);
}

img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Landing */
body.landing {
    display: block;
    min-height: 100vh;
    min-height: 100dvh;
    background: #000;
}

.home {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.home-stage {
    position: relative;
    /* Match assets/uefries.png (501×616) so CTA % positions track the art */
    aspect-ratio: 501 / 616;
    width: min(100vw, calc(100vh * 501 / 616));
    width: min(100vw, calc(100dvh * 501 / 616));
    height: auto;
    max-height: 100vh;
    max-height: 100dvh;
}

.home-art {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
}

.home-cta {
    position: absolute;
    /* uefries.png: U.E. FRIES starts ~53% from left, centerline ~90.9% from top */
    right: 55%;
    top: 90.9%;
    bottom: auto;
    transform: translateY(-50%);
    z-index: 2;
    animation: riseIn 0.9s ease 0.35s both;
}

.home-cta .btn {
    padding: 0.45rem 0.9rem;
    font-size: 0.92rem;
    line-height: 1.1;
    box-shadow: none;
}

@keyframes riseIn {
    from { opacity: 0; transform: translateY(calc(-50% + 12px)); }
    to { opacity: 1; transform: translateY(-50%); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes grainShift {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-2%, -3%, 0); }
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 7, 7, 0.88);
    backdrop-filter: blur(12px);
}

.site-header-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0.95rem 1.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    text-decoration: none;
    color: var(--gold);
}

.brand:hover {
    color: var(--gold-bright);
}

.brand-mark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.02em;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.15rem;
}

.site-nav > a {
    color: var(--cream-dim);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    transition: color 0.15s ease, background 0.15s ease;
}

.site-nav > a:hover,
.site-nav > a.is-active {
    color: var(--gold);
    background: rgba(240, 201, 51, 0.08);
}

.site-nav .nav-cta {
    color: var(--ink) !important;
    background: var(--gold) !important;
    font-weight: 700;
    margin-left: 0.25rem;
}

.site-nav .nav-cta:hover {
    background: var(--gold-bright) !important;
    color: var(--ink) !important;
}

.nav-sep {
    width: 1px;
    height: 1.1rem;
    background: var(--line-strong);
    margin: 0 0.45rem;
}

.nav-user {
    color: var(--muted);
    font-size: 0.88rem;
    padding: 0 0.35rem;
}

.site-nav .nav-muted {
    color: var(--muted);
    font-size: 0.88rem;
}

.badge {
    display: inline-block;
    background: var(--danger);
    color: #fff;
    border-radius: 999px;
    font-size: 0.68rem;
    padding: 0.05rem 0.4rem;
    vertical-align: middle;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--line);
    width: 2.6rem;
    height: 2.6rem;
    border-radius: var(--radius);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 1.15rem;
    height: 2px;
    background: var(--gold);
}

.site-main {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 2rem 1.35rem 3.5rem;
    flex: 1;
    animation: fadeUp 0.5s ease both;
}

.site-main.wide {
    max-width: 1180px;
}

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.35);
}

.site-footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 1.35rem;
    text-align: center;
}

.footer-brand {
    font-family: var(--font-display);
    color: var(--gold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.92rem;
}

.footer-note {
    color: var(--muted);
    font-size: 0.88rem;
    margin-top: 0.2rem;
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.15;
    color: var(--gold);
}

h1 {
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    margin-bottom: 0.55rem;
}

h2 {
    font-size: 1.45rem;
    margin: 1.75rem 0 0.75rem;
}

h3 {
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem;
    color: var(--cream);
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.page-head h1 {
    margin-bottom: 0;
}

.lede {
    color: var(--muted);
    max-width: 40rem;
    margin-bottom: 1.75rem;
    font-size: 1.08rem;
}

.meta {
    color: var(--muted);
    font-size: 0.92rem;
}

/* Forms & buttons */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 40rem;
}

.form-stack.wide {
    max-width: 48rem;
}

label.check-inline {
    flex-direction: row;
    align-items: center;
    gap: 0.55rem;
    font-weight: 500;
}

.share-media {
    border: 1px solid var(--line);
    padding: 0.85rem 1rem;
    border-radius: 4px;
}

.share-media-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.55rem 0;
    border-top: 1px solid var(--line);
}

.share-media-item:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.share-media-item input[type="text"] {
    font-weight: 400;
    font-size: 0.85rem;
}

.share-hint a {
    word-break: break-all;
}

label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--cream-dim);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="search"],
input[type="file"],
input[type="date"],
select,
textarea {
    font: inherit;
    color: var(--cream);
    background: var(--ink-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.72rem 0.85rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--gold-deep);
    box-shadow: 0 0 0 3px rgba(240, 201, 51, 0.15);
}

.date-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.75rem;
    gap: 0.5rem;
    align-items: stretch;
}

.date-field > input[type="text"] {
    min-width: 0;
    width: 100%;
}

.date-field-picker {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--gold);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.date-field-picker:hover,
.date-field-picker:focus-within {
    border-color: var(--gold-deep);
    background: var(--ink-elevated);
    box-shadow: 0 0 0 3px rgba(240, 201, 51, 0.15);
}

.date-field-icon {
    display: flex;
    pointer-events: none;
}

.date-field-native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    border: 0;
    background: transparent;
}

textarea {
    min-height: 11rem;
    resize: vertical;
}

.btn,
a.btn,
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font: inherit;
    font-weight: 700;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 0.7rem 1.2rem;
    cursor: pointer;
    text-decoration: none !important;
    background: var(--gold);
    color: var(--ink) !important;
    transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.btn:hover,
a.btn:hover,
button.btn:hover {
    background: var(--gold-bright);
    color: var(--ink) !important;
    transform: translateY(-1px);
}

.btn-ghost,
a.btn-ghost {
    background: transparent;
    color: var(--gold) !important;
    border-color: var(--line-strong);
}

.btn-ghost:hover,
a.btn-ghost:hover {
    background: rgba(240, 201, 51, 0.08);
    border-color: var(--gold);
    color: var(--gold-bright) !important;
}

.btn-danger {
    background: var(--danger);
    color: #fff !important;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.flash {
    padding: 0.95rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1.35rem;
    border: 1px solid var(--line);
}

.flash-success { background: rgba(61, 143, 106, 0.18); border-color: var(--ok); }
.flash-error { background: rgba(196, 75, 60, 0.18); border-color: var(--danger); }
.flash-info { background: rgba(240, 201, 51, 0.08); }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: end;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--ink-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.toolbar form,
form.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: end;
    flex: 1;
    width: 100%;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.chip {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--cream-dim);
    text-decoration: none;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.25);
}

.chip:hover,
.chip.is-active {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(240, 201, 51, 0.1);
}

.item-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.item-card {
    display: block;
    padding: 1.15rem 1.25rem;
    background: var(--ink-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.item-card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
    color: inherit;
    box-shadow: var(--shadow);
}

.item-card h3 {
    margin: 0 0 0.35rem;
    color: var(--gold);
}

.story-body {
    margin: 1.35rem 0;
    font-size: 1.1rem;
    max-width: 42rem;
    color: var(--cream);
}

.story-body p {
    margin-bottom: 1rem;
}

.people-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 1rem 0;
}

.people-tags a {
    font-size: 0.85rem;
    padding: 0.28rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    text-decoration: none;
    color: var(--cream-dim);
    background: var(--ink-soft);
}

.people-tags a:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}

.media-tile {
    background: var(--ink-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.media-tile img,
.media-tile video {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.media-tile .cap {
    padding: 0.7rem 0.8rem;
    font-size: 0.88rem;
    color: var(--muted);
}

.embed-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 1rem 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.embed-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.audio-panel {
    margin: 1.5rem 0;
    padding: 1.25rem;
    border: 1px solid var(--line);
    background: var(--ink-panel);
    border-radius: var(--radius);
}

.attached-media {
    margin: 0 0 1.75rem;
    max-width: 48rem;
}

.attached-media h2 {
    margin-bottom: 0.35rem;
}

.attached-media-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.attached-media-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0.9rem;
    border-top: 1px solid var(--line);
}

.attached-media-item:first-child {
    border-top: 0;
}

.story-media-block {
    margin: 1rem 0;
}

.media-tile .media-remove,
.story-media-block .media-remove {
    margin: 0.5rem 0.8rem 0.8rem;
}

.audio-panel audio {
    width: 100%;
    margin-bottom: 1rem;
}

.transcript {
    max-height: 22rem;
    overflow: auto;
    padding-right: 0.5rem;
}

.transcript-seg {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--cream);
    font: inherit;
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
}

.transcript-seg:hover,
.transcript-seg.is-active {
    background: rgba(240, 201, 51, 0.12);
    color: var(--gold);
}

.transcript-plain {
    white-space: pre-wrap;
}

.comments {
    margin-top: 2.25rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--line);
}

.comment {
    padding: 0.95rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.comment .meta {
    margin-bottom: 0.35rem;
}

/* Tree */
.tree-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 1.35rem;
    align-items: start;
}

.tree-panel,
.side-panel {
    background: linear-gradient(165deg, var(--ink-elevated), var(--ink-panel));
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
    min-height: 16rem;
}

.side-panel h3 {
    font-family: var(--font-display);
    color: var(--gold);
    letter-spacing: 0.04em;
    margin-top: 0;
}

.person-rail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1.25rem;
    max-height: 11rem;
    overflow: auto;
    padding-bottom: 0.25rem;
}

.person-node {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.28rem 0.75rem 0.28rem 0.28rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    text-decoration: none;
    color: var(--cream-dim);
    background: rgba(0, 0, 0, 0.28);
    font-size: 0.92rem;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.person-node-photo {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ink-elevated);
    border: 1px solid var(--line);
}

.person-node-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.person-node-photo span {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--gold);
    line-height: 1;
}

.person-node-name {
    line-height: 1.2;
}

.person-node:hover,
.person-node.is-focus {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(240, 201, 51, 0.1);
}

.person-node.has-photo.is-focus .person-node-photo,
.person-node.has-photo:hover .person-node-photo {
    border-color: var(--gold);
}

.rel-group {
    margin-bottom: 1.35rem;
}

.rel-group .person-node {
    margin: 0 0.35rem 0.35rem 0;
}

.rel-group h3 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin: 0 0 0.65rem;
    font-family: var(--font-body);
    font-weight: 600;
}

.focus-card {
    padding: 1.1rem 0 0.25rem;
    border-top: 1px solid var(--line);
}

.focus-card-main {
    display: flex;
    flex-wrap: wrap;
    gap: 1.15rem;
    align-items: center;
}

.focus-card-photo {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--line-strong);
    background: var(--ink-panel);
    flex-shrink: 0;
}

.focus-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.focus-card-photo .person-photo-placeholder span {
    font-size: 2.75rem;
}

.focus-card-body {
    flex: 1;
    min-width: 12rem;
}

.focus-card-body h2 {
    margin-top: 0;
}

.focus-card h2 {
    margin-top: 0.35rem;
}

/* Node / pedigree tree */
.node-tree {
    margin-top: 0.35rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.node-gen {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
}

.node-gen-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin: 0;
    font-family: var(--font-body);
    font-weight: 600;
}

.node-gen-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 0.85rem;
    max-width: 100%;
}

.node-gen-row.node-couple {
    align-items: center;
}

.node-branch {
    width: 100%;
    display: flex;
    justify-content: center;
    height: 1.65rem;
    position: relative;
}

.node-branch span {
    display: block;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, rgba(240, 201, 51, 0.15), var(--gold), rgba(240, 201, 51, 0.15));
}

.node-branch-down span {
    background: linear-gradient(to bottom, var(--gold), rgba(240, 201, 51, 0.2));
}

.node-spouse-link {
    width: 1.4rem;
    height: 1px;
    background: var(--gold);
    opacity: 0.7;
    flex-shrink: 0;
}

.graph-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 8.6rem;
    padding: 0.75rem 0.65rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    text-decoration: none;
    color: var(--cream-dim);
    background:
        radial-gradient(circle at 50% 0%, rgba(240, 201, 51, 0.1), transparent 60%),
        rgba(0, 0, 0, 0.32);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, background 0.15s ease;
    text-align: center;
}

.graph-node-photo {
    width: 4.1rem;
    height: 4.1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--line-strong);
    background: var(--ink-elevated);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.55rem;
}

.graph-node-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.graph-node-photo span {
    font-family: var(--font-display);
    font-size: 1.55rem;
    color: var(--gold);
    line-height: 1;
}

.graph-node-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    width: 100%;
}

.graph-node-name {
    font-family: var(--font-display);
    font-size: 0.98rem;
    line-height: 1.2;
    color: var(--cream);
}

.graph-node-meta {
    font-size: 0.72rem;
    color: var(--muted);
    line-height: 1.3;
}

.graph-node:hover,
.graph-node.is-focus {
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-2px);
    background:
        radial-gradient(circle at 50% 0%, rgba(240, 201, 51, 0.18), transparent 62%),
        rgba(240, 201, 51, 0.08);
}

.graph-node.is-focus {
    box-shadow: 0 0 0 1px rgba(240, 201, 51, 0.35), 0 14px 34px rgba(0, 0, 0, 0.35);
}

.graph-node.is-focus .graph-node-photo,
.graph-node:hover .graph-node-photo {
    border-color: var(--gold);
}

.graph-node.is-focus .graph-node-name,
.graph-node:hover .graph-node-name {
    color: var(--gold);
}

.node-gen-focus .graph-node.is-focus {
    width: 9.4rem;
}

.node-gen-focus .graph-node.is-focus .graph-node-photo {
    width: 4.6rem;
    height: 4.6rem;
}

@media (max-width: 640px) {
    .graph-node {
        width: 7.4rem;
        padding: 0.65rem 0.5rem 0.75rem;
    }

    .graph-node-photo {
        width: 3.5rem;
        height: 3.5rem;
    }

    .node-gen-focus .graph-node.is-focus {
        width: 8rem;
    }
}

.empty {
    padding: 2.5rem 1.5rem;
    color: var(--muted);
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
}

.empty-hero {
    padding: 2.75rem 1.75rem;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background:
        radial-gradient(circle at 50% 0%, rgba(240, 201, 51, 0.14), transparent 55%),
        var(--ink-panel);
    box-shadow: var(--shadow);
}

.empty-hero h2 {
    margin: 0 0 0.65rem;
}

.empty-hero p {
    color: var(--muted);
    max-width: 28rem;
    margin: 0 auto 1.35rem;
}

.empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.login-wrap {
    max-width: 28rem;
    margin: 3.5rem auto;
    padding: 2rem;
    background: var(--ink-panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.login-wrap h1 {
    margin-bottom: 0.35rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    text-align: left;
    padding: 0.65rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    vertical-align: top;
}

.table th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.85rem;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.4rem 0.75rem;
    max-height: 12rem;
    overflow: auto;
    padding: 0.65rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--ink-soft);
}

.checkbox-grid label {
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
    font-weight: 400;
    font-size: 0.9rem;
}

/* Person profile + album */
.person-hero {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 1.35rem;
    align-items: center;
    margin-bottom: 1.75rem;
}

.person-hero-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--line-strong);
    background: var(--ink-panel);
    box-shadow: var(--shadow);
}

.person-hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.person-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 40% 30%, rgba(240, 201, 51, 0.2), transparent 60%), var(--ink-elevated);
}

.person-photo-placeholder span {
    font-family: var(--font-display);
    font-size: 3.5rem;
    color: var(--gold);
    line-height: 1;
}

.photo-upload-card {
    padding: 1.25rem;
    background: var(--ink-panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.check-inline {
    flex-direction: row !important;
    align-items: center;
    gap: 0.55rem;
    font-weight: 500;
}

.person-album {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.1rem;
    margin-top: 0.5rem;
}

.album-card {
    background: var(--ink-panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.album-card.is-profile {
    border-color: var(--gold);
}

.album-card-media {
    position: relative;
}

.album-card-media img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.lightbox-trigger {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: zoom-in;
    text-align: inherit;
    font: inherit;
    position: relative;
}

.lightbox-trigger img {
    display: block;
    width: 100%;
    height: auto;
}

.person-hero-photo .lightbox-trigger,
.person-hero-photo .lightbox-trigger img {
    width: 100%;
    height: 100%;
}

.person-hero-photo .lightbox-trigger img {
    object-fit: cover;
}

.media-tile .lightbox-trigger img {
    aspect-ratio: 4/3;
    object-fit: cover;
}

.lightbox {
    position: fixed;
    inset: 0;
    margin: auto;
    width: fit-content;
    height: fit-content;
    padding: 0;
    border: 0;
    background: transparent;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
    color: var(--cream);
}

.lightbox::backdrop {
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(2px);
}

.lightbox-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-width: min(960px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    padding: 1rem 1rem 1.1rem;
    background: var(--ink-panel);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    overflow: auto;
}

.lightbox-img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: min(72vh, 820px);
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-meta {
    color: var(--cream-dim);
}

.lightbox-meta .album-caption {
    margin-bottom: 0.45rem;
}

.lightbox-meta .tag-list {
    margin-bottom: 0;
    min-height: 0;
}

.lightbox-meta:empty,
.lightbox-meta[hidden] {
    display: none;
}

.lightbox-close {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 2;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(7, 7, 7, 0.78);
    color: var(--gold);
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
    border-color: var(--gold);
    outline: none;
}

.lightbox-nav {
    position: absolute;
    bottom: 0.75rem;
    z-index: 2;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(7, 7, 7, 0.78);
    color: var(--gold);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.lightbox-prev {
    left: 0.75rem;
}

.lightbox-next {
    right: 0.75rem;
}

.lightbox-nav:hover,
.lightbox-nav:focus-visible {
    border-color: var(--gold);
    color: var(--gold-bright);
    outline: none;
}

.lightbox-nav[hidden] {
    display: none;
}

.lightbox.has-nav .lightbox-panel {
    padding-bottom: 3.5rem;
}

.profile-badge {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    background: var(--gold);
    color: var(--ink);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}

.album-card-body {
    padding: 0.9rem 1rem 1rem;
}

.album-caption {
    margin-bottom: 0.55rem;
    color: var(--cream-dim);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    min-height: 1.6rem;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.28);
    color: var(--cream-dim);
    font-size: 0.85rem;
    text-decoration: none;
    cursor: default;
}

a.tag-chip {
    cursor: pointer;
}

.tag-chip.is-tree {
    border-color: var(--line-strong);
    color: var(--gold);
}

.tag-chip.chip-removable {
    cursor: pointer;
}

.tag-chip .chip-x {
    font-size: 1rem;
    line-height: 1;
    opacity: 0.75;
}

.tag-editor summary {
    cursor: pointer;
    color: var(--gold);
    font-size: 0.9rem;
}

.chip-picker {
    position: relative;
}

.chip-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.55rem;
    min-height: 0.5rem;
}

.chip-input-row {
    position: relative;
}

.chip-input-row input.chip-search {
    width: 100%;
}

.chip-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 30;
    background: var(--ink-elevated);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    max-height: 220px;
    overflow: auto;
    box-shadow: var(--shadow);
}

.chip-suggest-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--cream);
    font: inherit;
    padding: 0.65rem 0.8rem;
    cursor: pointer;
}

.chip-suggest-item span {
    color: var(--muted);
    font-size: 0.82rem;
}

.chip-suggest-item:hover,
.chip-suggest-item.is-active {
    background: rgba(240, 201, 51, 0.1);
}

.chip-hint {
    margin-top: 0.45rem;
}

.audit-filters label {
    min-width: 9rem;
    flex: 1 1 9rem;
}

.audit-filters label:first-child {
    flex: 2 1 14rem;
}

.audit-count {
    margin: -0.5rem 0 1rem;
}

.audit-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.audit-entry {
    background: var(--ink-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.audit-entry[open] {
    border-color: rgba(240, 201, 51, 0.35);
}

.audit-row {
    display: grid;
    grid-template-columns: 9.5rem 8.5rem minmax(0, 1fr) auto;
    gap: 0.65rem 1rem;
    align-items: baseline;
    list-style: none;
    cursor: pointer;
    padding: 0.7rem 2.1rem 0.7rem 0.95rem;
    position: relative;
    color: inherit;
}

.audit-row::-webkit-details-marker {
    display: none;
}

.audit-row::after {
    content: '';
    position: absolute;
    right: 0.95rem;
    top: 50%;
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.audit-entry[open] > .audit-row::after {
    transform: translateY(-20%) rotate(225deg);
    border-color: var(--gold);
}

.audit-row:hover {
    background: rgba(240, 201, 51, 0.05);
}

.audit-when,
.audit-who,
.audit-kind {
    color: var(--muted);
    font-size: 0.88rem;
    white-space: nowrap;
}

.audit-who {
    overflow: hidden;
    text-overflow: ellipsis;
}

.audit-what {
    color: var(--cream);
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audit-kind {
    justify-self: end;
}

.audit-detail {
    padding: 0 0.95rem 0.9rem;
    border-top: 1px solid var(--line);
}

.audit-detail .meta {
    margin: 0.75rem 0 0;
}

.audit-summary {
    font-size: 1.05rem;
    margin: 0.35rem 0 0.75rem;
    color: var(--cream);
}

.audit-diff {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-top: 0.35rem;
}

@media (max-width: 900px) {
    .audit-row {
        grid-template-columns: 1fr auto;
        gap: 0.2rem 0.75rem;
    }

    .audit-when {
        grid-column: 1;
    }

    .audit-kind {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    .audit-who,
    .audit-what {
        grid-column: 1 / -1;
        white-space: normal;
    }
}

.audit-diff th,
.audit-diff td {
    text-align: left;
    vertical-align: top;
    padding: 0.45rem 0.55rem;
    border-top: 1px solid var(--line);
    word-break: break-word;
}

.audit-diff th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.audit-diff td:first-child {
    width: 22%;
    color: var(--gold);
    white-space: nowrap;
}

.audit-diff td:nth-child(2) {
    color: var(--muted);
}

@media (max-width: 860px) {
    .nav-toggle {
        display: flex;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        background: rgba(7, 7, 7, 0.98);
        border-bottom: 1px solid var(--line);
        padding: 0.85rem 1.25rem 1.25rem;
    }

    .site-nav.is-open {
        display: flex;
    }

    .nav-sep {
        display: none;
    }

    .tree-layout {
        grid-template-columns: 1fr;
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .person-hero {
        grid-template-columns: 1fr;
        justify-items: start;
    }
}
