* { box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; margin: 0; background: #f5f6f8; color: #333; }
.hidden { display: none !important; }

.password-gate { position: fixed; inset: 0; background: #003366; display: flex; align-items: center; justify-content: center; z-index: 1000; }
.password-box { background: white; padding: 2rem; border-radius: 8px; text-align: center; width: 300px; }
.password-box h1 { margin: 0 0 0.5rem; color: #003366; font-size: 1.4rem; }
.password-box input { width: 100%; padding: 0.6rem; margin: 1rem 0 0.5rem; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; }
.password-box button { width: 100%; padding: 0.6rem; background: #003366; color: white; border: none; border-radius: 4px; font-size: 1rem; cursor: pointer; }

header { background: #003366; color: white; padding: 1rem 1.5rem; }
header h1 { margin: 0; font-size: 1.4rem; }
#breadcrumb { margin-top: 0.5rem; font-size: 0.9rem; }
#breadcrumb a { color: #a8d4ff; text-decoration: none; }
#breadcrumb a:hover { text-decoration: underline; }
#breadcrumb span { color: #ccc; }

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }

.family-grid, .option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-top: 1rem; }
.card { background: white; border: 1px solid #ddd; border-radius: 8px; padding: 1.2rem; cursor: pointer; transition: box-shadow 0.2s; }
.card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.card h3 { margin: 0 0 0.3rem; color: #003366; }
.card p { margin: 0; font-size: 0.9rem; color: #666; }

.search-box { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.search-box input { flex: 1; padding: 0.6rem; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; }
.search-box button { padding: 0.6rem 1.2rem; background: #003366; color: white; border: none; border-radius: 4px; cursor: pointer; }

.results-list { background: white; border: 1px solid #ddd; border-radius: 8px; }
.result-item { padding: 0.8rem 1rem; border-bottom: 1px solid #eee; cursor: pointer; }
.result-item:hover { background: #f8f9fa; }
.result-item:last-child { border-bottom: none; }
.result-item strong { display: block; }
.result-item span { font-size: 0.85rem; color: #666; }

.detail { background: white; border: 1px solid #ddd; border-radius: 8px; padding: 1.2rem; margin-top: 1rem; }
.detail h2 { margin: 0 0 0.5rem; color: #003366; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; font-size: 0.9rem; }
.detail-meta span { background: #f0f4f8; padding: 0.3rem 0.6rem; border-radius: 4px; }
.back-btn { background: none; border: 1px solid #003366; color: #003366; padding: 0.4rem 0.8rem; border-radius: 4px; cursor: pointer; margin-bottom: 1rem; }

.panel-visuals { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 1rem; }
.overview-wrapper, .png-wrapper { position: relative; display: inline-block; }
.overview-img { max-width: 320px; width: 100%; height: auto; border-radius: 6px; border: 1px solid #ccc; }
.panel-png { max-width: 420px; width: 100%; height: auto; border-radius: 6px; border: 1px solid #ccc; }
/* Panel location diagram highlight boxes */
.hl-p6-1 .panel-highlight-box { top: 6.5%; left: 35%; width: 19%; height: 6.5%; display: block; }
.hl-p6-2 .panel-highlight-box { top: 23%; left: 19%; width: 22%; height: 7%; display: block; }
.hl-p6-3 .panel-highlight-box { top: 40%; left: 19%; width: 22%; height: 8%; display: block; }
.hl-p6-4 .panel-highlight-box { top: 62%; left: 19%; width: 22%; height: 7%; display: block; }
.hl-p6-5 .panel-highlight-box { top: 44%; left: 0%; width: 13%; height: 6%; display: block; }
.hl-p6-11 .panel-highlight-box { top: 83.5%; left: 35%; width: 18%; height: 6%; display: block; }
.hl-p6-12 .panel-highlight-box { top: 83.5%; left: 16%; width: 18%; height: 6%; display: block; }
.hl-p18-1 .panel-highlight-box { top: 23%; right: 19%; width: 16%; height: 6%; display: block; }
.hl-p18-2 .panel-highlight-box { top: 37.5%; right: 19%; width: 16%; height: 6%; display: block; }
.hl-p18-3 .panel-highlight-box { top: 54%; right: 6%; width: 24%; height: 7%; display: block; }

.panel-guide { margin-top: 0.75rem; padding: 0.6rem 0.8rem; background: #eafaf1; border-left: 4px solid #27ae60; border-radius: 4px; font-size: 0.95rem; }
.grid-highlight { position: absolute; width: 42px; height: 42px; border: 4px solid #e74c3c; border-radius: 50%; transform: translate(-50%, -50%); display: none; pointer-events: none; }
.grid-label { position: absolute; transform: translate(-50%, -50%); background: #e74c3c; color: white; font-weight: 700; font-size: 0.75rem; padding: 2px 6px; border-radius: 4px; display: none; pointer-events: none; }

footer { text-align: center; padding: 1rem; font-size: 0.85rem; color: #666; border-top: 1px solid #ddd; margin-top: 2rem; }

@media (max-width: 600px) {
  .search-box { flex-direction: column; }
  .panel-visuals { flex-direction: column; }
}
