* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans JP', sans-serif;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
}

/* --- コントロールパネル (ドロワー) --- */
.map-overlay {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 20;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px 16px;
    padding-top: 60px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

.map-overlay.drawer-open {
    transform: translateX(0);
}

.map-overlay-inner {
    background: rgba(245, 240, 230, 0.6);
    box-shadow: none;
    border: none;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
}

.map-overlay label {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.map-overlay input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #c9a96e, #8b6914);
    outline: none;
    margin-top: 8px;
    cursor: pointer;
}

.map-overlay input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #8b6914;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

/* --- トグルスイッチ --- */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background: linear-gradient(135deg, #c9a96e, #8b6914);
}

input:checked+.toggle-slider:before {
    transform: translateX(22px);
}

/* --- 登録ボタン --- */
.register-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.register-btn.inactive {
    background: linear-gradient(135deg, #c9a96e, #a88532);
    color: #fff;
    box-shadow: 0 2px 12px rgba(139, 105, 20, 0.3);
}

.register-btn.inactive:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(139, 105, 20, 0.4);
}

.register-btn.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    box-shadow: 0 2px 12px rgba(231, 76, 60, 0.3);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 2px 12px rgba(231, 76, 60, 0.3);
    }

    50% {
        box-shadow: 0 2px 20px rgba(231, 76, 60, 0.6);
    }
}

/* --- 登録モード表示 --- */
.register-mode-banner {
    display: none;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(231, 76, 60, 0.9);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    z-index: 20;
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.4);
    animation: slide-down 0.3s ease;
}

.register-mode-banner.show {
    display: block;
}

@keyframes slide-down {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* --- モーダル --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    justify-content: center;
    align-items: center;
    animation: fade-in 0.2s ease;
}

.modal-overlay.show {
    display: flex;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    width: 380px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modal-pop 0.3s ease;
}

@keyframes modal-pop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal h3 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal .form-group {
    margin-bottom: 16px;
}

.modal .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 6px;
}

.modal .form-group input[type="text"],
.modal .form-group input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
    transition: border-color 0.2s;
    outline: none;
}

.modal .form-group input:focus {
    border-color: #c9a96e;
}

.modal .form-group .coord-display {
    font-size: 12px;
    color: #888;
    background: #f5f5f5;
    padding: 8px 10px;
    border-radius: 6px;
    font-family: monospace;
}

/* --- ファイルアップロード --- */
.file-upload-area {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #999;
    font-size: 13px;
}

.file-upload-area:hover {
    border-color: #c9a96e;
    background: #fdf8ef;
    color: #8b6914;
}

.file-upload-area.has-file {
    border-color: #27ae60;
    background: #f0faf3;
    color: #27ae60;
}

.file-upload-area input {
    display: none;
}

.file-upload-area .preview-img {
    max-width: 100%;
    max-height: 120px;
    border-radius: 6px;
    margin-top: 8px;
}

/* --- ボタン群 --- */
.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #c9a96e, #a88532);
    color: #fff;
    box-shadow: 0 2px 8px rgba(139, 105, 20, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 105, 20, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}

.btn-danger:hover {
    transform: translateY(-1px);
}

/* --- ポップアップ ボタン群 --- */
.ukiyoe-popup .popup-buttons {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.edit-btn {
    flex: 1;
    padding: 6px 0;
    font-size: 12px;
    border: 1px solid #c9a96e;
    background: linear-gradient(135deg, #fdf3e0, #f5e6c8);
    color: #8b6914;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
}

.edit-btn:hover {
    background: linear-gradient(135deg, #c9a96e, #8b6914);
    color: #fff;
    transform: translateY(-1px);
}

/* --- ポップアップ 閉じるボタン --- */
.maplibregl-popup-close-button {
    font-size: 24px;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    top: -12px;
    right: -12px;
    border: 2px solid #fff;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    padding: 0;
    z-index: 1;
}

.maplibregl-popup-close-button:hover {
    background: rgba(231, 76, 60, 0.9);
    transform: scale(1.1);
}

/* --- ポップアップ(浮世絵詳細) --- */
.ukiyoe-popup {
    width: 230px;
}

.ukiyoe-popup h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #2c3e50;
}

.ukiyoe-popup img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 8px;
}

.ukiyoe-popup .delete-btn {
    flex: 1;
    padding: 6px 0;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-family: 'Noto Sans JP', sans-serif;
    text-align: center;
}

.ukiyoe-popup .delete-btn:hover {
    background: #c0392b;
}

/* --- トースト通知 --- */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toast.success {
    background: #27ae60;
    color: #fff;
}

.toast.error {
    background: #e74c3c;
    color: #fff;
}

/* --- ローディング --- */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

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

/* カーソル変更 */
.register-cursor .maplibregl-canvas {
    cursor: crosshair !important;
}

/* --- 認証バー --- */
.auth-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 14px;
}

.auth-bar .user-info-btn {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
    color: #333;
}

.auth-bar .user-info-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.auth-bar .user-info-btn::after {
    content: '✎';
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s;
    margin-left: 2px;
}

.auth-bar .user-info-btn:hover::after {
    opacity: 0.7;
}

/* アカウント設定モーダル */
.account-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.account-modal-overlay.show {
    display: flex;
}

.account-modal {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px 20px;
    width: 320px;
    max-width: 90vw;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    animation: modal-slide-in 0.25s ease;
}

@keyframes modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.account-modal h3 {
    margin: 0 0 18px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.account-modal .account-field {
    margin-bottom: 16px;
}

.account-modal .account-field+#account-avatar-section {
    margin-top: 0;
}

.account-modal .account-field label {
    display: block;
    font-size: 11px;
    color: #999;
    font-weight: 500;
    margin-bottom: 5px;
}

.account-modal .account-field .account-value {
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
    font-family: 'Noto Sans JP', sans-serif;
}

.account-modal .account-field input {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Noto Sans JP', sans-serif;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.account-modal .account-field input:focus {
    border-color: #c9a96e;
}

.account-delete-section {
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.btn-account-delete {
    background: none;
    border: none;
    color: #999;
    font-size: 12px;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    padding: 4px 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.btn-account-delete:hover {
    color: #e74c3c;
}

.account-modal .account-modal-buttons {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    justify-content: flex-end;
}

.account-modal .btn-account-cancel {
    padding: 8px 18px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
}

.account-modal .btn-account-cancel:hover {
    background: #e0e0e0;
}

.account-modal .btn-account-ok {
    padding: 8px 22px;
    background: linear-gradient(135deg, #c9a96e, #a88532);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
}

.account-modal .btn-account-ok:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(168, 133, 50, 0.35);
}

.auth-bar .user-info-btn .role-badge {
    background: #c9a96e;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 700;
}

.auth-bar .role-badge.admin {
    background: #e74c3c;
}

.auth-bar .role-badge.premium {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.auth-btn {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-btn:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.auth-btn.logout {
    font-size: 12px;
    padding: 6px 12px;
    color: #888;
}

/* --- 認証モーダル --- */
.auth-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.auth-modal-overlay.show {
    display: flex;
}

.auth-modal {
    background: #fff;
    border-radius: 16px;
    padding: 28px 32px;
    width: 340px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.auth-modal h3 {
    margin: 0 0 18px;
    text-align: center;
    font-size: 18px;
}

.auth-modal .form-group {
    margin-bottom: 14px;
}

.auth-modal .form-group label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.auth-modal .form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
}

.auth-modal .divider {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin: 14px 0;
    position: relative;
}

.auth-modal .divider::before,
.auth-modal .divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #ddd;
}

.auth-modal .divider::before {
    left: 0;
}

.auth-modal .divider::after {
    right: 0;
}

.google-btn-wrapper {
    padding: 20px 0;
}

.google-btn {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.google-btn:hover {
    background: #f5f5f5;
}

.auth-tabs {
    display: flex;
    margin-bottom: 16px;
    border-bottom: 2px solid #eee;
}

.auth-tab {
    flex: 1;
    padding: 8px;
    text-align: center;
    font-size: 14px;
    cursor: pointer;
    border: none;
    background: none;
    font-family: 'Noto Sans JP', sans-serif;
    color: #999;
    transition: all 0.2s;
}

.auth-tab.active {
    color: #333;
    border-bottom: 2px solid #c9a96e;
    margin-bottom: -2px;
}

.auth-error {
    color: #e74c3c;
    font-size: 12px;
    text-align: center;
    margin-top: 8px;
    min-height: 16px;
}

.auth-checkbox-group,
.account-checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.auth-checkbox-group input[type="checkbox"],
.account-checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #c9a96e;
    cursor: pointer;
    flex-shrink: 0;
}

.auth-checkbox-group label,
.account-checkbox-group label {
    font-size: 13px;
    color: #555;
    cursor: pointer;
    user-select: none;
}

/* --- タグ入力 --- */
.tag-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    min-height: 42px;
    cursor: text;
    transition: border-color 0.2s;
}

.tag-input-container:focus-within {
    border-color: #c9a96e;
}

.tag-input-container input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 80px;
    font-size: 13px;
    font-family: 'Noto Sans JP', sans-serif;
    padding: 2px 0;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #fdf3e0, #f5e6c8);
    color: #8b6914;
    border: 1px solid #e0c88a;
    border-radius: 14px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    animation: chip-in 0.2s ease;
}

@keyframes chip-in {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.tag-chip .remove-tag {
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.tag-chip .remove-tag:hover {
    opacity: 1;
}

/* --- タグ検索 --- */

/* ポップアップ内タグ */
.ukiyoe-popup .popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.ukiyoe-popup .popup-tag {
    display: inline-block;
    background: #fdf3e0;
    color: #8b6914;
    border: 1px solid #e0c88a;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.ukiyoe-popup .popup-tag:hover {
    background: #c9a96e;
    color: #fff;
}

/* --- ドロワー開閉ボタン --- */
.drawer-toggle {
    display: flex;
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 11;
    height: 40px;
    padding: 0 14px 0 4px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
    color: #333;
    white-space: nowrap;
}

.drawer-toggle .app-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #c9a96e;
}

.drawer-toggle .app-name {
    font-weight: 700;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
    color: #333;
    letter-spacing: 0.5px;
}

.drawer-toggle .hamburger-icon {
    font-size: 20px;
    line-height: 1;
    color: #555;
    padding: 0 4px;
}

.drawer-toggle:active {
    transform: scale(0.9);
}

/* --- ヘッダーラッパー（タイトル＋検索バー） --- */
.header-bar {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 11;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.header-bar>* {
    pointer-events: auto;
}

/* drawer-toggleを相対配置に変更 */
.drawer-toggle {
    position: relative;
    top: auto;
    left: auto;
}

/* --- グローバル検索バー --- */
.global-search-bar {
    position: relative;
    display: none;
    align-items: center;
}

.global-search-bar.show {
    display: flex;
}

.global-search-bar .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    color: #999;
    pointer-events: none;
    z-index: 1;
}

.global-search-bar input {
    width: 100%;
    height: 40px;
    padding: 0 36px 0 36px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
    color: #333;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.global-search-bar input::placeholder {
    color: #aaa;
    font-size: 13px;
}

.global-search-bar input:focus {
    border-color: #c9a96e;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 0 0 3px rgba(201, 169, 110, 0.2);
}

.global-search-bar .search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: rgba(0, 0, 0, 0.08);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    color: #888;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: background 0.2s;
}

.global-search-bar .search-clear:hover {
    background: rgba(0, 0, 0, 0.15);
}

.global-search-bar .search-clear.show {
    display: flex;
}

.global-search-bar .search-result-badge {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    pointer-events: none;
    display: none;
}

.global-search-bar .search-result-badge.show {
    display: block;
}

/* モバイルレイアウト: タイトルの下に検索バー */
@media (max-width: 600px) {
    .header-bar {
        flex-wrap: wrap;
    }
}


/* --- ドロワー内ガイドラインリンク --- */
.drawer-guideline-link {
    margin-top: auto;
    padding: 12px 16px;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.97);
}

.drawer-guideline-link a {
    color: #888;
    font-size: 12px;
    text-decoration: none;
    transition: color 0.2s;
}

.drawer-guideline-link a:hover {
    color: #165e83;
    text-decoration: underline;
}

/* --- ドロワー内パーツ --- */
.drawer-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background 0.2s;
}

.drawer-close-btn:hover {
    background: rgba(0, 0, 0, 0.12);
}

.drawer-title {
    position: absolute;
    top: 14px;
    left: 16px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-title .drawer-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #c9a96e;
}

/* モバイル用の認証バー位置調整 */
@media (max-width: 480px) {
    .auth-bar .user-info span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 140px;
        display: inline-block;
        vertical-align: middle;
    }
}

/* --- 画像プレビュー ライトボックス --- */
.image-preview-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    cursor: pointer;
    animation: fade-in 0.25s ease;
}

.image-preview-overlay.show {
    display: flex;
}

.image-preview-overlay img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    cursor: default;
    transition: transform 0.1s ease;
    transform-origin: center center;
}

.image-preview-overlay img.dragging {
    transition: none;
    cursor: grabbing;
}

.image-preview-overlay img.zoomed {
    cursor: grab;
}

.image-preview-overlay .zoom-indicator {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.image-preview-overlay .zoom-indicator.show {
    opacity: 1;
}

.image-preview-overlay .preview-title {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    margin-top: 16px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.image-preview-overlay .preview-close {
    position: absolute;
    top: 20px;
    right: 24px;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: background 0.2s;
}

.image-preview-overlay .preview-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ナビゲーションボタン（前後画像） */
.image-preview-overlay .preview-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 48px;
    width: 56px;
    height: 80px;
    border-radius: 12px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 10;
    line-height: 1;
    padding: 0;
    font-family: sans-serif;
}

.image-preview-overlay .preview-nav.show {
    display: flex;
}

.image-preview-overlay .preview-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.image-preview-overlay .preview-nav:active {
    transform: translateY(-50%) scale(0.92);
}

.image-preview-overlay .preview-nav-prev {
    left: 16px;
}

.image-preview-overlay .preview-nav-next {
    right: 16px;
}

/* 画像カウンター（1/3 など） */
.image-preview-overlay .preview-counter {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin-top: 8px;
    display: none;
}

.image-preview-overlay .preview-counter.show {
    display: block;
}

@media (max-width: 600px) {
    .image-preview-overlay .preview-nav {
        font-size: 36px;
        width: 44px;
        height: 64px;
    }

    .image-preview-overlay .preview-nav-prev {
        left: 8px;
    }

    .image-preview-overlay .preview-nav-next {
        right: 8px;
    }
}

.ukiyoe-popup img {
    cursor: pointer;
    transition: opacity 0.2s;
}

.ukiyoe-popup img:hover {
    opacity: 0.8;
}

/* --- 無効状態パネル --- */
.map-overlay-inner.disabled-panel {
    opacity: 0.45;
    pointer-events: none;
    position: relative;
}



/* --- ウェルカムモーダル --- */
.welcome-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    animation: fade-in 0.3s ease;
}

.welcome-overlay.show {
    display: flex;
}

.welcome-card {
    background: linear-gradient(160deg, #fffdf7 0%, #faf3e4 100%);
    border-radius: 20px;
    padding: 36px 32px 28px;
    width: 360px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(201, 169, 110, 0.2);
    text-align: center;
    animation: modal-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.welcome-card .welcome-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #c9a96e;
    box-shadow: 0 4px 16px rgba(201, 169, 110, 0.3);
    margin-bottom: 16px;
}

.welcome-card h2 {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 6px;
}

.welcome-card .welcome-subtitle {
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
    line-height: 1.6;
}

.welcome-card .welcome-features {
    text-align: left;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 22px;
    font-size: 13px;
    color: #555;
    line-height: 1.8;
}

.welcome-card .welcome-features span {
    display: block;
}

.welcome-card .welcome-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.welcome-card .btn-welcome-register {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    background: linear-gradient(135deg, #c9a96e, #a88532);
    color: #fff;
    box-shadow: 0 4px 16px rgba(139, 105, 20, 0.3);
    transition: all 0.2s ease;
}

.welcome-card .btn-welcome-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 105, 20, 0.4);
}

.welcome-card .btn-welcome-browse {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    background: transparent;
    color: #999;
    transition: color 0.2s;
}

.welcome-card .btn-welcome-browse:hover {
    color: #666;
}

/* --- 瓦版 右スライドアウトドロワー --- */
.pin-detail-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 360px;
    z-index: 30;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pin-detail-drawer.open {
    transform: translateX(0);
}

.pin-detail-drawer-header {
    background: transparent;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.pin-detail-drawer-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.pin-detail-drawer-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background 0.2s;
}

.pin-detail-drawer-close:hover {
    background: rgba(0, 0, 0, 0.12);
}

.pin-detail-drawer-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

.pin-detail-drawer .pin-memo {
    font-size: 15px;
    color: #333;
    margin-bottom: 16px;
    line-height: 1.7;
    word-break: break-word;
    white-space: pre-wrap;
    background: rgba(245, 240, 230, 0.5);
    border-radius: 12px;
    padding: 16px;
}

.pin-detail-drawer .pin-meta {
    font-size: 12px;
    color: #999;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}

.pin-detail-drawer .pin-author {
    font-weight: 500;
    color: #165e83;
}

.pin-detail-drawer .pin-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 16px;
}

.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 4px 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Noto Sans JP', sans-serif;
    color: #999;
    line-height: 1;
}

.reaction-btn:hover {
    transform: translateY(-1px);
}

.reaction-btn.like-btn:hover {
    border-color: #e74c3c;
    color: #e74c3c;
    background: #fef0ef;
}

.reaction-btn.like-btn.active {
    border-color: #e74c3c;
    color: #e74c3c;
    background: #fef0ef;
}

.reaction-btn.dislike-btn:hover {
    border-color: #3498db;
    color: #3498db;
    background: #eef6fd;
}

.reaction-btn.dislike-btn.active {
    border-color: #3498db;
    color: #3498db;
    background: #eef6fd;
}

.reaction-btn .reaction-count {
    font-size: 12px;
    min-width: 8px;
    text-align: center;
}

/* コメント・返信内リアクション */
.inline-reactions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.inline-reactions .reaction-btn {
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 12px;
}

.inline-reactions .reaction-btn .reaction-count {
    font-size: 11px;
}

.pin-detail-drawer .delete-pin-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    font-family: 'Noto Sans JP', sans-serif;
}

.pin-detail-drawer .delete-pin-btn:hover {
    color: #e74c3c;
    background: #fef0ef;
}

.pin-detail-drawer .reply-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
}

.pin-detail-drawer .reply-section {
    max-height: 300px;
    overflow-y: auto;
}

.pin-detail-drawer .reply-item {
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}

.pin-detail-drawer .reply-item:last-child {
    border-bottom: none;
}

.pin-detail-drawer .reply-author {
    font-weight: 500;
    color: #165e83;
    margin-right: 6px;
}

.pin-detail-drawer .reply-date {
    color: #ccc;
    font-size: 11px;
    margin-left: 4px;
}

.pin-detail-drawer .reply-delete {
    float: right;
    cursor: pointer;
    color: #ccc;
    font-size: 11px;
    transition: color 0.2s;
}

.pin-detail-drawer .reply-delete:hover {
    color: #e74c3c;
}

.pin-detail-drawer .reply-body {
    color: #555;
    margin-top: 4px;
    line-height: 1.6;
    word-break: break-word;
}

.pin-detail-drawer .reply-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.pin-detail-drawer .reply-input {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    font-family: 'Noto Sans JP', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.pin-detail-drawer .reply-input:focus {
    border-color: #165e83;
}

.pin-detail-drawer .reply-submit {
    background: linear-gradient(135deg, #c9a96e, #a88532);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(139, 105, 20, 0.3);
}

.pin-detail-drawer .reply-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 105, 20, 0.4);
}


/* --- 右ドロワー リサイズハンドル --- */
.drawer-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    z-index: 10;
    background: transparent;
    transition: background 0.15s;
}

.drawer-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 36px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}

.drawer-resize-handle:hover {
    background: rgba(0, 0, 0, 0.08);
}

.drawer-resize-handle:hover::after {
    background: rgba(0, 0, 0, 0.3);
}

/* --- 浮世絵 右スライドアウトドロワー --- */
.ukiyoe-detail-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    z-index: 30;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ukiyoe-detail-drawer.open {
    transform: translateX(0);
}

.ukiyoe-detail-drawer-header {
    background: transparent;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.ukiyoe-detail-drawer-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.ukiyoe-detail-drawer-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background 0.2s;
}

.ukiyoe-detail-drawer-close:hover {
    background: rgba(0, 0, 0, 0.12);
}

.ukiyoe-detail-drawer-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

.ukiyoe-detail-drawer .ukiyoe-drawer-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.ukiyoe-detail-drawer .ukiyoe-drawer-image:hover {
    opacity: 0.85;
}

.ukiyoe-detail-drawer .ukiyoe-drawer-name {
    font-size: 17px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.ukiyoe-detail-drawer .ukiyoe-drawer-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.ukiyoe-detail-drawer .ukiyoe-drawer-tag {
    display: inline-block;
    background: #fdf3e0;
    color: #8b6914;
    border: 1px solid #e0c88a;
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.ukiyoe-detail-drawer .ukiyoe-drawer-tag:hover {
    background: #c9a96e;
    color: #fff;
}

.ukiyoe-detail-drawer .ukiyoe-drawer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 16px;
}

.ukiyoe-detail-drawer .comment-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
}

.ukiyoe-detail-drawer .comment-section {
    max-height: 300px;
    overflow-y: auto;
}

.ukiyoe-detail-drawer .comment-item {
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}

.ukiyoe-detail-drawer .comment-item:last-child {
    border-bottom: none;
}

.ukiyoe-detail-drawer .comment-author {
    font-weight: 500;
    color: #165e83;
    margin-right: 6px;
}

.ukiyoe-detail-drawer .comment-date {
    color: #ccc;
    font-size: 11px;
    margin-left: 4px;
}

.ukiyoe-detail-drawer .comment-delete {
    float: right;
    cursor: pointer;
    color: #ccc;
    font-size: 11px;
    transition: color 0.2s;
}

.ukiyoe-detail-drawer .comment-delete:hover {
    color: #e74c3c;
}

.ukiyoe-detail-drawer .comment-body {
    color: #555;
    margin-top: 4px;
    line-height: 1.6;
    word-break: break-word;
}

.ukiyoe-detail-drawer .comment-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.ukiyoe-detail-drawer .comment-input {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    font-family: 'Noto Sans JP', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.ukiyoe-detail-drawer .comment-input:focus {
    border-color: #c9a96e;
}

.ukiyoe-detail-drawer .comment-submit {
    background: linear-gradient(135deg, #c9a96e, #a88532);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(139, 105, 20, 0.3);
}

.ukiyoe-detail-drawer .comment-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 105, 20, 0.4);
}

/* モバイル用ボトムドロワー（600px以下） */
@media (max-width: 600px) {

    .drawer-resize-handle {
        display: none;
    }

    /* --- 瓦版ドロワー --- */
    .pin-detail-drawer {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60vh;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
        border-radius: 16px 16px 0 0;
    }

    .pin-detail-drawer.open {
        transform: translateY(0);
    }

    .pin-detail-drawer::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: rgba(0, 0, 0, 0.15);
        border-radius: 2px;
        margin: 10px auto 0;
        flex-shrink: 0;
    }

    /* --- 浮世絵 & プレミアムドロワー --- */
    .ukiyoe-detail-drawer {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60vh;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
        border-radius: 16px 16px 0 0;
    }

    .ukiyoe-detail-drawer.open {
        transform: translateY(0);
    }

    .ukiyoe-detail-drawer::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: rgba(0, 0, 0, 0.15);
        border-radius: 2px;
        margin: 10px auto 0;
        flex-shrink: 0;
    }
}


/* --- みんなのピン 登録ボタン --- */
.community-register-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.community-register-btn.inactive {
    background: linear-gradient(135deg, #c9a96e, #a88532);
    color: #fff;
    box-shadow: 0 2px 12px rgba(139, 105, 20, 0.3);
}

.community-register-btn.inactive:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(139, 105, 20, 0.4);
}

.community-register-btn.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    box-shadow: 0 2px 12px rgba(231, 76, 60, 0.3);
    animation: pulse-glow-teal 2s infinite;
}

@keyframes pulse-glow-teal {

    0%,
    100% {
        box-shadow: 0 2px 12px rgba(231, 76, 60, 0.3);
    }

    50% {
        box-shadow: 0 2px 20px rgba(231, 76, 60, 0.6);
    }
}

/* --- みんなのピン 登録モードバナー --- */
.community-pin-banner {
    display: none;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(231, 76, 60, 0.9);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    z-index: 20;
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.4);
    animation: slide-down 0.3s ease;
}

.community-pin-banner.show {
    display: block;
}



/* --- 表示名設定 (削除済み: ポップオーバーに移行) --- */

/* --- マーカー共通ホバー＆クリック改善 --- */
.maplibregl-marker {
    cursor: pointer !important;
}

/* 内部SVGにトランジション適用 */
.maplibregl-marker svg {
    transition: transform 0.15s ease, filter 0.15s ease;
    transform-origin: bottom center;
}

/* ホバー時に少し大きくして押せることを示す */
.maplibregl-marker:hover svg {
    transform: scale(1.15);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* クリック可能領域を広げる透明ヒットエリア */
.maplibregl-marker::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -12px;
    right: -12px;
    bottom: -4px;
}

/* ドロワー表示中のピン — ホバー状態を維持 */
.marker-active {
    z-index: 10 !important;
}

.marker-active svg {
    transform: scale(1.15);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* カーソル変更（みんなのピンモード） */
.community-pin-cursor .maplibregl-canvas {
    cursor: crosshair !important;
}

/* --- 文字数カウンター --- */
.char-counter {
    width: 100%;
    text-align: right;
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}

.char-counter.over {
    color: #e74c3c;
    font-weight: 500;
}

/* --- ピン色選択 --- */
.color-picker-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 4px 0;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.color-swatch.selected {
    border-color: #333;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #333;
}

.color-swatch.selected::after {
    content: '✓';
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* --- アバターアップロード --- */
.avatar-upload-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-upload-controls {
    flex: 1;
    min-width: 0;
}

.avatar-preview-container {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f5f0e5;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e0d5c0;
    position: relative;
    flex-shrink: 0;
}

.avatar-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-placeholder {
    font-size: 24px;
    color: #ccc;
}

.avatar-remove-btn {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.9);
    color: #fff;
    border: none;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s;
}

.avatar-remove-btn:hover {
    background: #c0392b;
}

.btn-avatar-upload {
    padding: 6px 14px;
    border: 1px solid #d5c8a8;
    border-radius: 8px;
    background: #fdf8ef;
    color: #8b6914;
    font-size: 12px;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-avatar-upload:hover {
    background: #f5edd8;
    border-color: #c9a96e;
}

/* --- サブスクリプション管理 --- */
#account-subscription-section {
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

#account-subscription-section+.account-field {
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.subscription-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-bottom: 8px;
}

.subscription-status.active {
    background: rgba(243, 156, 18, 0.10);
    color: #c98a0e;
}

.subscription-status.free {
    background: rgba(0, 0, 0, 0.04);
    color: #aaa;
}

.subscription-badge {
    font-weight: 700;
    font-size: 11px;
}

.btn-subscription-upgrade {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    box-shadow: 0 2px 12px rgba(243, 156, 18, 0.3);
    transition: all 0.2s ease;
}

.btn-subscription-upgrade:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(243, 156, 18, 0.4);
}

.btn-subscription-manage {
    width: 100%;
    padding: 8px;
    border: 1px solid #e0d5c0;
    border-radius: 10px;
    font-size: 13px;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    background: #fdf8ef;
    color: #8b6914;
    transition: all 0.2s;
}

.btn-subscription-manage:hover {
    background: #f5edd8;
    border-color: #c9a96e;
}

.subscription-benefits {
    margin-top: 8px;
    text-align: center;
    color: #999;
}

.subscription-benefits small {
    font-size: 12px;
}

/* --- カスタムコミュニティピン（プレミアム） --- */
/* 注意: この要素は maplibregl-marker ラッパーそのもの。
   MapLibre が transform で位置を更新するため、
   transition: transform を設定するとカメラ追従が遅延する。 */
.community-pin-custom {
    cursor: pointer;
}

/* ホバー効果は内部SVGに適用（ラッパーのtransformに影響しない） */
.community-pin-custom:hover svg {
    transform: scale(1.15);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.community-pin-custom svg {
    transition: transform 0.15s ease, filter 0.15s ease;
    transform-origin: bottom center;
}

/* --- プレミアムコンテンツピン（ゴールド + kuro_edo.png） --- */
.premium-pin-custom {
    cursor: pointer;
}

.premium-pin-custom:hover svg {
    transform: scale(1.15);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.premium-pin-custom svg {
    transition: transform 0.15s ease, filter 0.15s ease;
    transform-origin: bottom center;
}

/* --- プレミアム 複数画像リスト（モーダル内） --- */
.premium-image-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.premium-image-thumb {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0d5c0;
}

.premium-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.premium-image-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.9);
    color: #fff;
    border: none;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s;
}

.premium-image-remove:hover {
    background: #c0392b;
}

.premium-image-add {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    border: 2px dashed #d5c8a8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #c9a96e;
    font-size: 24px;
}

.premium-image-add:hover {
    border-color: #c9a96e;
    background: #fdf8ef;
}

/* --- プレミアム 画像ギャラリー（ドロワー内） --- */
.premium-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
    margin-bottom: 14px;
}

.premium-gallery-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.premium-gallery-thumb:hover {
    opacity: 0.8;
}

/* --- プレミアム 記事テキスト（ドロワー内） --- */
.premium-body-text {
    font-size: 14px;
    color: #444;
    line-height: 1.8;
    margin-bottom: 14px;
    padding: 16px;
    background: rgba(245, 240, 230, 0.5);
    border-radius: 12px;
    word-break: break-word;
    white-space: pre-wrap;
}

/* --- プレミアム動画コンテナ --- */
.premium-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 */
    margin-bottom: 14px;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

.premium-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.premium-video-link {
    margin-bottom: 14px;
    padding: 16px;
    background: rgba(245, 240, 230, 0.5);
    border-radius: 12px;
    text-align: center;
}

.premium-video-link a {
    color: #c9a96e;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
}

.premium-video-link a:hover {
    color: #8b6914;
}

/* --- プレミアムコンテンツバナー --- */
.premium-content-banner {
    background: rgba(201, 169, 110, 0.9) !important;
    box-shadow: 0 4px 16px rgba(201, 169, 110, 0.4) !important;
}

/* --- プレミアム記事 textarea --- */
#premium-body {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

#premium-body:focus {
    border-color: #c9a96e;
}

/* =============================================
   ジオフィーチャー描画UI
   ============================================= */

/* --- 描画コントロールボタン --- */
.geo-draw-controls {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.btn-geo {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #c9a96e;
    border-radius: 10px;
    background: linear-gradient(135deg, #fdf8ef, #f5e6c8);
    color: #8b6914;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}

.btn-geo:hover {
    background: linear-gradient(135deg, #c9a96e, #a88532);
    color: #fff;
    border-color: #a88532;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(168, 133, 50, 0.35);
}

/* --- 描画ステータスオーバーレイ --- */
.geo-draw-status-overlay {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    background: rgba(30, 30, 30, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
    color: #f06060;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Noto Sans JP', sans-serif;
    animation: slide-up 0.3s ease;
}

@keyframes slide-up {
    from {
        transform: translateX(-50%) translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.geo-draw-status-buttons {
    display: flex;
    gap: 6px;
}

.btn-geo-action {
    padding: 6px 12px;
    border: 1.5px solid rgba(217, 64, 64, 0.4);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #f06060;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-geo-action:hover {
    background: rgba(217, 64, 64, 0.2);
    border-color: #f06060;
    transform: translateY(-1px);
}

.btn-geo-finish {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.2), rgba(39, 174, 96, 0.2));
    border-color: rgba(46, 204, 113, 0.5);
    color: #2ecc71;
}

.btn-geo-finish:hover {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.4), rgba(39, 174, 96, 0.4));
    border-color: #2ecc71;
}

.btn-geo-cancel {
    border-color: rgba(231, 76, 60, 0.4);
    color: #e74c3c;
}

.btn-geo-cancel:hover {
    background: rgba(231, 76, 60, 0.2);
    border-color: #e74c3c;
}

/* --- 描画バナー --- */
.geo-draw-banner {
    background: rgba(201, 169, 110, 0.92) !important;
    box-shadow: 0 4px 16px rgba(168, 133, 50, 0.5) !important;
}

/* --- ジオフィーチャー プレビュー（モーダル内） --- */
.geo-feature-preview {
    margin-top: 8px;
}

.geo-feature-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #fdf8ef, #f5e6c8);
    border: 1px solid #dac48a;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 6px;
    font-size: 13px;
}

.geo-feature-label {
    color: #8b6914;
    font-weight: 500;
}

.geo-feature-preview .btn-geo-remove {
    padding: 3px 8px;
    border: 1px solid #dac48a;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.6);
    color: #ad8a42;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.geo-feature-preview .btn-geo-remove:hover {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}

.btn-geo-remove-all {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid #e0d0b0;
    border-radius: 6px;
    background: transparent;
    color: #999;
    font-size: 11px;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
}

.btn-geo-remove-all:hover {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}

/* --- 画像⇔折れ点リンク設定UI --- */
.image-vertex-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f0ead8;
}

.image-vertex-link-row:last-child {
    border-bottom: none;
}

.image-vertex-link-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #e0d5c0;
    flex-shrink: 0;
}

.image-vertex-link-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c9a96e, #a88532);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.image-vertex-link-select {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #dac48a;
    border-radius: 8px;
    background: #fdf8ef;
    color: #8b6914;
    font-size: 13px;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.image-vertex-link-select:focus {
    border-color: #c9a96e;
}

/* --- 描画モード カーソル --- */
.geo-draw-cursor .maplibregl-canvas {
    cursor: crosshair !important;
}

/* --- モバイルレスポンシブ --- */
@media (max-width: 600px) {
    .geo-draw-status-overlay {
        bottom: 16px;
        padding: 10px 14px;
        flex-direction: column;
        gap: 8px;
        width: 90vw;
        max-width: 400px;
    }

    .geo-draw-controls {
        flex-direction: column;
    }
}