/* ===== Point detail: top-right "Редактировать" pill button + edit modal ===== */
.mp-edit-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    transition: border-color .15s, background .15s;
}
.mp-edit-pill-btn:hover { border-color: #d1d5db; background: var(--card-hover-bg); }

.mp-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mp-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
}
.mp-modal__box {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 480px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}
.mp-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}
.mp-modal__title { font-size: 15px; font-weight: 600; color: #1f2933; margin: 0; }
.mp-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.15s;
}
.mp-modal__close:hover { color: #1f2933; }
.mp-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px 20px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 18px;
}
.breadcrumb__item {
    font-size: 14px;
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s;
    overflow-wrap: break-word;
}
.breadcrumb__item:hover { color: #374151; }
.breadcrumb__item--last { color: #64748b; }
.breadcrumb__item--last:hover { color: #1f2933; }
.breadcrumb__sep { font-size: 14px; color: #94a3b8; line-height: 1; }
.breadcrumb__current { font-size: 14px; color: #1f2933; }

/* ===== Category / detail: small icon badge next to heading ===== */
.mp-cat-icon-sm {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mp-cat-icon-sm svg { width: 18px; height: 18px; }

/* ===== Category filter pills (/map/points/) ===== */
.mp-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.mp-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #4b5563;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color .15s, background .15s, color .15s;
}
.mp-pill:hover { border-color: #d1d5db; background: var(--card-hover-bg); }
.mp-pill--active { background: #0b2a48; color: #fff; border-color: transparent; }
.mp-pill--active:hover { background: #0b2a48; color: #fff; }
.mp-pill__count { font-size: 11.5px; opacity: 0.8; }

/* ===== Point grid (/map/points/ and /map/points/<category>/) ===== */
.mp-point-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}
.mp-point-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: #1f2933;
    transition: background 0.15s;
}
.mp-point-card:hover { background: var(--card-hover-bg); }
.mp-point-card__media {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}
.mp-point-card__media-icon {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6f7f8;
    border-bottom: 1px solid #f0f2f4;
}
.mp-point-card__media-icon svg { width: 32px; height: 32px; filter: brightness(0.45); }
.mp-point-card__body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mp-point-card__title {
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mp-point-card__meta {
    font-size: 12.5px;
    color: #9ca3af;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Related posts (point detail page, main column) ===== */
.mp-post-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.mp-post-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: #1f2933;
    transition: background 0.15s, border-color 0.15s;
}
.mp-post-card:hover { background: var(--card-hover-bg); border-color: #d1d5db; }
.mp-post-card__media {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}
.mp-post-card__media--placeholder {
    background: #f3f4f6;
    color: #c1c7cf;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mp-post-card__body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.mp-post-card__title {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mp-post-card__meta {
    font-size: 12px;
    color: #9ca3af;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Own pending (not-yet-moderated) photo thumbs, inline in the gallery strip ===== */
.boat-gallery__thumb--pending {
    position: relative;
    overflow: hidden;
    background: #f6f7f8;
    cursor: pointer;
}
.boat-gallery__thumb--pending img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.5; }
.boat-gallery__thumb-pending__badge {
    position: absolute;
    bottom: 3px;
    left: 3px;
    right: 3px;
    background: rgba(11, 42, 72, 0.85);
    color: #fff;
    font-size: 9.5px;
    text-align: center;
    padding: 2px 3px;
    border-radius: 4px;
}
.boat-gallery__thumb-pending__delete {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.boat-gallery__thumb-pending__delete:hover { background: rgba(0, 0, 0, 0.75); }
.boat-gallery__thumb-pending__delete:disabled { opacity: 0.5; cursor: default; }

/* ===== Add-photo tile, pinned to the left of the gallery thumbnail strip ===== */
.boat-gallery__thumb--add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: #f6f7f8;
    border: 1.5px solid #d1d5db;
    color: #9ca3af;
    font-size: 10.5px;
    cursor: pointer;
    position: sticky;
    left: 0;
    z-index: 1;
    transition: border-color .15s, background .15s, color .15s;
}
.boat-gallery__thumb--add::after {
    content: '';
    position: absolute;
    top: 0;
    left: calc(100% + 1.5px);
    width: 8px;
    height: 100%;
    background: #fff;
}
.boat-gallery__thumb--add:hover { border-color: #9ca3af; background: var(--card-hover-bg); color: #4b5563; }

/* ===== Point detail: cap the gallery hero height (shared .boat-gallery is sized for full page width) ===== */
.mp-detail-main .boat-gallery__main { width: 100%; max-height: 360px; }

/* ===== Point detail: two-column layout with sticky right sidebar ===== */
.mp-detail-layout {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}
.mp-detail-main {
    flex: 1;
    min-width: 0;
    order: 1;
}
.mp-detail-sidebar {
    flex: 0 0 auto;
    width: min(360px, max(240px, calc(100% - 824px)));
    display: flex;
    flex-direction: column;
    gap: 14px;
    order: 2;
}
.mp-detail-sidebar .linked-projects-card { margin-bottom: 0; }
@media (max-width: 900px) {
    .mp-detail-layout { flex-direction: column; align-items: stretch; gap: 16px; }
    .mp-detail-main, .mp-detail-sidebar { display: contents; }

    .mp-sidebar-actions { order: 1; }
    .boat-gallery { order: 2; }
    .boat-info-card { order: 3; }
    .mp-posts-card { order: 4; }
    .mp-map-card { order: 5; }
    .mp-contacts-card { order: 6; }
    .mp-company-card { order: 7; }
    .mp-coords-card { order: 8; }
    .mp-confirm-card { order: 9; }
    .mp-questions-card { order: 10; }
    .mp-pending-suggestion-card { order: 11; }
    .comments-section { order: 12; }
}

/* ===== Mini-map (point detail page) ===== */
.mp-map-card { padding: 0; overflow: hidden; gap: 0; }
.mp-map { width: 100%; height: 220px; isolation: isolate; }
.mp-map .maplibregl-ctrl-attrib { font-size: 9px; }
.mp-map .maplibregl-ctrl-attrib-inner { display: none !important; }
.mp-map-card__link {
    display: block;
    padding: 10px 14px;
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    border-top: 1px solid #e5e7eb;
}
.mp-map-card__link:hover { color: #374151; }

/* ===== "Добавлено ... пользователем X" (point detail page) ===== */
.mp-added-by-link {
    color: #0b2a48;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: #c8d9ea;
    text-underline-offset: 3px;
    transition: text-decoration-color 0.15s;
}
.mp-added-by-link:hover { text-decoration-color: #0b2a48; }

/* ===== Contacts (point detail page sidebar) ===== */
.mp-contact-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
}
.mp-contact-row:not(:last-child) { border-bottom: 1px solid #f3f4f6; }
.mp-contact-row svg { flex-shrink: 0; margin-top: 3px; color: #9ca3af; }
.mp-contact-row__label { font-size: 12px; color: #9ca3af; margin-bottom: 1px; }
.mp-contact-row__value { font-size: 14px; color: #1f2933; text-decoration: none; word-break: break-word; }
a.mp-contact-row__value:hover { color: #0b4f7a; text-decoration: underline; }

/* ===== Coordinates (point detail page sidebar) ===== */
.mp-coords-title { font-weight: 700; }
.mp-coords-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.mp-coords-value {
    font-size: 14px;
    font-family: inherit;
    color: #1f2933;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mp-coords-copy {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: none;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s;
}
.mp-coords-copy:hover { background: var(--card-hover-bg); }

/* ===== Suggest-edit form (point detail page) ===== */
.mp-form-label { display: block; font-weight: 500; color: #1f2933; margin: 0 0 6px; font-size: 14px; }
.mp-form-input, .mp-form-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    margin-bottom: 12px;
    font-family: inherit;
}
.mp-form-textarea { resize: vertical; min-height: 76px; }
.mp-form-submit {
    padding: 9px 20px;
    border-radius: 8px;
    border: none;
    background: #0b2a48;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.mp-form-submit:disabled { opacity: 0.6; cursor: default; }
.mp-form-submit--danger { background: #dc2626; }
.mp-form-submit--danger:hover { background: #b91c1c; }
.mp-form-error { color: #dc2626; font-size: 13px; margin: 0 0 10px; }
.mp-photo-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #fafafa;
    color: #4b5563;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.mp-photo-upload-btn:hover { border-color: #9ca3af; background: var(--card-hover-bg); }
.mp-photo-upload-hint { font-size: 13px; color: #9ca3af; margin: 8px 0 0; }
.mp-photo-upload-error { font-size: 13px; color: #dc2626; margin: 8px 0 0; }

/* ===== Actuality confirmations (point detail page sidebar) ===== */
.mp-confirm-history-link {
    border: none;
    background: none;
    color: #2563eb;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}
.mp-confirm-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.mp-confirm-btn {
    padding: 7px 12px;
    border-radius: 8px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.mp-confirm-btn--ok { color: #15803d; }
.mp-confirm-btn--ok:hover { border-color: #86efac; background: #f0fdf4; }
.mp-confirm-btn--ok.mp-confirm-btn--active { border-color: #15803d; background: #15803d; color: #fff; }
.mp-confirm-btn--issue { color: #b45309; }
.mp-confirm-btn--issue:hover { border-color: #fcd34d; background: #fffbeb; }
.mp-confirm-btn--issue.mp-confirm-btn--active { border-color: #b45309; background: #b45309; color: #fff; }
.mp-confirm-form { margin: 4px 0 4px; position: relative; }
.mp-confirm-form__cancel {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
}
.mp-confirm-form__cancel:hover { color: #1f2933; }

.mp-confirm-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}
.mp-confirm-entry { display: flex; gap: 8px; position: relative; }
.mp-confirm-entry__body { min-width: 0; padding-right: 20px; }
.mp-confirm-entry__delete {
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
}
.mp-confirm-entry__delete:hover { color: #1f2933; }
.mp-confirm-entry__avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
}
.mp-confirm-entry__avatar--placeholder {
    background: #0B1F33;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}
.mp-confirm-entry__meta { font-size: 12px; color: #9ca3af; }
.mp-confirm-entry--issue .mp-confirm-entry__meta { color: #b45309; }
.mp-confirm-entry__name { display: block; font-size: 13.5px; font-weight: 600; color: #1f2933; text-decoration: none; }
.mp-confirm-entry__name:hover { text-decoration: underline; }
.mp-confirm-entry__comment { font-size: 13px; color: #4b5563; margin: 2px 0 0; line-height: 1.5; white-space: pre-wrap; }

/* ===== Questions (point detail page sidebar) ===== */
.mp-questions-card__header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mp-question-ask-link {
    border: none;
    background: none;
    color: #2563eb;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    white-space: nowrap;
}
.mp-question-ask-link:hover { text-decoration: underline; }
.mp-question-list { display: flex; flex-direction: column; }
.mp-question-entry {
    display: block;
    padding: 8px 0;
    text-decoration: none;
    border-top: 1px solid #f0f1f3;
}
.mp-question-entry:first-child { border-top: none; padding-top: 0; }
.mp-question-entry__title {
    font-size: 13.5px;
    font-weight: 400;
    color: #374151;
    line-height: 1.3;
}
.mp-question-entry__meta { font-size: 12px; color: #9ca3af; margin-top: 2px; }

/* ===== Flatten card chrome in the main column (point detail page) ===== */
.mp-detail-main .boat-info-card,
.mp-detail-main .linked-projects-card,
.mp-detail-main .comments-section {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 32px;
}
.mp-detail-main .comments-section { margin-top: 0; }
.mp-detail-main .boat-gallery { margin-bottom: 32px; }
.mp-detail-main .comments-title {
    font-size: 17px;
    font-weight: 700;
}
.mp-detail-main .comments-count-badge { font-size: 17px; }

/* ===== Point detail: header (breadcrumb / edit button / title / category / added-by) ===== */
.mp-header-grid {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
        "breadcrumb breadcrumb editbtn"
        "caticon    title      title"
        "catlabel   catlabel   catlabel"
        "addedby    addedby    addedby";
    align-items: center;
    column-gap: 10px;
    row-gap: 6px;
    margin-bottom: 18px;
}
.mp-header-breadcrumb { grid-area: breadcrumb; margin-bottom: 0; }
.mp-header-actions { grid-area: editbtn; justify-self: end; display: flex; align-items: center; gap: 10px; }
.mp-header-caticon { grid-area: caticon; }
.mp-header-title { grid-area: title; margin: 0; }
.mp-header-catlabel { grid-area: catlabel; font-size: 13px; display: inline-flex; align-items: center; gap: 8px; }
.mp-pending-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1.5px solid #fde68a;
    background: #fef3c7;
    color: #92400e;
    font-size: 13px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    white-space: nowrap;
    flex-shrink: 0;
}
.mp-delete-point-link {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1.5px solid #fecaca;
    background: #fff;
    color: #dc2626;
    font-size: 13px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    transition: border-color .15s, background .15s;
}
.mp-delete-point-link:hover { border-color: #f87171; background: #fef2f2; }
.mp-header-addedby { grid-area: addedby; justify-self: start; text-align: left; font-size: 13px; color: #9ca3af; }

.mp-sidebar-actions { display: none; }

@media (max-width: 900px) {
    .mp-header-grid {
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "breadcrumb breadcrumb"
            "title      title"
            "caticon    catlabel"
            "addedby    addedby";
        row-gap: 8px;
    }
    .mp-header-actions--desktop { display: none; }
    .mp-sidebar-actions { display: flex; align-items: center; gap: 10px; align-self: flex-start; }

    .mp-detail-main .boat-gallery,
    .mp-detail-main .boat-info-card,
    .mp-detail-main .mp-posts-card {
        margin-bottom: 8px;
    }
}
