:root {
    --bg-color: #0c0e12;
    --card-bg: rgba(22, 26, 34, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%);
    --input-bg: #1f2937;
    --input-border: #374151;
    --modal-overlay: rgba(0, 0, 0, 0.8);
    --success-color: #10b981;
    --error-color: #ef4444;

    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.7), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    scrollbar-width: none !important; /* Firefox用スクロールバー非表示 */
    -ms-overflow-style: none !important; /* IE/Edge用スクロールバー非表示 */
}

/* Chrome, Safari, Opera のスクロールバーを非表示にする */
::-webkit-scrollbar {
    display: none !important;
}

html {
    height: 100%;
    height: -webkit-fill-available;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100%;
    height: -webkit-fill-available;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image:
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(45, 212, 191, 0.1) 0px, transparent 50%);
    overscroll-behavior: none; /* スワイプによるブラウザバック等の防止 */
    touch-action: manipulation; /* ピンチズームやダブルタップズームを無効化 */
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

.app-container {
    width: 100%;
    max-width: 800px;
    min-height: 100vh;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .app-container {
        min-height: auto;
        border-radius: 24px;
        background: rgba(22, 26, 34, 0.6);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.05);
        box-shadow: var(--shadow-lg);
        margin: 2rem;
    }
}

.app-header {
    margin-bottom: 2.5rem;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.app-title {
    font-size: clamp(1.5rem, 7vw, 2.5rem);
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    margin: 0;
    white-space: nowrap;
}

.settings-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -0.25rem;
}

.settings-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(30deg);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tabs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    gap: 1.25rem;
}

.tab-card {
    position: relative;
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    height: 8.0rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    color: var(--text-primary);
}

.tab-card.clickable-tab {
    border: 2px solid #ffffff;
}

.tab-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}


.tab-label {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    z-index: 1;
}

/* モーダル関連のスタイルは全画面ビュー移行に伴い削除されました */

.station-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    /* 全画面表示に合わせたため max-height を削除 */
    padding-right: 0.25rem;
}

/* スクロールバーカスタマイズ */
.station-list::-webkit-scrollbar {
    width: 4px;
}
.station-list::-webkit-scrollbar-track {
    background: transparent;
}
.station-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.station-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-weight: 500;
    color: var(--text-primary);
    border: 1px solid var(--input-border);
    transition: all 0.2s ease;
}

.station-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(59, 130, 246, 0.3);
}

/* 各アイテムのヘッダー（名前 + 削除ボタン） */
.station-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.station-item-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.station-edit-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
}

.station-item:hover .station-edit-btn {
    opacity: 1;
}

.station-edit-btn:hover {
    color: var(--accent-color);
    background: rgba(59, 130, 246, 0.1);
}

/* サブ情報 */
.station-item-area {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.station-item-location {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.station-item-remarks {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.375rem;
    padding-top: 0.375rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* 設置物タグ */
.station-item-facilities {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.facility-tag {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
    white-space: nowrap;
}

.facility-tag-none {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
    border-color: rgba(148, 163, 184, 0.2);
}

/* 空リスト表示 */
.station-empty {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    padding: 2rem 1rem;
    opacity: 0.7;
}

.btn {
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: var(--input-bg);
}

/* チェックボックスグリッド */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.checkbox-item:hover {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(31, 41, 55, 0.8);
}

/* ネイティブチェックボックスを非表示 */
.checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* カスタムチェックボックス */
.checkbox-custom {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 6px;
    border: 2px solid var(--input-border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* チェックマーク */
.checkbox-custom::after {
    content: '';
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: -2px;
}

/* チェック時のスタイル */
.checkbox-item input[type="checkbox"]:checked ~ .checkbox-custom {
    background: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.checkbox-item input[type="checkbox"]:checked ~ .checkbox-custom::after {
    transform: rotate(45deg) scale(1);
}

/* チェック時のカード全体 */
.checkbox-item:has(input:checked) {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(59, 130, 246, 0.08);
}

.checkbox-label-text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* --- View (Page) Transitions --- */
.app-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    height: -webkit-fill-available;
    overflow: hidden;
    max-width: 800px;
}

@media (min-width: 768px) {
    .app-wrapper {
        height: auto;
        min-height: 80vh;
        border-radius: 24px;
        background: rgba(22, 26, 34, 0.6);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.05);
        box-shadow: var(--shadow-lg);
        margin: 2rem;
        overflow: hidden;
    }
    
    /* app-containerの元のスタイルを上書き */
    .app-container {
        border-radius: 0;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: none;
        box-shadow: none;
        margin: 0;
        min-height: 100%;
    }
}

.view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden; /* 横スクロールバーを完全に非表示にする */
    background-color: var(--bg-color);
    display: none;
    flex-direction: column;
    overscroll-behavior-y: none;
}

@media (min-width: 768px) {
    .view {
        background: transparent;
    }
}

.view.active-view {
    display: flex;
}

/* Animations */
.slide-in-right {
    display: flex;
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.slide-out-left {
    display: flex;
    animation: slideOutLeft 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.slide-in-left {
    display: flex;
    animation: slideInLeft 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.slide-out-right {
    display: flex;
    animation: slideOutRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slideOutLeft {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes slideOutRight {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

/* 報告画面の固有スタイル */
.report-view-content {
    padding: 2rem 1.5rem;
    flex: 1;
}

.back-btn-container {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0.5rem 0;
    touch-action: manipulation; /* iOSでのタップ遅延を防止 */
    position: relative;
    z-index: 30; /* stickyヘッダーより上に置いてタッチを確実に受ける */
    -webkit-user-select: none;
    user-select: none;
}

.back-btn:hover {
    color: var(--text-primary);
}

.back-btn:active {
    opacity: 0.6;
}

.report-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

#report-section-card {
    border: 1.5px solid #ffffff; /* 報告の大外の枠（白） */
    padding: 0.8rem 1.2rem; /* 上下の隙間を詰める（デフォルトは1.5rem） */
}

#collect-section-card {
    border: 1.5px solid rgba(74, 222, 128, 0.6); /* 回収の大外の枠（緑） */
}


/* 報告画面の設置物グリッド */
.facility-report-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 0;
    list-style: none;
    margin-top: 0.5rem;
}

.facility-report-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: none; /* アニメーションを廃止しタップレスポンスを劇的に向上 */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}

/* 一部回収中のため報告側で編集不可となったカードのスタイル */
.facility-report-card.disabled-card {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
}

.facility-report-card.selected {
    border-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* 報告側のタブ（カード）を明るい青に（透明度50% / borderを排除し内側シャドウで枠線を描画してガタつきを防止） */
#report-facility-list .facility-report-card {
    background: rgba(59, 130, 246, 0.5);
    border: none;
    padding: 0.5rem 0.75rem; /* 上下のパディングを短縮（デフォルトは0.75rem） */
    gap: 0.4rem; /* カード内の要素間隔を短縮（デフォルトは0.75rem） */
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.4); /* 内側に1pxの青い枠線 */
}

/* 報告側のタブ（カード）の回収状態（タップによるトグルで緑透過50%に切り替え） */
#report-facility-list .facility-report-card.collect-status {
    background: rgba(74, 222, 128, 0.5); /* 緑の透明度50% */
    box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.4); /* 内側に1pxの緑の枠線 */
}

/* 報告側のタブ（カード）選択時の枠を白に（内側に2pxの白い枠線をシャドウで描画し、物理的なサイズ変化を防止） */
#report-facility-list .facility-report-card.selected {
    border: none;
    box-shadow: inset 0 0 0 2px #ffffff, 0 0 0 2px rgba(255, 255, 255, 0.4); /* 内側に2pxの白枠、外側に薄い光彩 */
}

/* 回収側のタブ（カード）を明るい緑に */
#collect-facility-list .facility-report-card {
    background: rgba(74, 222, 128, 0.05);
    border-color: rgba(74, 222, 128, 0.2);
}

#collect-facility-list .facility-report-card.selected {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.15);
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3);
}

.facility-report-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    pointer-events: none;
}

.facility-report-value {
    width: 100%;
    text-align: center;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    padding: 0; /* paddingによる要素の膨らみを防止 */
    font-size: 1.125rem;
    font-weight: 700;
    color: #ffffff;
    height: 2.125rem; /* 固定高さに変更 */
    line-height: 1; /* フォントによる高さのブレを排除 */
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-sizing: border-box;
}

.facility-report-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    width: 100%;
}

.facility-key-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    height: 2.35rem; /* 元の高さ（約37px）に合わせて固定し、満杯による伸縮を防止 */
    display: inline-flex; /* 内部テキストの完全な中央配置 */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.facility-key-btn:active {
    transform: scale(0.95);
}

.facility-key-btn.selected {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* タップフィードバック用 */
.tab-tap-preview {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: scale(0.98);
    border-color: rgba(255, 255, 255, 0.2) !important;
}



/* 報告一覧ビューの設置物グリッド（4列・小さめ） */
#report-list-facilities {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.5rem !important;
    padding: 0 0.5rem !important;
    margin-top: 0 !important;
}

#report-list-facilities .facility-report-card {
    padding: 0.6rem 0.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

/* --- 一部回収フローティングウインドウ --- */
.partial-window {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.partial-window-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.partial-window-facility {
    font-size: 1.2rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 0.25rem;
}

.partial-input-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 240px;
}

.partial-input-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 3.5rem;
    text-align: right;
}

.partial-input-field {
    flex: 1;
    text-align: center;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.partial-input-field.selected {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.partial-window-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    width: 100%;
    max-width: 240px;
}

.partial-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.partial-btn:active {
    transform: scale(0.96);
}

.partial-btn-confirm {
    background: #3b82f6;
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.partial-btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* 計量計算時の確認ポップアップオーバーレイ */
.confirm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    z-index: 100;
    animation: fadeInOverlay 0.2s ease-out forwards;
    padding: 1rem;
    box-sizing: border-box;
    border: 1.5px solid rgba(59, 130, 246, 0.5);
}

.confirm-overlay-msg {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    line-height: 1.4;
}

.confirm-overlay-btn-group {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    max-width: 220px;
}

.confirm-overlay-btn {
    flex: 1;
    padding: 0.55rem 0.75rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.confirm-overlay-btn-yes {
    background: #3b82f6;
    color: white;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

.confirm-overlay-btn-yes:active {
    background: #2563eb;
    transform: scale(0.96);
}

.confirm-overlay-btn-no {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.confirm-overlay-btn-no:active {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(0.96);
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 座標取得アクションボタン */
.location-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    width: 100%;
}

.btn-location-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.6rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transition: all 0.2s ease;
    margin: 0;
    width: auto;
}

.btn-location-action:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-location-action:active {
    transform: scale(0.98);
}

.location-icon {
    flex-shrink: 0;
}

/* 計量データ残存時の蛍のような光ギミック */
@keyframes firefly-glow {
    0%, 100% {
        box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.15);
    }
    50% {
        box-shadow: inset 0 0 25px rgba(255, 255, 255, 0.65);
    }
}

.tab-unmeasured-glow {
    animation: firefly-glow 2.5s ease-in-out infinite;
    position: relative;
}

.tab-unmeasured-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
    pointer-events: none;
    opacity: 0.3;
    animation: firefly-pulse 2.5s ease-in-out infinite;
    z-index: 0;
}

@keyframes firefly-pulse {
    0%, 100% {
        opacity: 0.08;
    }
    50% {
        opacity: 0.3;
    }
}

/* ステーション選択カスタムモーダル */
.modal-overlay-custom {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(12, 14, 18, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.modal-content-custom {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    width: 100%;
    max-width: 450px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header-custom h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body-custom {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.station-select-option-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.station-select-option-btn:hover,
.station-select-option-btn:active {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--accent-color);
}

.station-select-option-name {
    font-weight: 600;
    font-size: 1.05rem;
}

.station-select-option-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.station-select-option-distance {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-weight: 600;
    background: rgba(59, 130, 246, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 50px;
}

/* ================================ */
/* 地図ビュー（Maplibre）スタイル     */
/* ================================ */
.map-type-control {
    display: flex;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 3px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.map-type-btn {
    background: transparent;
    border: none;
    padding: 5px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.map-type-btn.active {
    background: #3b82f6;
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* 自車位置送信トグルスイッチ */
.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .3s;
    border-radius: 20px;
}

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

input:checked + .slider {
    background-color: #10b981;
}

input:checked + .slider:before {
    transform: translateX(18px);
}

/* ステーション詳細シート */
.station-detail-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px 16px 0 0;
    padding: 1.25rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    animation: sheetSlideUp 0.25s ease-out;
}

@keyframes sheetSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ステーションピンマーカー */
.station-map-pin {
    width: 32px;
    height: 32px;
    background: #ef4444;
    border: 2px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.station-map-pin:hover, .station-map-pin:active {
    transform: scale(1.15);
    background: #dc2626;
}

.station-map-pin svg {
    color: white;
    width: 18px;
    height: 18px;
}

/* リアルタイム共有の車マーカー */
.car-pin-marker {
    width: 36px;
    height: 36px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
    transition: transform 0.3s ease-out;
}

/* ステーションラベルの表示・非表示（ズームレベル12基準: 広域時は非表示、詳細拡大時に表示） */
.station-marker-label {
    display: none !important;
}
.map-zoom-detailed .station-marker-label {
    display: block !important;
}

/* 仮登録ピンのアニメーション */
@keyframes koshiTempPulse {
    0%, 100% {
        transform: rotate(-45deg) scale(1);
        box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5);
    }
    50% {
        transform: rotate(-45deg) scale(1.12);
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.85);
    }
}

/* 位置調整確認ポップアップの最前面固定 */
.adjust-popup-top,
.maplibregl-popup.adjust-popup-top {
    z-index: 3000 !important;
}

/* 地図画面：設置物フィルタータブバー */
.map-facility-tab-btn {
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.16);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.map-facility-tab-btn:active {
    transform: scale(0.96);
}

.map-facility-tab-btn.active {
    background: #3b82f6;
    color: #ffffff;
    border-color: #60a5fa;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.45);
}
