@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', 'Courier New', monospace;
    background: #0a0a0a;
    color: #e8e8e8;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 0;
    animation: scanline 10s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(10px); }
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(209, 213, 219, 0.02);
    pointer-events: none;
    z-index: 9997;  /* 9998 → 9997 に変更 */
    animation: glitch 8s infinite;
}

@keyframes glitch {
    0%, 90%, 100% { opacity: 0; }
    91%, 94% { opacity: 1; transform: translate(2px, 2px); }
    92%, 96% { opacity: 1; transform: translate(-2px, -2px); }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.noise-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100" height="100" filter="url(%23noise)" opacity="0.05"/></svg>');
    pointer-events: none;
    opacity: 0.3;
}

.login-view {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-box {
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #d4d4d4;
    padding: 50px 40px;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 
        0 0 30px rgba(212, 212, 212, 0.1),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.login-box::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #d4d4d4, transparent, #d4d4d4);
    z-index: -1;
    opacity: 0.3;
    animation: borderPulse 3s ease-in-out infinite;
}

@keyframes borderPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.terminal-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #404040;
}

.terminal-header::before {
    content: '[ SYSTEM ACCESS ]';
    display: block;
    font-size: 12px;
    color: #808080;
    margin-bottom: 15px;
    letter-spacing: 4px;
}

h1 {
    color: #d4d4d4;
    font-size: 28px;
    font-weight: 900;
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    text-shadow: 0 0 10px rgba(212, 212, 212, 0.5);
}

.subtitle {
    color: #808080;
    text-align: center;
    font-size: 12px;
    margin-bottom: 30px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.input-group {
    margin-bottom: 25px;
    position: relative;
}

label {
    display: block;
    color: #808080;
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

label::before {
    content: '> ';
    color: #d4d4d4;
}

input[type="text"],
input[type="password"],
input[type="search"] {
    width: 100%;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #404040;
    color: #d4d4d4;
    font-size: 14px;
    font-weight: 400;
    font-family: 'Orbitron', monospace;
    transition: all 0.3s;
    letter-spacing: 1px;
}

input:focus {
    outline: none;
    border-color: #d4d4d4;
    box-shadow: 
        0 0 10px rgba(212, 212, 212, 0.2),
        inset 0 0 10px rgba(212, 212, 212, 0.05);
    background: rgba(0, 0, 0, 0.7);
}

input::placeholder {
    color: #404040;
    letter-spacing: 1px;
}

.btn {
    width: 100%;
    padding: 18px;
    background: #d4d4d4;
    color: #0a0a0a;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    position: relative;
    letter-spacing: 3px;
    text-transform: uppercase;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn:hover {
    box-shadow: 0 0 20px rgba(212, 212, 212, 0.5);
    transform: translateY(-2px);
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.error {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid #dc2626;
    color: #dc2626;
    padding: 15px;
    font-size: 11px;
    font-weight: 500;
    margin-top: 20px;
    text-align: center;
    display: none;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.error.show {
    display: block;
    animation: errorGlitch 0.3s;
}

@keyframes errorGlitch {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

.loading {
    display: none;
    text-align: center;
    margin-top: 20px;
    color: #d4d4d4;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.loading.show {
    display: block;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.sites-view {
    display: none;
}

.header {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #404040;
    padding: 25px 30px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    flex-wrap: wrap;
    gap: 15px;
}

.header::before {
    content: '[ DATABASE ACCESS ]';
    position: absolute;
    top: -12px;
    left: 20px;
    background: #0a0a0a;
    padding: 0 10px;
    font-size: 10px;
    color: #808080;
    letter-spacing: 2px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.header h1 {
    font-size: 20px;
    margin: 0;
    letter-spacing: 3px;
}

.camera-count {
    background: rgba(212, 212, 212, 0.1);
    border: 1px solid #404040;
    padding: 8px 15px;
    font-size: 10px;
    color: #d4d4d4;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.logout-btn {
    padding: 12px 24px;
    background: transparent;
    color: #d4d4d4;
    border: 1px solid #404040;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.logout-btn:hover {
    border-color: #d4d4d4;
    box-shadow: 0 0 10px rgba(212, 212, 212, 0.3);
    background: rgba(212, 212, 212, 0.05);
}

/* マルチビューボタンのスタイル改善 */
.multi-view-btn {
    padding: 12px 24px;
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid #22c55e;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 8px;
}

.multi-view-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.2), transparent);
    transition: left 0.5s;
}

.multi-view-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
    transform: translateY(-2px);
}

.multi-view-btn:hover::before {
    left: 100%;
}

.multi-view-icon {
    font-size: 14px;
    animation: pulse-icon 2s infinite;
}

@keyframes pulse-icon {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.search-box {
    margin-bottom: 30px;
    position: relative;
}

.search-box::before {
    content: 'SEARCH';
    position: absolute;
    top: -12px;
    left: 20px;
    background: #0a0a0a;
    padding: 0 10px;
    font-size: 10px;
    color: #808080;
    letter-spacing: 2px;
    z-index: 1;
}

.search-box input {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #404040;
    padding: 18px 60px 18px 24px;
    font-size: 14px;
}

.clear-search {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(212, 212, 212, 0.1);
    border: 1px solid #404040;
    color: #d4d4d4;
    width: 35px;
    height: 35px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}

.clear-search:hover {
    background: rgba(212, 212, 212, 0.2);
    border-color: #d4d4d4;
}

.tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #404040;
    padding: 2px;
}

.tab {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    color: #808080;
    border: none;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab:hover {
    color: #d4d4d4;
    background: rgba(212, 212, 212, 0.05);
}

.tab.active {
    background: #d4d4d4;
    color: #0a0a0a;
    font-weight: 700;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.map-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
    display: flex;
    gap: 10px;
}

.map-control-btn {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #404040;
    color: #d4d4d4;
    padding: 10px 15px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-control-btn:hover {
    border-color: #d4d4d4;
    background: rgba(20, 20, 20, 1);
    box-shadow: 0 0 10px rgba(212, 212, 212, 0.3);
}

#mapContainer {
    height: 70vh;
    min-height: 500px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #404040;
    position: relative;
}

#mapContainer::before {
    content: '[ MAP VIEW ]';
    position: absolute;
    top: -12px;
    left: 20px;
    background: #0a0a0a;
    padding: 0 10px;
    font-size: 10px;
    color: #808080;
    letter-spacing: 2px;
    z-index: 1000;
}

.leaflet-container {
    background: #1a1a1a;
    font-family: 'Orbitron', monospace;
}

.custom-marker {
    background: none !important;
    border: none !important;
}

.custom-marker.selected {
    animation: marker-pulse 1.5s infinite;
}

@keyframes marker-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.camera-marker {
    width: 40px;
    height: 40px;
    background: rgba(212, 212, 212, 0.95);
    border: 2px solid #0a0a0a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 15px rgba(212, 212, 212, 0.4);
}

.camera-marker:hover {
    transform: scale(1.2);
    box-shadow: 0 0 25px rgba(212, 212, 212, 0.7);
}

.camera-icon {
    transition: all 0.3s;
}

.camera-icon.selected {
    filter: drop-shadow(0 0 10px #22c55e);
}

.my-location-marker {
    background: none !important;
    border: none !important;
}

.location-pulse {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    animation: locationPulse 1.5s infinite;
    filter: drop-shadow(0 0 10px rgba(34, 197, 94, 0.8));
}

@keyframes locationPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.leaflet-popup-content-wrapper {
    background: rgba(20, 20, 20, 0.98);
    border: 2px solid #d4d4d4;
    color: #d4d4d4;
    font-family: 'Orbitron', monospace;
    box-shadow: 0 0 40px rgba(212, 212, 212, 0.5);
}

.leaflet-popup-tip {
    background: rgba(20, 20, 20, 0.98);
    border: 2px solid #d4d4d4;
    border-top: none;
    border-right: none;
}

.leaflet-popup-content {
    margin: 0;
    width: auto !important;
    min-width: 300px;
}

.popup-content {
    padding: 25px;
}

.popup-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #d4d4d4;
    border-bottom: 2px solid #404040;
    padding-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.popup-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 11px;
}

.popup-info-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    align-items: center;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #2a2a2a;
    gap: 15px;
}

.popup-info-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    align-items: center;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #2a2a2a;
    gap: 15px;
}

.popup-value {
    color: #d4d4d4;
    letter-spacing: 1px;
    font-weight: 500;
    font-size: 13px;
    word-break: break-all;
}

.popup-copy {
    background: transparent;
    border: 1px solid #404040;
    color: #d4d4d4;
    cursor: pointer;
    padding: 8px 15px;
    font-size: 10px;
    font-weight: 600;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.popup-copy:hover {
    border-color: #d4d4d4;
    background: rgba(212, 212, 212, 0.1);
    box-shadow: 0 0 10px rgba(212, 212, 212, 0.3);
}

.popup-direction-item {
    display: grid;
    grid-template-columns: 100px 1fr;
    align-items: center;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #2a2a2a;
    gap: 15px;
}

.popup-select-btn {
    display: block;
    width: 100%;
    padding: 15px;
    margin-bottom: 12px;
    background: transparent;
    color: #22c55e;
    border: 2px solid #22c55e;
    text-align: center;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s;
    cursor: pointer;
    font-family: 'Orbitron', monospace;
}

.popup-select-btn:hover {
    background: rgba(34, 197, 94, 0.1);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

.popup-select-btn.active {
    background: #22c55e;
    color: #0a0a0a;
    font-weight: 900;
}

.popup-btn {
    display: block;
    width: 100%;
    padding: 18px;
    background: #d4d4d4;
    color: #0a0a0a;
    text-decoration: none;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.popup-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.popup-btn:hover {
    box-shadow: 0 0 25px rgba(212, 212, 212, 0.6);
    transform: translateY(-2px);
}

.popup-btn:hover::before {
    left: 100%;
}

.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.site-card {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #404040;
    padding: 0;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.site-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #d4d4d4;
    opacity: 0;
    transition: opacity 0.3s;
}

.site-card:hover {
    border-color: #d4d4d4;
    box-shadow: 0 0 20px rgba(212, 212, 212, 0.1);
    transform: translateX(5px);
}

.site-card:hover::before {
    opacity: 1;
}

.site-card.selected {
    border-color: #22c55e;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
}

.site-card.selected::before {
    background: #22c55e;
    opacity: 1;
}

.site-header {
    background: rgba(0, 0, 0, 0.5);
    padding: 15px 20px;
    border-bottom: 1px solid #404040;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.site-name {
    font-size: 16px;
    font-weight: 700;
    color: #d4d4d4;
    letter-spacing: 2px;
    text-transform: uppercase;
    flex: 1;
}

.select-btn {
    padding: 8px 16px;
    background: transparent;
    color: #22c55e;
    border: 1px solid #22c55e;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}

.select-btn:hover {
    background: rgba(34, 197, 94, 0.1);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.select-btn.active {
    background: #22c55e;
    color: #0a0a0a;
    font-weight: 700;
}

.site-body {
    padding: 20px;
}

.site-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.info-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #2a2a2a;
    font-size: 12px;
}

.info-label {
    color: #808080;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.info-label::before {
    content: '> ';
}

.info-value {
    color: #d4d4d4;
    word-break: break-all;
    font-weight: 400;
    letter-spacing: 1px;
}

.copy-btn {
    background: transparent;
    border: 1px solid #404040;
    color: #d4d4d4;
    cursor: pointer;
    padding: 6px 12px;
    font-size: 10px;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    letter-spacing: 1px;
}

.copy-btn:hover {
    border-color: #d4d4d4;
    box-shadow: 0 0 10px rgba(212, 212, 212, 0.3);
}

.open-link {
    display: block;
    text-align: center;
    background: #d4d4d4;
    color: #0a0a0a;
    text-decoration: none;
    font-weight: 700;
    font-size: 12px;
    padding: 15px 20px;
    transition: all 0.3s;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.open-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,0.2), transparent);
    transition: left 0.5s;
}

.open-link:hover {
    box-shadow: 0 0 20px rgba(212, 212, 212, 0.5);
}

.open-link:hover::before {
    left: 100%;
}

.map-link {
    display: block;
    text-align: center;
    background: transparent;
    color: #d4d4d4;
    border: 1px solid #404040;
    text-decoration: none;
    font-weight: 500;
    font-size: 11px;
    padding: 12px 20px;
    transition: all 0.3s;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    font-family: 'Orbitron', monospace;
    margin-top: 10px;
}

.map-link:hover {
    border-color: #d4d4d4;
    background: rgba(212, 212, 212, 0.05);
    box-shadow: 0 0 10px rgba(212, 212, 212, 0.3);
}

.no-results {
    text-align: center;
    padding: 60px 40px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #404040;
    color: #808080;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.no-results::before {
    content: '[ NO DATA FOUND ]';
    display: block;
    margin-bottom: 20px;
    font-size: 20px;
    color: #404040;
}

.toast {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background: rgba(20, 20, 20, 0.98);
    border: 1px solid #d4d4d4;
    color: #d4d4d4;
    padding: 15px 25px;
    font-weight: 500;
    font-size: 11px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 10000;
    letter-spacing: 2px;
    text-transform: uppercase;
    box-shadow: 0 0 20px rgba(212, 212, 212, 0.3);
}

.toast.show {
    opacity: 1;
}

.toast::before {
    content: '[ ';
}

.toast::after {
    content: ' ]';
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .login-box {
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 20px;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 15px;
    }
    
    .header-left {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .header h1 {
        font-size: 16px;
    }
    
    .camera-count {
        font-size: 9px;
        padding: 6px 12px;
    }
    
    .logout-btn {
        width: 100%;
        padding: 10px 20px;
        font-size: 10px;
    }
    
    .multi-view-btn {
        width: 100%;
        margin-top: 10px;
        justify-content: center;
    }
    
    .search-box {
        margin-bottom: 20px;
    }
    
    .search-box input {
        padding: 15px 50px 15px 20px;
        font-size: 13px;
    }
    
    .tabs {
        margin-bottom: 20px;
    }
    
    .tab {
        font-size: 11px;
        padding: 12px 15px;
        flex-direction: column;
        gap: 5px;
    }
    
    .map-controls {
        flex-direction: column;
        top: 10px;
        right: 10px;
        gap: 5px;
    }
    
    .map-control-btn {
        padding: 8px 12px;
        font-size: 9px;
    }
    
    #mapContainer {
        height: 60vh;
        min-height: 400px;
    }
    
    .sites-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .site-card:hover {
        transform: translateX(0);
    }
    
    .site-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 15px;
    }
    
    .site-name {
        font-size: 14px;
        width: 100%;
    }
    
    .select-btn {
        width: 100%;
        padding: 10px;
    }
    
    .site-body {
        padding: 15px;
    }
    
    .info-item {
        grid-template-columns: 60px 1fr auto;
        gap: 10px;
        padding: 10px 12px;
        font-size: 11px;
    }
    
    .copy-btn {
        padding: 6px 10px;
        font-size: 9px;
    }
    
    .open-link,
    .map-link {
        padding: 12px 15px;
        font-size: 11px;
    }
    
    .toast {
        right: 15px;
        bottom: 15px;
        left: 15px;
        text-align: center;
        font-size: 10px;
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 14px;
    }
    
    .site-name {
        font-size: 12px;
    }
    
    .tab {
        font-size: 10px;
        padding: 10px 12px;
    }
    
    #mapContainer {
        height: 50vh;
        min-height: 350px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .sites-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #mapContainer {
        height: 65vh;
        min-height: 550px;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1600px;
    }
    
    #mapContainer {
        height: 75vh;
        min-height: 650px;
    }
    
    .sites-grid {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    }
}
.custom-marker {
    background: none !important;
    border: none !important;
}

.custom-camera-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    position: relative;
}


.camera-marker-default {
    width: 40px;
    height: 40px;
    background: rgba(212, 212, 212, 0.95);
    border: 2px solid #0a0a0a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 15px rgba(212, 212, 212, 0.4);
}

.custom-camera-marker:hover .camera-marker-default {
    transform: scale(1.2);
    box-shadow: 0 0 25px rgba(212, 212, 212, 0.7);
}

.camera-label-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #d4d4d4;
    color: #d4d4d4;
    padding: 4px 8px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 5;
    pointer-events: none;
    transition: all 0.3s;
}

/* Map View Container */
.map-view-container {
    display: flex;
    gap: 20px;
    height: 70vh;
    min-height: 500px;
}

.map-main {
    flex: 1;
    position: relative;
}

.map-mode-switch {
    position: absolute;
    top: 15px;
    left: 50px;
    z-index: 1000;
    display: flex;
    gap: 5px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #404040;
    padding: 5px;
}

.mode-btn {
    padding: 10px 20px;
    background: transparent;
    color: #808080;
    border: none;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.mode-btn:hover {
    color: #d4d4d4;
    background: rgba(212, 212, 212, 0.05);
}

.mode-btn.active {
    background: #d4d4d4;
    color: #0a0a0a;
    font-weight: 700;
}

#cadContainer {
    width: 100%;
    height: 100%;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #404040;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #808080;
    font-size: 14px;
    letter-spacing: 2px;
}

#cadContainer::before {
    content: '読み込み中です...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: 700;
    color: #d4d4d4;
    letter-spacing: 3px;
    text-transform: uppercase;
    z-index: 1;
    animation: blink 1.5s infinite;
}

#cadContainer:has(.cad-viewer)::before {
    display: none; /* 画像が読み込まれたら非表示 */
}

/* Sidebar */
.map-sidebar {
    width: 350px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #404040;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #404040;
    background: rgba(0, 0, 0, 0.5);
}

.sidebar-header h3 {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #d4d4d4;
    margin-bottom: 10px;
}

.selected-count {
    font-size: 10px;
    color: #808080;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.sidebar-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #2a2a2a;
    padding: 12px 15px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.sidebar-item:hover {
    border-color: #404040;
    background: rgba(0, 0, 0, 0.5);
}

.sidebar-item.selected {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.sidebar-item.active-camera {
    border-left: 3px solid #05dff7;
    box-shadow: 0 0 15px rgba(212, 212, 212, 0.2);
}

.sidebar-item-header {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-item-name {
    font-size: 12px;
    font-weight: 600;
    color: #d4d4d4;
    letter-spacing: 1px;
    cursor: pointer;
    transition: color 0.3s;
}

.sidebar-item-name:hover {
    color: #3b82f6;
}

.active-badge {
    display: inline-block;
    font-size: 9px;
    color: #05dff7;
    background: rgba(212, 212, 212, 0.2);
    padding: 3px 8px;
    border: 1px solid #05dff7;
    letter-spacing: 1px;
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.sidebar-select-btn {
    width: 35px;
    height: 35px;
    background: transparent;
    border: 1px solid #22c55e;
    color: #22c55e;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-select-btn:hover {
    background: rgba(34, 197, 94, 0.1);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.sidebar-select-btn.active {
    background: #22c55e;
    color: #0a0a0a;
}

.sidebar-multiview-btn {
    margin: 15px;
    padding: 15px;
    background: #22c55e;
    color: #0a0a0a;
    border: none;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.sidebar-multiview-btn:hover {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
    transform: translateY(-2px);
}

/* Active Marker Styles */
.custom-camera-marker.active-marker {
    position: relative;
}

.custom-camera-marker.active-marker .camera-marker-default {
    box-shadow: 0 0 25px rgba(212, 212, 212, 0.2);
    animation: marker-glow 2s infinite;
}

.custom-camera-marker.active-marker::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    border: 3px solid rgba(5, 223, 247, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: sonar-pulse-map 2s infinite;
    pointer-events: none;
    z-index: -1;
}

.custom-camera-marker.active-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    border: 3px solid rgba(5, 223, 247, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: sonar-pulse-map 2s infinite 1s;
    pointer-events: none;
    z-index: -1;
}

@keyframes sonar-pulse-map {
    0% {
        width: 60px;
        height: 60px;
        opacity: 1;
    }
    100% {
        width: 150px;
        height: 150px;
        opacity: 0;
    }
}

/* アクティブマーカーのアイコングロー効果 */
.custom-camera-marker.active-marker .camera-marker-default {
    box-shadow: 0 0 20px rgba(5, 223, 247, 0.8);
    animation: icon-glow 2s infinite;
}

@keyframes icon-glow {
    0%, 100% { 
        filter: drop-shadow(0 0 15px rgba(5, 223, 247, 1));
    }
    50% { 
        filter: drop-shadow(0 0 25px rgba(5, 223, 247, 1));
    }
}

.active-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #05dff7;
    color: #0a0a0a;
    font-size: 8px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 2px;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(5, 223, 247, 0.8);
}
@media (max-width: 1024px) {
    .map-view-container {
        flex-direction: column;
    }
    
    .map-main {
        height: 50vh;
    }
    
    .map-sidebar {
        width: 100%;
        height: 300px;
    }
}

@media (max-width: 768px) {
    .map-mode-switch {
        left: 10px;
        top: 10px;
        flex-direction: column;
        gap: 2px;
    }
    
    .mode-btn {
        padding: 8px 15px;
        font-size: 10px;
    }
    
    .map-sidebar {
        height: 250px;
    }
    
    .sidebar-header {
        padding: 15px;
    }
    
    .sidebar-header h3 {
        font-size: 12px;
    }
    
    .sidebar-item-name {
        font-size: 11px;
    }
}

/* style.css の最後に追加 */

/* CAD Viewer - Single Floor Plan */
.cad-viewer {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #1a1a1a;
}

.cad-canvas {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: grab;
    transition: transform 0.15s ease-out;
    transform-origin: center center;
}

.cad-canvas:active {
    cursor: grabbing;
}

.cad-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
    pointer-events: auto;
}

.cad-markers-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.cad-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    pointer-events: auto;
}

.cad-marker:hover {
    transform: translate(-50%, -50%) scale(1.3);
    z-index: 20;
}

.cad-marker-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.cad-camera-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(212, 212, 212, 0.6));
}

.cad-camera-icon-default {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

.cad-marker.active .cad-camera-icon-img,
.cad-marker.active .cad-camera-icon-default {
    filter: drop-shadow(0 0 15px rgba(59, 130, 246, 1));
    animation: cad-icon-sonar 2s infinite;
}

@keyframes cad-icon-sonar {
    0%, 100% { 
        filter: drop-shadow(0 0 15px rgba(59, 130, 246, 1));
    }
    50% { 
        filter: drop-shadow(0 0 25px rgba(59, 130, 246, 1));
    }
}

.cad-marker.active::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(59, 130, 246, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: sonar-pulse 2s infinite;
}

.cad-marker.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(59, 130, 246, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: sonar-pulse 2s infinite 0.5s;
}

@keyframes sonar-pulse {
    0% {
        width: 100%;
        height: 100%;
        opacity: 1;
    }
    100% {
        width: 250%;
        height: 250%;
        opacity: 0;
    }
}

.cad-marker-label {
    display: none;
}

.cad-active-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #3b82f6;
    color: #ffffff;
    font-size: 7px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 2px;
    letter-spacing: 0.5px;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.8);
    animation: badge-pulse 2s infinite;
}

/* CAD Controls */
.cad-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 100;
}

.cad-zoom-btn {
    width: 45px;
    height: 45px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #404040;
    color: #d4d4d4;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cad-zoom-btn:hover {
    border-color: #d4d4d4;
    background: rgba(20, 20, 20, 1);
    box-shadow: 0 0 10px rgba(212, 212, 212, 0.3);
    transform: scale(1.05);
}

.cad-zoom-btn:active {
    transform: scale(0.95);
}

/* CAD Legend */
.cad-legend {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #404040;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: #d4d4d4;
    letter-spacing: 1px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #808080;
    border: 2px solid #0a0a0a;
}

.legend-dot.active {
    background: #05dff7;
    border-color: #0a0a0a;
    box-shadow: 0 0 15px rgba(5, 223, 247, 0.8);
     animation: legend-glow 2s infinite;
}

@keyframes legend-pulse {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(212, 212, 212, 0.8);
    }
    50% { 
        box-shadow: 0 0 15px rgba(212, 212, 212, 1);
    }
}

.legend-text {
    text-transform: uppercase;
    font-weight: 500;
}

/* CAD Info */
.cad-info {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #404040;
    padding: 10px 15px;
    z-index: 100;
}

.cad-info-text {
    color: #d4d4d4;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* CAD Popup */
.cad-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s;
}

.cad-popup.show {
    opacity: 1;
}

.cad-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.cad-popup-content {
    background: rgba(20, 20, 20, 0.98);
    border: 2px solid #d4d4d4;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    position: relative;
    box-shadow: 0 0 40px rgba(212, 212, 212, 0.4);
    z-index: 1;
}

.cad-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: 1px solid #404040;
    color: #d4d4d4;
    width: 15px;
    height: 15px;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cad-popup-close:hover {
    border-color: #d4d4d4;
    background: rgba(212, 212, 212, 0.1);
}

.cad-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #404040;
}

.cad-popup-header h3 {
    color: #d4d4d4;
    font-size: 18px;
    margin: 0;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.popup-active-badge {
    background: #d4d4d4;
    color: #0a0a0a;
    font-size: 9px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 2px;
    letter-spacing: 1px;
    animation: badge-pulse 2s infinite;
}

.cad-popup-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.cad-popup-info {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #2a2a2a;
}

.cad-popup-label {
    color: #808080;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.cad-popup-value {
    color: #d4d4d4;
    font-size: 12px;
    letter-spacing: 1px;
    word-break: break-all;
}

.cad-popup-copy {
    background: transparent;
    border: 1px solid #404040;
    color: #d4d4d4;
    cursor: pointer;
    padding: 6px 12px;
    font-size: 10px;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.cad-popup-copy:hover {
    border-color: #d4d4d4;
    box-shadow: 0 0 10px rgba(212, 212, 212, 0.3);
}

.cad-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cad-popup-select {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: #22c55e;
    border: 1px solid #22c55e;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.cad-popup-select:hover {
    background: rgba(34, 197, 94, 0.1);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.cad-popup-select.active {
    background: #22c55e;
    color: #0a0a0a;
    font-weight: 700;
}

.cad-popup-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background: #d4d4d4;
    color: #0a0a0a;
    text-decoration: none;
    text-align: center;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s;
}

.cad-popup-btn:hover {
    box-shadow: 0 0 20px rgba(212, 212, 212, 0.5);
    transform: translateY(-2px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cad-controls {
        top: 10px;
        right: 10px;
    }
    
    .cad-zoom-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .cad-legend {
        bottom: 10px;
        left: 10px;
        padding: 10px;
    }
    
    .legend-item {
        font-size: 10px;
    }
    
    .cad-info {
        bottom: 10px;
        right: 10px;
        padding: 8px 12px;
    }
    
    .cad-info-text {
        font-size: 9px;
    }
    
    .cad-marker-label {
        font-size: 8px;
        padding: 3px 6px;
    }
    
    .cad-popup-content {
        padding: 20px;
        max-width: 95%;
    }
    
    .cad-popup-header h3 {
        font-size: 14px;
    }
    
    .cad-popup-info {
        grid-template-columns: 60px 1fr auto;
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .cad-marker {
        transform: translate(-50%, -50%) scale(0.8);
    }
    
    .cad-marker:hover {
        transform: translate(-50%, -50%) scale(1.1);
    }
}
/* ===================================
   CAD View 追加修正スタイル
   既存のstyle.cssの最後に追加してください
   =================================== */


/* CAD Viewer Container */
.cad-viewer {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #1a1a1a;
}

.cad-canvas {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: grab;
    transition: transform 0.15s ease-out;
    transform-origin: center center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cad-canvas:active {
    cursor: grabbing;
}

.cad-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    user-select: none;
    pointer-events: auto;
}

.cad-markers-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* CAD Marker スタイル改善 */
.cad-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    pointer-events: auto;
    transform-origin: center center;
}

.cad-marker:hover {
    z-index: 20;
}

.cad-marker-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.cad-camera-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(212, 212, 212, 0.6));
    transition: all 0.3s;
}

.cad-marker:hover .cad-camera-icon-img {
    filter: drop-shadow(0 0 15px rgba(212, 212, 212, 1));
    transform: scale(1.2);
}

.cad-camera-icon-default {
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
    transition: all 0.3s;
}

.cad-marker:hover .cad-camera-icon-default {
    filter: drop-shadow(0 0 15px rgba(212, 212, 212, 1));
    transform: scale(1.2);
}

/* Active Camera スタイル */
.cad-marker.active .cad-camera-icon-img,
.cad-marker.active .cad-camera-icon-default {
    filter: drop-shadow(0 0 15px rgba(5, 223, 247, 1));
    animation: cad-icon-glow 2s infinite;
}

@keyframes cad-icon-glow {
    0%, 100% { 
        filter: drop-shadow(0 0 15px rgba(5, 223, 247, 1));
    }
    50% { 
        filter: drop-shadow(0 0 25px rgba(5, 223, 247, 1));
    }
}

/* Active Marker ソナーエフェクト */
.cad-marker.active::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    border: 3px solid rgba(5, 223, 247, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: sonar-pulse 2s infinite;
    pointer-events: none;
}

.cad-marker.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    border: 3px solid rgba(5, 223, 247, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: sonar-pulse 2s infinite 1s;
    pointer-events: none;
}

@keyframes sonar-pulse {
    0% {
        width: 60px;
        height: 60px;
        opacity: 1;
    }
    100% {
        width: 150px;
        height: 150px;
        opacity: 0;
    }
}

/* CAD Marker Label */
.cad-marker-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #d4d4d4;
    color: #d4d4d4;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.cad-marker:hover .cad-marker-label {
    opacity: 1;
}

/* Active Badge */
.cad-active-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #05dff7;
    color: #0a0a0a;
    font-size: 8px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 2px;
    letter-spacing: 0.5px;
    box-shadow: 0 0 10px rgba(5, 223, 247, 0.8);
    z-index: 1;
}

@keyframes badge-pulse {
    0%, 100% { 
        opacity: 1;
    }
    50% { 
        opacity: 0.6;
    }
}

/* CAD Controls 改善 */
.cad-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.cad-zoom-btn {
    width: 50px;
    height: 50px;
    background: rgba(20, 20, 20, 0.98);
    border: 2px solid #404040;
    color: #d4d4d4;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.cad-zoom-btn:hover {
    border-color: #d4d4d4;
    background: rgba(20, 20, 20, 1);
    box-shadow: 0 0 15px rgba(212, 212, 212, 0.4);
    transform: scale(1.05);
}

.cad-zoom-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 10px rgba(212, 212, 212, 0.6);
}

/* CAD Legend 改善 */
.cad-legend {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(20, 20, 20, 0.98);
    border: 2px solid #404040;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: #d4d4d4;
    letter-spacing: 1px;
}

.legend-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #808080;
    border: 2px solid #0a0a0a;
    flex-shrink: 0;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.legend-dot.active {
    background: #05dff7;
    border-color: #0a0a0a;
    box-shadow: 0 0 15px rgba(5, 223, 247, 0.8);
    animation: legend-glow 2s infinite;
}

@keyframes legend-glow {
    0%, 100% { 
        box-shadow: 0 0 12px rgba(5, 223, 247, 0.7);
    }
    50% { 
        box-shadow: 0 0 18px rgba(5, 223, 247, 0.9);
    }
}

.legend-text {
    text-transform: uppercase;
    font-weight: 600;
}

/* CAD Info 改善 */
.cad-info {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(20, 20, 20, 0.98);
    border: 2px solid #404040;
    padding: 12px 20px;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.cad-info-text {
    color: #d4d4d4;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* CAD Popup 改善 */
.cad-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.cad-popup.show {
    opacity: 1;
    pointer-events: auto;
}

.cad-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.cad-popup-content {
    background: rgba(20, 20, 20, 0.98);
    border: 2px solid #d4d4d4;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 0 40px rgba(212, 212, 212, 0.5);
    z-index: 1;
    max-height: 90vh;
    overflow-y: auto;
}

.cad-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #404040;
    gap: 15px;
}

.cad-popup-header h3 {
    color: #d4d4d4;
    font-size: 20px;
    margin: 0;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
}

.popup-active-badge {
    background: #05dff7;
    color: #0a0a0a;
    font-size: 10px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 3px;
    letter-spacing: 1px;
    white-space: nowrap;
}

.cad-popup-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.cad-popup-info {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #2a2a2a;
}

.cad-popup-label {
    color: #808080;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.cad-popup-value {
    color: #d4d4d4;
    font-size: 13px;
    letter-spacing: 1px;
    word-break: break-all;
    font-weight: 500;
}

.cad-popup-copy {
    background: transparent;
    border: 1px solid #404040;
    color: #d4d4d4;
    cursor: pointer;
    padding: 8px 15px;
    font-size: 10px;
    font-weight: 600;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.cad-popup-copy:hover {
    border-color: #d4d4d4;
    background: rgba(212, 212, 212, 0.1);
    box-shadow: 0 0 10px rgba(212, 212, 212, 0.3);
}

.cad-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cad-popup-select {
    width: 100%;
    padding: 15px;
    background: transparent;
    color: #22c55e;
    border: 2px solid #22c55e;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.cad-popup-select:hover {
    background: rgba(34, 197, 94, 0.1);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

.cad-popup-select.active {
    background: #22c55e;
    color: #0a0a0a;
    font-weight: 900;
}

.cad-popup-btn {
    display: block;
    width: 100%;
    padding: 18px;
    background: #d4d4d4;
    color: #0a0a0a;
    text-decoration: none;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.cad-popup-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.cad-popup-btn:hover {
    box-shadow: 0 0 25px rgba(212, 212, 212, 0.6);
    transform: translateY(-2px);
}

.cad-popup-btn:hover::before {
    left: 100%;
}

/* Mobile Responsive 改善 */
@media (max-width: 768px) {
    .cad-controls {
        top: 10px;
        right: 10px;
        gap: 5px;
    }
    
    .cad-zoom-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .cad-legend {
        bottom: 10px;
        left: 10px;
        padding: 15px;
        gap: 10px;
    }
    
    .legend-item {
        font-size: 10px;
        gap: 10px;
    }
    
    .legend-dot {
        width: 14px;
        height: 14px;
    }
    
    .cad-info {
        top: 10px;
        left: 10px;
        padding: 10px 15px;
    }
    
    .cad-info-text {
        font-size: 10px;
    }
    
    .cad-marker-icon {
        width: 35px;
        height: 35px;
    }
    
    .cad-marker-label {
        font-size: 9px;
        padding: 3px 8px;
    }
    
    .cad-popup-content {
        padding: 25px 20px;
        max-width: 95%;
    }
    
    .cad-popup-header h3 {
        font-size: 16px;
    }
    
    .cad-popup-info {
        grid-template-columns: 70px 1fr auto;
        padding: 10px 12px;
        gap: 10px;
    }
    
    .cad-popup-copy {
        padding: 6px 12px;
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .cad-marker-icon {
        width: 30px;
        height: 30px;
    }
    
    .cad-controls {
        gap: 3px;
    }
    
    .cad-zoom-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .cad-legend {
        padding: 12px;
        gap: 8px;
    }
    
    .legend-item {
        font-size: 9px;
    }
    
    .cad-popup-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cad-popup-info {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .cad-popup-label {
        font-size: 10px;
    }
    
    .cad-popup-value {
        font-size: 12px;
    }
}

/* Fullscreen Mode */
.cad-viewer:-webkit-full-screen {
    width: 100%;
    height: 100%;
}

.cad-viewer:-moz-full-screen {
    width: 100%;
    height: 100%;
}

.cad-viewer:fullscreen {
    width: 100%;
    height: 100%;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .popup-content {
        padding: 20px;
    }
    
    .popup-title {
        font-size: 16px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .popup-info-item {
        grid-template-columns: 70px 1fr auto;
        padding: 10px 12px;
        gap: 10px;
    }
    
    .popup-copy {
        padding: 6px 12px;
        font-size: 9px;
    }
    
    .leaflet-popup-content {
        min-width: 280px;
    }
}

@media (max-width: 480px) {
    .popup-info-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .popup-label,
    .popup-value {
        font-size: 11px;
    }
    
    .leaflet-popup-content {
        min-width: 260px;
    }
}
/* リストビューのACTIVEカード表示 */
.site-card.active-card {
    border-left: 3px solid #05dff7;
    box-shadow: 0 0 20px rgba(5, 223, 247, 0.2);
}

.site-name-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.site-name-wrapper .active-badge {
    font-size: 8px;
    padding: 3px 6px;
}

@media (max-width: 768px) {
    .site-name-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Group Marker Styles */
.custom-group-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    cursor: pointer;
}

.group-marker-circle {
    width: 50px;
    height: 50px;
    background: rgba(20, 20, 20, 0.95);
    border: 3px solid #d4d4d4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(212, 212, 212, 0.6);
    transition: all 0.3s;
}

.custom-group-marker:hover .group-marker-circle {
    transform: scale(1.15);
    box-shadow: 0 0 30px rgba(212, 212, 212, 0.9);
}

.group-marker-count {
    font-size: 18px;
    font-weight: 900;
    color: #d4d4d4;
    letter-spacing: 1px;
}

.custom-group-marker.has-active .group-marker-circle {
    border-color: #05dff7;
    box-shadow: 0 0 25px rgba(5, 223, 247, 0.8);
    animation: group-pulse 2s infinite;
}

@keyframes group-pulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(5, 223, 247, 0.7);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 35px rgba(5, 223, 247, 1);
        transform: scale(1.05);
    }
}

.custom-group-marker.has-active .group-marker-count {
    color: #05dff7;
}

.group-marker-label {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #d4d4d4;
    color: #d4d4d4;
    padding: 5px 12px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    text-align: center;
    pointer-events: none;
}

.custom-group-marker.has-active .group-marker-label {
    border-color: #05dff7;
    color: #05dff7;
}

.group-active-badge {
    position: absolute;
    top: -5px;
    right: -15px;
    background: #05dff7;
    color: #0a0a0a;
    font-size: 8px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 2px;
    letter-spacing: 0.5px;
    box-shadow: 0 0 10px rgba(5, 223, 247, 0.8);
    animation: badge-pulse 2s infinite;
    white-space: nowrap;
}

/* Group Popup Styles */
.group-popup-content {
    max-height: 450px;
    overflow-y: auto;
}

.popup-group-count {
    font-size: 11px;
    color: #808080;
    font-weight: 500;
    letter-spacing: 1px;
    margin-left: 10px;
}

.group-camera-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.group-camera-list::-webkit-scrollbar {
    width: 6px;
}

.group-camera-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.group-camera-list::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 3px;
}

.group-camera-list::-webkit-scrollbar-thumb:hover {
    background: #d4d4d4;
}

.group-camera-item {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #2a2a2a;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
}

.group-camera-item:hover {
    border-color: #404040;
    background: rgba(0, 0, 0, 0.6);
}

.group-camera-item.active-item {
    border-left: 3px solid #05dff7;
    box-shadow: 0 0 15px rgba(5, 223, 247, 0.2);
}

.group-camera-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.group-camera-name {
    font-size: 12px;
    font-weight: 600;
    color: #d4d4d4;
    letter-spacing: 1px;
}

.group-camera-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.group-select-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid #22c55e;
    color: #22c55e;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.group-select-btn:hover {
    background: rgba(34, 197, 94, 0.1);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.group-select-btn.active {
    background: #22c55e;
    color: #0a0a0a;
}

.group-open-btn {
    padding: 8px 16px;
    background: #d4d4d4;
    color: #0a0a0a;
    border: none;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}

.group-open-btn:hover {
    box-shadow: 0 0 15px rgba(212, 212, 212, 0.5);
    transform: translateY(-1px);
}

.group-popup-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #404040;
}

.popup-select-all-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: #22c55e;
    border: 2px solid #22c55e;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.popup-select-all-btn:hover {
    background: rgba(34, 197, 94, 0.1);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

/* Mobile Responsive for Group Markers */
@media (max-width: 768px) {
    .group-marker-circle {
        width: 45px;
        height: 45px;
    }
    
    .group-marker-count {
        font-size: 16px;
    }
    
    .group-marker-label {
        font-size: 9px;
        padding: 4px 10px;
    }
    
    .group-camera-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .group-camera-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .group-open-btn {
        flex: 1;
        text-align: center;
    }
}
/* ========================================
   AIヘルプアシスタント
   ======================================== */

/* ========================================
   AIヘルプアシスタント
   ======================================== */

.help-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: rgba(34, 197, 94, 0.95);
    border: 2px solid #22c55e;
    border-radius: 50%;
    color: #0a0a0a;
    font-size: 28px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    z-index: 10000;  /* 9999 → 10000 に変更 */
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
    border: none;
    outline: none;
}

.help-button:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 30px rgba(34, 197, 94, 0.6);
}
@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.help-panel {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 420px;
    max-width: calc(100vw - 60px);
    height: 600px;
    max-height: calc(100vh - 150px);
    background: rgba(20, 20, 20, 0.98);
    border: 2px solid #22c55e;
    box-shadow: 0 0 40px rgba(34, 197, 94, 0.3);
    display: none;
    flex-direction: column;
    z-index: 9998;
    font-family: 'Orbitron', monospace;
    backdrop-filter: blur(10px);
}

.help-panel.show {
    display: flex;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.help-header {
    background: rgba(34, 197, 94, 0.1);
    border-bottom: 2px solid #22c55e;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.help-title {
    color: #22c55e;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.help-title::before {
    content: '👾 ';
}

.help-close {
    background: transparent;
    border: 1px solid #404040;
    color: #d4d4d4;
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 18px;
}

.help-close:hover {
    border-color: #22c55e;
    color: #22c55e;
}

.help-chat {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.help-chat::-webkit-scrollbar {
    width: 8px;
}

.help-chat::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.help-chat::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 4px;
}

.help-chat::-webkit-scrollbar-thumb:hover {
    background: #22c55e;
}

.chat-message {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.assistant-avatar {
    background: rgba(34, 197, 94, 0.2);
    border: 2px solid #22c55e;
}

.user-avatar {
    background: rgba(59, 130, 246, 0.2);
    border: 2px solid #3b82f6;
}

.chat-content {
    flex: 1;
}

.chat-bubble {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    letter-spacing: 0.5px;
}

.assistant-bubble {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #d4d4d4;
}

.user-bubble {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #d4d4d4;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.quick-btn {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid #22c55e;
    color: #22c55e;
    padding: 8px 12px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    letter-spacing: 1px;
    border-radius: 4px;
}

.quick-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.help-input-area {
    border-top: 2px solid #22c55e;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.5);
}

.help-input-container {
    display: flex;
    gap: 10px;
}

.help-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #404040;
    color: #d4d4d4;
    padding: 12px 15px;
    font-size: 13px;
    font-family: 'Orbitron', monospace;
    transition: all 0.3s;
    border-radius: 4px;
}

.help-input:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.2);
}

.help-input::placeholder {
    color: #404040;
}

.help-send {
    background: #22c55e;
    color: #0a0a0a;
    border: none;
    padding: 12px 20px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 4px;
}

.help-send:hover {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
    transform: translateY(-2px);
}

.help-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .help-button {
        width: 55px;
        height: 55px;
        font-size: 24px;
        bottom: 20px;
        right: 20px;
    }

    .help-panel {
        bottom: 85px;
        right: 20px;
        width: calc(100vw - 40px);
        height: calc(100vh - 150px);
    }

    .help-title {
        font-size: 14px;
    }

    .chat-bubble {
        font-size: 12px;
    }

    .quick-btn {
        font-size: 10px;
        padding: 6px 10px;
    }
}
/* ヘルプボタン強制修正 */
.help-button {
    pointer-events: auto !important;
}

.help-button::before,
.help-button::after {
    pointer-events: none !important;
}

/* ==========================================
   リストビュー グループカード
   ========================================== */

.site-group-card {
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #404040;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.site-group-card:hover {
    border-color: #d4d4d4;
    box-shadow: 0 0 20px rgba(212, 212, 212, 0.1);
}

.site-group-card.has-active-group {
    border-color: #05dff7;
    box-shadow: 0 0 20px rgba(5, 223, 247, 0.2);
}

.group-card-header {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px 25px;
    border-bottom: 1px solid #404040;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: background 0.3s;
}

.group-card-header:hover {
    background: rgba(0, 0, 0, 0.7);
}

.group-card-title {
    flex: 1;
}

.group-name {
    font-size: 20px;
    font-weight: 700;
    color: #d4d4d4;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.group-count {
    font-size: 11px;
    color: #808080;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.group-active-badge {
    background: #05dff7;
    color: #0a0a0a;
    font-size: 10px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 3px;
    letter-spacing: 1px;
    white-space: nowrap;
    animation: badge-pulse 2s infinite;
}

.group-expand-btn {
    background: transparent;
    border: 1px solid #404040;
    color: #d4d4d4;
    width: 35px;
    height: 35px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.group-expand-btn:hover {
    border-color: #d4d4d4;
    background: rgba(212, 212, 212, 0.1);
}

.expand-icon {
    transition: transform 0.3s;
}

.group-card-body {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
}

/* ミニカードスタイル */
.site-card-mini {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #2a2a2a;
    transition: all 0.3s;
    position: relative;
}

.site-card-mini::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: #d4d4d4;
    opacity: 0;
    transition: opacity 0.3s;
}

.site-card-mini:hover::before {
    opacity: 1;
    transform: translateX(3px);
}

.site-card-mini.selected::before {
    background: #22c55e;
    opacity: 1;
}

.site-card-mini.active-card::before {
    background: #05dff7;
    opacity: 1;
    width: 3px;
}

.site-header-mini {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 15px;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.site-name-wrapper-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.site-name-mini {
    font-size: 13px;
    font-weight: 600;
    color: #d4d4d4;
    letter-spacing: 1px;
}

.active-badge-mini {
    font-size: 7px;
    padding: 2px 6px;
    background: rgba(5, 223, 247, 0.2);
    border: 1px solid #05dff7;
    color: #05dff7;
    letter-spacing: 1px;
    animation: badge-pulse 2s infinite;
}

.select-btn-mini {
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid #22c55e;
    color: #22c55e;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.select-btn-mini:hover {
    background: rgba(34, 197, 94, 0.1);
}

.select-btn-mini.active {
    background: #22c55e;
    color: #0a0a0a;
}

.site-body-mini {
    padding: 12px 15px;
}

.site-info-mini {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.info-item-mini {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #1a1a1a;
    font-size: 11px;
}

.info-label-mini {
    color: #808080;
    font-weight: 500;
    letter-spacing: 1px;
    font-size: 9px;
}

.info-value-mini {
    color: #d4d4d4;
    word-break: break-all;
    font-size: 11px;
}

.copy-btn-mini {
    background: transparent;
    border: 1px solid #404040;
    color: #d4d4d4;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 8px;
    transition: all 0.3s;
    font-family: 'Orbitron', monospace;
    letter-spacing: 1px;
}

.copy-btn-mini:hover {
    border-color: #d4d4d4;
}

.open-link-mini {
    display: block;
    text-align: center;
    background: #d4d4d4;
    color: #0a0a0a;
    text-decoration: none;
    font-weight: 700;
    font-size: 10px;
    padding: 10px 15px;
    transition: all 0.3s;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.open-link-mini:hover {
    box-shadow: 0 0 15px rgba(212, 212, 212, 0.4);
}

/* モバイル対応 */
@media (max-width: 768px) {
    .group-card-header {
        padding: 15px;
    }
    
    .group-name {
        font-size: 16px;
    }
    
    .group-count {
        font-size: 10px;
    }
    
    .group-card-body {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 10px;
    }
    
    .site-name-wrapper-mini {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}
/* サイドバーグループスタイル */
.sidebar-group {
    margin-bottom: 10px;
    border: 1px solid #2a2a2a;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.sidebar-group.sidebar-group-active {
    border-color: #05dff7;
    box-shadow: 0 0 15px rgba(5, 223, 247, 0.1);
}

.sidebar-group-header {
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.3s;
}

.sidebar-group-header:hover {
    background: rgba(0, 0, 0, 0.5);
}

.sidebar-group-info {
    flex: 1;
}

.sidebar-group-name {
    font-size: 13px;
    font-weight: 700;
    color: #d4d4d4;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.sidebar-group-count {
    font-size: 9px;
    color: #808080;
    letter-spacing: 1px;
}

.sidebar-group-badge {
    font-size: 8px;
    padding: 3px 8px;
    background: #05dff7;
    color: #0a0a0a;
    border-radius: 2px;
    font-weight: 700;
    letter-spacing: 1px;
    white-space: nowrap;
    animation: badge-pulse 2s infinite;
}

.sidebar-expand-icon {
    font-size: 12px;
    color: #808080;
    transition: transform 0.3s;
}

.sidebar-group-body {
    padding: 5px;
}

.sidebar-group-body .sidebar-item {
    margin-bottom: 5px;
}

@media (max-width: 768px) {
    .sidebar-group-name {
        font-size: 12px;
    }
    
    .sidebar-group-count {
        font-size: 8px;
    }
    
    .sidebar-group-header {
        padding: 10px 12px;
    }
}


