:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #18251f;
  background: #f5f3ed;
}

* { box-sizing: border-box; }
body { margin: 0; }
.page { width: min(760px, calc(100% - 40px)); margin: 8vh auto; }
.page.wide { width: min(1000px, calc(100% - 40px)); }
.site-header { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: end; }
.eyebrow { margin: 0 0 10px; color: #486454; font-size: .88rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 0 0 28px; font-size: clamp(2rem, 7vw, 3.3rem); line-height: 1.05; }
.status { padding: 24px; border: 1px solid; border-radius: 14px; }
.status h2 { margin: 0 0 8px; font-size: 1.25rem; }
.status p { margin: 0; line-height: 1.5; }
.success { color: #17452c; background: #e5f2e7; border-color: #a7cdb0; }
.error { color: #70281e; background: #fae8e4; border-color: #e5b4aa; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 20px; }
.stats article { display: grid; gap: 4px; padding: 18px; background: #fff; border: 1px solid #dedbd2; border-radius: 12px; }
.stats strong { font-size: 2rem; }
.stats span { color: #57645b; font-size: .9rem; }
.next { margin-top: 26px; color: #57645b; }
code { padding: .1em .35em; background: rgb(255 255 255 / .55); border-radius: 4px; }
.button { display: inline-block; padding: .7rem 1rem; border: 0; border-radius: 8px; color: #fff; background: #1c6d43; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
.button:hover { background: #145735; }.button.secondary { color: #1c6d43; background: #e8eee9; }
.panel { margin: 20px 0; padding: 24px; background: #fff; border: 1px solid #dedbd2; border-radius: 14px; }.panel h2 { margin: 0 0 8px; }
.help, .muted { color: #57645b; }.notice { margin: 20px 0; padding: 14px 18px; border-radius: 10px; }.notice.success { color: #17452c; background: #e5f2e7; }.notice.error { color: #70281e; background: #fae8e4; }.notice ul { margin: .5rem 0 0; }
form { display: grid; gap: 18px; margin-top: 20px; }.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }label { display: grid; gap: 6px; font-weight: 650; }input, select, textarea { width: 100%; padding: .65rem .7rem; border: 1px solid #bfc8c1; border-radius: 7px; background: #fff; color: inherit; font: inherit; font-weight: 400; }textarea { resize: vertical; }
.table-wrap { overflow-x: auto; }table { width: 100%; border-collapse: collapse; }th, td { padding: .75rem; border-bottom: 1px solid #e4e1d9; text-align: left; }th { color: #57645b; font-size: .88rem; }
td a, .next a { color: #125e38; font-weight: 650; }
.place-picker { display: grid; gap: 6px; }.place-results { display: grid; gap: 4px; max-height: 230px; overflow-y: auto; }.place-result { padding: .5rem .6rem; border: 1px solid #d6ddd7; border-radius: 6px; background: #f7faf7; color: #1d3b2b; font: inherit; text-align: left; cursor: pointer; }.place-result:hover { background: #e4f0e6; }
.attribution { margin-top: 42px; color: #6b766e; font-size: .78rem; }
.danger-zone { margin-top: 28px; padding-top: 20px; border-top: 1px solid #e5c6c0; }.button.danger { background: #a03528; }.button.danger:hover { background: #7e261d; }
.inline-form { display: inline; margin: 0; }.text-button { padding: 0; border: 0; color: #a03528; background: none; font: inherit; font-weight: 650; text-decoration: underline; cursor: pointer; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-top: 20px; }.photo-card { display: grid; gap: 8px; margin: 0; }.photo-card img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border: 1px solid #dedbd2; border-radius: 8px; }.photo-card figcaption { color: #607067; font-size: .9rem; }
.search-form .actions, .tree-controls { align-items: center; margin-top: 0; }.tree-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }.tree-controls .button { min-width: 48px; }
.tree-options { display: flex; flex-wrap: wrap; gap: 14px 22px; margin: 0; padding: 12px 0 0; border: 0; }.tree-options legend { padding: 0; font-weight: 650; }.tree-options label { display: flex; align-items: center; gap: 7px; font-weight: 400; }.tree-options input[type="checkbox"] { width: auto; }
.family-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 28px; }.family-grid h3 { margin-bottom: 8px; font-size: 1rem; }.record-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }.record-list li { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid #ece9e1; }
.tree-wrap { min-height: 220px; overflow: auto; padding: 12px; border: 1px solid #dedbd2; border-radius: 10px; background: #fbfcfa; }.tree-wrap svg { display: block; min-width: 680px; width: 100%; }.tree-link, .tree-adoptive, .tree-union { fill: none; stroke-linecap: round; stroke-linejoin: round; }.tree-link { stroke: #4c8061; stroke-width: 2.5; }.tree-adoptive { stroke: #4c8061; stroke-width: 2.5; stroke-dasharray: 8 5; }.tree-union { stroke: #896c3c; stroke-width: 2.5; stroke-dasharray: 7 5; }.tree-node { cursor: pointer; }.tree-node rect { fill: #fff; stroke: #8db59a; stroke-width: 1.5; }.tree-node:hover rect { fill: #e5f2e7; }.tree-node text { fill: #1a3023; font: 14px system-ui, sans-serif; }.tree-node .tree-sub { fill: #607067; font-size: 11px; }
.stats-summary { margin: 0 0 20px; }.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }.bar-list { display: grid; gap: 12px; margin-top: 18px; }.bar-row { display: grid; grid-template-columns: minmax(90px, 1.2fr) minmax(90px, 2fr) auto; align-items: center; gap: 10px; }.bar-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.bar-track { height: 10px; overflow: hidden; border-radius: 999px; background: #e8eee9; }.bar-track i { display: block; height: 100%; min-width: 4px; border-radius: inherit; background: #4c8061; }.bar-row strong { font-size: .9rem; }.map-canvas { height: min(66vh, 620px); min-height: 360px; margin-top: 18px; border: 1px solid #dedbd2; border-radius: 10px; }
.login-page { width: min(520px, calc(100% - 40px)); }.user-actions { display: grid; gap: 8px; }.user-reset { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }.user-reset input { width: min(190px, 100%); padding: .35rem .5rem; }
.read-only form[method="post"] { display: none; }

/* Diseño de navegación y superficies compartidas */
body { min-height: 100vh; background: radial-gradient(circle at top left, #eff5ef 0, transparent 38rem), #f7f5f0; }
.app-topbar { position: sticky; z-index: 20; top: 0; border-bottom: 1px solid rgb(28 70 46 / .12); background: rgb(250 249 245 / .92); backdrop-filter: blur(14px); }
.topbar-inner { display: flex; align-items: center; gap: 24px; width: min(1240px, calc(100% - 40px)); min-height: 70px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #173d2a; font-weight: 780; letter-spacing: -.02em; text-decoration: none; white-space: nowrap; }
.brand-mark, .user-avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #fff; background: linear-gradient(145deg, #1b7447, #164f34); font-size: .88rem; font-weight: 800; }
.main-nav { display: flex; align-items: center; gap: 3px; margin-right: auto; overflow-x: auto; }
.main-nav a { padding: .48rem .66rem; border-radius: 7px; color: #53675b; font-size: .92rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
.main-nav a:hover, .main-nav a.is-active { color: #165e38; background: #e7f0e8; }
.account-nav { display: flex; align-items: center; margin-left: auto; }
.top-login { padding: .48rem .75rem; border: 1px solid #bcd1c1; border-radius: 8px; color: #155f38; font-weight: 700; text-decoration: none; }
.user-menu { position: relative; }.user-menu summary { display: flex; align-items: center; gap: 8px; list-style: none; color: #214532; font-size: .9rem; font-weight: 700; cursor: pointer; }.user-menu summary::-webkit-details-marker { display: none; }.user-avatar { width: 28px; height: 28px; border-radius: 50%; font-size: .75rem; }.user-menu-panel { position: absolute; top: calc(100% + 10px); right: 0; display: grid; min-width: 180px; overflow: hidden; border: 1px solid #d9e2da; border-radius: 10px; background: #fff; box-shadow: 0 12px 35px rgb(23 61 42 / .16); }.user-menu-panel a { padding: .75rem .9rem; color: #244634; text-decoration: none; }.user-menu-panel a:hover { background: #eef5ef; }
.page { margin: 42px auto 72px; }.page-heading { margin: 0 0 30px; }.page-heading h1 { margin-bottom: 10px; }.page-heading p:not(.eyebrow) { max-width: 680px; margin: 0; color: #5e6c63; font-size: 1.08rem; line-height: 1.5; }.page-heading.compact { margin-bottom: 24px; }.page-heading.compact h1 { font-size: clamp(2rem, 5vw, 3rem); }
.panel { box-shadow: 0 8px 28px rgb(26 48 35 / .035); }.stats-home { gap: 16px; margin: 0 0 20px; }.stats-home article { min-height: 130px; padding: 23px; border: 0; box-shadow: 0 8px 26px rgb(29 64 43 / .07); }.stats-home strong { color: #155f38; font-size: clamp(2rem, 5vw, 2.75rem); letter-spacing: -.05em; }.welcome-panel { display: grid; gap: 10px; padding: 28px; background: linear-gradient(135deg, #183f2b, #276a45); color: #fff; border: 0; }.welcome-panel h2 { margin: 0; }.welcome-panel .help { color: #dceee0; }.welcome-panel .button { background: #fff; color: #185d38; }.welcome-panel .button.secondary { background: rgb(255 255 255 / .16); color: #fff; }
.button { box-shadow: 0 2px 4px rgb(15 55 32 / .12); transition: transform .15s ease, background .15s ease; }.button:hover { transform: translateY(-1px); }.notice:not(.success):not(.error) { color: #355446; background: #e7f0e8; }
@media (max-width: 780px) { .topbar-inner { width: min(100% - 24px, 1240px); gap: 12px; min-height: 62px; }.brand > span:last-child { display: none; }.main-nav { gap: 0; }.main-nav a { padding: .45rem .55rem; font-size: .85rem; }.user-menu summary { font-size: 0; }.page { width: min(100% - 28px, 1000px); margin-top: 28px; }.page-heading p:not(.eyebrow) { font-size: 1rem; }.stats-home { grid-template-columns: repeat(2, 1fr); }.stats-home article { min-height: 105px; padding: 17px; } }

/* Variante editorial: contraste, color y ritmo visual */
:root { color: #172b2a; background: #f5eee3; }
body { background: radial-gradient(circle at 8% 4%, rgb(244 178 113 / .30), transparent 27rem), radial-gradient(circle at 94% 12%, rgb(122 181 159 / .25), transparent 32rem), #f7f0e6; }
.app-topbar { border-bottom: 1px solid rgb(255 255 255 / .12); background: linear-gradient(105deg, #102f32, #164b43 54%, #542d4a); backdrop-filter: none; box-shadow: 0 5px 22px rgb(23 31 31 / .18); }
.brand { color: #fff5e8; font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; letter-spacing: .01em; }.brand-mark, .user-avatar { color: #2d2630; background: linear-gradient(145deg, #f7be75, #e67b70); box-shadow: 0 3px 10px rgb(0 0 0 / .22); }
.main-nav a { color: rgb(255 246 235 / .78); }.main-nav a:hover, .main-nav a.is-active { color: #fff; background: rgb(255 255 255 / .16); }.top-login { border-color: rgb(255 255 255 / .42); color: #fff8ef; }.user-menu summary { color: #fff7ed; }.user-menu-panel { border: 0; box-shadow: 0 18px 42px rgb(20 30 29 / .30); }.user-menu-panel a:hover { background: #f8e5cb; }
.page-heading { position: relative; overflow: hidden; padding: clamp(26px, 5vw, 48px); border-radius: 24px; color: #fff8ec; background: linear-gradient(122deg, #133b3c, #256450 57%, #743a58); box-shadow: 0 20px 46px rgb(51 44 38 / .18); }.page-heading::after { position: absolute; right: -44px; bottom: -95px; width: 285px; height: 285px; border: 1px solid rgb(255 239 212 / .42); border-radius: 50%; box-shadow: -42px -14px 0 -1px rgb(255 239 212 / .16), -84px -29px 0 -2px rgb(255 239 212 / .10); content: ""; }.page-heading .eyebrow { color: #ffc98c; }.page-heading h1 { position: relative; z-index: 1; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.5rem, 7vw, 4.3rem); letter-spacing: -.045em; }.page-heading p:not(.eyebrow) { position: relative; z-index: 1; color: #f3e6da; }.page-heading.compact { padding: 27px 32px; }.page-heading.compact h1 { font-size: clamp(2.1rem, 5vw, 3.35rem); }
.panel { border: 1px solid rgb(91 61 45 / .12); border-radius: 18px; background: rgb(255 252 247 / .9); box-shadow: 0 10px 30px rgb(69 55 42 / .08); }.panel h2 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -.02em; }.stats-home article { position: relative; overflow: hidden; border-radius: 18px; background: #fffaf3; }.stats-home article::before { position: absolute; top: 0; left: 0; width: 100%; height: 6px; content: ""; background: #e7826f; }.stats-home article:nth-child(2)::before { background: #5f9f85; }.stats-home article:nth-child(3)::before { background: #d8a13e; }.stats-home article:nth-child(4)::before { background: #794d75; }.stats-home strong { color: #173e3b; }
.welcome-panel { border-radius: 20px; background: linear-gradient(118deg, #8c4058, #a95354 43%, #d17c4e); box-shadow: 0 17px 36px rgb(108 48 57 / .22); }.welcome-panel .button { border-radius: 999px; }.welcome-panel .button.secondary { border: 1px solid rgb(255 255 255 / .48); }
.button { border-radius: 999px; background: #1c6959; box-shadow: 0 4px 10px rgb(20 67 54 / .20); }.button:hover { background: #145444; }.button.secondary { color: #294940; background: #e7ede4; }.tree-wrap { border-radius: 16px; background: #fffdfa; }.tree-node rect { fill: #fffdf9; stroke: #78a88d; }.tree-node:hover rect { fill: #f5ead8; }
.place-picker { align-content: start; }.place-picker [data-person-selected], .place-picker [data-place-selected] { display: none; }.place-picker .place-results:empty { display: none; }.person-heading { display: flex; align-items: stretch; justify-content: space-between; gap: 24px; padding-right: 0; }.person-heading > div { display: grid; align-content: center; min-width: 0; padding: 0 0 0 clamp(0px, 2vw, 12px); }.person-heading .heading-photo { width: clamp(128px, 19vw, 210px); min-height: 142px; object-fit: cover; object-position: center; border-radius: 0 22px 22px 0; box-shadow: -12px 0 28px rgb(0 0 0 / .16); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; clip-path: inset(50%); }
table [data-sort] { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; color: inherit; background: transparent; font: inherit; font-weight: 750; cursor: pointer; }table [data-sort]::after { content: '↕'; color: #a46a55; font-size: .82em; }table [data-sort][data-direction="asc"]::after { content: '↑'; }table [data-sort][data-direction="desc"]::after { content: '↓'; }.column-chooser { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 16px; padding: 13px 16px; border: 1px dashed #d6bca7; border-radius: 12px; background: #fff7ed; }.column-chooser label { display: flex; align-items: center; gap: 5px; font-size: .88rem; font-weight: 650; }.column-chooser input { width: auto; }.person-table [hidden] { display: none; }
@media (max-width: 540px) { .person-heading .heading-photo { width: 108px; min-height: 126px; }.person-heading { gap: 8px; }.person-heading h1 { font-size: 2rem; } }
input, select, textarea { border-color: #d7c8b8; background: #fffdfa; }.bar-track { background: #eee1d1; }.bar-track i { background: linear-gradient(90deg, #216853, #d27d50); }
@media (max-width: 540px) { .family-grid, .stats-grid { grid-template-columns: 1fr; } }
@media (max-width: 540px) { .stats, .form-grid { grid-template-columns: repeat(2, 1fr); }.site-header { display: grid; }.form-grid { grid-template-columns: 1fr; } }
@media print { @page { size: landscape; margin: 10mm; } body { background: #fff; }.site-header, .panel:not([data-tree-export]), .tree-controls { display: none !important; }.page.wide { width: 100%; margin: 0; }.panel[data-tree-export] { margin: 0; padding: 0; border: 0; }.tree-wrap { overflow: visible; padding: 0; border: 0; }.tree-wrap svg { width: 100% !important; min-width: 0; }.tree-node { cursor: default; } }

/* Lectura del árbol: la rama biológica puede resaltarse a voluntad. */
.tree-node .tree-name { font-size: 17px; font-weight: 700; }
.tree-node .tree-sex { fill: #356d4b; font: 16px system-ui, sans-serif; }
.tree-node rect.tree-biological { fill: #eff7f0; }
.tree-shade-control { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; color: #40594b; font-size: .9rem; font-weight: 650; }
.tree-shade-control input { width: auto; }
.person-tree-link { align-self: start; width: fit-content; margin-top: 6px; text-decoration: none; }
.document-list { display: grid; gap: 14px; margin-top: 18px; }.document-card { display: grid; gap: 10px; padding: 16px; border: 1px solid #e4d5c5; border-radius: 12px; background: #fffaf4; }.document-card h3 { margin: 0; }.document-card p { margin: 0; }.document-link-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }.document-link-form .place-picker { flex: 1 1 250px; }.document-link-form .button { min-height: 40px; }
.edit-records { display: grid; gap: 10px; }.edit-records details { padding: 12px 14px; border: 1px solid #ead8c7; border-radius: 11px; background: #fffaf4; }.edit-records summary { color: #245443; font-weight: 700; cursor: pointer; }.edit-grid, .edit-inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; margin-top: 14px; }.edit-inline { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }.edit-grid .full { grid-column: 1 / -1; }.edit-grid .place-picker { align-content: end; }.edit-grid .button, .edit-inline .button { width: fit-content; min-height: 40px; }
.icon-action { display: inline-grid; width: 28px; height: 28px; place-items: center; margin-right: 6px; padding: 0; border: 1px solid #c7d9cb; border-radius: 8px; color: #1c6959; background: #f2f7f1; font: 700 1.1rem/1 system-ui, sans-serif; cursor: pointer; }.icon-action:hover { color: #fff; background: #1c6959; }.record-list .icon-action { float: right; margin-left: 8px; }.photo-card .icon-action { position: absolute; top: 8px; right: 8px; margin: 0; }.photo-card { position: relative; }.document-card > .icon-action { position: absolute; top: 12px; right: 12px; }.document-card { position: relative; }
.icon-action.delete-action { color: #9f392d; border-color: #e5c3bd; background: #fff3f0; text-decoration: none; }.icon-action.delete-action:hover { background: #9f392d; }
.person-heading .person-id { margin: 0; color: #ffe1bd; font-size: .82rem; font-weight: 650; letter-spacing: .04em; }
