:root {
    color-scheme: light;
    --bg: #f6f4ef;
    --surface: #ffffff;
    --ink: #202622;
    --muted: #667067;
    --line: #d9ddd5;
    --accent: #136f63;
    --accent-dark: #0d4f49;
    --danger: #a43d3d;
    --success: #207044;
    --focus: #f0b429;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.65;
}

a {
    color: var(--accent-dark);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px clamp(16px, 4vw, 44px);
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.brand-icon {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex: 0 0 auto;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.nav a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 6px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
}

.nav a.active,
.nav a:hover {
    background: #e6efec;
    color: var(--accent-dark);
}

.main {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 56px;
}

.hero,
.page-title {
    padding: clamp(24px, 5vw, 54px) 0 22px;
}

.hero.with-kolan,
.page-title.with-kolan {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    align-items: center;
    gap: clamp(22px, 5vw, 52px);
}

.kolan-callout {
    justify-self: end;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    width: min(100%, 420px);
    padding: 16px 18px;
    background: #fffefa;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(41, 49, 44, 0.06);
}

.kolan-callout img {
    display: block;
    width: 112px;
    height: 112px;
    object-fit: contain;
}

.kolan-callout p {
    margin: 0;
}

.kolan-message-title {
    color: var(--accent-dark);
    font-size: 0.94rem;
    font-weight: 800;
}

.kolan-message-title + p {
    margin-top: 5px;
    color: var(--ink);
    font-size: 0.95rem;
}

.page-title.narrow,
.panel.narrow {
    max-width: 620px;
    margin-inline: auto;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    line-height: 1.25;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.7rem);
    max-width: 13ch;
}

h2 {
    font-size: 1.18rem;
}

.lead,
.page-title p:not(.eyebrow) {
    max-width: 760px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 1.05rem;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 12px 0 24px;
}

.admin-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.action-card {
    display: grid;
    gap: 8px;
    min-height: 160px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(41, 49, 44, 0.06);
}

.action-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.card-kicker {
    color: var(--accent);
    font-size: 0.86rem;
    font-weight: 800;
}

.action-card strong {
    font-size: 1.25rem;
}

.action-card span:last-child {
    color: var(--muted);
}

.panel,
.notice {
    margin: 18px 0;
    padding: clamp(18px, 3vw, 26px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(41, 49, 44, 0.05);
}

.panel-heading,
.location-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #e6efec;
    color: var(--accent-dark);
    font-size: 0.9rem;
    font-weight: 800;
}

.quota-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.quota-grid.compact {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.quota-illustration {
    margin: -8px 0 22px;
}

.quota-illustration img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.quota-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfbf8;
}

.quota-item span {
    min-width: 0;
    font-weight: 700;
}

.quota-item strong {
    color: var(--accent-dark);
    font-size: 1.4rem;
}

.quota-item.full {
    opacity: 0.58;
}

.notice.success {
    border-color: rgba(32, 112, 68, 0.35);
    background: #eff8f1;
}

.notice.error {
    border-color: rgba(164, 61, 61, 0.35);
    background: #fff2f1;
}

.admin-message {
    border-color: rgba(19, 111, 99, 0.35);
    background: #f3fbf8;
}

.danger-panel {
    border-color: rgba(164, 61, 61, 0.45);
    background: #fff8f7;
}

.notice ul {
    margin: 8px 0 0;
    padding-left: 1.2rem;
}

.privacy-notice {
    border-top: 4px solid var(--accent);
}

.privacy-intro {
    margin: 0 0 18px;
}

.privacy-grid {
    display: grid;
    grid-template-columns: minmax(120px, 170px) minmax(0, 1fr);
    gap: 0;
    margin: 0;
    border-top: 1px solid var(--line);
}

.privacy-grid dt,
.privacy-grid dd {
    margin: 0;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.privacy-grid dt {
    padding-right: 18px;
    font-weight: 800;
}

.privacy-grid dd ul {
    margin: 0;
    padding-left: 1.2rem;
}

.privacy-confirmation {
    margin: 16px 0 0;
    font-weight: 800;
}

.code-box {
    display: inline-flex;
    margin: 10px 0;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 1.25rem;
    font-weight: 800;
}

.form {
    display: grid;
    gap: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 800;
}

.field-help {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 500;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #c8cec5;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
}

::placeholder {
    color: #8a938a;
    opacity: 1;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.check-row {
    grid-template-columns: 22px 1fr;
    align-items: start;
    font-weight: 700;
}

.check-row input {
    width: 18px;
    min-height: 18px;
    margin-top: 4px;
}

.consent-illustration {
    margin: -4px 0 6px;
}

.consent-illustration img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.survey-illustration {
    margin: 16px 0 0;
}

.survey-illustration img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.survey-workflow-illustration {
    margin-top: 18px;
}

.photo-guide-illustration {
    margin: 8px 0 14px;
}

.photo-guide-illustration img {
    height: clamp(76px, 12vw, 142px);
    object-fit: cover;
    object-position: center;
    opacity: 0.82;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

button {
    min-height: 46px;
    padding: 10px 16px;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

button:hover {
    background: var(--accent-dark);
}

.danger-button {
    background: var(--danger);
}

.danger-button:hover {
    background: #7d2d2d;
}

button.secondary {
    background: #e6efec;
    color: var(--accent-dark);
}

.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.location-block {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfbf8;
}

.osm-map {
    position: relative;
    height: clamp(280px, 48vw, 440px);
    overflow: hidden;
    border: 1px solid #c8cec5;
    border-radius: 8px;
    background: #e7ece7;
    touch-action: none;
    user-select: none;
}

.osm-tiles {
    position: absolute;
    inset: 0;
}

.osm-tiles img {
    position: absolute;
    width: 256px;
    height: 256px;
    max-width: none;
}

.map-pin {
    position: absolute;
    z-index: 3;
    width: 22px;
    height: 22px;
    margin: -22px 0 0 -11px;
    border: 4px solid #fff;
    border-radius: 50% 50% 50% 0;
    background: var(--danger);
    box-shadow: 0 3px 10px rgba(32, 38, 34, 0.3);
    transform: rotate(-45deg);
    pointer-events: none;
}

.map-pin::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: #fff;
}

.map-crosshair {
    position: absolute;
    z-index: 4;
    left: 50%;
    top: 50%;
    width: 42px;
    height: 42px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.map-crosshair::before,
.map-crosshair::after {
    content: "";
    position: absolute;
    background: rgba(13, 79, 73, 0.95);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.map-crosshair::before {
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
}

.map-crosshair::after {
    left: 0;
    top: 50%;
    width: 100%;
    height: 2px;
}

.map-zoom-controls {
    position: absolute;
    z-index: 5;
    left: 10px;
    top: 10px;
    display: grid;
    gap: 6px;
}

.map-icon-button {
    width: 38px;
    min-height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.95);
    color: var(--ink);
    font-size: 1.25rem;
}

.map-center-button {
    position: absolute;
    z-index: 5;
    right: 10px;
    top: 10px;
    max-width: min(260px, calc(100% - 68px));
    background: rgba(19, 111, 99, 0.96);
}

.map-attribution {
    position: absolute;
    z-index: 5;
    right: 6px;
    bottom: 4px;
    padding: 2px 5px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--accent-dark);
    font-size: 0.75rem;
}

.muted {
    color: var(--muted);
}

.photo-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    min-height: 0;
}

.photo-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 220px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.table-wrap {
    overflow-x: auto;
}

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

th,
td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

th {
    background: #f2f5f0;
    font-size: 0.92rem;
}

.status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.example-code {
    overflow-x: auto;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f7f8f5;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    white-space: pre;
}

.site-footer {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 28px;
    color: var(--muted);
    font-size: 0.92rem;
}

@media (max-width: 900px) {
    .hero.with-kolan,
    .page-title.with-kolan {
        grid-template-columns: 1fr;
    }

    .kolan-callout {
        justify-self: stretch;
    }

    .action-grid,
    .admin-actions,
    .quota-grid,
    .quota-grid.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .brand {
        align-items: flex-start;
    }

    .main {
        width: min(100% - 22px, 1080px);
        padding-top: 18px;
    }

    .action-grid,
    .admin-actions,
    .quota-grid,
    .quota-grid.compact,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .panel-heading,
    .location-heading,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .privacy-grid {
        grid-template-columns: 1fr;
    }

    .privacy-grid dt {
        padding-bottom: 2px;
        border-bottom: 0;
    }

    .privacy-grid dd {
        padding-top: 2px;
    }

    h1 {
        max-width: none;
    }
}

@media (max-width: 430px) {
    .kolan-callout {
        grid-template-columns: 78px minmax(0, 1fr);
        gap: 12px;
        padding: 14px;
    }

    .kolan-callout img {
        width: 78px;
        height: 78px;
    }
}
