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

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { color: #1f2933; background: #d9e1e5; }

.map-background { position: fixed; inset: 0; z-index: 0; }
.map-shade { position: fixed; inset: 0; z-index: 400; pointer-events: none; background: rgba(16, 24, 32, .18); }
.page-layer { position: relative; z-index: 500; min-height: 100%; display: flex; padding: 5.75rem 1rem 1rem; pointer-events: none; }
.page-layer--home { align-items: flex-start; justify-content: space-between; gap: 1rem; }
.page-layer--center { align-items: center; justify-content: flex-start; }
.panel { width: min(100%, 27rem); padding: 1.5rem; background: rgba(255, 255, 255, .94); border: 1px solid rgba(255, 255, 255, .8); border-radius: .75rem; box-shadow: 0 .5rem 2rem rgba(0, 0, 0, .22); pointer-events: auto; }
.brand { margin: 0; font-size: clamp(2rem, 8vw, 3.5rem); line-height: 1; letter-spacing: .04em; }
.tagline { margin: .45rem 0 1.5rem; font-weight: 600; }
.status { margin-block: 1rem; }
.field { margin-block: 1rem; }
.field label { display: inline-block; margin-bottom: .35rem; font-weight: 600; }
.field-label { display: block; margin-bottom: .35rem; font-weight: 600; }
.field input { width: 100%; min-height: 2.75rem; padding: .65rem .75rem; border: 1px solid #65737e; border-radius: .35rem; font: inherit; }
.field input:focus, .button:focus, .link-button:focus { outline: .2rem solid #111; outline-offset: .15rem; }
.button, .link-button { display: inline-block; min-height: 2.75rem; padding: .7rem 1rem; border: 1px solid #1f2933; border-radius: .35rem; background: #fff; color: #1f2933; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.button--primary { background: #1f2933; color: #fff; }
.button--danger { border-color: #8b1e1e; background: #8b1e1e; color: #fff; }
.danger-zone { margin-top: 2rem; padding-top: 1rem; border-top: 2px solid #8b1e1e; }
.panel--legal { width: min(100%, 52rem); }
.legal-index { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: 2rem; }
.legal-section { scroll-margin-top: 9rem; margin-top: 2rem; padding-top: .5rem; border-top: 1px solid rgba(31,41,51,.25); }
.site-footer { position: fixed; right: 1rem; bottom: .75rem; z-index: 650; padding: .35rem .55rem; border-radius: .35rem; background: rgba(255,255,255,.94); font-size: .78rem; }
.site-footer a, .home-information-link a { color: inherit; }
.button:disabled { border-color: #9aa5b1; background: #d9e1e5; color: #65737e; cursor: not-allowed; box-shadow: none; }
.capture-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.capture-photo-button { margin-bottom: 0; }
.capture-step { min-width: 0; margin: 1rem 0; padding: 1rem; border: 1px solid rgba(31,41,51,.3); border-radius: .55rem; background: rgba(255,255,255,.72); }
.capture-step legend { padding-inline: .4rem; font-weight: 800; }
.capture-step:disabled { opacity: .5; background: #eef1f3; }
.capture-step:disabled .button { cursor: not-allowed; }
.error { padding: .75rem; border: 2px solid #8b1e1e; background: #fff; }
.inline-form { display: inline; }
.friend-search { margin-block: 1rem; }
.friend-search > label { display: block; margin-bottom: .35rem; font-weight: 600; }
.friend-search__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: .4rem; }
.friend-search__row input { width: 100%; min-width: 0; min-height: 2.75rem; padding: .65rem .75rem; border: 1px solid #65737e; border-radius: .35rem; font: inherit; }
.friend-search__button { display: grid; width: 2.75rem; padding: .65rem; place-items: center; }
.friend-search__button svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.friend-list { display: grid; gap: .4rem; }
.friend-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .75rem; min-height: 2.75rem; padding: .35rem .45rem .35rem .7rem; border: 1px solid rgba(31,41,51,.22); border-radius: .4rem; background: #fff; }
.friend-row__name { overflow-wrap: anywhere; color: inherit; font-weight: 700; }
.friend-row__actions { display: flex; align-items: center; gap: .35rem; }
.friend-row__actions form { margin: 0; }
.friend-action { display: grid; width: 2.15rem; min-height: 2.15rem; padding: .42rem; place-items: center; }
.friend-action svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.friend-action--block { border-color: #8b1e1e; color: #8b1e1e; }
.invitation-result { margin-block: 1rem; padding-block: 1rem; border-block: 1px solid #65737e; }
.invitation-result code { overflow-wrap: anywhere; }
.administrator-grant { margin-block: 1.25rem; padding: 1rem; border: 1px solid rgba(31,41,51,.3); border-radius: .5rem; }
.administrator-grant legend { padding-inline: .35rem; font-weight: 800; }
.invitation-qr { width: 220px; min-height: 220px; margin-top: 1rem; padding: 10px; background: #fff; }
.invitation-qr img, .invitation-qr canvas { display: block; max-width: 100%; height: auto; }
.avatar { display: block; width: 8rem; height: 8rem; margin: 0 auto 1rem; border-radius: 50%; object-fit: cover; }
.language-selector { margin-bottom: 1rem; text-align: right; }
.language-selector a { color: inherit; }
.field select { width: 100%; min-height: 2.75rem; padding: .65rem .75rem; border: 1px solid #65737e; border-radius: .35rem; background: #fff; font: inherit; }
.field textarea { width: 100%; min-height: 7rem; padding: .65rem .75rem; border: 1px solid #65737e; border-radius: .35rem; font: inherit; resize: vertical; }
.leaflet-control-attribution { font-size: .7rem; }
.tree-map-marker { display: grid; place-items: center; border: 2px solid #fff; border-radius: 50% 50% 50% 0; background: #fff; box-shadow: 0 .2rem .65rem rgba(0,0,0,.45); transform: rotate(-45deg); }
.tree-map-marker img { width: 27px; height: 27px; transform: rotate(45deg); }
.tree-map-cluster { position: relative; border-radius: 48% 48% 45% 45%; background: #e3eee3; transform: none; }
.tree-map-cluster__forest { position: absolute; inset: 3px 5px 5px; }
.tree-map-cluster .tree-map-cluster__forest img { position: absolute; width: 24px; height: 24px; transform: none; }
.tree-map-cluster__forest img:nth-child(1) { left: 0; bottom: 0; }
.tree-map-cluster__forest img:nth-child(2) { left: 13px; top: 0; }
.tree-map-cluster__forest img:nth-child(3) { right: 0; bottom: 0; }
.tree-map-cluster > strong { position: absolute; right: -7px; top: -8px; display: grid; min-width: 1.35rem; height: 1.35rem; padding-inline: .25rem; place-items: center; border: 2px solid #fff; border-radius: 1rem; background: #1f2933; color: #fff; font-size: .7rem; line-height: 1; }
.tree-map-popup { min-width: 9rem; text-align: center; }
.tree-map-popup img { display: block; width: 9rem; height: 7rem; margin: 0 auto .5rem; border-radius: .3rem; object-fit: cover; }
.tree-map-popup a { color: inherit; font-weight: 700; }
.site-header { position: fixed; inset: 0 0 auto; z-index: 700; min-height: 4.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem 1rem; background: rgba(255,255,255,.96); border-bottom: 1px solid rgba(31,41,51,.2); box-shadow: 0 .15rem .7rem rgba(0,0,0,.12); }
.site-identity { display: flex; align-items: center; gap: .7rem; color: inherit; text-decoration: none; }
.site-logo { width: 2.4rem; height: 2.4rem; }
.site-identity strong, .site-identity small { display: block; }
.site-identity strong { font-size: 1.05rem; letter-spacing: .04em; }
.site-identity small { margin-top: .1rem; font-size: .72rem; }
.main-navigation { display: flex; align-items: center; justify-content: center; gap: .35rem; margin-inline: auto; }
.main-navigation a { display: block; padding: .65rem .85rem; border: 1px solid rgba(31,41,51,.4); border-radius: .35rem; background: #fff; box-shadow: 0 .1rem .2rem rgba(0,0,0,.12); color: inherit; font-weight: 700; text-decoration: none; white-space: nowrap; }
.main-navigation a:hover, .main-navigation a:focus { border-color: #1f2933; background: #eef1f3; outline: none; }
.profile-menu { position: relative; }
.profile-menu summary { display: flex; align-items: center; gap: .5rem; min-height: 2.75rem; cursor: pointer; list-style: none; font-weight: 700; }
.profile-menu summary::-webkit-details-marker { display: none; }
.profile-menu summary::after { content: "▾"; }
.profile-menu summary img { width: 2.4rem; height: 2.4rem; border-radius: 50%; object-fit: cover; }
.profile-menu nav { position: absolute; top: calc(100% + .5rem); right: 0; width: min(18rem, calc(100vw - 2rem)); padding: .5rem; background: #fff; border: 1px solid #65737e; border-radius: .5rem; box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.2); }
.profile-menu nav a, .profile-menu nav button { display: block; width: 100%; padding: .75rem; border: 0; background: transparent; color: inherit; text-align: left; text-decoration: none; font: inherit; cursor: pointer; }
.profile-menu nav a:hover, .profile-menu nav button:hover, .profile-menu nav a:focus, .profile-menu nav button:focus { background: #eef1f3; outline: none; }
.profile-menu nav form { margin: 0; }
.panel--wide { width: min(100%, 68rem); }
.panel--feed { width: min(100%, 42rem); }
.welcome-panel { width: min(100%, 20rem); padding-block: 1rem; }
.welcome-panel p { margin-block: .35rem; }
.tree-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.tree-feed { display: grid; gap: 1rem; }
.tree-card { overflow: hidden; border: 1px solid rgba(31,41,51,.25); border-radius: .65rem; background: #fff; }
.tree-card__image { display: grid; min-height: 9rem; place-items: center; background: #dfe9df; }
.tree-card__image a { display: block; width: 100%; }
.tree-card__image img { width: 4.5rem; height: 4.5rem; opacity: .7; }
.tree-card__image .tree-photo { width: 100%; height: 16rem; object-fit: cover; opacity: 1; }
.tree-card__image .tree-photo--full { height: auto; max-height: 42rem; object-fit: contain; }
.tree-card__body h2 a { color: inherit; }
.tree-card__body { padding: 1rem; }
.tree-card__body h2 { margin: 0 0 .5rem; font-size: 1.15rem; }
.tree-card__body p { margin: .4rem 0; }
.tree-card--empty { border-style: dashed; }
.tree-card--empty .tree-card__image, .tree-card--empty .tree-card__body { opacity: .65; }
.muted { color: #52606d; }
.action-form { margin-block: 1.5rem; padding-block: 1rem; border-block: 1px solid rgba(31,41,51,.25); }
.action-text { white-space: normal; overflow-wrap: anywhere; }
.tree-card details { margin-top: 1rem; }
.tree-card details summary { cursor: pointer; font-weight: 700; }
.comments { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid rgba(31,41,51,.2); }
.comments h3 { margin: 0 0 .75rem; font-size: 1rem; }
.comment { margin-block: .65rem; padding: .65rem; border-left: .25rem solid #9aa5b1; background: #f5f7f8; }
.comment p { margin: .25rem 0; }
.comment__type { font-size: .85rem; font-weight: 700; }
.comment__delete { padding: 0; border: 0; background: transparent; color: #8b1e1e; text-decoration: underline; cursor: pointer; }
.comment__report { padding: 0; border: 0; background: transparent; color: #52606d; text-decoration: underline; cursor: pointer; }
.comment-form { margin-top: 1rem; }
.comment-form .field textarea { min-height: 5rem; }
.interactions { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid rgba(31,41,51,.2); }
.reactions { display: flex; flex-wrap: wrap; gap: .5rem; }
.reactions form, .comment__actions form { margin: 0; }
.reaction { padding: .4rem .65rem; border: 1px solid #9aa5b1; border-radius: 2rem; background: #fff; cursor: pointer; }
.reaction--active { border-color: #1f2933; background: #e3eee3; box-shadow: inset 0 0 0 1px #1f2933; }
.comment-children { margin-left: 1rem; padding-left: .6rem; border-left: 2px solid #cbd2d9; }
.comment__actions { display: flex; align-items: flex-start; gap: .75rem; }
.comment__actions details summary { font-size: .9rem; }
.tree-settings { margin-block: 1rem; padding: .8rem; border: 1px solid rgba(31,41,51,.3); border-radius: .5rem; }
.tree-settings > summary { cursor: pointer; font-weight: 700; }
.tree-settings form:last-child { margin-top: 1rem; }
.analysis-result { margin-block: 1rem; padding: 1rem; border: 1px solid #8a9a5b; border-radius: .5rem; background: #f7faef; }
.analysis-result h3 { margin: 1rem 0 .35rem; font-size: 1rem; }
.analysis-warning { padding: .65rem; border-left: .25rem solid #9b6b19; background: #fff8e6; font-weight: 600; }
.analysis-hypothesis { margin-block: .65rem; padding-left: .75rem; border-left: .2rem solid #9aa5b1; }
.moderation-card { padding: 1rem; border: 1px solid rgba(31,41,51,.25); border-radius: .6rem; background: #fff; }
.moderation-card p { overflow-wrap: anywhere; }
.moderation-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.moderation-actions form { margin: 0; }

@media (max-width: 40rem) {
    .site-header { display: grid; grid-template-columns: 1fr auto; }
    .main-navigation { grid-column: 1 / -1; grid-row: 2; width: 100%; justify-content: stretch; order: 3; }
    .main-navigation a { flex: 1; padding: .55rem .35rem; text-align: center; }
    .page-layer { padding-top: 8.5rem; }
    .page-layer--home { flex-direction: column; }
    .panel { padding: 1.25rem; }
    .tree-grid { grid-template-columns: 1fr; }
}
