:root{--gap:12px;--card-bg:#fff;--card-border:#ddd}
body{font-family:system-ui,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background:#f6f7f9;margin:0;padding:24px}
.wrapper{max-width:1200px;margin:0 auto}
h1{margin:0 0 16px}

/* Dashboard map */
.dashboard-map{position:relative;max-width:1400px;margin:0 auto}
.dashboard-map img{width:100%;display:block;border-radius:6px}
.hotspot{position:absolute;background:transparent;border:none;cursor:pointer}
.hotspot:focus{outline:2px solid #49a}

/* Example absolute positions (percent-based). Adjust as needed to match the real image. */
.hs-1{top:6%;left:4%;width:12%;height:18%}
.hs-2{top:6%;left:18%;width:12%;height:18%}
.hs-3{top:6%;left:32%;width:12%;height:18%}
.hs-4{top:6%;left:46%;width:12%;height:18%}
.hs-5{top:6%;left:60%;width:12%;height:18%}
.hs-6{top:6%;left:74%;width:12%;height:18%}
.hs-7{top:6%;left:88%;width:8%;height:18%}
.hs-8{top:36%;left:4%;width:12%;height:18%}
.hs-9{top:36%;left:18%;width:12%;height:18%}
.hs-10{top:36%;left:32%;width:12%;height:18%}
.hs-11{top:36%;left:46%;width:12%;height:18%}
.hs-12{top:36%;left:60%;width:12%;height:18%}
.hs-13{top:36%;left:74%;width:12%;height:18%}
.hs-14{top:36%;left:88%;width:8%;height:18%}
.hs-15{top:66%;left:4%;width:20%;height:28%}
.hs-16{top:66%;left:28%;width:20%;height:28%}
.hs-17{top:66%;left:56%;width:20%;height:28%}

#detail { /* use id selector to target the aside */}
.detail{position:fixed;right:24px;top:80px;width:420px;background:#fff;border:1px solid #ccc;padding:16px;border-radius:6px;box-shadow:0 6px 20px rgba(0,0,0,0.08);overflow:auto;max-height:calc(100vh - 96px);-webkit-overflow-scrolling:touch}
.detail.hidden{display:none}

/* When detail panel is open, prevent body from scrolling */
body.detail-open{overflow:hidden;height:100vh}
.back{display:inline-block;margin-bottom:8px}
#diagnosis{width:100%}

/* Scenario grid styles */
.scenario-grid-section{max-width:1200px;margin:28px auto}
.scenario-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:1rem;padding:1rem;align-items:stretch}
.sd-card{display:flex;flex-direction:column;background:#fff;border:1px solid rgba(0,0,0,0.06);border-radius:12px;overflow:hidden;transition:transform .15s ease,box-shadow .15s ease;box-shadow:0 4px 14px rgba(12,20,30,0.06);padding:1rem}
.sd-card:focus{outline:3px solid #3aa;outline-offset:2px}
.sd-card:hover{transform:translateY(-6px);box-shadow:0 18px 36px rgba(10,20,40,0.12);border-color:rgba(58,170,200,0.12)}
.sd-card__media{width:100%;overflow:hidden}
.sd-card-img{width:100%;height:140px;object-fit:cover;background:#eef;display:block}
.sd-card-body{padding:12px;flex:1 1 auto;display:flex;flex-direction:column}
.sd-card-title{margin:0 0 6px;font-size:1rem}
.sd-card-meta{font-size:0.85rem;color:#666;margin-bottom:8px}
.sd-card-text{margin-top:auto;color:#555;font-size:0.9rem}
.sd-card-footer{padding:12px;border-top:1px solid rgba(0,0,0,0.03);display:flex;justify-content:flex-end}

@media (max-width:768px){
	.sd-card{padding:0.75rem}
	.scenario-grid, #scenarioGrid{grid-template-columns:1fr;gap:0.75rem;padding:0.75rem}
		.sd-card-img{height:120px}
}

/* Normalize image heights and reduce on mobile */
.sd-card__media,
.sd-card-img{
	max-height:160px;
	object-fit:cover;
}

@media (max-width:768px){
	.sd-card__media,
	.sd-card-img{
		max-height:110px;
	}
}

/* Mobile friendly detail: full-width sheet */
@media (max-width:768px){
	.detail{left:0;right:0;top:0;bottom:0;width:100%;height:100vh;border-radius:0;padding:1rem;box-shadow:none;max-height:none}
	.detail #backBtn{position:sticky;top:0;z-index:10;background:transparent;padding:12px 0;margin:-12px 0 8px;border:none;text-align:left}
	.detail h2{margin-top:8px}
}

/* Make all cards equal height by letting grid items stretch */
.scenario-grid > * { display:flex; }

.visually-hidden{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);white-space:nowrap}

/* Filters bar */
.page-subtitle{color:#444;margin:8px 0 16px}
.filters{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-bottom:16px}
.filter-item{display:flex;flex-direction:column}
.filter-label{font-size:0.85rem;color:#444;margin-bottom:6px}
.filter-input{padding:8px;border-radius:6px;border:1px solid rgba(0,0,0,0.08);min-width:160px}
.filter-count{margin-left:auto;color:#333;font-weight:600}
.filter-actions{display:flex;align-items:flex-end}
.empty-state{padding:36px;text-align:center;color:var(--muted);background:#fff;border:1px dashed rgba(0,0,0,0.04);border-radius:8px}

/* Loading skeletons for cards */
.sd-skeleton-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem;padding:1rem}
.sd-skeleton-card{background:#fff;border-radius:12px;padding:12px;box-shadow:0 2px 6px rgba(0,0,0,0.03);display:flex;flex-direction:column;gap:8px}
.sd-skeleton-media{height:120px;background:linear-gradient(90deg,#f0f0f0,#e8e8e8,#f0f0f0);background-size:200% 100%;animation:shimmer 1.2s linear infinite}
.sd-skeleton-line{height:12px;background:#f0f0f0;border-radius:6px}
.sd-skeleton-line.short{width:40%}

@keyframes shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}

@media (max-width:768px){
	.sd-skeleton-media{height:90px}
	.sd-skeleton-grid{grid-template-columns:1fr;gap:0.75rem;padding:0.75rem}
}

@media (max-width:600px){
	.filters{flex-direction:column;align-items:stretch}
	.filter-count{margin-left:0}
	.filter-actions{align-items:stretch}
}

.progress-controls{max-width:1200px;margin:6px auto 18px;display:flex;align-items:center;gap:12px}
.progress-summary{font-weight:700;color:#333}
.progress-actions{margin-left:auto;display:flex;gap:8px}
.sd-badge{display:inline-block;padding:6px 8px;border-radius:6px;margin-right:8px;font-size:0.85rem}
.sd-badge.badge--status{background:#eef;border:1px solid rgba(0,0,0,0.05)}
.sd-badge:contains('completed'){background:#e6ffed}
