:root {
    --pgm-ink: #172126;
    --pgm-muted: #61706d;
    --pgm-paper: #f8faf8;
    --pgm-panel: rgba(255, 255, 255, 0.86);
    --pgm-line: rgba(23, 33, 38, 0.16);
    --pgm-accent: #0f7b75;
    --pgm-accent-dark: #07514d;
    --pgm-red: #e05b3f;
    --pgm-glass: rgba(255, 255, 255, 0.8);
    --pgm-menu-bg: rgba(68, 68, 68, 0.8);
}

* {
    box-sizing: border-box;
}

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

.pgm-body {
    color: var(--pgm-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pgm-shell {
    display: flex;
    align-items: stretch;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    min-height: 100vh;
    padding: 0;
    background: var(--pgm-paper);
    overflow: hidden;
}

.pgm-map-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}

.pgm-map-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 2px 0;
    border-bottom: 0;
    background: var(--pgm-menu-bg);
    backdrop-filter: none;
}

.pgm-shared-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: grid;
    gap: 2px;
    min-height: 54px;
    background: rgba(68, 68, 68, 0.8);
    color: #fff;
    padding: 7px 12px 8px;
}

.pgm-shared-header h1 {
    margin: 0;
    color: #fff;
    font-size: 18px;
    line-height: 1.15;
}

.pgm-shared-header a {
    overflow: hidden;
    color: rgba(255, 255, 255, 0.88);
    font-size: 12px;
    font-weight: 750;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pgm-shared-header a:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.pgm-shared-body .maplibregl-control-container {
    display: none;
}

.pgm-map-primary-actions,
.pgm-map-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pgm-mobile-menu {
    display: none;
    position: relative;
    z-index: 40;
}

.pgm-album-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--pgm-ink);
    font-size: 14px;
    font-weight: 800;
    padding: 7px 10px;
}

.pgm-upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    padding: 10px 14px;
    text-decoration: none;
}

.pgm-upload-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.pgm-upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-radius: 50%;
    line-height: 1;
}

.pgm-map-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #fff;
    font-size: 14px;
    font-weight: 750;
    padding: 8px 12px;
    text-decoration: none;
}

.pgm-button-text {
    display: inline;
}

.pgm-circle-button {
    position: relative;
}

.pgm-desktop-action .pgm-circle-button,
.pgm-map-primary-actions .pgm-circle-button,
.pgm-map-actions .pgm-circle-button {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    justify-content: center;
    gap: 0;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 50%;
    background: rgba(20, 25, 24, 0.24);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
    padding: 0;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.pgm-map-actions .pgm-circle-button:hover,
.pgm-map-actions .pgm-circle-button:focus-visible,
.pgm-map-primary-actions .pgm-circle-button:hover,
.pgm-map-primary-actions .pgm-circle-button:focus-visible {
    border-color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.pgm-map-actions .pgm-circle-button .pgm-button-text,
.pgm-map-primary-actions .pgm-circle-button .pgm-button-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.pgm-map-actions .pgm-circle-button::after,
.pgm-map-primary-actions .pgm-circle-button::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    z-index: 1010;
    max-width: 180px;
    padding: 7px 10px;
    border-radius: 7px;
    background: rgba(20, 25, 24, 0.92);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    opacity: 0;
    pointer-events: none;
    text-align: center;
    transform: translate(-50%, -4px);
    transition: opacity 0.14s ease, transform 0.14s ease;
    white-space: nowrap;
}

.pgm-map-actions .pgm-circle-button:hover::after,
.pgm-map-actions .pgm-circle-button:focus-visible::after,
.pgm-map-primary-actions .pgm-circle-button:hover::after,
.pgm-map-primary-actions .pgm-circle-button:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.pgm-share-menu {
    position: relative;
    display: inline-flex;
}

.pgm-share-menu summary {
    cursor: pointer;
    list-style: none;
}

.pgm-share-menu summary::-webkit-details-marker {
    display: none;
}

.pgm-share-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1005;
    display: grid;
    gap: 6px;
    min-width: 170px;
    border-radius: 8px;
    background: var(--pgm-menu-bg);
    padding: 8px;
}

.pgm-share-menu-panel a,
.pgm-share-menu-panel button {
    display: flex;
    align-items: center;
    min-height: 36px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 750;
    padding: 8px 10px;
    text-align: left;
    text-decoration: none;
}

.pgm-share-menu-panel a:hover,
.pgm-share-menu-panel button:hover {
    background: rgba(255, 255, 255, 0.16);
}

.pgm-album-select-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    border-radius: 7px;
    background: transparent;
    color: #fff;
    padding: 0 8px 0 12px;
}

.pgm-album-select-control select {
    min-height: 38px;
    width: 100%;
    max-width: 170px;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 750;
    outline: none;
}

.pgm-album-select-control option {
    color: var(--pgm-ink);
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

button.pgm-map-link {
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
}

.pgm-menu-icon {
    position: relative;
    display: inline-block;
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
}

.pgm-menu-icon::before,
.pgm-menu-icon::after {
    content: "";
    position: absolute;
    box-sizing: border-box;
}

.pgm-icon-view::before {
    inset: 3px 1px;
    border: 2px solid currentColor;
    border-radius: 999px;
}

.pgm-icon-view::after {
    top: 6px;
    left: 6px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.pgm-icon-dashboard::before {
    inset: 2px;
    border: 2px solid currentColor;
    border-radius: 3px;
}

.pgm-icon-dashboard::after {
    top: 7px;
    left: 2px;
    width: 13px;
    height: 2px;
    background: currentColor;
    box-shadow: 0 -5px 0 -0.2px transparent, 5px -5px 0 -0.2px transparent;
}

.pgm-icon-album::before {
    inset: 3px 2px 2px;
    border: 2px solid currentColor;
    border-radius: 2px;
}

.pgm-icon-album::after {
    top: 1px;
    left: 3px;
    width: 8px;
    height: 4px;
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 2px 2px 0 0;
}

.pgm-icon-share::before {
    top: 3px;
    right: 1px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, currentColor 0 58%, transparent 60%),
        radial-gradient(circle at -11px 5px, currentColor 0 58%, transparent 60%),
        radial-gradient(circle at -2px 12px, currentColor 0 58%, transparent 60%);
}

.pgm-icon-share::after {
    top: 7px;
    left: 4px;
    width: 12px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: skewY(-25deg);
}

.pgm-icon-login::before,
.pgm-icon-logout::before {
    top: 4px;
    right: 1px;
    width: 8px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
}

.pgm-icon-login::after,
.pgm-icon-logout::after {
    top: 8px;
    left: 2px;
    width: 13px;
    height: 2px;
    background: currentColor;
}

.pgm-icon-logout {
    transform: rotate(180deg);
}

.pgm-icon-register::before {
    top: 2px;
    left: 4px;
    width: 9px;
    height: 9px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.pgm-icon-register::after {
    left: 1px;
    bottom: 1px;
    width: 15px;
    height: 8px;
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 9px 9px 0 0;
}

.pgm-icon-upload::before {
    top: 2px;
    left: 7px;
    width: 3px;
    height: 13px;
    background: currentColor;
}

.pgm-icon-upload::after {
    top: 2px;
    left: 3px;
    width: 11px;
    height: 11px;
    border-top: 3px solid currentColor;
    border-left: 3px solid currentColor;
    transform: rotate(45deg);
}

.pgm-map-link:hover {
    border-color: rgba(224, 91, 63, 0.45);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.pgm-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.pgm-user-chip img {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 2px solid rgba(255, 255, 255, 0.88);
    border-radius: 50%;
    object-fit: cover;
}

.pgm-map-actions .pgm-avatar-button img {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-width: 2px;
}

.pgm-menu-avatar {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
    object-fit: cover;
}

.pgm-map-actions .pgm-album-select-control select {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: none;
    opacity: 0;
}

.pgm-map-actions .pgm-album-select-control .screen-reader-text {
    pointer-events: none;
}

.pgm-map-actions .pgm-share-menu[open] summary::after {
    display: none;
}

.pgm-username {
    max-width: min(34vw, 220px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pgm-mobile-menu > summary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 7px;
    background: var(--pgm-menu-bg);
    cursor: pointer;
    list-style: none;
}

.pgm-mobile-menu > summary::-webkit-details-marker {
    display: none;
}

.pgm-mobile-menu > summary > span {
    position: absolute;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: #fff;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.pgm-mobile-menu > summary > span:nth-child(1) {
    transform: translateY(-7px);
}

.pgm-mobile-menu > summary > span:nth-child(3) {
    transform: translateY(7px);
}

.pgm-mobile-menu[open] > summary > span:nth-child(1) {
    transform: rotate(45deg);
}

.pgm-mobile-menu[open] > summary > span:nth-child(2) {
    opacity: 0;
}

.pgm-mobile-menu[open] > summary > span:nth-child(3) {
    transform: rotate(-45deg);
}

.pgm-mobile-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 18px;
    z-index: 1000;
    display: grid;
    gap: 8px;
    width: min(260px, calc(100vw - 36px));
    border: 0;
    border-radius: 8px;
        background: var(--pgm-menu-bg);
    backdrop-filter: none;
    box-shadow: none;
    padding: 10px;
}

.pgm-mobile-menu[open] .pgm-mobile-menu-panel {
    display: grid;
}

.pgm-mobile-menu-panel .pgm-map-link {
    justify-content: flex-start;
    background: transparent;
    color: #fff;
}

.pgm-mobile-menu-panel .pgm-map-link,
.pgm-mobile-menu-panel .pgm-user-chip,
.pgm-mobile-menu-panel .pgm-album-select-control,
.pgm-mobile-menu-panel .pgm-share-menu {
    width: 100%;
}

.pgm-mobile-menu-panel .pgm-user-chip {
    padding: 4px 2px 6px;
}

.pgm-mobile-menu-panel .pgm-album-select-control select {
    max-width: none;
    width: 100%;
}

.pgm-mobile-menu-panel .pgm-share-menu {
    display: grid;
    min-width: 0;
}

.pgm-mobile-menu-panel .pgm-share-menu summary {
    display: flex;
    width: 100%;
    min-height: 38px;
    height: auto;
    justify-content: flex-start;
    gap: 8px;
    padding: 8px 12px;
    white-space: nowrap;
}

.pgm-mobile-menu-panel .pgm-share-menu summary .pgm-menu-icon {
    position: relative;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    background: transparent;
    transform: none;
}

.pgm-mobile-menu-panel .pgm-share-menu-panel {
    position: static;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin-top: 6px;
    background: rgba(255, 255, 255, 0.08);
}

.pgm-mobile-menu-panel .pgm-share-menu-panel a,
.pgm-mobile-menu-panel .pgm-share-menu-panel button {
    width: 100%;
    justify-content: flex-start;
}

.pgm-google-login {
    display: flex;
    align-items: center;
}

.pgm-mobile-menu-panel .pgm-google-login {
    width: 100%;
}

.pgm-map {
    position: relative;
    z-index: 1;
    flex: 1;
    height: 100%;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    border-top: 0;
    background: #e9f0ee;
}

.pgm-photo-slider {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    z-index: 25;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 10px 18px 14px;
    background: rgba(255, 255, 255, 0.64);
    scroll-snap-type: none;
    scrollbar-width: thin;
}

.pgm-photo-slider::after {
    content: "";
    position: sticky;
    right: -18px;
    flex: 0 0 42px;
    margin-left: -42px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72));
}

.pgm-photo-slider.is-empty {
    display: none;
}

.pgm-slider-item {
    flex: 0 0 100px;
    width: 100px;
    height: 100px;
    border: 4px solid rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(24, 32, 31, 0.2);
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    scroll-snap-align: start;
}

.pgm-slider-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pgm-status {
    position: absolute;
    top: 58px;
    left: 50%;
    z-index: 65;
    max-width: min(520px, calc(100vw - 36px));
    padding: 9px 12px;
    border-radius: 8px;
    background: #fff1df;
    color: var(--pgm-muted);
    font-size: 14px;
    box-shadow: 0 12px 30px rgba(20, 25, 24, 0.18);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -8px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.pgm-status.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.pgm-qr-modal {
    position: absolute;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    background: rgba(20, 25, 24, 0.42);
    padding: 18px;
}

.pgm-qr-modal[hidden] {
    display: none;
}

.pgm-qr-dialog {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 12px;
    width: min(330px, calc(100vw - 36px));
    border-radius: 8px;
    background: #fff;
    color: var(--pgm-ink);
    padding: 22px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.26);
}

.pgm-qr-dialog h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: 0;
}

.pgm-qr-dialog img {
    width: 220px;
    height: 220px;
}

.pgm-qr-dialog p {
    width: 100%;
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--pgm-muted);
    font-size: 12px;
    line-height: 1.45;
    text-align: center;
}

.pgm-qr-close {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 7px;
    background: rgba(36, 51, 49, 0.08);
    color: var(--pgm-ink);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.pgm-dashboard-body {
    background: var(--pgm-paper);
}

.pgm-dashboard-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 42px;
}

.pgm-dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.pgm-dashboard-header h1 {
    margin: 0 0 8px;
    font-size: clamp(30px, 5vw, 54px);
    line-height: 1;
    letter-spacing: 0;
}

.pgm-dashboard-header p {
    margin: 0;
    color: var(--pgm-muted);
}

.pgm-dashboard-header nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.pgm-dashboard-body .pgm-map-link {
    background: var(--pgm-menu-bg);
    color: #fff;
}

.pgm-dashboard-body .pgm-map-link:hover {
    background: rgba(68, 68, 68, 0.92);
    color: #fff;
}

.pgm-dashboard-header nav .pgm-map-link {
    min-height: 42px;
}

.pgm-dashboard-notice {
    margin-bottom: 16px;
    border: 1px solid rgba(15, 123, 117, 0.24);
    border-radius: 8px;
    background: rgba(15, 123, 117, 0.1);
    color: var(--pgm-accent-dark);
    font-weight: 750;
    padding: 12px 14px;
}

.pgm-dashboard-notice.is-error {
    border-color: rgba(224, 91, 63, 0.28);
    background: #fff1df;
    color: #835329;
}

.pgm-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
    gap: 18px;
}

.pgm-upload-only-grid {
    grid-template-columns: minmax(280px, 720px);
    justify-content: center;
}

.pgm-dashboard-form,
.pgm-photo-list,
.pgm-album-list {
    border: 1px solid var(--pgm-line);
    border-radius: 8px;
    background: var(--pgm-panel);
    box-shadow: 0 18px 60px rgba(24, 32, 31, 0.08);
    padding: 18px;
}

.pgm-dashboard-form h2,
.pgm-photo-list h2,
.pgm-album-list h2 {
    margin: 0 0 16px;
    font-size: 22px;
    letter-spacing: 0;
}

.pgm-dashboard-column {
    display: grid;
    align-content: start;
    gap: 18px;
}

.pgm-dashboard-form {
    display: grid;
    align-content: start;
    gap: 14px;
}

.pgm-avatar-editor {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}

.pgm-avatar-editor > img {
    width: 76px;
    height: 76px;
    border: 3px solid #fff;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(24, 32, 31, 0.14);
}

.pgm-photo-edit-preview {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--pgm-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(24, 32, 31, 0.1);
}

.pgm-photo-edit-preview[hidden] {
    display: none;
}

.pgm-photo-edit-preview img {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: cover;
}

.pgm-photo-edit-preview figcaption {
    color: var(--pgm-muted);
    font-size: 13px;
    font-weight: 800;
    padding: 9px 12px;
}

.pgm-dashboard-form label {
    display: grid;
    gap: 7px;
    color: var(--pgm-muted);
    font-size: 13px;
    font-weight: 800;
}

.pgm-submit-status,
.pgm-exif-status {
    margin: -4px 0 0;
    border-radius: 7px;
    background: rgba(15, 123, 117, 0.08);
    color: var(--pgm-muted);
    font-size: 13px;
    line-height: 1.45;
    padding: 10px 12px;
}

.pgm-submit-status[data-status="busy"] {
    background: rgba(224, 91, 63, 0.12);
    color: #9a3926;
    font-weight: 750;
}

.pgm-submit-status[data-status="error"] {
    background: #fff1df;
    color: #835329;
    font-weight: 750;
}

.pgm-exif-status[data-status="success"] {
    background: rgba(15, 123, 117, 0.12);
    color: var(--pgm-accent-dark);
}

.pgm-exif-status[data-status="warning"] {
    background: #fff1df;
    color: #835329;
}

.pgm-dashboard-form input,
.pgm-dashboard-form select,
.pgm-dashboard-form textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--pgm-line);
    border-radius: 7px;
    background: #fff;
    color: var(--pgm-ink);
    font: inherit;
    padding: 10px 12px;
}

.pgm-dashboard-form textarea {
    resize: vertical;
}

.pgm-dashboard-form .pgm-upload-button {
    width: fit-content;
    min-width: 150px;
    background: #24312f;
    color: #fff;
    box-shadow: 0 10px 22px rgba(20, 31, 29, 0.16);
}

.pgm-dashboard-form .pgm-upload-button:hover,
.pgm-dashboard-form .pgm-upload-button:focus-visible {
    background: var(--pgm-accent-dark);
    color: #fff;
}

.pgm-upload-button:disabled,
.pgm-upload-button.is-busy {
    cursor: progress;
    opacity: 0.78;
}

.pgm-upload-button.is-busy .pgm-upload-icon {
    animation: pgm-spin 0.9s linear infinite;
}

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

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

.pgm-photo-list {
    display: grid;
    align-content: start;
    gap: 12px;
}

.pgm-album-list {
    display: grid;
    align-content: start;
    gap: 12px;
}

.pgm-album-row {
    display: grid;
    gap: 12px;
    border: 1px solid var(--pgm-line);
    border-radius: 8px;
    background: #fff;
    padding: 12px;
}

.pgm-album-row-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.pgm-album-row h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

.pgm-album-row p {
    margin: 0;
    color: var(--pgm-muted);
    font-size: 13px;
}

.pgm-album-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.pgm-album-actions form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pgm-album-inline-form input {
    width: 150px;
    min-height: 36px;
    border: 1px solid var(--pgm-line);
    border-radius: 7px;
    color: var(--pgm-ink);
    font: inherit;
    font-size: 13px;
    padding: 7px 9px;
}

.pgm-album-actions button {
    min-height: 36px;
    border: 0;
    border-radius: 7px;
    background: rgba(15, 123, 117, 0.1);
    color: var(--pgm-accent-dark);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    padding: 7px 10px;
}

.pgm-album-actions .pgm-danger-button {
    background: #fff1df;
    color: #9a3926;
}

.pgm-album-photo-list {
    display: grid;
    gap: 10px;
    padding-top: 2px;
}

.pgm-album-photo-list summary {
    width: fit-content;
    min-height: 36px;
    border-radius: 7px;
    background: rgba(15, 123, 117, 0.1);
    color: var(--pgm-accent-dark);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    list-style: none;
    padding: 9px 12px;
}

.pgm-album-photo-list summary::-webkit-details-marker {
    display: none;
}

.pgm-album-photo-list[open] summary {
    background: var(--pgm-accent-dark);
    color: #fff;
}

.pgm-album-photo-list-body {
    display: grid;
    gap: 10px;
}

.pgm-photo-row {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 12px;
    min-height: 92px;
    border: 1px solid var(--pgm-line);
    border-radius: 8px;
    background: #fff;
    padding: 10px;
}

.pgm-photo-row img {
    width: 92px;
    height: 92px;
    border-radius: 6px;
    object-fit: cover;
}

.pgm-photo-row h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.pgm-photo-row p {
    margin: 0 0 10px;
    color: var(--pgm-muted);
    font-size: 13px;
}

.pgm-photo-row a {
    margin-right: 10px;
    color: var(--pgm-accent-dark);
    font-weight: 750;
}

.pgm-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 4px;
}

.pgm-pagination-status,
.pgm-pagination-disabled {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    border-radius: 7px;
    color: var(--pgm-muted);
    font-size: 14px;
    font-weight: 750;
    padding: 8px 12px;
}

.pgm-pagination-disabled {
    background: rgba(23, 33, 38, 0.06);
    color: rgba(97, 112, 109, 0.68);
}

.pgm-login-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 9;
    width: min(420px, calc(100vw - 32px));
    padding: 26px;
    border-radius: 8px;
    transform: translate(-50%, -50%);
}

.pgm-login-panel h1 {
    margin: 0 0 10px;
    color: var(--pgm-ink);
    font-size: clamp(32px, 8vw, 48px);
    line-height: 1;
    letter-spacing: 0;
}

.pgm-login-panel p {
    margin: 0 0 22px;
    color: var(--pgm-muted);
    font-size: 15px;
    line-height: 1.55;
}

.pgm-kicker {
    margin-bottom: 10px !important;
    color: var(--pgm-accent) !important;
    font-size: 12px !important;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-username,
.login-password,
.login-remember,
.login-submit {
    margin: 0 0 14px;
}

.login-username label,
.login-password label {
    display: block;
    margin-bottom: 7px;
    color: var(--pgm-ink);
    font-size: 13px;
    font-weight: 750;
}

.login-username input,
.login-password input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--pgm-line);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--pgm-ink);
    font: inherit;
    padding: 10px 12px;
}

.login-remember label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--pgm-muted);
    font-size: 14px;
}

.login-submit .button {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
}

.pgm-demo-logins {
    display: grid;
    gap: 7px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--pgm-line);
    color: var(--pgm-muted);
    font-size: 13px;
}

.pgm-demo-logins code {
    width: 100%;
    overflow-wrap: anywhere;
    border-radius: 6px;
    background: rgba(15, 123, 117, 0.1);
    color: var(--pgm-accent-dark);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    padding: 7px 9px;
}

.maplibregl-map {
    font-family: inherit;
}

.maplibregl-ctrl-attrib {
    font-size: 0.68rem;
}

.maplibregl-popup-content {
    width: min(240px, calc(100vw - 44px));
    max-width: calc(100vw - 44px);
    max-height: min(430px, calc(100vh - 120px));
    border-radius: 8px;
    padding: 10px;
    overflow: auto;
}

.photo-map-marker {
    display: block;
    width: 58px;
    height: 58px;
    border: 4px solid #fff;
    border-radius: 50%;
    background: #fff center / cover no-repeat;
    box-shadow: 0 0 0 7px rgba(224, 91, 63, 0.22), 0 10px 24px rgba(30, 40, 38, 0.34);
}

.cluster-marker {
    width: 48px;
    height: 48px;
    border: 4px solid #fff;
    border-radius: 50%;
    background: #243331;
    color: #fff;
    box-shadow: 0 0 0 8px rgba(36, 51, 49, 0.18), 0 10px 24px rgba(30, 40, 38, 0.34);
    cursor: pointer;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 850;
}

.cluster-popup {
    display: grid;
    width: min(220px, 68vw);
    max-height: 250px;
    overflow: auto;
    gap: 8px;
}

.cluster-popup button {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    border: 1px solid var(--pgm-line);
    border-radius: 8px;
    background: #fff;
    color: var(--pgm-ink);
    cursor: pointer;
    padding: 6px;
    text-align: left;
}

.cluster-popup img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.cluster-popup span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-popup {
    width: 100%;
    min-width: 0;
}

.photo-popup img {
    display: block;
    width: auto;
    max-width: min(200px, 100%);
    max-height: 200px;
    object-fit: contain;
    border-radius: 6px;
    margin: 0 auto 10px;
}

.photo-popup strong {
    display: block;
    margin-bottom: 4px;
    color: var(--pgm-ink);
    font-size: 15px;
}

.photo-popup p {
    margin: 0;
    color: var(--pgm-muted);
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.photo-popup a {
    color: var(--pgm-accent-dark);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.photo-popup a:hover {
    color: var(--pgm-ink);
}

@media (max-width: 640px) {
    .pgm-shell {
        padding: 0;
    }

    .pgm-map-card {
        position: relative;
        height: 100vh;
        height: 100svh;
        height: 100dvh;
        min-height: 100vh;
        border: 0;
        border-radius: 0;
    }

    .pgm-map-header {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        border-bottom: 0;
        background: var(--pgm-menu-bg);
        backdrop-filter: none;
    }

    .pgm-dashboard-header {
        align-items: stretch;
        flex-direction: column;
    }

    .pgm-map-primary-actions {
        min-width: 0;
    }

    .pgm-desktop-action {
        display: none;
    }

    .pgm-mobile-menu {
        display: block;
    }

    .pgm-mobile-menu-panel {
        position: fixed;
        top: 74px;
        right: 12px;
        left: auto;
        z-index: 1000;
        width: min(280px, calc(100vw - 24px));
    }

    .pgm-map-link,
    .pgm-upload-button {
        width: 100%;
    }

    .pgm-map {
        height: 100%;
        min-height: 100vh;
        min-height: 100svh;
        min-height: 100dvh;
        border-top: 0;
    }

    .pgm-dashboard-grid,
    .pgm-form-row,
    .pgm-photo-row {
        grid-template-columns: 1fr;
    }

    .pgm-album-row-main,
    .pgm-album-actions,
    .pgm-album-actions form {
        align-items: stretch;
        flex-direction: column;
    }

    .pgm-album-actions {
        width: 100%;
    }

    .pgm-album-inline-form input,
    .pgm-album-actions button,
    .pgm-album-actions .pgm-map-link,
    .pgm-album-photo-list summary {
        width: 100%;
    }

    .pgm-avatar-editor {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .pgm-photo-row img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}
