/* Familietavle – valgfrit mørkegrønt galleri (v58).
   Udelukkende aktiveret med serverens indstilling appearance_theme=gallery.
   Lyse indholdspaneler beholder deres eksisterende farver og læsbarhed. */
html.appearance-gallery {background:#0d1714;}
body.appearance-gallery {
  min-height:100vh;
  background:
    radial-gradient(ellipse at 82% 60%,rgba(155,127,76,.13) 0%,transparent 58%),
    radial-gradient(ellipse at 14% 8%,#344b41 0%,#14271f 35%,#0d1714 78%);
  background-attachment:fixed;
  color:#ebf2ec;
}
/* Navbar: samme afdæmpede grønne glasvirkning som portrætpauseskærmen. */
body.appearance-gallery .topbar {
  background:rgba(14,29,24,.90);
  border-bottom:1px solid rgba(222,204,156,.22);
  color:#f3f3e9;
  box-shadow:0 8px 26px rgba(5,14,10,.17);
  -webkit-backdrop-filter:blur(15px);backdrop-filter:blur(15px);
}
body.appearance-gallery .topbar .brand {color:#f7f1e2;}
body.appearance-gallery .topbar .brand-mark {background:#385d49;color:#f8efdb;box-shadow:inset 0 0 0 1px rgba(213,183,122,.32);}
body.appearance-gallery .topbar .nav-link {color:#d3e1d4;}
body.appearance-gallery .topbar .nav-link:hover {color:#fff;background:rgba(255,255,255,.055);}
body.appearance-gallery .topbar .nav-link.active {color:#eed5a1;border-color:#d7b879;}
body.appearance-gallery .topbar .search-open {color:#e1e6dd;background:rgba(234,246,233,.09);border-color:rgba(228,230,203,.21);}
body.appearance-gallery .topbar .search-open:hover {background:rgba(234,246,233,.16);}
body.appearance-gallery .topbar .user-menu-identity strong {color:#f7f5ec;}
body.appearance-gallery .topbar .user-menu-identity small,
body.appearance-gallery .topbar .user-menu-chevron {color:#baccbd;}
body.appearance-gallery .topbar .user-menu>summary:hover,
body.appearance-gallery .topbar .user-menu[open]>summary {background:rgba(255,255,255,.09);border-color:rgba(236,238,216,.19);}
body.appearance-gallery .topbar .user-menu-popover {color:#172b20;}
body.appearance-gallery .mobile-nav {background:rgba(15,33,26,.97);border-top:1px solid rgba(225,207,168,.28);box-shadow:0 -8px 23px rgba(0,0,0,.18);}
body.appearance-gallery .mobile-nav a,
body.appearance-gallery .mobile-nav button {color:#dce5d7;}
body.appearance-gallery .mobile-nav .active {color:#f0ce91;}
/* Hvid / elfenbensfarvet indhold skal have mørkt blæk, aldrig lys tekst. */
body.appearance-gallery .page-shell {color:#f1f4ee;}
body.appearance-gallery .page-shell :is(.card,.loading-card,.stat,.people-card,.birthday-card,.person-card,.period-stat,.period-nav-item,.period-person,.history-category-card,.history-event-card,.history-hero,.profile-hero,.tree-canvas,.tree-person,.family-kinship-group,.research-section,.people-import-row,.timeline-relationship-card,.person-picker-results,.research-finder,.research-live-results,.research-live-search,.research-tool-card,.research-hero-card) {color:#172b22;}
/* Lyse kort, som ikke altid bruger .card. */
body.appearance-gallery .page-shell :is(.people-card,.person-card,.period-stat,.period-nav-item,.period-person,.history-category-card,.history-event-card,.people-import-row,.tree-person) {background-color:#fff;}
body.appearance-gallery .page-shell .profile-hero {color:#172b22;}
body.appearance-gallery .page-shell .tree-canvas {color:#172b22;}
/* Sideoverskrifter, introer og statistiktekster står direkte på baggrunden. */
body.appearance-gallery .page-shell > .page-head h1,
body.appearance-gallery .page-shell > .page-head h2,
body.appearance-gallery .page-shell > .page-head strong,
body.appearance-gallery .page-shell > .page-head .eyebrow {color:#f5f1e6;}
body.appearance-gallery .page-shell > .page-head .eyebrow {color:#e1c58e;}
body.appearance-gallery .page-shell > .page-head .muted,
body.appearance-gallery .page-shell > .muted,
body.appearance-gallery .page-shell > .small-note,
body.appearance-gallery .page-shell > p.muted {color:#c6d9cc;}
body.appearance-gallery .page-shell > .page-head a:not(.btn) {color:#e5cf9d;}
/* Forms outside cards should still be readable. */
body.appearance-gallery .page-shell :is(input:not([type=checkbox]):not([type=radio]),textarea,select) {color:#172b22;}
body.appearance-gallery .page-shell .btn {color:#204b35;}
body.appearance-gallery .page-shell .btn.primary,
body.appearance-gallery .page-shell .btn.is-active,
body.appearance-gallery .page-shell .people-switch .btn.is-active,
body.appearance-gallery .page-shell .family-scope-switch .btn.is-active {color:#fff;}
/* Særlige frie sektionstitler uden selvstændig lys panelbaggrund. */
body.appearance-gallery .page-shell > :is(.section-head,.people-result-head,.family-directory-heading,.history-results-head,.period-summary),
body.appearance-gallery .page-shell > :is(.section-head,.people-result-head,.family-directory-heading,.history-results-head,.period-summary) .muted {color:#ebf2e9;}
body.appearance-gallery .page-shell > .period-summary p {color:#d5e4d5;}
/* Frie hjælpetekster og historiefiltre – de ligger uden for de lyse paneler. */
body.appearance-gallery .page-shell > .my-family-note {color:#cadccd;}
body.appearance-gallery .history-results-head .eyebrow {color:#e1c58e;}
body.appearance-gallery .history-results-head .muted {color:#cadccd;}
body.appearance-gallery .site-presence-footer {color:#cbdccc;}
body.appearance-gallery .site-presence-footer>small {color:#c3d3c5;}
body.appearance-gallery .site-presence-footer {border-top-color:rgba(225,207,168,.25);}
body.appearance-gallery .site-presence-footer .muted {color:#cad9cd;}
body.appearance-gallery .page-shell .admin-shortcuts a {color:#295840;}
/* Dialoger og andre popovers bør fortsat bruge deres oprindelige lyse tema. */
body.appearance-gallery :is(.search-dialog,.user-menu-popover,.profile-edit-dialog,.profile-portrait-menu) {color:#172b22;}
body.appearance-gallery .flash {color:#1b2a22;}
/* Login, nulstilling og invitation bruger samme baggrund, men deres kort er lyst. */
body.appearance-gallery.auth-body {background:
  radial-gradient(ellipse at 82% 60%,rgba(155,127,76,.13) 0%,transparent 58%),
  radial-gradient(ellipse at 14% 8%,#344b41 0%,#14271f 35%,#0d1714 78%);
  background-attachment:fixed;
}
body.appearance-gallery .auth-card {color:#172b22;}
/* Indstillinger: tydelige tema-eksempler, som ikke påvirker resten af hjemmesiden. */
.appearance-theme-form{display:grid;justify-items:start;gap:18px;margin:18px 0 6px}
.appearance-theme-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;width:min(100%,740px);padding:0;border:0;min-width:0}
.appearance-theme-choices>legend{font-size:.84rem;font-weight:750;padding:0;margin-bottom:10px}
.appearance-theme-option{display:grid;grid-template-columns:22px minmax(0,1fr);gap:10px;align-items:start;cursor:pointer;padding:12px;border:1px solid var(--line);border-radius:14px;background:#fff;min-width:0;transition:border-color .18s,box-shadow .18s}
.appearance-theme-option:has(input:checked){border-color:#2a7851;box-shadow:0 0 0 2px rgba(45,127,85,.21)}
.appearance-theme-option:has(input:focus-visible){outline:3px solid #9ebfa7;outline-offset:3px}
.appearance-theme-option>input{margin:5px 0 0;accent-color:#245b41}
.appearance-theme-sample{grid-column:2;display:grid;grid-template-columns:1fr 1fr;gap:8px;min-height:112px;padding:10px;border-radius:10px;overflow:hidden}
.appearance-theme-sample .appearance-sample-header{grid-column:1/-1;height:18px;border-radius:5px}
.appearance-theme-sample .appearance-sample-card{display:block;min-height:45px;border-radius:7px}
.appearance-theme-sample-light{background:#edf3ed;border:1px solid #dbe4dc}
.appearance-theme-sample-light .appearance-sample-header{background:#fff}
.appearance-theme-sample-light .appearance-sample-card{background:#fff;border:1px solid #dce6df}
.appearance-theme-sample-gallery{background:radial-gradient(ellipse at 15% 6%,#3c5849 0%,#14271f 60%,#0d1714 100%);border:1px solid #345241}
.appearance-theme-sample-gallery .appearance-sample-header{background:#233c31;border-bottom:2px solid #d2b77e}
.appearance-theme-sample-gallery .appearance-sample-card{background:#f8faf5;border:1px solid #e1e9df}
.appearance-theme-description{grid-column:2;display:grid;gap:4px}
.appearance-theme-description strong{font-size:.94rem}
.appearance-theme-description small{font-size:.78rem;color:var(--muted);line-height:1.45}
@media(max-width:600px){.appearance-theme-choices{grid-template-columns:1fr}.appearance-theme-sample{min-height:90px}}


/* v59: slægtstræet dæmpes i mørkegrønt tema, så de lyse flader harmonerer bedre med baggrunden. */
body.appearance-gallery .tree-canvas{
  background:
    linear-gradient(rgba(241,245,239,.82),rgba(241,245,239,.82)),
    radial-gradient(circle at center,rgba(67,102,84,.18) 1px,transparent 1.6px),
    linear-gradient(180deg,rgba(227,236,228,.92) 0%,rgba(234,240,234,.9) 100%);
  background-size:auto,24px 24px,auto;
  border:1px solid rgba(203,217,207,.58);
  box-shadow:0 16px 36px rgba(6,16,12,.18);
}
body.appearance-gallery .tree-toolbar{border-bottom-color:rgba(103,128,114,.22);}
body.appearance-gallery .tree-toolbar .tree-toolbar-copy small,
body.appearance-gallery .tree-toolbar .tree-toolbar-copy span{color:#5f7269;}
body.appearance-gallery .tree-depth-panel{
  border-color:rgba(183,199,189,.78);
  background:rgba(244,248,242,.78);
  box-shadow:0 6px 18px rgba(11,29,19,.07);
}
body.appearance-gallery .tree-depth-control{
  background:rgba(250,252,249,.92);
  border-color:rgba(198,212,203,.92);
}
body.appearance-gallery .tree-depth-control>button{
  background:#f0f5f1;
  border-color:#bed0c4;
}
body.appearance-gallery .tree-depth-control>button:hover:not(:disabled){background:#e6efe9;border-color:#9eb7a8;}
body.appearance-gallery .tree-visual-stack:before{
  background:linear-gradient(to bottom,transparent,rgba(114,142,126,.42) 4%,rgba(79,111,95,.58) 50%,rgba(114,142,126,.42) 96%,transparent);
}
body.appearance-gallery .tree-generation-label{
  background:rgba(244,248,243,.88);
  color:#5e7067;
  box-shadow:0 2px 8px rgba(12,32,21,.06);
}
body.appearance-gallery .tree-generation-label small{
  background:#dde8df;
  color:#234d39;
}
body.appearance-gallery .tree-line,
body.appearance-gallery .mobile-tree-connector{background:#789783;}
body.appearance-gallery .tree-person,
body.appearance-gallery .mobile-tree-person{
  background:linear-gradient(180deg,rgba(249,251,247,.96) 0%,rgba(241,246,239,.96) 100%);
  border-color:rgba(191,208,196,.92);
  box-shadow:0 8px 20px rgba(17,39,28,.08);
}
body.appearance-gallery .tree-person a,
body.appearance-gallery .mobile-tree-person a{
  background:linear-gradient(180deg,rgba(243,247,242,.95) 0%,rgba(234,241,235,.95) 100%);
  border-left-color:rgba(191,208,196,.88);
}
body.appearance-gallery .tree-person.focus,
body.appearance-gallery .mobile-tree-person.focus{
  box-shadow:0 0 0 3px rgba(35,89,62,.11),0 12px 26px rgba(16,43,30,.14);
}
body.appearance-gallery .tree-person.verified,
body.appearance-gallery .mobile-tree-person.verified{
  box-shadow:0 0 0 1px rgba(43,129,82,.08),0 10px 24px rgba(22,69,48,.12);
}
body.appearance-gallery .mobile-tree-toolbar{border-bottom-color:rgba(104,128,115,.24);}
body.appearance-gallery .mobile-tree-label{color:#365b49;}
body.appearance-gallery .mobile-tree-label small,
body.appearance-gallery .mobile-profile-link{background:#dde8e0;color:#214936;}
body.appearance-gallery .mobile-tree-empty,
body.appearance-gallery .mobile-tree-more-sections details{
  background:rgba(243,247,242,.84);
  border-color:rgba(191,208,196,.92);
}


/* v60 – samlet galleri-finpudsning: varm elfenben, roligere flader og gyldne detaljer.
   Alle regler er begrænset til galleri-temaet; det klassiske tema røres ikke. */
body.appearance-gallery {
  --gallery-ivory:#f7f5ee;
  --gallery-ivory-light:#fdfbf5;
  --gallery-mist:#eaece3;
  --gallery-edge:#d8dbce;
  --gallery-ink:#213a2e;
  --gallery-muted:#617167;
  --gallery-gold:#bda274;
  --line:#d9dfd4;
  --soft:#edf1e8;
  --paper:#f7f5ee;
  --muted:#64756a;
  --shadow:0 12px 28px rgba(3,23,12,.12);
}
/* Store læseflader: varmt hvid fremfor blændende hvidt. */
body.appearance-gallery .page-shell :is(
  .card,.loading-card,.people-card,.birthday-card,.profile-hero,
  .research-section,.research-tool-card,.research-hero-card,
  .history-hero,.history-category-card,.history-event-card,
  .period-stat,.period-nav-item,.period-person,.people-import-row,
  .people-page .family-directory-card,.family-kinship-overview,
  .timeline-relationship-card,.stat
){
  background-color:var(--gallery-ivory);
  border-color:var(--gallery-edge);
  box-shadow:0 7px 25px rgba(5,29,17,.1);
  color:var(--gallery-ink);
}
/* Nested kort skal være lidt lysere for at bevare hierarkiet. */
body.appearance-gallery .page-shell :is(
  .person-card,.people-page .family-kinship-group,
  .family-kinship-list a,.people-page .family-directory-card .family-links a,
  .birthday-strip a,.birthday-calendar>div,.health-item,
  .timeline-relationship-card,.research-task-edit,
  .history-filters,.history-event-portraits,
  .period-person
){
  background-color:var(--gallery-ivory-light);
  border-color:var(--gallery-edge);
  color:var(--gallery-ink);
}
body.appearance-gallery .page-shell .birthday-strip a,
body.appearance-gallery .page-shell .birthday-calendar>div {background:#edf1e9;}
body.appearance-gallery .page-shell .birthday-calendar>div {border:1px solid rgba(190,203,191,.6);}
/* Stille, varme kantlinjer og rolige overskrifter inden i kortene. */
body.appearance-gallery .page-shell :is(.card,.people-card,.birthday-card,.profile-hero) h1,
body.appearance-gallery .page-shell :is(.card,.people-card,.birthday-card,.profile-hero) h2,
body.appearance-gallery .page-shell :is(.card,.people-card,.birthday-card,.profile-hero) h3 {color:#193c2c;}
body.appearance-gallery .page-shell :is(.card,.people-card,.birthday-card,.profile-hero) .eyebrow {color:#55745b;}
body.appearance-gallery .page-shell :is(.card,.people-card,.birthday-card,.profile-hero) .muted {color:var(--gallery-muted);}
/* Lidt færre knaldhvide knapper og søgefelter, men stadig tydelig kontrast. */
body.appearance-gallery .page-shell .btn:not(.primary):not(.is-active),
body.appearance-gallery .page-shell :is(.tree-depth-panel,.family-scope-switch,.people-switch) .btn:not(.primary):not(.is-active) {
  background:var(--gallery-ivory-light);
  border-color:#cbd8ca;
  color:#244e37;
}
body.appearance-gallery .page-shell .btn:not(.primary):not(.is-active):hover {
  background:#edf2e9;
  border-color:#a8c0ab;
}
body.appearance-gallery :is(.page-shell,.auth-card) :is(
  input:not([type=checkbox]):not([type=radio]),textarea,select
){
  background-color:#fffef9;
  border-color:#cbd8ca;
}
body.appearance-gallery :is(.page-shell,.auth-card) :is(input,textarea,select):focus-visible,
body.appearance-gallery .page-shell :is(a,button,summary):focus-visible {
  outline:2px solid #a98753;
  outline-offset:3px;
}
body.appearance-gallery .page-shell :is(.search-field,.people-toolbar,.research-controls) input {background:transparent;}
/* Små familiegrupper og oversigter får en papiragtig, mindre klinisk flade. */
body.appearance-gallery .page-shell .people-page .family-member-children {background:#eef1e9;}
body.appearance-gallery .page-shell .people-page .family-member-block {border-color:#dce3d7;}
body.appearance-gallery .page-shell .people-page .family-directory-card .family-links a:hover,
body.appearance-gallery .page-shell .person-card:hover {background:#f0f4ec;border-color:#aac3aa;}
body.appearance-gallery .page-shell .place-directory-page .place-directory-list>.card {
  background:#fbfaf4;
  border-color:var(--gallery-edge);
  box-shadow:0 4px 13px rgba(12,32,19,.045);
}
/* Ny, varmere bundfarve i selve træet: blød, ikke hvid. */
body.appearance-gallery .tree-canvas {
  background:
    linear-gradient(rgba(229,233,224,.84),rgba(226,231,221,.88)),
    radial-gradient(circle at center,rgba(71,108,82,.2) 1px,transparent 1.6px),
    radial-gradient(ellipse at 80% 20%,#e7e4d6 0%,#d7e4d5 80%);
  background-size:auto,24px 24px,auto;
  border-color:#bfcdbf;
}
body.appearance-gallery .tree-depth-panel {
  background:rgba(244,245,237,.81);
  border-color:#cad7c8;
}
body.appearance-gallery .tree-depth-control {background:rgba(251,250,244,.96);border-color:#d0d9c9;}
body.appearance-gallery .tree-generation-label {background:#f3f3e9;color:#536d5b;}
body.appearance-gallery .tree-generation-label small {background:#e0e9dd;}
body.appearance-gallery .tree-person,
body.appearance-gallery .mobile-tree-person,
body.appearance-gallery .relation-visual-stack .relation-tree-person {
  background:linear-gradient(160deg,#fdfbf4 0%,#f4f4ec 100%);
  border-color:#bed0c0;
  color:#1e3b2c;
}
body.appearance-gallery .tree-person a,
body.appearance-gallery .mobile-tree-person a {
  background:linear-gradient(180deg,#f4f5eb,#e8eee4);
  border-color:#cad9c9;
}
body.appearance-gallery .tree-person .tree-place-value,
body.appearance-gallery .mobile-tree-person .tree-place-value {color:#4a6355;}
body.appearance-gallery .tree-person small.tree-years,
body.appearance-gallery .mobile-tree-person small.tree-years {color:#607469;}
/* Fokus og dokumentation skal fortsat være synlig, ikke udvandet af temaet. */
body.appearance-gallery .tree-page .tree-person.focus,
body.appearance-gallery .tree-page .mobile-tree-person.focus {
  background:linear-gradient(160deg,#fffcf4 0%,#f4f5e9 100%);
}
/* Profil og redigering: varmt fotoalbum frem for hårde hvide paneler. */
body.appearance-gallery .person-page .profile-hero {
  background:linear-gradient(130deg,#fbfaf2 0%,#ecf0e6 100%);
  border-color:#cbd8c8;
}
body.appearance-gallery .page-shell .profile-section-nav,
body.appearance-gallery .page-shell .profile-period-badges {border-color:#d6dfd2;}
body.appearance-gallery .page-shell .timeline-relationship-card {
  background:linear-gradient(110deg,#f7f7ef,#fbfaf5);
}
body.appearance-gallery .page-shell :is(.person-picker-results,.place-picker-results,.research-live-results) {
  background:#fffcf6;
  border-color:#d0dacd;
}
/* Skærmfrie hjælpetekster forbliver lyse på baggrunden. */
body.appearance-gallery .page-shell > :is(.page-head,.section-head,.people-result-head,.family-directory-heading,.history-results-head,.period-summary) {
  text-shadow:0 1px 1px rgba(3,16,10,.07);
}
body.appearance-gallery .page-shell > .people-result-head .muted,
body.appearance-gallery .page-shell > .section-head .muted,
body.appearance-gallery .page-shell > .family-directory-heading .muted {color:#cfdecf;}
/* Login og adminvalg bør have samme varme materialesprog. */
body.appearance-gallery .auth-card {
  background:linear-gradient(155deg,#faf9f2,#f3f3e9);
  border-color:#cdd9cb;
  box-shadow:0 24px 55px rgba(0,12,8,.24);
}
body.appearance-gallery .appearance-theme-option {background:#fbfaf4;border-color:#d1dcce;}
body.appearance-gallery .appearance-theme-option:has(input:checked) {
  border-color:#517a5f;
  box-shadow:0 0 0 2px rgba(175,151,105,.22);
}
/* Touch, små skærme og bevægelsesfølsomme brugere: ingen nye animationer. */
@media(max-width:640px){
  body.appearance-gallery .tree-canvas {background-color:#e1e8dd;}
  body.appearance-gallery .page-shell .card {box-shadow:0 4px 17px rgba(5,29,17,.075);}
}
/* Temaeksemplet i Admin viser også de nye, varme flader. */
.appearance-theme-sample-gallery .appearance-sample-card {background:#f7f5ee;border-color:#d8dbce;}

/* V61 – væggen anvender det varme mørkegrønne temas papirflader. */
body.appearance-gallery .wall-feed-page .wall-feed-total{background:rgba(229,232,217,.94);border-color:#c9d4c6;color:#2c563c}
body.appearance-gallery .wall-feed-page .wall-feed-comment{background:#eef1e7;border-left-color:#b7c8b4}
body.appearance-gallery .wall-feed-page .wall-feed-post .wall-feed-person{border-bottom-color:#d8dfd2}
body.appearance-gallery .wall-feed-page .wall-feed-post .wall-feed-person>a{color:#2e6044}
body.appearance-gallery .wall-feed-page .wall-feed-post .wall-feed-reply textarea{background:#fffdf8}

/* Mobiltræet har en lys baggrund også i galleri-temaet. */
body.appearance-gallery .page-shell .mobile-family-tree{color:#172b22;}
body.appearance-gallery .mobile-nav .mobile-more>summary{color:#dce5d7;}
body.appearance-gallery .mobile-nav .mobile-more>summary.active{color:#f0ce91;}
body.appearance-gallery .mobile-nav .mobile-more-panel a{color:#172b22;}
body.appearance-gallery .mobile-nav .mobile-more-panel a[aria-current="page"]{color:#174d3a;background:#edf3ef;}

/* Blåt og rødt galleri arver det afprøvede grønne galleris layout. */
html.appearance-blue,html.appearance-red{background:#101a29}
body.appearance-blue,body.appearance-red{min-height:100vh;color:#ebf2ec;background-attachment:fixed}
body.appearance-blue{background:radial-gradient(ellipse at 80% 58%,rgba(116,151,206,.14),transparent 58%),radial-gradient(ellipse at 14% 8%,#354e72 0%,#182b48 36%,#0c1628 78%)}
body.appearance-red{background:radial-gradient(ellipse at 80% 58%,rgba(209,141,120,.13),transparent 58%),radial-gradient(ellipse at 14% 8%,#653b43 0%,#39202a 36%,#1d1019 78%)}
body.appearance-blue .topbar{background:rgba(17,31,53,.93);border-bottom:1px solid rgba(183,204,235,.25)}
body.appearance-red .topbar{background:rgba(54,24,33,.93);border-bottom:1px solid rgba(233,183,179,.25)}
body.appearance-blue .mobile-nav{background:rgba(17,31,53,.97)}
body.appearance-red .mobile-nav{background:rgba(54,24,33,.97)}
body.appearance-blue .topbar .brand-mark{background:#35577e;color:#fff}
body.appearance-red .topbar .brand-mark{background:#82434d;color:#fff}
body.appearance-blue .topbar .nav-link.active,body.appearance-blue .mobile-nav .active{color:#a9d4ff;border-color:#8ab9e6}
body.appearance-red .topbar .nav-link.active,body.appearance-red .mobile-nav .active{color:#ffb9b3;border-color:#e7a09b}
.appearance-theme-sample-blue{background:radial-gradient(ellipse at 15% 6%,#35547c,#101a30);border:1px solid #47618a}
.appearance-theme-sample-red{background:radial-gradient(ellipse at 15% 6%,#76414d,#25121d);border:1px solid #89515d}
.appearance-theme-sample-blue .appearance-sample-header{background:#243d61;border-bottom:2px solid #9fc4e8}
.appearance-theme-sample-red .appearance-sample-header{background:#592c3a;border-bottom:2px solid #e3a3a0}
.appearance-theme-sample-blue .appearance-sample-card,.appearance-theme-sample-red .appearance-sample-card{background:#f8fafb;border:1px solid #e0e5eb}

/* Arvede galleriregler: blue */
/* Familietavle – valgfrit mørkegrønt galleri (v58).
   Udelukkende aktiveret med serverens indstilling appearance_theme=gallery.
   Lyse indholdspaneler beholder deres eksisterende farver og læsbarhed. */
html.appearance-blue {background:#0d1714;}

body.appearance-blue {
  min-height:100vh;
  background:
    radial-gradient(ellipse at 82% 60%,rgba(155,127,76,.13) 0%,transparent 58%),
    radial-gradient(ellipse at 14% 8%,#344b41 0%,#14271f 35%,#0d1714 78%);
  background-attachment:fixed;
  color:#ebf2ec;
}

/* Navbar: samme afdæmpede grønne glasvirkning som portrætpauseskærmen. */
body.appearance-blue .topbar {
  background:rgba(14,29,24,.90);
  border-bottom:1px solid rgba(222,204,156,.22);
  color:#f3f3e9;
  box-shadow:0 8px 26px rgba(5,14,10,.17);
  -webkit-backdrop-filter:blur(15px);backdrop-filter:blur(15px);
}

body.appearance-blue .topbar .brand {color:#f7f1e2;}

body.appearance-blue .topbar .brand-mark {background:#385d49;color:#f8efdb;box-shadow:inset 0 0 0 1px rgba(213,183,122,.32);}

body.appearance-blue .topbar .nav-link {color:#d3e1d4;}

body.appearance-blue .topbar .nav-link:hover {color:#fff;background:rgba(255,255,255,.055);}

body.appearance-blue .topbar .nav-link.active {color:#eed5a1;border-color:#d7b879;}

body.appearance-blue .topbar .search-open {color:#e1e6dd;background:rgba(234,246,233,.09);border-color:rgba(228,230,203,.21);}

body.appearance-blue .topbar .search-open:hover {background:rgba(234,246,233,.16);}

body.appearance-blue .topbar .user-menu-identity strong {color:#f7f5ec;}

body.appearance-blue .topbar .user-menu-identity small,
body.appearance-blue .topbar .user-menu-chevron {color:#baccbd;}

body.appearance-blue .topbar .user-menu>summary:hover,
body.appearance-blue .topbar .user-menu[open]>summary {background:rgba(255,255,255,.09);border-color:rgba(236,238,216,.19);}

body.appearance-blue .topbar .user-menu-popover {color:#172b20;}



body.appearance-blue .mobile-nav {background:rgba(15,33,26,.97);border-top:1px solid rgba(225,207,168,.28);box-shadow:0 -8px 23px rgba(0,0,0,.18);}

body.appearance-blue .mobile-nav a,
body.appearance-blue .mobile-nav button {color:#dce5d7;}

body.appearance-blue .mobile-nav .active {color:#f0ce91;}

/* Hvid / elfenbensfarvet indhold skal have mørkt blæk, aldrig lys tekst. */
body.appearance-blue .page-shell {color:#f1f4ee;}

body.appearance-blue .page-shell :is(.card,.loading-card,.stat,.people-card,.birthday-card,.person-card,.period-stat,.period-nav-item,.period-person,.history-category-card,.history-event-card,.history-hero,.profile-hero,.tree-canvas,.tree-person,.family-kinship-group,.research-section,.people-import-row,.timeline-relationship-card,.person-picker-results,.research-finder,.research-live-results,.research-live-search,.research-tool-card,.research-hero-card) {color:#172b22;}

/* Lyse kort, som ikke altid bruger .card. */
body.appearance-blue .page-shell :is(.people-card,.person-card,.period-stat,.period-nav-item,.period-person,.history-category-card,.history-event-card,.people-import-row,.tree-person) {background-color:#fff;}

body.appearance-blue .page-shell .profile-hero {color:#172b22;}

body.appearance-blue .page-shell .tree-canvas {color:#172b22;}

/* Sideoverskrifter, introer og statistiktekster står direkte på baggrunden. */
body.appearance-blue .page-shell > .page-head h1,
body.appearance-blue .page-shell > .page-head h2,
body.appearance-blue .page-shell > .page-head strong,
body.appearance-blue .page-shell > .page-head .eyebrow {color:#f5f1e6;}

body.appearance-blue .page-shell > .page-head .eyebrow {color:#e1c58e;}

body.appearance-blue .page-shell > .page-head .muted,
body.appearance-blue .page-shell > .muted,
body.appearance-blue .page-shell > .small-note,
body.appearance-blue .page-shell > p.muted {color:#c6d9cc;}

body.appearance-blue .page-shell > .page-head a:not(.btn) {color:#e5cf9d;}

/* Forms outside cards should still be readable. */
body.appearance-blue .page-shell :is(input:not([type=checkbox]):not([type=radio]),textarea,select) {color:#172b22;}

body.appearance-blue .page-shell .btn {color:#204b35;}

body.appearance-blue .page-shell .btn.primary,
body.appearance-blue .page-shell .btn.is-active,
body.appearance-blue .page-shell .people-switch .btn.is-active,
body.appearance-blue .page-shell .family-scope-switch .btn.is-active {color:#fff;}

/* Særlige frie sektionstitler uden selvstændig lys panelbaggrund. */
body.appearance-blue .page-shell > :is(.section-head,.people-result-head,.family-directory-heading,.history-results-head,.period-summary),
body.appearance-blue .page-shell > :is(.section-head,.people-result-head,.family-directory-heading,.history-results-head,.period-summary) .muted {color:#ebf2e9;}

body.appearance-blue .page-shell > .period-summary p {color:#d5e4d5;}

/* Frie hjælpetekster og historiefiltre – de ligger uden for de lyse paneler. */
body.appearance-blue .page-shell > .my-family-note {color:#cadccd;}

body.appearance-blue .history-results-head .eyebrow {color:#e1c58e;}

body.appearance-blue .history-results-head .muted {color:#cadccd;}

body.appearance-blue .site-presence-footer {color:#cbdccc;}

body.appearance-blue .site-presence-footer>small {color:#c3d3c5;}

body.appearance-blue .site-presence-footer {border-top-color:rgba(225,207,168,.25);}

body.appearance-blue .site-presence-footer .muted {color:#cad9cd;}

body.appearance-blue .page-shell .admin-shortcuts a {color:#295840;}

/* Dialoger og andre popovers bør fortsat bruge deres oprindelige lyse tema. */
body.appearance-blue :is(.search-dialog,.user-menu-popover,.profile-edit-dialog,.profile-portrait-menu) {color:#172b22;}

body.appearance-blue .flash {color:#1b2a22;}

/* Login, nulstilling og invitation bruger samme baggrund, men deres kort er lyst. */
body.appearance-blue.auth-body {background:
  radial-gradient(ellipse at 82% 60%,rgba(155,127,76,.13) 0%,transparent 58%),
  radial-gradient(ellipse at 14% 8%,#344b41 0%,#14271f 35%,#0d1714 78%);
  background-attachment:fixed;
}

body.appearance-blue .auth-card {color:#172b22;}



/* v59: slægtstræet dæmpes i mørkegrønt tema, så de lyse flader harmonerer bedre med baggrunden. */
body.appearance-blue .tree-canvas{
  background:
    linear-gradient(rgba(241,245,239,.82),rgba(241,245,239,.82)),
    radial-gradient(circle at center,rgba(67,102,84,.18) 1px,transparent 1.6px),
    linear-gradient(180deg,rgba(227,236,228,.92) 0%,rgba(234,240,234,.9) 100%);
  background-size:auto,24px 24px,auto;
  border:1px solid rgba(203,217,207,.58);
  box-shadow:0 16px 36px rgba(6,16,12,.18);
}

body.appearance-blue .tree-toolbar{border-bottom-color:rgba(103,128,114,.22);}

body.appearance-blue .tree-toolbar .tree-toolbar-copy small,
body.appearance-blue .tree-toolbar .tree-toolbar-copy span{color:#5f7269;}

body.appearance-blue .tree-depth-panel{
  border-color:rgba(183,199,189,.78);
  background:rgba(244,248,242,.78);
  box-shadow:0 6px 18px rgba(11,29,19,.07);
}

body.appearance-blue .tree-depth-control{
  background:rgba(250,252,249,.92);
  border-color:rgba(198,212,203,.92);
}

body.appearance-blue .tree-depth-control>button{
  background:#f0f5f1;
  border-color:#bed0c4;
}

body.appearance-blue .tree-depth-control>button:hover:not(:disabled){background:#e6efe9;border-color:#9eb7a8;}

body.appearance-blue .tree-visual-stack:before{
  background:linear-gradient(to bottom,transparent,rgba(114,142,126,.42) 4%,rgba(79,111,95,.58) 50%,rgba(114,142,126,.42) 96%,transparent);
}

body.appearance-blue .tree-generation-label{
  background:rgba(244,248,243,.88);
  color:#5e7067;
  box-shadow:0 2px 8px rgba(12,32,21,.06);
}

body.appearance-blue .tree-generation-label small{
  background:#dde8df;
  color:#234d39;
}

body.appearance-blue .tree-line,
body.appearance-blue .mobile-tree-connector{background:#789783;}

body.appearance-blue .tree-person,
body.appearance-blue .mobile-tree-person{
  background:linear-gradient(180deg,rgba(249,251,247,.96) 0%,rgba(241,246,239,.96) 100%);
  border-color:rgba(191,208,196,.92);
  box-shadow:0 8px 20px rgba(17,39,28,.08);
}

body.appearance-blue .tree-person a,
body.appearance-blue .mobile-tree-person a{
  background:linear-gradient(180deg,rgba(243,247,242,.95) 0%,rgba(234,241,235,.95) 100%);
  border-left-color:rgba(191,208,196,.88);
}

body.appearance-blue .tree-person.focus,
body.appearance-blue .mobile-tree-person.focus{
  box-shadow:0 0 0 3px rgba(35,89,62,.11),0 12px 26px rgba(16,43,30,.14);
}

body.appearance-blue .tree-person.verified,
body.appearance-blue .mobile-tree-person.verified{
  box-shadow:0 0 0 1px rgba(43,129,82,.08),0 10px 24px rgba(22,69,48,.12);
}

body.appearance-blue .mobile-tree-toolbar{border-bottom-color:rgba(104,128,115,.24);}

body.appearance-blue .mobile-tree-label{color:#365b49;}

body.appearance-blue .mobile-tree-label small,
body.appearance-blue .mobile-profile-link{background:#dde8e0;color:#214936;}

body.appearance-blue .mobile-tree-empty,
body.appearance-blue .mobile-tree-more-sections details{
  background:rgba(243,247,242,.84);
  border-color:rgba(191,208,196,.92);
}



/* v60 – samlet galleri-finpudsning: varm elfenben, roligere flader og gyldne detaljer.
   Alle regler er begrænset til galleri-temaet; det klassiske tema røres ikke. */
body.appearance-blue {
  --gallery-ivory:#f7f5ee;
  --gallery-ivory-light:#fdfbf5;
  --gallery-mist:#eaece3;
  --gallery-edge:#d8dbce;
  --gallery-ink:#213a2e;
  --gallery-muted:#617167;
  --gallery-gold:#bda274;
  --line:#d9dfd4;
  --soft:#edf1e8;
  --paper:#f7f5ee;
  --muted:#64756a;
  --shadow:0 12px 28px rgba(3,23,12,.12);
}

/* Store læseflader: varmt hvid fremfor blændende hvidt. */
body.appearance-blue .page-shell :is(
  .card,.loading-card,.people-card,.birthday-card,.profile-hero,
  .research-section,.research-tool-card,.research-hero-card,
  .history-hero,.history-category-card,.history-event-card,
  .period-stat,.period-nav-item,.period-person,.people-import-row,
  .people-page .family-directory-card,.family-kinship-overview,
  .timeline-relationship-card,.stat
){
  background-color:var(--gallery-ivory);
  border-color:var(--gallery-edge);
  box-shadow:0 7px 25px rgba(5,29,17,.1);
  color:var(--gallery-ink);
}

/* Nested kort skal være lidt lysere for at bevare hierarkiet. */
body.appearance-blue .page-shell :is(
  .person-card,.people-page .family-kinship-group,
  .family-kinship-list a,.people-page .family-directory-card .family-links a,
  .birthday-strip a,.birthday-calendar>div,.health-item,
  .timeline-relationship-card,.research-task-edit,
  .history-filters,.history-event-portraits,
  .period-person
){
  background-color:var(--gallery-ivory-light);
  border-color:var(--gallery-edge);
  color:var(--gallery-ink);
}

body.appearance-blue .page-shell .birthday-strip a,
body.appearance-blue .page-shell .birthday-calendar>div {background:#edf1e9;}

body.appearance-blue .page-shell .birthday-calendar>div {border:1px solid rgba(190,203,191,.6);}

/* Stille, varme kantlinjer og rolige overskrifter inden i kortene. */
body.appearance-blue .page-shell :is(.card,.people-card,.birthday-card,.profile-hero) h1,
body.appearance-blue .page-shell :is(.card,.people-card,.birthday-card,.profile-hero) h2,
body.appearance-blue .page-shell :is(.card,.people-card,.birthday-card,.profile-hero) h3 {color:#193c2c;}

body.appearance-blue .page-shell :is(.card,.people-card,.birthday-card,.profile-hero) .eyebrow {color:#55745b;}

body.appearance-blue .page-shell :is(.card,.people-card,.birthday-card,.profile-hero) .muted {color:var(--gallery-muted);}

/* Lidt færre knaldhvide knapper og søgefelter, men stadig tydelig kontrast. */
body.appearance-blue .page-shell .btn:not(.primary):not(.is-active),
body.appearance-blue .page-shell :is(.tree-depth-panel,.family-scope-switch,.people-switch) .btn:not(.primary):not(.is-active) {
  background:var(--gallery-ivory-light);
  border-color:#cbd8ca;
  color:#244e37;
}

body.appearance-blue .page-shell .btn:not(.primary):not(.is-active):hover {
  background:#edf2e9;
  border-color:#a8c0ab;
}

body.appearance-blue :is(.page-shell,.auth-card) :is(
  input:not([type=checkbox]):not([type=radio]),textarea,select
){
  background-color:#fffef9;
  border-color:#cbd8ca;
}

body.appearance-blue :is(.page-shell,.auth-card) :is(input,textarea,select):focus-visible,
body.appearance-blue .page-shell :is(a,button,summary):focus-visible {
  outline:2px solid #a98753;
  outline-offset:3px;
}

body.appearance-blue .page-shell :is(.search-field,.people-toolbar,.research-controls) input {background:transparent;}

/* Små familiegrupper og oversigter får en papiragtig, mindre klinisk flade. */
body.appearance-blue .page-shell .people-page .family-member-children {background:#eef1e9;}

body.appearance-blue .page-shell .people-page .family-member-block {border-color:#dce3d7;}

body.appearance-blue .page-shell .people-page .family-directory-card .family-links a:hover,
body.appearance-blue .page-shell .person-card:hover {background:#f0f4ec;border-color:#aac3aa;}

body.appearance-blue .page-shell .place-directory-page .place-directory-list>.card {
  background:#fbfaf4;
  border-color:var(--gallery-edge);
  box-shadow:0 4px 13px rgba(12,32,19,.045);
}

/* Ny, varmere bundfarve i selve træet: blød, ikke hvid. */
body.appearance-blue .tree-canvas {
  background:
    linear-gradient(rgba(229,233,224,.84),rgba(226,231,221,.88)),
    radial-gradient(circle at center,rgba(71,108,82,.2) 1px,transparent 1.6px),
    radial-gradient(ellipse at 80% 20%,#e7e4d6 0%,#d7e4d5 80%);
  background-size:auto,24px 24px,auto;
  border-color:#bfcdbf;
}

body.appearance-blue .tree-depth-panel {
  background:rgba(244,245,237,.81);
  border-color:#cad7c8;
}

body.appearance-blue .tree-depth-control {background:rgba(251,250,244,.96);border-color:#d0d9c9;}

body.appearance-blue .tree-generation-label {background:#f3f3e9;color:#536d5b;}

body.appearance-blue .tree-generation-label small {background:#e0e9dd;}

body.appearance-blue .tree-person,
body.appearance-blue .mobile-tree-person,
body.appearance-blue .relation-visual-stack .relation-tree-person {
  background:linear-gradient(160deg,#fdfbf4 0%,#f4f4ec 100%);
  border-color:#bed0c0;
  color:#1e3b2c;
}

body.appearance-blue .tree-person a,
body.appearance-blue .mobile-tree-person a {
  background:linear-gradient(180deg,#f4f5eb,#e8eee4);
  border-color:#cad9c9;
}

body.appearance-blue .tree-person .tree-place-value,
body.appearance-blue .mobile-tree-person .tree-place-value {color:#4a6355;}

body.appearance-blue .tree-person small.tree-years,
body.appearance-blue .mobile-tree-person small.tree-years {color:#607469;}

/* Fokus og dokumentation skal fortsat være synlig, ikke udvandet af temaet. */
body.appearance-blue .tree-page .tree-person.focus,
body.appearance-blue .tree-page .mobile-tree-person.focus {
  background:linear-gradient(160deg,#fffcf4 0%,#f4f5e9 100%);
}

/* Profil og redigering: varmt fotoalbum frem for hårde hvide paneler. */
body.appearance-blue .person-page .profile-hero {
  background:linear-gradient(130deg,#fbfaf2 0%,#ecf0e6 100%);
  border-color:#cbd8c8;
}

body.appearance-blue .page-shell .profile-section-nav,
body.appearance-blue .page-shell .profile-period-badges {border-color:#d6dfd2;}

body.appearance-blue .page-shell .timeline-relationship-card {
  background:linear-gradient(110deg,#f7f7ef,#fbfaf5);
}

body.appearance-blue .page-shell :is(.person-picker-results,.place-picker-results,.research-live-results) {
  background:#fffcf6;
  border-color:#d0dacd;
}

/* Skærmfrie hjælpetekster forbliver lyse på baggrunden. */
body.appearance-blue .page-shell > :is(.page-head,.section-head,.people-result-head,.family-directory-heading,.history-results-head,.period-summary) {
  text-shadow:0 1px 1px rgba(3,16,10,.07);
}

body.appearance-blue .page-shell > .people-result-head .muted,
body.appearance-blue .page-shell > .section-head .muted,
body.appearance-blue .page-shell > .family-directory-heading .muted {color:#cfdecf;}

/* Login og adminvalg bør have samme varme materialesprog. */
body.appearance-blue .auth-card {
  background:linear-gradient(155deg,#faf9f2,#f3f3e9);
  border-color:#cdd9cb;
  box-shadow:0 24px 55px rgba(0,12,8,.24);
}

body.appearance-blue .appearance-theme-option {background:#fbfaf4;border-color:#d1dcce;}

body.appearance-blue .appearance-theme-option:has(input:checked) {
  border-color:#517a5f;
  box-shadow:0 0 0 2px rgba(175,151,105,.22);
}

  body.appearance-blue .tree-canvas {background-color:#e1e8dd;}

  body.appearance-blue .page-shell .card {box-shadow:0 4px 17px rgba(5,29,17,.075);}


/* V61 – væggen anvender det varme mørkegrønne temas papirflader. */
body.appearance-blue .wall-feed-page .wall-feed-total{background:rgba(229,232,217,.94);border-color:#c9d4c6;color:#2c563c}

body.appearance-blue .wall-feed-page .wall-feed-comment{background:#eef1e7;border-left-color:#b7c8b4}

body.appearance-blue .wall-feed-page .wall-feed-post .wall-feed-person{border-bottom-color:#d8dfd2}

body.appearance-blue .wall-feed-page .wall-feed-post .wall-feed-person>a{color:#2e6044}

body.appearance-blue .wall-feed-page .wall-feed-post .wall-feed-reply textarea{background:#fffdf8}


/* Mobiltræet har en lys baggrund også i galleri-temaet. */
body.appearance-blue .page-shell .mobile-family-tree{color:#172b22;}

body.appearance-blue .mobile-nav .mobile-more>summary{color:#dce5d7;}

body.appearance-blue .mobile-nav .mobile-more>summary.active{color:#f0ce91;}

body.appearance-blue .mobile-nav .mobile-more-panel a{color:#172b22;}

body.appearance-blue .mobile-nav .mobile-more-panel a[aria-current="page"]{color:#174d3a;background:#edf3ef;}

/* Arvede galleriregler: red */
/* Familietavle – valgfrit mørkegrønt galleri (v58).
   Udelukkende aktiveret med serverens indstilling appearance_theme=gallery.
   Lyse indholdspaneler beholder deres eksisterende farver og læsbarhed. */
html.appearance-red {background:#0d1714;}

body.appearance-red {
  min-height:100vh;
  background:
    radial-gradient(ellipse at 82% 60%,rgba(155,127,76,.13) 0%,transparent 58%),
    radial-gradient(ellipse at 14% 8%,#344b41 0%,#14271f 35%,#0d1714 78%);
  background-attachment:fixed;
  color:#ebf2ec;
}

/* Navbar: samme afdæmpede grønne glasvirkning som portrætpauseskærmen. */
body.appearance-red .topbar {
  background:rgba(14,29,24,.90);
  border-bottom:1px solid rgba(222,204,156,.22);
  color:#f3f3e9;
  box-shadow:0 8px 26px rgba(5,14,10,.17);
  -webkit-backdrop-filter:blur(15px);backdrop-filter:blur(15px);
}

body.appearance-red .topbar .brand {color:#f7f1e2;}

body.appearance-red .topbar .brand-mark {background:#385d49;color:#f8efdb;box-shadow:inset 0 0 0 1px rgba(213,183,122,.32);}

body.appearance-red .topbar .nav-link {color:#d3e1d4;}

body.appearance-red .topbar .nav-link:hover {color:#fff;background:rgba(255,255,255,.055);}

body.appearance-red .topbar .nav-link.active {color:#eed5a1;border-color:#d7b879;}

body.appearance-red .topbar .search-open {color:#e1e6dd;background:rgba(234,246,233,.09);border-color:rgba(228,230,203,.21);}

body.appearance-red .topbar .search-open:hover {background:rgba(234,246,233,.16);}

body.appearance-red .topbar .user-menu-identity strong {color:#f7f5ec;}

body.appearance-red .topbar .user-menu-identity small,
body.appearance-red .topbar .user-menu-chevron {color:#baccbd;}

body.appearance-red .topbar .user-menu>summary:hover,
body.appearance-red .topbar .user-menu[open]>summary {background:rgba(255,255,255,.09);border-color:rgba(236,238,216,.19);}

body.appearance-red .topbar .user-menu-popover {color:#172b20;}



body.appearance-red .mobile-nav {background:rgba(15,33,26,.97);border-top:1px solid rgba(225,207,168,.28);box-shadow:0 -8px 23px rgba(0,0,0,.18);}

body.appearance-red .mobile-nav a,
body.appearance-red .mobile-nav button {color:#dce5d7;}

body.appearance-red .mobile-nav .active {color:#f0ce91;}

/* Hvid / elfenbensfarvet indhold skal have mørkt blæk, aldrig lys tekst. */
body.appearance-red .page-shell {color:#f1f4ee;}

body.appearance-red .page-shell :is(.card,.loading-card,.stat,.people-card,.birthday-card,.person-card,.period-stat,.period-nav-item,.period-person,.history-category-card,.history-event-card,.history-hero,.profile-hero,.tree-canvas,.tree-person,.family-kinship-group,.research-section,.people-import-row,.timeline-relationship-card,.person-picker-results,.research-finder,.research-live-results,.research-live-search,.research-tool-card,.research-hero-card) {color:#172b22;}

/* Lyse kort, som ikke altid bruger .card. */
body.appearance-red .page-shell :is(.people-card,.person-card,.period-stat,.period-nav-item,.period-person,.history-category-card,.history-event-card,.people-import-row,.tree-person) {background-color:#fff;}

body.appearance-red .page-shell .profile-hero {color:#172b22;}

body.appearance-red .page-shell .tree-canvas {color:#172b22;}

/* Sideoverskrifter, introer og statistiktekster står direkte på baggrunden. */
body.appearance-red .page-shell > .page-head h1,
body.appearance-red .page-shell > .page-head h2,
body.appearance-red .page-shell > .page-head strong,
body.appearance-red .page-shell > .page-head .eyebrow {color:#f5f1e6;}

body.appearance-red .page-shell > .page-head .eyebrow {color:#e1c58e;}

body.appearance-red .page-shell > .page-head .muted,
body.appearance-red .page-shell > .muted,
body.appearance-red .page-shell > .small-note,
body.appearance-red .page-shell > p.muted {color:#c6d9cc;}

body.appearance-red .page-shell > .page-head a:not(.btn) {color:#e5cf9d;}

/* Forms outside cards should still be readable. */
body.appearance-red .page-shell :is(input:not([type=checkbox]):not([type=radio]),textarea,select) {color:#172b22;}

body.appearance-red .page-shell .btn {color:#204b35;}

body.appearance-red .page-shell .btn.primary,
body.appearance-red .page-shell .btn.is-active,
body.appearance-red .page-shell .people-switch .btn.is-active,
body.appearance-red .page-shell .family-scope-switch .btn.is-active {color:#fff;}

/* Særlige frie sektionstitler uden selvstændig lys panelbaggrund. */
body.appearance-red .page-shell > :is(.section-head,.people-result-head,.family-directory-heading,.history-results-head,.period-summary),
body.appearance-red .page-shell > :is(.section-head,.people-result-head,.family-directory-heading,.history-results-head,.period-summary) .muted {color:#ebf2e9;}

body.appearance-red .page-shell > .period-summary p {color:#d5e4d5;}

/* Frie hjælpetekster og historiefiltre – de ligger uden for de lyse paneler. */
body.appearance-red .page-shell > .my-family-note {color:#cadccd;}

body.appearance-red .history-results-head .eyebrow {color:#e1c58e;}

body.appearance-red .history-results-head .muted {color:#cadccd;}

body.appearance-red .site-presence-footer {color:#cbdccc;}

body.appearance-red .site-presence-footer>small {color:#c3d3c5;}

body.appearance-red .site-presence-footer {border-top-color:rgba(225,207,168,.25);}

body.appearance-red .site-presence-footer .muted {color:#cad9cd;}

body.appearance-red .page-shell .admin-shortcuts a {color:#295840;}

/* Dialoger og andre popovers bør fortsat bruge deres oprindelige lyse tema. */
body.appearance-red :is(.search-dialog,.user-menu-popover,.profile-edit-dialog,.profile-portrait-menu) {color:#172b22;}

body.appearance-red .flash {color:#1b2a22;}

/* Login, nulstilling og invitation bruger samme baggrund, men deres kort er lyst. */
body.appearance-red.auth-body {background:
  radial-gradient(ellipse at 82% 60%,rgba(155,127,76,.13) 0%,transparent 58%),
  radial-gradient(ellipse at 14% 8%,#344b41 0%,#14271f 35%,#0d1714 78%);
  background-attachment:fixed;
}

body.appearance-red .auth-card {color:#172b22;}



/* v59: slægtstræet dæmpes i mørkegrønt tema, så de lyse flader harmonerer bedre med baggrunden. */
body.appearance-red .tree-canvas{
  background:
    linear-gradient(rgba(241,245,239,.82),rgba(241,245,239,.82)),
    radial-gradient(circle at center,rgba(67,102,84,.18) 1px,transparent 1.6px),
    linear-gradient(180deg,rgba(227,236,228,.92) 0%,rgba(234,240,234,.9) 100%);
  background-size:auto,24px 24px,auto;
  border:1px solid rgba(203,217,207,.58);
  box-shadow:0 16px 36px rgba(6,16,12,.18);
}

body.appearance-red .tree-toolbar{border-bottom-color:rgba(103,128,114,.22);}

body.appearance-red .tree-toolbar .tree-toolbar-copy small,
body.appearance-red .tree-toolbar .tree-toolbar-copy span{color:#5f7269;}

body.appearance-red .tree-depth-panel{
  border-color:rgba(183,199,189,.78);
  background:rgba(244,248,242,.78);
  box-shadow:0 6px 18px rgba(11,29,19,.07);
}

body.appearance-red .tree-depth-control{
  background:rgba(250,252,249,.92);
  border-color:rgba(198,212,203,.92);
}

body.appearance-red .tree-depth-control>button{
  background:#f0f5f1;
  border-color:#bed0c4;
}

body.appearance-red .tree-depth-control>button:hover:not(:disabled){background:#e6efe9;border-color:#9eb7a8;}

body.appearance-red .tree-visual-stack:before{
  background:linear-gradient(to bottom,transparent,rgba(114,142,126,.42) 4%,rgba(79,111,95,.58) 50%,rgba(114,142,126,.42) 96%,transparent);
}

body.appearance-red .tree-generation-label{
  background:rgba(244,248,243,.88);
  color:#5e7067;
  box-shadow:0 2px 8px rgba(12,32,21,.06);
}

body.appearance-red .tree-generation-label small{
  background:#dde8df;
  color:#234d39;
}

body.appearance-red .tree-line,
body.appearance-red .mobile-tree-connector{background:#789783;}

body.appearance-red .tree-person,
body.appearance-red .mobile-tree-person{
  background:linear-gradient(180deg,rgba(249,251,247,.96) 0%,rgba(241,246,239,.96) 100%);
  border-color:rgba(191,208,196,.92);
  box-shadow:0 8px 20px rgba(17,39,28,.08);
}

body.appearance-red .tree-person a,
body.appearance-red .mobile-tree-person a{
  background:linear-gradient(180deg,rgba(243,247,242,.95) 0%,rgba(234,241,235,.95) 100%);
  border-left-color:rgba(191,208,196,.88);
}

body.appearance-red .tree-person.focus,
body.appearance-red .mobile-tree-person.focus{
  box-shadow:0 0 0 3px rgba(35,89,62,.11),0 12px 26px rgba(16,43,30,.14);
}

body.appearance-red .tree-person.verified,
body.appearance-red .mobile-tree-person.verified{
  box-shadow:0 0 0 1px rgba(43,129,82,.08),0 10px 24px rgba(22,69,48,.12);
}

body.appearance-red .mobile-tree-toolbar{border-bottom-color:rgba(104,128,115,.24);}

body.appearance-red .mobile-tree-label{color:#365b49;}

body.appearance-red .mobile-tree-label small,
body.appearance-red .mobile-profile-link{background:#dde8e0;color:#214936;}

body.appearance-red .mobile-tree-empty,
body.appearance-red .mobile-tree-more-sections details{
  background:rgba(243,247,242,.84);
  border-color:rgba(191,208,196,.92);
}



/* v60 – samlet galleri-finpudsning: varm elfenben, roligere flader og gyldne detaljer.
   Alle regler er begrænset til galleri-temaet; det klassiske tema røres ikke. */
body.appearance-red {
  --gallery-ivory:#f7f5ee;
  --gallery-ivory-light:#fdfbf5;
  --gallery-mist:#eaece3;
  --gallery-edge:#d8dbce;
  --gallery-ink:#213a2e;
  --gallery-muted:#617167;
  --gallery-gold:#bda274;
  --line:#d9dfd4;
  --soft:#edf1e8;
  --paper:#f7f5ee;
  --muted:#64756a;
  --shadow:0 12px 28px rgba(3,23,12,.12);
}

/* Store læseflader: varmt hvid fremfor blændende hvidt. */
body.appearance-red .page-shell :is(
  .card,.loading-card,.people-card,.birthday-card,.profile-hero,
  .research-section,.research-tool-card,.research-hero-card,
  .history-hero,.history-category-card,.history-event-card,
  .period-stat,.period-nav-item,.period-person,.people-import-row,
  .people-page .family-directory-card,.family-kinship-overview,
  .timeline-relationship-card,.stat
){
  background-color:var(--gallery-ivory);
  border-color:var(--gallery-edge);
  box-shadow:0 7px 25px rgba(5,29,17,.1);
  color:var(--gallery-ink);
}

/* Nested kort skal være lidt lysere for at bevare hierarkiet. */
body.appearance-red .page-shell :is(
  .person-card,.people-page .family-kinship-group,
  .family-kinship-list a,.people-page .family-directory-card .family-links a,
  .birthday-strip a,.birthday-calendar>div,.health-item,
  .timeline-relationship-card,.research-task-edit,
  .history-filters,.history-event-portraits,
  .period-person
){
  background-color:var(--gallery-ivory-light);
  border-color:var(--gallery-edge);
  color:var(--gallery-ink);
}

body.appearance-red .page-shell .birthday-strip a,
body.appearance-red .page-shell .birthday-calendar>div {background:#edf1e9;}

body.appearance-red .page-shell .birthday-calendar>div {border:1px solid rgba(190,203,191,.6);}

/* Stille, varme kantlinjer og rolige overskrifter inden i kortene. */
body.appearance-red .page-shell :is(.card,.people-card,.birthday-card,.profile-hero) h1,
body.appearance-red .page-shell :is(.card,.people-card,.birthday-card,.profile-hero) h2,
body.appearance-red .page-shell :is(.card,.people-card,.birthday-card,.profile-hero) h3 {color:#193c2c;}

body.appearance-red .page-shell :is(.card,.people-card,.birthday-card,.profile-hero) .eyebrow {color:#55745b;}

body.appearance-red .page-shell :is(.card,.people-card,.birthday-card,.profile-hero) .muted {color:var(--gallery-muted);}

/* Lidt færre knaldhvide knapper og søgefelter, men stadig tydelig kontrast. */
body.appearance-red .page-shell .btn:not(.primary):not(.is-active),
body.appearance-red .page-shell :is(.tree-depth-panel,.family-scope-switch,.people-switch) .btn:not(.primary):not(.is-active) {
  background:var(--gallery-ivory-light);
  border-color:#cbd8ca;
  color:#244e37;
}

body.appearance-red .page-shell .btn:not(.primary):not(.is-active):hover {
  background:#edf2e9;
  border-color:#a8c0ab;
}

body.appearance-red :is(.page-shell,.auth-card) :is(
  input:not([type=checkbox]):not([type=radio]),textarea,select
){
  background-color:#fffef9;
  border-color:#cbd8ca;
}

body.appearance-red :is(.page-shell,.auth-card) :is(input,textarea,select):focus-visible,
body.appearance-red .page-shell :is(a,button,summary):focus-visible {
  outline:2px solid #a98753;
  outline-offset:3px;
}

body.appearance-red .page-shell :is(.search-field,.people-toolbar,.research-controls) input {background:transparent;}

/* Små familiegrupper og oversigter får en papiragtig, mindre klinisk flade. */
body.appearance-red .page-shell .people-page .family-member-children {background:#eef1e9;}

body.appearance-red .page-shell .people-page .family-member-block {border-color:#dce3d7;}

body.appearance-red .page-shell .people-page .family-directory-card .family-links a:hover,
body.appearance-red .page-shell .person-card:hover {background:#f0f4ec;border-color:#aac3aa;}

body.appearance-red .page-shell .place-directory-page .place-directory-list>.card {
  background:#fbfaf4;
  border-color:var(--gallery-edge);
  box-shadow:0 4px 13px rgba(12,32,19,.045);
}

/* Ny, varmere bundfarve i selve træet: blød, ikke hvid. */
body.appearance-red .tree-canvas {
  background:
    linear-gradient(rgba(229,233,224,.84),rgba(226,231,221,.88)),
    radial-gradient(circle at center,rgba(71,108,82,.2) 1px,transparent 1.6px),
    radial-gradient(ellipse at 80% 20%,#e7e4d6 0%,#d7e4d5 80%);
  background-size:auto,24px 24px,auto;
  border-color:#bfcdbf;
}

body.appearance-red .tree-depth-panel {
  background:rgba(244,245,237,.81);
  border-color:#cad7c8;
}

body.appearance-red .tree-depth-control {background:rgba(251,250,244,.96);border-color:#d0d9c9;}

body.appearance-red .tree-generation-label {background:#f3f3e9;color:#536d5b;}

body.appearance-red .tree-generation-label small {background:#e0e9dd;}

body.appearance-red .tree-person,
body.appearance-red .mobile-tree-person,
body.appearance-red .relation-visual-stack .relation-tree-person {
  background:linear-gradient(160deg,#fdfbf4 0%,#f4f4ec 100%);
  border-color:#bed0c0;
  color:#1e3b2c;
}

body.appearance-red .tree-person a,
body.appearance-red .mobile-tree-person a {
  background:linear-gradient(180deg,#f4f5eb,#e8eee4);
  border-color:#cad9c9;
}

body.appearance-red .tree-person .tree-place-value,
body.appearance-red .mobile-tree-person .tree-place-value {color:#4a6355;}

body.appearance-red .tree-person small.tree-years,
body.appearance-red .mobile-tree-person small.tree-years {color:#607469;}

/* Fokus og dokumentation skal fortsat være synlig, ikke udvandet af temaet. */
body.appearance-red .tree-page .tree-person.focus,
body.appearance-red .tree-page .mobile-tree-person.focus {
  background:linear-gradient(160deg,#fffcf4 0%,#f4f5e9 100%);
}

/* Profil og redigering: varmt fotoalbum frem for hårde hvide paneler. */
body.appearance-red .person-page .profile-hero {
  background:linear-gradient(130deg,#fbfaf2 0%,#ecf0e6 100%);
  border-color:#cbd8c8;
}

body.appearance-red .page-shell .profile-section-nav,
body.appearance-red .page-shell .profile-period-badges {border-color:#d6dfd2;}

body.appearance-red .page-shell .timeline-relationship-card {
  background:linear-gradient(110deg,#f7f7ef,#fbfaf5);
}

body.appearance-red .page-shell :is(.person-picker-results,.place-picker-results,.research-live-results) {
  background:#fffcf6;
  border-color:#d0dacd;
}

/* Skærmfrie hjælpetekster forbliver lyse på baggrunden. */
body.appearance-red .page-shell > :is(.page-head,.section-head,.people-result-head,.family-directory-heading,.history-results-head,.period-summary) {
  text-shadow:0 1px 1px rgba(3,16,10,.07);
}

body.appearance-red .page-shell > .people-result-head .muted,
body.appearance-red .page-shell > .section-head .muted,
body.appearance-red .page-shell > .family-directory-heading .muted {color:#cfdecf;}

/* Login og adminvalg bør have samme varme materialesprog. */
body.appearance-red .auth-card {
  background:linear-gradient(155deg,#faf9f2,#f3f3e9);
  border-color:#cdd9cb;
  box-shadow:0 24px 55px rgba(0,12,8,.24);
}

body.appearance-red .appearance-theme-option {background:#fbfaf4;border-color:#d1dcce;}

body.appearance-red .appearance-theme-option:has(input:checked) {
  border-color:#517a5f;
  box-shadow:0 0 0 2px rgba(175,151,105,.22);
}

  body.appearance-red .tree-canvas {background-color:#e1e8dd;}

  body.appearance-red .page-shell .card {box-shadow:0 4px 17px rgba(5,29,17,.075);}


/* V61 – væggen anvender det varme mørkegrønne temas papirflader. */
body.appearance-red .wall-feed-page .wall-feed-total{background:rgba(229,232,217,.94);border-color:#c9d4c6;color:#2c563c}

body.appearance-red .wall-feed-page .wall-feed-comment{background:#eef1e7;border-left-color:#b7c8b4}

body.appearance-red .wall-feed-page .wall-feed-post .wall-feed-person{border-bottom-color:#d8dfd2}

body.appearance-red .wall-feed-page .wall-feed-post .wall-feed-person>a{color:#2e6044}

body.appearance-red .wall-feed-page .wall-feed-post .wall-feed-reply textarea{background:#fffdf8}


/* Mobiltræet har en lys baggrund også i galleri-temaet. */
body.appearance-red .page-shell .mobile-family-tree{color:#172b22;}

body.appearance-red .mobile-nav .mobile-more>summary{color:#dce5d7;}

body.appearance-red .mobile-nav .mobile-more>summary.active{color:#f0ce91;}

body.appearance-red .mobile-nav .mobile-more-panel a{color:#172b22;}

body.appearance-red .mobile-nav .mobile-more-panel a[aria-current="page"]{color:#174d3a;background:#edf3ef;}

body.appearance-blue{background:radial-gradient(ellipse at 80% 58%,rgba(116,151,206,.14),transparent 58%),radial-gradient(ellipse at 14% 8%,#354e72 0%,#182b48 36%,#0c1628 78%);background-attachment:fixed}
body.appearance-red{background:radial-gradient(ellipse at 80% 58%,rgba(209,141,120,.13),transparent 58%),radial-gradient(ellipse at 14% 8%,#653b43 0%,#39202a 36%,#1d1019 78%);background-attachment:fixed}
body.appearance-blue .topbar{background:rgba(17,31,53,.93)}
body.appearance-red .topbar{background:rgba(54,24,33,.93)}
body.appearance-blue .mobile-nav{background:rgba(17,31,53,.97)}
body.appearance-red .mobile-nav{background:rgba(54,24,33,.97)}
