:root {
    color-scheme: light;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #182b2a;
    background: #f3f6f4;
    --paper: #fff;
    --line: #d8e3df;
    --muted: #4a6461;
    --accent: #105d52;
    --accent-dark: #10483f;
    --danger: #8b2b2f;
    --radius: 1rem;
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-dark); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #167769; outline-offset: 3px; }

.skip-link, .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link:focus {
    z-index: 1000;
    inset: .5rem auto auto .5rem;
    width: auto;
    height: auto;
    clip-path: none;
    padding: .5rem 1rem;
    background: var(--paper);
}

.topbar {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.topbar-inner, .container {
    width: min(100% - 2rem, 61rem);
    margin-inline: auto;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-height: 4.5rem;
    padding-block: .5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    color: #183430;
    font-weight: 750;
    text-decoration: none;
    line-height: 1.2;
}

.brand-logo { width: auto; max-width: 7rem; height: auto; max-height: 2.5rem; }
.sign-out {
    padding: .6rem .75rem;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: .65rem;
    background: transparent;
    color: var(--accent-dark);
    font-weight: 650;
}

.container { padding-block: clamp(1.5rem, 4vw, 3rem) 4rem; }
.container > section + section, .spaced { margin-top: 1.3rem; }

h1, h2, p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.95rem, 5vw, 3rem); line-height: 1.12; letter-spacing: -.045em; }
h2 { margin-bottom: .6rem; font-size: 1.25rem; line-height: 1.3; }
p + p { margin-top: .4rem; }
address { font-style: normal; }
address + p { margin-top: .3rem; }

.page-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-heading p { margin-top: .5rem; }
.back-link { display: inline-block; padding-block: .4rem; margin-bottom: .5rem; }
.panel {
    padding: clamp(1rem, 3vw, 1.5rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
}

.narrow { max-width: 31rem; margin-inline: auto; }
.narrow > h1 { margin-bottom: .6rem; }
.empty, .muted { color: var(--muted); }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: .55rem .9rem;
    border: 1px solid transparent;
    border-radius: .65rem;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.button:hover { color: #fff; background: var(--accent-dark); }
.button.secondary {
    background: var(--paper);
    color: var(--accent-dark);
    border-color: var(--line);
}
.button.secondary:hover, .sign-out:hover { background: #e5f0ec; }
.button.danger {
    background: #fff;
    color: var(--danger);
    border-color: #e7bfc0;
}
.button.danger:hover { background: #fcebec; }

.card-list, .section-nav, .record-list, .messages { margin: 0; padding: 0; list-style: none; }
.card-list { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.site-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    min-height: 5.5rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    color: inherit;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.site-card:hover { border-color: #9dbdb4; background: #fbfefc; }
.site-card strong { display: block; font-size: 1.12rem; line-height: 1.35; }
.card-address { display: block; color: var(--muted); margin-top: .25rem; }
.card-arrow { color: var(--accent); font-size: 1.7rem; }
.section-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.section-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: .4rem .8rem;
    border-radius: .65rem;
    background: #e3eeea;
    font-weight: 650;
}

.site-map {
    width: 100%;
    height: clamp(17rem, 45vw, 28rem);
    margin-top: 1rem;
    border: 1px solid var(--line);
    border-radius: .8rem;
    background: #e6eeeb;
    z-index: 0;
}
.map-status { color: var(--muted); font-size: .9rem; margin-top: .4rem; }
.archive-panel { margin-top: 1.25rem; }
.archive-panel summary { color: var(--danger); cursor: pointer; width: fit-content; padding-block: .6rem; }
.archive-panel form { margin-top: .65rem; }

.field-form { margin-top: 1rem; }
.field-form > p, .field-form > fieldset { margin: 0 0 1rem; }
label { display: block; margin-bottom: .25rem; font-weight: 650; }
input:not([type=hidden]), select, textarea {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: .55rem .7rem;
    border: 1px solid #a8beb8;
    border-radius: .55rem;
    background: var(--paper);
    color: inherit;
    font-size: 1rem;
}

fieldset { min-width: 0; padding: .85rem; border: 1px solid var(--line); border-radius: .8rem; }
legend { padding-inline: .3rem; font-weight: 700; }
.coordinate-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin-top: .65rem; }
.coordinate-fields > div { min-width: 0; }
.errorlist { color: var(--danger); margin-block: .35rem; padding-inline-start: 1.25rem; }
.helptext { display: block; margin-top: .3rem; color: var(--muted); font-size: .9rem; }
.helptext ul { padding-inline-start: 1.25rem; margin-top: .25rem; }

.contact-card + .contact-card { margin-top: .7rem; }
.contact-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}
.contact-card h2 { margin-bottom: .15rem; }
.contact-card + section { margin-top: 1.25rem; }
.empty + section { margin-top: 1.25rem; }

.record-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    overflow-wrap: anywhere;
}
.record-list li + li { margin-top: .65rem; padding-top: .65rem; border-top: 1px solid var(--line); }
.record-list li > div { min-width: 0; }

.invite-result, .messages {
    border: 1px solid #b9d5c9;
    border-radius: .8rem;
    background: #eaf4ee;
    padding: .85rem;
    overflow-wrap: anywhere;
}
.invite-result { margin-top: .85rem; }
.messages { margin-bottom: 1rem; }

.share-sections { margin-top: 1rem; }
.share-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-block: 1rem; }
.share-options { margin-bottom: .85rem; }
.share-options label { display: flex; align-items: center; gap: .55rem; }
.share-options input[type=checkbox] { display: inline-block; width: 1.2rem; min-height: 1.2rem; }
.qr-url { overflow-wrap: anywhere; }
.qr-sheet { padding: 2rem 1rem; text-align: center; }
.qr-sheet h1 { overflow-wrap: anywhere; }
.qr-sheet .brand { display: block; }
.qr-logo { display: block; max-width: min(80%, 12rem); max-height: 5rem; margin: 0 auto 1rem; }
.qr-image { display: block; width: min(100%, 22rem); height: auto; margin: 1rem auto; }

.foto-upload-status { margin-top: 1rem; }
.foto-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 8rem), 1fr));
    gap: .7rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.foto-gallery a {
    display: block;
    border: 1px solid var(--line);
    border-radius: .6rem;
    background: #f3f6f4;
}
.foto-gallery img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: inherit;
}
