/* ============================================================
   easy-minimap-maker - style.css
   デザインシステム: ar-banner-flag / uma-ouen-baken 準拠
   ============================================================ */

:root {
    --primary-color: #1565c0;
    --primary-hover: #0d47a1;
    --primary-light: #e3f2fd;
    --primary-border: #90caf9;

    --accent-color: #2e7d32;
    --accent-hover: #1b5e20;
    --accent-light: #e8f5e9;

    --warning-color: #ed6c02;
    --warning-light: #fff3e0;
    --warning-border: #ffb74d;

    --danger-color: #d32f2f;
    --danger-hover: #b71c1c;
    --danger-light: #ffebee;
    --danger-border: #ef9a9a;

    --bg-light: #f4f6f8;
    --bg-dark: #1e222b;
    --bg-darker: #15181f;
    --panel-bg: #272c37;
    --panel-border: #383f4f;

    --text-main: #222222;
    --text-light: #f5f5f7;
    --text-muted: #8e95a5;
    --text-muted-dark: #666666;

    --border-color: #d0d7de;
    --border-dark: #3a4150;

    --radius-lg: 14px;
    --radius-md: 8px;
    --radius-sm: 4px;

    --shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-dark: 0 4px 20px rgba(0, 0, 0, 0.35);

    --transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

button,
input,
select,
textarea {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    height: var(--app-height, 100dvh);
    min-height: -webkit-fill-available;
    font-feature-settings: "palt";
    -webkit-font-feature-settings: "palt";
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
    overflow: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

input,
textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* ============================================================
   スタート画面 (案内・利用設定)
   ============================================================ */
.start-screen-container {
    width: 100%;
    height: 100%;
    padding: 24px 16px 40px 16px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f1f8e9 100%);
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.container {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
}

/* ヘッダー・メタ情報 */
.header-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}

.version-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.version-badge {
    background: var(--primary-color);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.changelog-link,
.credit-link {
    color: var(--text-muted-dark);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 14px;
}

.changelog-link:hover,
.credit-link:hover {
    color: var(--primary-color);
}

.credit-link strong {
    color: var(--text-main);
    text-decoration: underline;
}

/* タイトルエリア */
.main-title {
    font-size: 26px;
    font-weight: 900;
    color: var(--text-main);
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.sub-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    margin-top: 4px;
}

.eng-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text-muted-dark);
    margin-bottom: 16px;
}

/* ツールリンク */
.tool-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tool-link,
.tool-link-subtle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    transition: var(--transition);
}

.tool-link {
    background: #ffffff;
    color: #333333;
    border: 1px solid var(--border-color);
}

.tool-link:hover {
    background: var(--primary-light);
    border-color: var(--primary-border);
    color: var(--primary-color);
}

.tool-link-subtle {
    background: transparent;
    color: var(--text-muted-dark);
}

/* カードコンポーネント */
.card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--text-main);
}


/* 「このツールについて」内 特徴ハイライトボックス (GPS情報不要) */
.about-feature-box {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.22);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.about-feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    width: fit-content;
    letter-spacing: 0.02em;
}

.about-feature-badge svg {
    flex-shrink: 0;
}

.about-feature-desc {
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
}


/* 特徴セクション (Features Grid) */
.tool-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border: 1px solid #e8ebee;
}

.feature-item:hover {
    border-color: #cbd5e1;
}

.feature-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon-box svg {
    width: 20px;
    height: 20px;
}

.feature-text strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-main);
}

.feature-text p {
    font-size: 12px;
    color: var(--text-muted-dark);
    margin: 0;
    line-height: 1.55;
}

/* ガイドステップ */
.guide-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.guide-step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border: 1px solid #e8ebee;
}

.guide-step-num {
    background: var(--primary-color);
    color: #ffffff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.guide-step-text strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-main);
}

.guide-step-text p {
    font-size: 12px;
    color: var(--text-muted-dark);
    margin: 0;
    line-height: 1.5;
}

/* クラッシュ復元通知バナー */
.restore-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(59, 130, 246, 0.12));
    border: 1px solid rgba(59, 130, 246, 0.28);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 20px;
    gap: 12px;
}

.restore-banner-text {
    font-size: 14px;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.restore-banner-text svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.restore-banner-text strong {
    color: #1d4ed8;
    font-weight: 700;
}

.restore-banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* プライバシー注記 */
.dropzone-privacy-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted-dark);
    background: #f9fbfd;
    border-left: 3px solid var(--accent-color);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
}

/* 動画ファイルドロップゾーン */
.dropzone {
    border: 2px dashed #cccccc;
    border-radius: 10px;
    padding: 28px 16px;
    text-align: center;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.dropzone-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 10px auto;
    color: #94a3b8;
    transition: color 0.2s;
}

.dropzone:hover .dropzone-icon,
.dropzone.dragover .dropzone-icon {
    color: var(--primary-color);
}

.dropzone-title {
    font-weight: 700;
    font-size: 14px;
    color: #444444;
    margin-bottom: 4px;
}

.dropzone-desc {
    font-size: 12px;
    color: #888888;
    margin-bottom: 14px;
}

/* ボタンスタイル */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    user-select: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-accent {
    background: var(--accent-color);
    color: #ffffff;
}

.btn-accent:hover {
    background: var(--accent-hover);
}

.btn-danger {
    background: var(--danger-color);
    color: #ffffff;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-warning {
    background: var(--warning-color);
    color: #ffffff;
}

.btn-secondary {
    background: #f0f2f5;
    color: #333333;
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: #e4e7eb;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-icon-only {
    padding: 8px;
    border-radius: var(--radius-md);
}

/* ============================================================
   メインワークスペース画面 (動画編集ソフト風レイアウト)
   ============================================================ */
.workspace-container {
    width: 100%;
    height: 100%;
    height: 100dvh;
    height: var(--app-height, 100dvh);
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    background: var(--bg-darker);
    color: var(--text-light);
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ワークスペースヘッダーバー */
.workspace-header {
    height: 48px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
    z-index: 10;
}

.workspace-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.project-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.auto-save-indicator {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.auto-save-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background-color 0.2s ease;
}

.workspace-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 上部ビューポート (動画プレビュー + 地図) */
.workspace-top {
    flex: 1;
    min-height: 240px;
    display: flex;
    background: var(--bg-darker);
    overflow: visible;
    position: relative;
    z-index: 20;
}

/* 左側: 元動画プレビューペイン */
.video-pane {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    background: #0d1117;
    border-right: 1px solid var(--panel-border);
    position: relative;
}

.video-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    position: relative;
    overflow: hidden;
}

.video-container video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 動画下部コントロールバー (時間・ジョグ・ステップ) */
.video-control-bar {
    height: 48px;
    background: var(--panel-bg);
    border-top: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    gap: 8px;
    flex-shrink: 0;
}

.timecode-display {
    font-family: 'SF Mono', Menlo, Monaco, Consolas, monospace;
    font-size: 14px;
    font-weight: 700;
    color: #4ade80;
    background: #000000;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em;
    min-width: 140px;
    text-align: center;
}

.timecode-total {
    color: var(--text-muted);
    font-size: 12px;
}

.video-step-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-ctrl {
    background: #1e222b;
    color: var(--text-light);
    border: 1px solid var(--border-dark);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-ctrl:hover {
    background: #2a313d;
    border-color: #4a5468;
}

.btn-ctrl:active {
    background: var(--primary-color);
}

.btn-play {
    background: var(--primary-color);
    color: #ffffff;
    padding: 6px 14px;
}

.btn-play:hover {
    background: var(--primary-hover);
}

/* ジョグダイヤル・スクラバー */
.jog-shuttle {
    flex: 1;
    max-width: 180px;
    height: 32px;
    background: #181b22;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ew-resize;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.jog-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.jog-arrow.left {
    left: 8px;
}

.jog-arrow.right {
    right: 8px;
}

.jog-shuttle:hover .jog-arrow {
    color: #94a3b8;
}

.jog-lines {
    display: flex;
    gap: 4px;
    pointer-events: none;
}

.jog-line {
    width: 2px;
    height: 14px;
    background: #4a5468;
    border-radius: 1px;
}

.jog-line.center {
    background: #60a5fa;
    height: 20px;
}

.jog-label {
    position: absolute;
    bottom: 2px;
    font-size: 9px;
    color: var(--text-muted);
    pointer-events: none;
}

/* 右側: Leaflet 地図ペイン */
.map-pane {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    background: #11141a;
    position: relative;
}

.map-header {
    height: 38px;
    background: var(--panel-bg);
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    font-size: 12px;
    color: var(--text-light);
    flex-shrink: 0;
}

/* モバイル向けヘッダーボタン (デスクトップでは非表示) */
#btnToggleSideSearch,
#btnToggleMobileLayout {
    display: none;
}

.map-search-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-light);
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 2px;
    transition: var(--transition);
}

.map-search-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.map-header-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-container {
    flex: 1;
    position: relative;
}

#leafletMap {
    width: 100%;
    height: 100%;
    background: #e5e3df;
}

/* 地図オーバーレイ: 方角・座標・ズーム */
.map-overlay-info {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(26, 29, 33, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    z-index: 1000;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.compass-icon {
    width: 14px;
    height: 14px;
    color: #ef4444;
}

/* 地図上の現在地パルスマーカー */
.current-pos-icon-wrapper,
.current-pos-marker {
    pointer-events: none !important;
}

.current-pos-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2563eb;
    border: 3px solid #ffffff;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.8);
    position: relative;
}

.current-pos-marker::after {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 2px solid #3b82f6;
    animation: marker-pulse 1.8s infinite;
}

@keyframes marker-pulse {
    0% {
        transform: scale(0.9);
        opacity: 1;
    }

    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

/* レスポンシブ スプリット調整 */
@media (max-width: 768px) {

    /* スマートフォンでの restoreBanner ボタン折り返し */
    .restore-banner {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        gap: 12px;
    }

    .restore-banner-text {
        font-size: 13.5px;
        line-height: 1.5;
    }

    .restore-banner-actions {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .restore-banner-actions .btn {
        flex: 1;
        justify-content: center;
        padding: 8px 12px;
        min-height: 38px;
        font-size: 13px;
    }

    .workspace-top {
        flex-direction: column;
    }

    .video-pane {
        flex: 1;
        min-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--panel-border);
    }

    .map-pane {
        flex: 1;
        min-height: 180px;
    }

    .video-control-bar {
        height: 42px;
        padding: 0 6px;
    }

    .timecode-display {
        font-size: 12px;
        min-width: 110px;
        padding: 2px 4px;
    }

    .jog-shuttle {
        max-width: 120px;
    }
}

/* ============================================================
   モーダルダイアログ
   ============================================================ */
@keyframes modalBackdropFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalContentPopIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    pointer-events: none;
}

.modal-backdrop.open {
    display: flex;
    pointer-events: auto;
    animation: modalBackdropFadeIn 0.2s ease forwards;
}

.modal-content {
    background: #ffffff;
    color: var(--text-main);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-dark);
}

.modal-backdrop.open .modal-content {
    animation: modalContentPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted-dark);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
}

.btn-close:hover {
    color: var(--text-main);
    background: #f0f0f0;
}

.modal-body {
    padding: 20px;
}

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--text-main);
}

.form-hint {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 5px;
    line-height: 1.4;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.color-picker-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-preview-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px var(--border-color);
    cursor: pointer;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal-footer .btn,
.modal-footer button {
    white-space: nowrap;
    flex-shrink: 0;
}

/* プログレスバー */
.progress-container {
    margin: 16px 0;
}

.progress-bar-bg {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), #3b82f6);
    transition: width 0.1s linear;
}

.progress-status {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted-dark);
    margin-top: 6px;
}


/* ============================================================
   Leaflet カスタムマーカー (キーフレームピン)
   ============================================================ */
.map-kf-icon-container {
    background: transparent;
    border: none;
}


/* ============================================================
   地点の通し番号 (マップ上の菱形ピン & タイムラインバッジ)
   中央がタップ・クリック地点と完全一致する菱形デザイン
   ============================================================ */
.map-kf-pin {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    background: #2563eb;
    transform: rotate(45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.map-kf-pin .pin-number {
    transform: rotate(-45deg);
    font-size: 11px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    user-select: none;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.map-kf-pin:hover {
    transform: rotate(45deg) scale(1.25);
    background: #3b82f6;
}

.map-kf-pin.selected-pin {
    background: #f59e0b;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.95);
    transform: rotate(45deg) scale(1.3);
    z-index: 999;
}

.map-kf-pin.pause-pin {
    background: #ef4444;
}

.map-kf-pin.pause-pin:hover {
    background: #f87171;
}

.map-kf-pin.pause-pin.selected-pin {
    background: #f97316;
}

/* タイムライン上の通し番号バッジ */
.kf-marker {
    display: flex;
    align-items: center;
    justify-content: center;
}

.kf-marker-label {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    pointer-events: none;
    white-space: nowrap;
    line-height: 1.2;
}

.kf-marker.selected .kf-marker-label {
    background: #f59e0b;
    border-color: #ffffff;
    color: #000000;
}

/* ============================================================
   Leaflet マップピン用確認ポップアップ
   ============================================================ */
.leaflet-popup-content-wrapper {
    background: #1e222b;
    color: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid #383f4f;
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 10px 12px;
    line-height: 1.4;
}

.leaflet-popup-tip {
    background: #1e222b;
}

.map-popup-card {
    min-width: 170px;
}

.map-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    color: #93c5fd;
    border-bottom: 1px solid #334155;
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.map-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.map-popup-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    width: 100%;
}

.map-popup-btn svg {
    flex-shrink: 0;
}

.map-popup-btn-copy {
    background: #1e3a8a;
    color: #dbeafe;
    border-color: #3b82f6;
}

.map-popup-btn-copy:hover {
    background: #2563eb;
    color: #ffffff;
}

.map-popup-btn-delete {
    background: #450a0a;
    color: #fecaca;
    border-color: #ef4444;
}

.map-popup-btn-delete:hover {
    background: #dc2626;
    color: #ffffff;
}

.map-popup-btn-jump {
    background: #1e293b;
    color: #cbd5e1;
    border-color: #475569;
}

.map-popup-btn-jump:hover {
    background: #334155;
    color: #ffffff;
}

/* プレビュー画質切替バッジ */
.preview-quality-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    z-index: 5;
    transition: var(--transition);
}

.preview-quality-badge:hover {
    background: rgba(37, 99, 235, 0.85);
    border-color: #60a5fa;
}


/* ============================================================
   動画プレビュー内ドロップエリア (復元時・動画未読み込み時)
   ============================================================ */
.video-placeholder-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 17, 23, 0.94);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 20;
    text-align: center;
    transition: opacity 0.2s ease;
}

.video-placeholder-box {
    border: 2px dashed #3b82f6;
    background: rgba(59, 130, 246, 0.08);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    max-width: 440px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.video-placeholder-box:hover,
.video-placeholder-box.dragover {
    background: rgba(59, 130, 246, 0.16);
    border-color: #60a5fa;
    transform: scale(1.01);
}

.video-placeholder-icon {
    width: 48px;
    height: 48px;
    color: #60a5fa;
    margin-bottom: 12px;
}

.video-placeholder-title {
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 6px;
}

.video-placeholder-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 14px;
}

.video-placeholder-prevname {
    font-size: 11px;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* トースト通知 (一時停止区間内の警告等) */
.vrm-toast {
    position: fixed;
    bottom: 250px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e293b;
    border: 1px solid #e11d48;
    color: #fecdd3;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

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


/* ============================================================
   スマートフォン向けレスポンシブ最適化 (動画3:マップ3:タイムライン1 & アイコン優先)
   ============================================================ */
@media (max-width: 768px) {

    /* スマートフォンでの restoreBanner ボタン折り返し */
    .restore-banner {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        gap: 12px;
    }

    .restore-banner-text {
        font-size: 13.5px;
        line-height: 1.5;
    }

    .restore-banner-actions {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .restore-banner-actions .btn {
        flex: 1;
        justify-content: center;
        padding: 8px 12px;
        min-height: 38px;
        font-size: 13px;
    }


    /* モバイル環境でのレイアウト切替ボタン表示 */
    #btnToggleMobileLayout {
        display: inline-flex;
    }

    /* 横並び表示時の検索ボタントグル (1番目にアイコンのみ表示) */
    .workspace-top.mobile-side-by-side #btnToggleSideSearch {
        display: inline-flex !important;
    }

    /* 横並び表示時: 通常配置の検索ボックスは非表示 */
    .workspace-top.mobile-side-by-side .map-search-bar {
        display: none !important;
    }

    /* 横並び表示時: 検索ボタンタップで一時表示される検索ボックス */
    @keyframes searchBarModalPop {
        from {
            opacity: 0;
            transform: translateY(-8px) scale(0.98);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    .workspace-top.mobile-side-by-side .map-search-bar.temporary-open {
        display: flex !important;
        position: absolute !important;
        top: 8px !important;
        left: 8px !important;
        right: 8px !important;
        width: calc(100% - 16px) !important;
        max-width: none !important;
        z-index: 2500 !important;
        animation: searchBarModalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .workspace-top.mobile-side-by-side .map-search-bar.temporary-open .map-search-input-wrapper {
        background: rgba(18, 22, 30, 0.98);
        border-color: var(--primary-color);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(59, 130, 246, 0.3);
        height: 38px;
        padding: 0 8px;
    }

    .workspace-top.mobile-side-by-side .map-search-bar.temporary-open .map-search-close-btn {
        display: flex !important;
    }

    /* スマートフォンでの左右分割レイアウト */
    .workspace-top.mobile-side-by-side {
        flex-direction: row !important;
    }

    .workspace-top.mobile-side-by-side .video-pane {
        flex: 1 1 50% !important;
        width: 50% !important;
        max-width: 50% !important;
        min-width: 0 !important;
        border-right: 1px solid var(--panel-border) !important;
        border-bottom: none !important;
    }

    .workspace-top.mobile-side-by-side .map-pane {
        flex: 1 1 50% !important;
        width: 50% !important;
        max-width: 50% !important;
        min-width: 0 !important;
    }

    /* 左右並び時: ヘッダーの「OpenStreetMap」文字を非表示 */
    .workspace-top.mobile-side-by-side .map-title-text {
        display: none !important;
    }

    /* 左右並び時: map-header-tools 内のボタンをアイコンのみにする */
    .workspace-top.mobile-side-by-side .map-header-tools .btn span,
    .workspace-top.mobile-side-by-side #btnFitBounds span,
    .workspace-top.mobile-side-by-side #btnCenterCurrent span,
    .workspace-top.mobile-side-by-side #btnToggleMobileLayout span {
        display: none !important;
    }

    .workspace-top.mobile-side-by-side .map-header-tools {
        gap: 4px !important;
    }

    .workspace-top.mobile-side-by-side .map-header-tools .btn {
        padding: 4px 6px !important;
        min-height: 26px !important;
    }

    /* 左右並び時: 切替ボタンのアイコンを上下分割アイコンに変更 */
    .workspace-top.mobile-side-by-side #btnToggleMobileLayout .icon-split-horizontal {
        display: none !important;
    }

    .workspace-top.mobile-side-by-side #btnToggleMobileLayout .icon-split-vertical {
        display: inline-block !important;
    }

    /* 左右並び時: 動画コントロールバーをコンパクト化 */
    .workspace-top.mobile-side-by-side .video-control-bar {
        padding: 4px !important;
        min-height: 38px !important;
        gap: 3px !important;
    }

    .workspace-top.mobile-side-by-side .timecode-display {
        font-size: 10px !important;
        min-width: 0 !important;
        padding: 1px 3px !important;
    }

    .workspace-top.mobile-side-by-side .jog-shuttle {
        max-width: 70px !important;
        height: 24px !important;
    }

    .workspace-top.mobile-side-by-side .jog-arrow {
        width: 10px;
        height: 10px;
    }

    .workspace-top.mobile-side-by-side .jog-arrow.left {
        left: 3px;
    }

    .workspace-top.mobile-side-by-side .jog-arrow.right {
        right: 3px;
    }

    .workspace-top.mobile-side-by-side .video-step-controls {
        gap: 2px !important;
    }

    .workspace-top.mobile-side-by-side .btn-ctrl {
        width: 22px !important;
        height: 22px !important;
        font-size: 9px !important;
        padding: 0 !important;
    }

    /* 画面比率: 画面内クランプ (動画 + マップ + タイムライン操作群) */
    .workspace-top {
        flex: 1;
        min-height: 0;
        flex-direction: column;
        overflow: visible;
        z-index: 20;
    }

    .video-pane {
        flex: 1;
        min-height: 0;
        border-right: none;
        border-bottom: 1px solid var(--panel-border);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .video-container {
        flex: 1;
        min-height: 0;
    }

    .map-pane {
        flex: 1;
        min-height: 0;
        position: relative;
        display: flex;
        flex-direction: column;
        overflow: visible;
        z-index: 10;
    }

    .map-container {
        flex: 1;
        min-height: 0;
        height: 100%;
    }

    /* 地図ヘッダー: デスクトップ表示と共通の統一デザイン (高さ34pxバー) */
    .map-header {
        position: static;
        height: 34px;
        background: var(--panel-bg);
        border-bottom: 1px solid var(--panel-border);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 8px;
        font-size: 11px;
        color: var(--text-light);
        flex-shrink: 0;
        z-index: 5;
    }

.map-header-tools {
        position: static;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .map-header-tools .btn {
        padding: 4px 8px;
        font-size: 11px;
        min-height: 28px;
        gap: 4px;
    }

    /* 下部ワークスペース (動画操作バー + タイムラインツールバー + タイムライン) */
    .workspace-bottom {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        flex: none;
        display: flex;
        flex-direction: column;
        border-top: 1px solid var(--panel-border);
    }

    .timeline-container {
        height: 116px;
        min-height: 100px;
        flex: none;
    }

    .timeline-viewport {
        height: 116px;
    }

    .timeline-track-lane {
        height: calc(100% - 28px);
    }

    .workspace-header {
        height: 42px;
        padding: 0 8px;
        gap: 6px;
    }

    .workspace-title-group {
        flex: 1;
        min-width: 0;
        gap: 6px;
    }

    #btnBackToStart {
        flex-shrink: 0;
    }

    .project-name {
        flex: 0 1 auto;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 12px;
    }

    .auto-save-indicator {
        flex-shrink: 0;
    }

    .auto-save-indicator span#autoSaveText {
        display: none;
    }

    .workspace-header-actions {
        flex-shrink: 0;
    }

    /* ワークスペースヘッダーボタンのテキスト非表示 (アイコン優先) */
    #btnBackToStart span,
    #btnNewProject span,
    #btnOpenSettings span,
    #btnOpenExport span {
        display: none;
    }

    /* マップツールボタン: スマホでもデスクトップ同様にテキストを表示 */
    #btnFitBounds span,
    #btnCenterCurrent span {
        display: inline !important;
    }

    .workspace-header .btn {
        padding: 6px 8px;
        min-height: 32px;
    }

    /* 動画プレビュー内ドロップエリアの超シンプル化 */
    .video-placeholder-overlay {
        padding: 8px;
    }

    .video-placeholder-box {
        padding: 10px 14px;
        max-width: 90%;
    }

    .video-placeholder-icon {
        width: 26px;
        height: 26px;
        margin-bottom: 4px;
    }

    .video-placeholder-title {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .video-placeholder-sub {
        display: none !important;
        /* スマホでは長い説明文を非表示 */
    }

    .video-placeholder-prevname {
        font-size: 10px;
        padding: 2px 6px;
        margin-bottom: 8px;
    }

    #btnWorkspaceSelectVideo {
        padding: 4px 10px;
        font-size: 11px;
    }

    /* 動画コントロールバー */
    .video-control-bar {
        height: auto;
        min-height: 44px;
        padding: 6px 8px;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 6px;
    }

    .timecode-display {
        font-size: 12px;
        padding: 4px 6px;
        min-width: 110px;
    }

    .jog-shuttle {
        height: 30px;
        max-width: 140px;
        min-width: 100px;
    }

    .video-step-controls {
        width: 100%;
        justify-content: space-between;
        gap: 3px;
    }

    .btn-ctrl {
        padding: 6px 6px;
        font-size: 12px;
        font-weight: 700;
        min-height: 34px;
        min-width: 32px;
        flex: 1;
    }

    .btn-play {
        flex: 1.3;
        min-height: 34px;
    }

    .btn-play svg {
        width: 15px;
        height: 15px;
    }

    /* タイムラインツールバー (1行でコンパクトに配置) */
    .timeline-toolbar {
        height: 36px;
        min-height: 36px;
        padding: 0 6px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 4px;
    }

    /* テキスト非表示 (アイコンのみ) */
    #btnTogglePause span#pauseBtnLabel {
        display: none !important;
    }

    .btn-pause-mode {
        padding: 6px 10px;
        min-height: 30px;
        min-width: 32px;
        justify-content: center;
    }

    .btn-pause-mode svg {
        width: 15px;
        height: 15px;
    }

    .btn-tool {
        padding: 5px 7px;
        min-height: 30px;
        min-width: 30px;
    }

    .btn-tool svg {
        width: 15px;
        height: 15px;
    }

    #btnUndo,
    #btnRedo {
        padding: 5px 7px;
        min-height: 30px;
        min-width: 30px;
        display: inline-flex !important;
        /* スマホでもUndo/Redoを常時表示 */
    }

    #btnUndo svg,
    #btnRedo svg {
        width: 15px;
        height: 15px;
    }

    .timeline-tools-left {
        gap: 4px;
    }

    .timeline-tools-right {
        gap: 4px;
    }

    .timeline-zoom-control {
        display: none !important;
        /* スマホではピンチジェスチャーでズーム */
    }

    /* スマートフォン・タッチ環境でのボタン押下後 :active / :hover の残留対策 */
    button:active,
    .btn:active,
    .btn-ctrl:active,
    .btn-tool:active,
    .btn-kf-nav:active,
    .btn-pause-mode:active,
    .btn-delete-kf:active,
    .btn-close:active {
        transform: none !important;
    }

    /* コントロールボタンの色反転がタップ後に残留するのを防止 */
    .btn-ctrl:active:not(.btn-play) {
        background: #1e222b !important;
        color: var(--text-light) !important;
        border-color: var(--border-dark) !important;
    }

    /* タップ後の不要なフォーカス枠・シャドウを除去 */
    button:focus:not(:focus-visible),
    .btn:focus:not(:focus-visible),
    .btn-ctrl:focus:not(:focus-visible),
    .btn-tool:focus:not(:focus-visible),
    .btn-kf-nav:focus:not(:focus-visible),
    .btn-pause-mode:focus:not(:focus-visible),
    .btn-delete-kf:focus:not(:focus-visible) {
        outline: none !important;
        box-shadow: none !important;
    }

    /* タップハイライトの残留・不透明化を防止 */
    button,
    .btn,
    .btn-ctrl,
    .btn-tool,
    .btn-kf-nav,
    .btn-pause-mode,
    .btn-delete-kf,
    .btn-close {
        -webkit-tap-highlight-color: transparent;
    }
}

/* ============================================================
   地図フローティング検索バー (Google Maps ライクなモダンデザイン)
   ============================================================ */
.map-search-bar {
    position: absolute;
    top: 10px;
    left: 50px;
    width: calc(100% - 180px);
    max-width: 280px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}

.map-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(22, 26, 34, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    height: 34px;
    padding: 0 8px;
    gap: 6px;
    transition: var(--transition);
}

.map-search-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25), 0 6px 18px rgba(0, 0, 0, 0.5);
    background: rgba(18, 22, 30, 0.98);
}

.map-search-input-wrapper .search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.map-search-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 12px;
}

.map-search-input::placeholder {
    color: #717b91;
}

.map-search-clear {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 3px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.map-search-clear:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.map-search-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.map-search-spinner .spinner-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* 候補ドロップダウン */
.map-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: rgba(18, 22, 30, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.5);
    max-height: min(320px, calc(100vh - 160px));
    overflow-y: auto;
    display: none;
    flex-direction: column;
    z-index: 3000;
}

.map-search-results.show {
    display: flex;
}

.map-search-item {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: background 0.15s ease;
}

.map-search-item:last-child {
    border-bottom: none;
}

.map-search-item:hover {
    background: rgba(59, 130, 246, 0.15);
}

.search-item-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.search-item-name {
    font-size: 12px;
    font-weight: 600;
    color: #f1f5f9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-item-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    flex-shrink: 0;
    text-transform: uppercase;
}

.badge-coord {
    background: rgba(59, 130, 246, 0.25);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.badge-gsi {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-osm {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.search-item-sub {
    font-size: 10px;
    color: #8e95a5;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-search-empty {
    padding: 10px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

/* 検索結果マーカー（一時ピン） */
.search-result-marker-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-result-pin {
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: #ffffff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    border: 2px solid #ffffff;
    animation: search-pin-bounce 0.6s ease;
}

.search-result-pin svg {
    transform: rotate(45deg);
    width: 12px;
    height: 12px;
}

@keyframes search-pin-bounce {
    0% {
        transform: translateY(-20px) rotate(-45deg);
        opacity: 0;
    }

    60% {
        transform: translateY(0px) rotate(-45deg);
        opacity: 1;
    }

    80% {
        transform: translateY(-6px) rotate(-45deg);
    }

    100% {
        transform: translateY(0px) rotate(-45deg);
    }
}

@media (max-width: 768px) {
    .map-search-bar {
        left: 46px;
        width: calc(100% - 150px);
        max-width: 220px;
        z-index: 2500;
    }

    .map-search-input {
        font-size: 11px;
    }

    .map-search-results {
        min-width: 240px;
        max-width: min(320px, calc(100vw - 32px));
        box-shadow: 0 14px 35px rgba(0, 0, 0, 0.8), 0 4px 10px rgba(0, 0, 0, 0.5);
    }
}
/* ============================================================
   エクスポートモーダル セクション整理レイアウト
   ============================================================ */
.export-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.export-section:last-of-type {
    margin-bottom: 16px;
    padding-bottom: 0;
    border-bottom: none;
}

.export-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.export-section-title svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

/* ボタン無効化スタイル */
button:disabled,
.btn:disabled {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    box-shadow: none !important;
    transform: none !important;
}

/* スピナーアニメーション */
.animate-spin {
    animation: vrm-spin 1s linear infinite;
    display: inline-block;
}

@keyframes vrm-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ポップアップ内「この地点でキーフレームを追加」ボタン */
.btn-add-kf-from-popup {
    margin-top: 8px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    background: var(--primary-color, #3b82f6);
    color: #ffffff !important;
    border: none;
    transition: background 0.15s ease, transform 0.1s ease;
    box-sizing: border-box;
}

.btn-add-kf-from-popup:hover {
    background: var(--primary-hover, #2563eb);
    transform: translateY(-1px);
}

.btn-add-kf-from-popup:active {
    transform: translateY(0);
}

.btn-add-kf-from-popup svg {
    flex-shrink: 0;
}



/* ============================================================
   認証 & クラウドプロジェクト管理スタイル (Supabase連携)
   ============================================================ */

/* ヘッダーユーザーアクション */
.header-user-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(21, 101, 192, 0.08);
    border: 1px solid var(--primary-border);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--primary-color);
    box-sizing: border-box;
    height: 34px;
}

.auth-user-badge.ws-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-dark);
    color: var(--text-light);
    padding: 5px 10px;
    font-size: 12px;
    height: 31px;
}

.user-email-text {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.ws-auth-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 6px;
    padding-left: 8px;
    border-left: 1px solid var(--border-dark);
}

.btn-outline-subtle {
    background: transparent;
    border: 1px solid currentColor;
    color: inherit;
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.btn-outline-subtle:hover {
    background: rgba(0, 0, 0, 0.06);
}

.ws-badge .btn-outline-subtle:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-xs {
    font-size: 11px;
    padding: 2px 6px;
}

/* スタート画面のプロジェクト読み込みボタングループ */
.start-project-open-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-color);
}

/* 認証モーダル */
.social-login-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.btn-social {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.btn-google {
    background: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #c0c4cc;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.btn-github {
    background: #24292e;
    color: #ffffff;
    border: 1px solid #24292e;
}

.btn-github:hover {
    background: #1b1f23;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 18px 0;
    color: var(--text-muted);
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
    padding: 0 10px;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.auth-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.auth-message-box {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.5;
    margin-top: 12px;
}

.auth-message-box.error {
    background: var(--danger-light);
    color: var(--danger-color);
    border: 1px solid var(--danger-border);
}

.auth-message-box.success {
    background: var(--accent-light);
    color: var(--accent-color);
    border: 1px solid #a5d6a7;
}

.auth-note-text {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 16px;
    margin-bottom: 0;
}

/* クラウドプロジェクトモーダル */
.cloud-save-section {
    background: var(--bg-light);
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.cloud-save-input-row {
    display: flex;
    gap: 8px;
}

.cloud-save-input-row input {
    flex: 1;
}

.cloud-current-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 12px;
}

.badge-synced {
    background: var(--accent-light);
    color: var(--accent-color);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.text-subtle {
    color: var(--text-muted);
}

.cloud-divider {
    height: 1px;
    background: var(--border-color);
    margin: 16px 0;
}

.cloud-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cloud-list-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

.cloud-loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.spin-icon {
    animation: spin 1s linear infinite;
}

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

.cloud-projects-empty {
    text-align: center;
    padding: 30px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.cloud-projects-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 280px;
    overflow-y: auto;
}

.cloud-project-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.cloud-project-card:hover {
    border-color: var(--primary-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.cloud-project-card.active-project {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.cloud-project-info {
    flex: 1;
    min-width: 0;
    padding-right: 12px;
}

.cloud-project-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cloud-project-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cloud-badge-current {
    background: var(--primary-color);
    color: #ffffff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.cloud-project-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
    display: flex;
    gap: 12px;
}

.cloud-project-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* ============================================================
   ダイアログ最前面化 & レスポンシブ改善 (v1.00)
   ============================================================ */

/* 汎用ダイアログモーダルを全モーダル・要素の最前面に表示 */
#dialogModal {
    z-index: 10050 !important;
}

/* スタート画面のプロジェクト読み込みボタングループの折り返し制御 */
.start-project-open-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-color);
}

.start-project-open-actions .btn,
.start-project-open-actions .auth-user-badge {
    white-space: nowrap !important;
    flex-shrink: 0;
}

/* プロジェクトを開くモーダル（縦並びカードボタングループ） */
.project-open-vertical-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-open-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    width: 100%;
    box-sizing: border-box;
}

.btn-open-option:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.08);
}

.btn-open-option:active {
    transform: translateY(0);
}

.open-option-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(21, 101, 192, 0.08);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.open-option-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.open-option-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.open-option-desc {
    font-size: 12px;
    color: var(--text-muted-dark);
    line-height: 1.4;
}

.open-option-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.18s ease;
}

.btn-open-option:hover .open-option-arrow {
    color: var(--primary-color);
    transform: translateX(3px);
}

/* デスクトップ / モバイル ヘッダー切り替え */
.desktop-only {
    display: flex;
}

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }
}

/* モバイル用ヘッダー & 認証インジケーター */
.workspace-header-mobile {
    align-items: center;
    gap: 8px;
}

.ws-mobile-auth-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-dark);
    color: var(--text-light);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.ws-mobile-auth-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.auth-status-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-dark);
    box-sizing: border-box;
}

.auth-status-badge.status-logged-in {
    background: #10b981;
    color: #ffffff;
}

.auth-status-badge.status-logged-out {
    background: #ef4444;
    color: #ffffff;
}

.btn-hamburger {
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* モバイル用ハンバーガードロップダウンメニュー */
.ws-mobile-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9995;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.ws-mobile-dropdown.open {
    opacity: 1;
    pointer-events: auto;
}

.ws-mobile-dropdown-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
}

.ws-mobile-dropdown-content {
    position: absolute;
    top: 54px;
    right: 12px;
    width: 250px;
    max-width: calc(100vw - 24px);
    background: var(--bg-dark);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-dark);
    overflow: hidden;
    transform: translateY(-8px);
    transition: transform 0.2s ease;
    z-index: 1;
}

.ws-mobile-dropdown.open .ws-mobile-dropdown-content {
    transform: translateY(0);
}

.ws-mobile-user-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid var(--border-dark);
    font-size: 12px;
    color: var(--text-light);
}

.user-status-dot.logged-in {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
    flex-shrink: 0;
}

.ws-mobile-user-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.ws-mobile-menu-items {
    display: flex;
    flex-direction: column;
    padding: 6px;
}

.ws-mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
    width: 100%;
    box-sizing: border-box;
}

.ws-mobile-menu-item:hover,
.ws-mobile-menu-item:active {
    background: rgba(255, 255, 255, 0.1);
}

.ws-mobile-menu-item.item-accent {
    color: #34d399;
    font-weight: 600;
}

.ws-mobile-menu-item.item-accent:hover {
    background: rgba(16, 185, 129, 0.15);
}

.ws-mobile-menu-divider {
    margin: 4px 6px;
    border: none;
    border-top: 1px solid var(--border-dark);
}

/* クラウドプロジェクト管理モーダルのスマートフォンレスポンシブ改善 */
@media (max-width: 600px) {
    .cloud-save-section {
        padding: 12px;
    }

    .cloud-save-input-row {
        flex-direction: column;
        gap: 8px;
    }

    .cloud-save-input-row input {
        width: 100%;
        box-sizing: border-box;
    }

    .cloud-save-input-row .btn {
        width: 100%;
        justify-content: center;
        padding: 9px 12px;
    }

    .cloud-project-card {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }

    .cloud-project-info {
        padding-right: 0;
    }

    .cloud-project-title-row {
        flex-wrap: wrap;
        gap: 6px;
    }

    .cloud-project-name {
        font-size: 14px;
        max-width: 100%;
    }

    .cloud-badge-current {
        white-space: nowrap !important;
        flex-shrink: 0;
    }

    .cloud-project-meta {
        flex-wrap: wrap;
        gap: 4px 12px;
        margin-top: 6px;
        font-size: 11px;
    }

    .cloud-project-actions {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 8px;
        padding-top: 8px;
        border-top: 1px dashed var(--border-color);
    }

    .cloud-project-actions .btn-cloud-open {
        flex: 1;
        justify-content: center;
        padding: 7px 12px;
    }

    .cloud-project-actions .btn-cloud-delete {
        padding: 7px 12px;
    }
}

/* スタート画面 最上部アカウントバー (中央寄せ・中身幅の区切り線) */
.start-top-auth-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 14px;
    width: 100%;
}

.start-top-auth-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #cbd5e1;
}

.auth-user-simple {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted-dark);
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.auth-user-simple:hover {
    opacity: 0.8;
}

.auth-user-simple svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.auth-user-simple .user-email-text {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    color: var(--text-dark);
}

/* ============================================================
   タブレット対応 (max-width: 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    /* ワークスペースヘッダーのボタンテキスト非表示 (アイコン優先) */
    .workspace-header-actions .btn span {
        display: none !important;
    }

    .workspace-header-actions .btn {
        padding: 6px 8px !important;
        min-width: 34px;
        justify-content: center;
    }

    /* タイムラインツールバーの削除ボタンテキスト非表示 */
    .btn-delete-kf span {
        display: none !important;
    }

    /* 動画コントロールバーの内部折り返し */
    .video-control-bar {
        height: auto !important;
        min-height: 44px;
        padding: 6px 8px !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 6px 10px !important;
    }

    .timecode-display {
        font-size: 12px;
        padding: 4px 6px;
    }

    .jog-shuttle {
        height: 30px;
    }

    .video-step-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ============================================================
   エクスポートモーダル タブ切り替えスタイル (案B)
   ============================================================ */
.export-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
    margin: -20px -20px 18px -20px;
    padding: 0 16px;
    gap: 8px;
}

.export-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    font-family: inherit;
}

.export-tab-btn svg {
    color: var(--text-muted);
    transition: color 0.15s ease;
}

.export-tab-btn:hover {
    color: var(--text-main);
}

.export-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: #ffffff;
}

.export-tab-btn.active svg {
    color: var(--primary-color);
}

.export-tab-panel {
    display: none;
}

.export-tab-panel.active {
    display: block;
    animation: modalTabFadeIn 0.2s ease;
}

@keyframes modalTabFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   チュートリアルモーダル（使い方ガイド）
   ============================================================ */
.modal-content.tutorial-modal-content {
    max-width: 560px;
    width: 94%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background: #141820;
    color: var(--text-light);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.tutorial-modal-content .modal-header {
    background: #141820;
    border-bottom: 1px solid var(--border-dark);
    padding: 14px 20px;
}

.tutorial-modal-content .modal-title {
    color: #f1f5f9;
    font-size: 16px;
    font-weight: 700;
}

.tutorial-modal-content .modal-title svg {
    color: #60a5fa;
}

.tutorial-modal-content .btn-close {
    color: #94a3b8;
}

.tutorial-modal-content .btn-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.tutorial-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tutorial-page-counter {
    font-family: var(--font-mono);
    font-size: 12px;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 600;
}

.tutorial-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    flex: 1;
}

/* 画像フレーム (3:2) */
.tutorial-image-frame {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 3 / 2;
    background: radial-gradient(circle at 50% 45%, #1a2332 0%, #0c1017 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.05), 0 8px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    position: relative;
}

.tutorial-image-frame img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* テキスト解説エリア */
.tutorial-text-area {
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.tutorial-step-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    padding: 2px 10px;
    border-radius: 9999px;
    margin-bottom: 6px;
    letter-spacing: 0.06em;
}

.tutorial-title {
    font-size: 16px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 8px;
    line-height: 1.4;
}

.tutorial-desc {
    font-size: 13px;
    line-height: 1.6;
    color: #94a3b8;
    text-align: left;
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: 10px 14px;
}

/* フッターナビゲーション */
.tutorial-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid var(--border-dark);
    background: #10141c;
}

.tutorial-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tutorial-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #334155;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.tutorial-dot:hover {
    background: #64748b;
}

.tutorial-dot.active {
    background: #3b82f6;
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

@media (max-width: 600px) {
    #tutorialModal {
        height: 100vh;
        height: 100svh;
    }
    .modal-content.tutorial-modal-content {
        width: 96%;
        max-height: 100vh;
        max-height: 100svh;
        border-radius: var(--radius-md);
    }
    .tutorial-modal-body {
        padding: 10px 12px 8px;
        gap: 8px;
    }
    .tutorial-image-frame {
        max-width: 100%;
        aspect-ratio: 3 / 2;
        padding: 6px;
    }
    .tutorial-title {
        font-size: 14px;
        margin-bottom: 6px;
    }
    .tutorial-desc {
        font-size: 12px;
        line-height: 1.5;
        padding: 8px 10px;
    }
    .tutorial-modal-footer {
        padding: 10px 12px;
    }
    .tutorial-dot {
        width: 6px;
        height: 6px;
    }
}

/* ============================================================
   エクスポート完了時 ツールシェアUI & 静止画プレビューモーダル
   ============================================================ */

/* ツールシェアカード */
.export-share-card {
    margin-top: 16px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    animation: fadeIn 0.25s ease-out;
}

.export-share-header {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.export-share-header svg {
    color: var(--primary-color);
}

.export-share-desc {
    font-size: 12px;
    color: var(--text-muted-dark);
    margin-bottom: 12px;
    line-height: 1.4;
}

.export-share-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-share-x {
    background: #0f1419;
    color: #ffffff;
    border: 1px solid #0f1419;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-share-x:hover {
    background: #272c30;
    color: #ffffff;
}

.btn-share-x svg {
    fill: currentColor;
}

/* 静止画プレビューモーダル (中間地点表示) */
.export-preview-modal-backdrop {
    z-index: 10005;
}

.export-preview-modal-content {
    max-width: 520px;
    width: 92%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.export-preview-modal-body {
    padding: 16px 20px;
    text-align: center;
    overflow-y: auto;
}

.export-preview-meta {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted-dark);
    margin-bottom: 12px;
    padding: 6px 12px;
    background: #f1f5f9;
    border-radius: var(--radius-sm);
    display: inline-block;
}

.export-preview-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
    margin: 0 auto;
    max-width: 100%;
}

#exportPreviewImg {
    max-width: 100%;
    max-height: min(46vh, 380px);
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    display: block;
}

.export-preview-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 10px;
    line-height: 1.4;
}

/* アカウント管理 / ログアウト画面 (ログイン中ビュー) */
.auth-logged-in-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.auth-logged-in-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-logged-in-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.auth-logged-in-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.auth-logged-in-email {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    word-break: break-all;
}

.auth-danger-zone {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.auth-danger-desc {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.4;
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid #f87171;
    color: #ef4444;
}

.btn-danger-outline:hover {
    background: #fef2f2;
    border-color: #ef4444;
    color: #dc2626;
}

.btn-delete-account-subtle {
    color: #ef4444 !important;
    border-color: #fecaca !important;
    background: #ffffff !important;
}

.btn-delete-account-subtle:hover {
    background: #fef2f2 !important;
    border-color: #f87171 !important;
    color: #dc2626 !important;
}
