.mt-fp-field-wrapper {
    border-radius: 14px;
    border: 1px solid #e3e7eb;
    padding: 14px 16px 16px;
    background: #f7f9fc;
    margin-top: 8px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

/* HEADER */
.mt-fp-header-row {
    margin-bottom: 10px;
}

.mt-fp-title {
    font-weight: 600;
    font-size: 15px;
    color: #111827;
}

.mt-fp-subtitle {
    font-size: 12px;
    color: #6b7280;
}

/* TOOLBAR */
.mt-fp-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    margin-bottom: 10px;
}

.mt-fp-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Upload button: GREEN */
.mt-fp-upload-btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content:center;
    padding: 6px 12px;
    border-radius: 999px;
    background: #00a985;
    color: #ffffff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.25);
    border: none;
}

.mt-fp-upload-btn input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.mt-fp-upload-btn-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mt-fp-toolbar-hint {
    font-size: 11px;
    color: #6b7280;
}

/* MAIN LAYOUT */
.mt-fp-main-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 10px;
}

/* CANVAS SIDE */
.mt-fp-canvas-wrapper {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 8px;
}

.mt-fp-canvas-inner {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: repeating-conic-gradient(
        from 0deg,
        #f3f4f6 0deg 15deg,
        #e5e7eb 15deg 30deg
    );
    max-height: 580px;
}

.mt-fp-image {
    display: block;
    max-width: 100%;
    height: auto;
    cursor: crosshair;
}

.mt-fp-pins-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* PINS */
.mt-fp-pin {
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    transform: translate(-50%, -50%);
    box-shadow: 0 8px 14px rgba(15, 23, 42, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f9fafb;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.85);
}

/* Text icon */
.mt-fp-pin-icon {
    pointer-events: none;
}

/* Image icon */
.mt-fp-pin-icon-image {
    max-width: 18px;
    max-height: 18px;
    border-radius: 3px;
    pointer-events: none;
}

/* Location label under pin */
.mt-fp-pin-layer-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, 4px);
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 9px;
    white-space: nowrap;
    pointer-events: none;
}

/* Description bubble (hover) */
.mt-fp-pin-description {
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translate(-50%, 8px);
    padding: 4px 8px;
    font-size: 10px;
    max-width: 220px;
    border-radius: 10px;
    white-space: normal;
    line-height: 1.3;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.35);
}

/* Show description on hover */
.mt-fp-pin:hover .mt-fp-pin-description {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.mt-fp-pin-active {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

.mt-fp-legend {
    display: flex;
    justify-content: flex-start;
    gap: 14px;
    margin-top: 8px;
    font-size: 11px;
    color: #6b7280;
}

.mt-fp-legend-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    margin-right: 4px;
}

.mt-fp-legend-dot-public {
    background: #00a985;
}

.mt-fp-legend-dot-internal {
    background: #e74c3c;
}

/* MAP KEY under the image – same width as canvas */
.mt-fp-key {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 8px;
    margin-top: 8px;
}

.mt-fp-key-header {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.mt-fp-key-list {
    max-height: 160px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mt-fp-key-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    font-size: 11px;
}

.mt-fp-key-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    flex-shrink: 0;
}

.mt-fp-key-text {
    flex: 1;
}

.mt-fp-key-layer {
    font-weight: 500;
    color: #111827;
}

.mt-fp-key-description {
    font-size: 11px;
    color: #4b5563;
}

.mt-fp-key-empty {
    font-size: 11px;
    color: #9ca3af;
}

/* SIDEBAR */
.mt-fp-sidebar {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 580px;
}

.mt-fp-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.mt-fp-sidebar-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.mt-fp-sidebar-count {
    font-size: 11px;
    color: #6b7280;
}

/* Pin list fills sidebar when no pin is selected */
.mt-fp-pin-list {
    flex: 1;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 4px;
}

.mt-fp-pin-list-empty {
    font-size: 11px;
    color: #9ca3af;
    padding: 8px;
    text-align: center;
}

.mt-fp-pin-list-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    color: #111827;
}

.mt-fp-pin-list-row:hover {
    background: #e5f6ff;
}

.mt-fp-pin-list-row-active {
    background: #111827;
    color: #f9fafb;
}

.mt-fp-pin-list-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.8);
}

.mt-fp-pin-list-main {
    flex: 1;
}

.mt-fp-pin-list-title {
    font-weight: 500;
}

.mt-fp-pin-list-meta {
    font-size: 11px;
    color: inherit;
    opacity: 0.8;
}

/* EDITOR fills the whole right column when a pin is selected */
.mt-fp-pin-editor {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f3f4f6;
    padding: 8px;
    font-size: 12px;
    display: none;
    position: relative;
    z-index: 5;
}

.mt-fp-pin-editor-header {
    font-weight: 600;
    color: #111827;
    margin-bottom: 6px;
}

.mt-fp-pin-editor-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mt-fp-pin-editor-empty {
    border-radius: 10px;
    border: 1px dashed #d1d5db;
    background: #f9fafb;
    padding: 8px;
    font-size: 11px;
    color: #6b7280;
    text-align: center;
}

.mt-fp-field-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mt-fp-field-row label {
    font-size: 11px;
    color: #4b5563;
    font-weight: 500;
}

.mt-fp-field-row select,
.mt-fp-field-row input[type="text"],
.mt-fp-field-row input[type="color"],
.mt-fp-field-row textarea {
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #ffffff;
}

.mt-fp-field-row textarea {
    resize: vertical;
}

.mt-fp-small-hint {
    font-size: 10px;
    color: #9ca3af;
}

/* Color row */
.mt-fp-color-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mt-fp-color-preview {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #e5e7eb;
}

/* Editor actions */
.mt-fp-editor-actions {
    margin-top: 4px;
    display: flex;
    gap: 6px;
}

/* Save pin: GREEN */
.mt-fp-save-pin {
    border-radius: 999px;
    font-size: 11px;
    padding: 4px 10px;
    cursor: pointer;
    border: none;
    background: #00a985;
    color: #ffffff;
}

/* Delete pin */
.mt-fp-delete-pin {
    border-radius: 999px;
    font-size: 11px;
    padding: 4px 10px;
    cursor: pointer;
    border: none;
    background: #fee2e2;
    color: #b91c1c;
}

/* ENTRY PREVIEW */
.mt-fp-entry-preview {
    font-size: 12px;
    padding: 4px 0;
}

/* BOTTOM ROW */
.mt-fp-bottom-row {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 1;
}

/* FLOOR PLANS META */
.mt-fp-plans {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 8px;
    font-size: 12px;
}

.mt-fp-plans-header {
    font-weight: 600;
    font-size: 12px;
    color: #111827;
    margin-bottom: 4px;
}

.mt-fp-plans-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 4px;
}

.mt-fp-plan-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
    padding: 4px 6px;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.mt-fp-plan-radio {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mt-fp-plan-name {
    width: 100%;
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #ffffff;
}

.mt-fp-plan-visibility {
    font-size: 11px;
    padding: 3px 4px;
}

.mt-fp-add-plan {
    border-radius: 999px;
    font-size: 11px;
    padding: 4px 10px;
    border: none;
    background: #e5e7eb;
    color: #111827;
    cursor: pointer;
}

.mt-fp-add-plan:hover {
    background: #d1d5db;
}

.mt-fp-plans-hint {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 4px;
}

/* READ-ONLY MODE */
.mt-fp-field-wrapper.mt-fp-readonly .mt-fp-upload-btn,
.mt-fp-field-wrapper.mt-fp-readonly .mt-fp-toolbar-hint,
.mt-fp-field-wrapper.mt-fp-readonly .mt-fp-pin-editor {
    opacity: 0.4;
    pointer-events: none;
}

.mt-fp-field-wrapper.mt-fp-readonly .mt-fp-image {
    cursor: default;
}

.mt-fp-field-wrapper.mt-fp-readonly .mt-fp-pin-list-row {
    cursor: default;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .mt-fp-main-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}