:root {
    color-scheme: light;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #17202a;
    background: #ffffff;
    letter-spacing: 0;
    --line: #d8dee4;
    --line-strong: #aab5bf;
    --surface: #ffffff;
    --surface-soft: #f4f6f7;
    --text: #17202a;
    --muted: #66727d;
    --primary: #007f66;
    --primary-hover: #006451;
    --danger: #c43d34;
    --success: #247443;
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html,
body {
    min-width: 320px;
    min-height: 100%;
    margin: 0;
}

body {
    background: var(--surface);
    color: var(--text);
}

button,
input,
textarea {
    font: inherit;
}

button,
a,
input,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
.leaflet-container:focus-visible {
    outline: 3px solid rgba(0, 127, 102, 0.32);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.public-shell {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.public-header {
    position: relative;
    z-index: 1000;
    min-height: 72px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.public-brand {
    width: 192px;
    flex: 0 0 auto;
    text-decoration: none;
}

.public-brand img {
    display: block;
    width: 100%;
    height: auto;
}

.public-tabs {
    align-self: stretch;
    display: flex;
    align-items: stretch;
    gap: 22px;
}

.public-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.public-tab::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    background: transparent;
}

.public-tab:hover {
    color: var(--text);
}

.public-tab.is-active {
    color: var(--text);
}

.public-tab.is-active::after {
    background: var(--primary);
}

.staff-link {
    margin-left: auto;
    color: var(--primary);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}

.staff-link:hover {
    text-decoration: underline;
}

.contacts-workspace {
    flex: 1;
    padding: 52px 24px 72px;
    background: var(--surface-soft);
}

.contacts-section {
    width: min(860px, 100%);
    margin: 0 auto;
}

.contacts-heading {
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.contacts-mark {
    width: 104px;
    height: 104px;
    flex: 0 0 auto;
    border-radius: 8px;
}

.contacts-heading h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.15;
}

.contacts-heading p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.5;
}

.contact-list {
    display: grid;
    gap: 12px;
}

.contact-item {
    min-width: 0;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
}

.contact-copy {
    min-width: 0;
    flex: 1;
}

.contact-copy h2 {
    margin: 0 0 9px;
    font-size: 17px;
    line-height: 1.35;
}

.contact-number {
    color: var(--primary);
    font-size: 22px;
    font-weight: 750;
    line-height: 1.25;
    text-decoration: none;
}

.contact-number:hover {
    text-decoration: underline;
}

.call-button {
    min-height: 42px;
    padding: 9px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid var(--primary);
    border-radius: 4px;
    background: var(--primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
}

.call-button:hover {
    border-color: var(--primary-hover);
    background: var(--primary-hover);
}

.public-workspace {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
}

.map-region {
    position: relative;
    min-width: 0;
    min-height: 460px;
    overflow: hidden;
    background: #e8ecef;
}

.report-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #e8ecef;
}

.leaflet-container {
    font-family: inherit;
}

.leaflet-control-attribution {
    font-size: 11px;
}

.leaflet-control-attribution a {
    color: #0b4f86;
}

.locate-button {
    position: absolute;
    z-index: 500;
    top: 14px;
    right: 14px;
    min-height: 42px;
    max-width: calc(100% - 78px);
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--text);
    font-weight: 650;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(23, 32, 42, 0.14);
}

.locate-button:hover {
    background: #ffffff;
    border-color: #7f8b95;
}

.locate-button[aria-busy="true"] {
    cursor: wait;
    opacity: 0.72;
}

.locate-symbol {
    width: 20px;
    font-size: 22px;
    line-height: 1;
    text-align: center;
}

.map-readout {
    position: absolute;
    z-index: 500;
    left: 14px;
    bottom: 48px;
    min-width: 210px;
    max-width: calc(100% - 28px);
    padding: 9px 11px;
    border: 1px solid rgba(130, 143, 154, 0.7);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 3px 12px rgba(23, 32, 42, 0.14);
}

.map-readout-label {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.map-readout output {
    display: block;
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    font-weight: 650;
}

.map-status {
    position: absolute;
    z-index: 500;
    left: 14px;
    top: 66px;
    width: min(420px, calc(100% - 28px));
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid rgba(130, 143, 154, 0.7);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.96);
    color: #3b4650;
    font-size: 13px;
    text-align: left;
    box-shadow: 0 3px 12px rgba(23, 32, 42, 0.12);
}

.map-status.is-error {
    color: #8a2d24;
    border-color: rgba(196, 61, 52, 0.55);
}

.report-marker-shell,
.user-marker-shell {
    background: transparent;
    border: 0;
}

.report-pin {
    position: relative;
    display: block;
    width: 28px;
    height: 28px;
    transform: rotate(-45deg);
    border: 3px solid #ffffff;
    border-radius: 50% 50% 50% 0;
    background: var(--danger);
    box-shadow: -2px 3px 10px rgba(23, 32, 42, 0.34);
}

.report-pin::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff;
}

.user-dot {
    display: block;
    width: 18px;
    height: 18px;
    border: 4px solid #ffffff;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 2px 9px rgba(23, 32, 42, 0.35);
}

.report-panel {
    min-width: 0;
    overflow-y: auto;
    border-left: 1px solid var(--line);
    background: var(--surface);
    scrollbar-gutter: stable;
}

#formState,
.success-state {
    padding: 24px;
}

.panel-heading {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.panel-heading h2,
.success-state h2 {
    margin: 0;
    font-size: 23px;
    line-height: 1.25;
}

.panel-heading p,
.success-state p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.report-form {
    display: block;
}

.form-section {
    min-width: 0;
    margin: 0;
    padding: 20px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
}

.form-section legend {
    width: 100%;
    margin: 0 0 14px;
    padding: 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 750;
}

.form-section label:not(.file-button) {
    display: block;
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 700;
}

input[type="text"],
textarea {
    display: block;
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: #ffffff;
    color: var(--text);
}

input[type="text"] {
    min-height: 42px;
    padding: 9px 10px;
}

textarea {
    min-height: 132px;
    padding: 10px;
    line-height: 1.45;
    resize: vertical;
}

input[type="text"]:hover,
textarea:hover {
    border-color: #7f8b95;
}

.selected-location {
    min-height: 42px;
    margin-bottom: 14px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface-soft);
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
}

.selected-location.is-selected {
    color: var(--text);
}

.location-indicator {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #98a3ad;
}

.selected-location.is-selected .location-indicator {
    background: var(--danger);
}

.field-meta {
    margin-top: 7px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
}

.photo-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.photo-picker input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.file-button,
.secondary-button {
    min-height: 38px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: #ffffff;
    color: #25313b;
    font-weight: 650;
    cursor: pointer;
}

.file-button:hover,
.secondary-button:hover {
    border-color: #7f8b95;
    background: var(--surface-soft);
}

.field-meta-inline {
    color: var(--muted);
    font-size: 12px;
}

.photo-preview {
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
    background: var(--surface-soft);
}

.photo-preview img {
    display: block;
    width: 100%;
    height: 190px;
    object-fit: contain;
    background: #eef1f3;
}

.photo-preview-meta {
    min-height: 42px;
    padding: 7px 8px 7px 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
}

.photo-preview-meta span {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remove-photo {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #7f211b;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.remove-photo:hover {
    background: #fae9e7;
}

.form-status {
    margin-top: 16px;
    padding: 11px 12px;
    border-left: 4px solid var(--danger);
    background: #fae9e7;
    color: #7f211b;
    font-size: 13px;
    line-height: 1.4;
}

.submit-button {
    position: relative;
    width: 100%;
    min-height: 46px;
    margin-top: 20px;
    padding: 10px 14px;
    border: 1px solid var(--primary);
    border-radius: 4px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 750;
    cursor: pointer;
}

.submit-button:hover:not(:disabled) {
    border-color: var(--primary-hover);
    background: var(--primary-hover);
}

.submit-button:disabled {
    border-color: #aeb8c1;
    background: #aeb8c1;
    cursor: not-allowed;
}

.submit-progress {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: progress-spin 0.8s linear infinite;
}

.submit-button[aria-busy="true"] {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.submit-button[aria-busy="true"] .submit-progress {
    display: inline-block;
}

.trap-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.success-state {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.success-mark {
    width: 44px;
    height: 44px;
    margin-bottom: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #dff2e5;
    color: var(--success);
    font-size: 25px;
    font-weight: 800;
}

.success-state dl {
    width: 100%;
    margin: 24px 0;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.success-state dt {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.success-state dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
}

.noscript-message {
    margin: 20px;
    padding: 12px;
    border-left: 4px solid var(--danger);
    background: #fae9e7;
}

.toast {
    position: fixed;
    z-index: 2000;
    right: 18px;
    bottom: 18px;
    width: min(360px, calc(100% - 36px));
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: #ffffff;
    color: var(--text);
    box-shadow: 0 8px 28px rgba(23, 32, 42, 0.22);
    font-size: 13px;
    line-height: 1.4;
}

.toast.is-error {
    border-color: rgba(196, 61, 52, 0.6);
    color: #7f211b;
}

@keyframes progress-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1040px) {
    .public-workspace {
        grid-template-columns: minmax(0, 1fr) 380px;
    }

    .public-header {
        gap: 18px;
    }

    .public-brand {
        width: 168px;
    }

    .public-tabs {
        gap: 16px;
    }
}

@media (max-width: 760px) {
    .public-header {
        min-height: 108px;
        padding: 8px 14px 0;
        flex-wrap: wrap;
        gap: 4px 12px;
    }

    .public-brand {
        width: 148px;
    }

    .staff-link {
        margin-left: auto;
        font-size: 13px;
    }

    .public-tabs {
        width: 100%;
        height: 44px;
        order: 3;
        gap: 22px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .public-tabs::-webkit-scrollbar {
        display: none;
    }

    .public-tab {
        font-size: 13px;
    }

    .public-workspace {
        display: block;
    }

    .map-region {
        height: clamp(320px, 48dvh, 440px);
        min-height: 320px;
    }

    .report-panel {
        overflow: visible;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    #formState,
    .success-state {
        padding: 20px 16px 28px;
    }

    .locate-button {
        top: 12px;
        right: 12px;
        min-height: 40px;
        padding: 7px 10px;
        font-size: 13px;
    }

    .map-status {
        left: 12px;
        right: 12px;
        top: auto;
        bottom: 98px;
        width: auto;
        min-height: 0;
        padding: 8px 10px;
        font-size: 12px;
    }

    .map-readout {
        left: 12px;
        bottom: 42px;
        min-width: 0;
        max-width: calc(100% - 24px);
        padding: 7px 9px;
    }

    .map-readout-label {
        font-size: 10px;
    }

    .map-readout output {
        font-size: 12px;
    }

    .leaflet-control-attribution {
        max-width: calc(100vw - 84px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .contacts-workspace {
        padding: 30px 16px 48px;
    }

    .contacts-heading {
        margin-bottom: 22px;
        align-items: flex-start;
        gap: 16px;
    }

    .contacts-mark {
        width: 72px;
        height: 72px;
    }

    .contacts-heading h1 {
        font-size: 28px;
    }

    .contacts-heading p {
        font-size: 14px;
    }

    .contact-item {
        padding: 18px;
        align-items: stretch;
        flex-direction: column;
        gap: 16px;
    }

    .call-button {
        width: 100%;
    }
}

@media (max-width: 390px) {
    .public-brand {
        width: 138px;
    }

    .staff-link {
        max-width: 138px;
        text-align: right;
    }

    .locate-button span:last-child {
        display: none;
    }

    .locate-button {
        width: 42px;
        padding: 0;
        justify-content: center;
    }

    .contacts-heading {
        display: block;
    }

    .contacts-mark {
        margin-bottom: 14px;
    }

    .contact-number {
        font-size: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
