:root{
  --bg0:#f7f9fc;
  --bg1:#eef3ff;
  --ink:#0b1220;
  --muted:#4b5563;

  --card: rgba(255,255,255,0.72);
  --stroke: rgba(15,23,42,0.10);
  --stroke-strong: rgba(15,23,42,0.16);

  --shadow: 0 18px 45px rgba(2,6,23,0.08);
  --shadow-soft: 0 8px 22px rgba(2,6,23,0.06);

  --blue:#1f3a8a;
  --blue2:#2563eb;
  --green:#16a34a;
  --green2:#22c55e;

  --radius:16px;
  --radius2:20px;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background:
    radial-gradient(900px 500px at 10% 5%, rgba(37,99,235,0.10), transparent 60%),
    radial-gradient(900px 600px at 85% 10%, rgba(34,197,94,0.10), transparent 55%),
    radial-gradient(900px 600px at 30% 95%, rgba(99,102,241,0.08), transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
  color:var(--ink);
  margin:0;
}

body::before{
  content:"";
  position:fixed;
  inset:-20vh -20vw;
  background:
    conic-gradient(from 180deg at 50% 50%, rgba(255,255,255,0.0), rgba(255,255,255,0.35), rgba(255,255,255,0.0));
  filter: blur(22px);
  opacity:0.35;
  animation: shimmer 10s linear infinite;
  pointer-events:none;
  z-index:-1;
}
@keyframes shimmer{
  0%{transform: translate3d(-6%, -2%, 0) rotate(0deg)}
  100%{transform: translate3d(6%, 2%, 0) rotate(360deg)}
}

.topbar{
  position:sticky;
  top:0;
  z-index:10;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:14px 28px;
  background: rgba(255,255,255,0.70);
  backdrop-filter: blur(14px);
  border-bottom:1px solid var(--stroke);
}

.brand{display:flex;align-items:center;gap:12px;min-width:260px;}
.logo-circle{
  width:32px;height:32px;border-radius:50%;
  background: radial-gradient(circle at 30% 30%, rgba(37,99,235,0.45), rgba(37,99,235,0.08) 55%, rgba(255,255,255,0.3));
  border:1px solid rgba(31,58,138,0.30);
  box-shadow: 0 10px 20px rgba(31,58,138,0.10);
  position:relative;
  overflow:hidden;
}
.logo-circle::after{
  content:'';
  position:absolute;
  bottom:-4px;right:-4px;
  width:16px;height:16px;border-radius:50%;
  background: radial-gradient(circle at 30% 30%, rgba(34,197,94,0.55), rgba(34,197,94,0.12));
  border:1px solid rgba(22,163,74,0.22);
}

.brand-text{display:flex;flex-direction:column;line-height:1.05}
.blue{color:var(--blue);font-weight:800;letter-spacing:0.2px;}
.green{color:var(--green);font-weight:800;letter-spacing:0.2px;}

.nav-links{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1;
  justify-content:center;
  min-width:0;
  overflow:auto;
  scrollbar-width:none;
}
.nav-links::-webkit-scrollbar{display:none}

.nav-tab{
  color:#334155;
  text-decoration:none;
  padding:9px 12px;
  border-radius:999px;
  border:1px solid transparent;
  cursor:pointer;
  white-space:nowrap;
  transition: transform 120ms ease, background 140ms ease, border-color 140ms ease;
}
.nav-tab:hover{background: rgba(255,255,255,0.65); border-color: var(--stroke); transform: translateY(-1px);}
.nav-tab.active{background: rgba(37,99,235,0.10); border-color: rgba(37,99,235,0.22); color: var(--blue);}

.top-actions{display:flex;align-items:center;gap:10px;}

.segmented{
  display:flex;
  border:1px solid var(--stroke);
  border-radius:999px;
  background: rgba(255,255,255,0.65);
  overflow:hidden;
}
.seg{
  border:none;
  background:transparent;
  padding:9px 12px;
  cursor:pointer;
  color:#334155;
}
.seg.active{
  background: rgba(37,99,235,0.10);
  color: var(--blue);
  font-weight:700;
}

button,select,input{font-family:inherit}

.cta{
  background: linear-gradient(135deg, rgba(31,58,138,1), rgba(37,99,235,1));
  color:white;
  padding:10px 14px;
  border:none;
  border-radius:12px;
  box-shadow: 0 10px 22px rgba(37,99,235,0.18);
  cursor:pointer;
  transition: transform 120ms ease, filter 120ms ease;
  white-space:nowrap;
}
.cta:hover{transform: translateY(-1px); filter: brightness(1.05);}

.primary{
  background: linear-gradient(135deg, rgba(34,197,94,0.20), rgba(37,99,235,0.14));
  border:1px solid rgba(37,99,235,0.25);
  color: var(--blue);
  border-radius:12px;
  padding:10px 14px;
  cursor:pointer;
  transition: transform 120ms ease, background 140ms ease;
}
.primary:hover{transform: translateY(-1px); background: rgba(37,99,235,0.12);}
.primary[disabled]{opacity:0.65; cursor:not-allowed; transform:none;}

.ghost{
  background: rgba(255,255,255,0.68);
  border:1px solid var(--stroke);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
}
.ghost:hover{border-color: var(--stroke-strong);}

.scenario-strip{
  display:flex;
  gap:10px;
  padding:12px 28px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(14px);
  border-bottom:1px solid var(--stroke);
  overflow:auto;
  scrollbar-width:none;
}
.scenario-strip::-webkit-scrollbar{display:none}

.scenario-strip button{
  padding:9px 14px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.75);
  cursor:pointer;
  white-space:nowrap;
  transition: transform 120ms ease, border-color 140ms ease, background 140ms ease;
}
.scenario-strip button:hover{transform: translateY(-1px); border-color: var(--stroke-strong);}
.scenario-strip button.active{
  background: linear-gradient(135deg, rgba(34,197,94,0.16), rgba(37,99,235,0.10));
  border-color: rgba(34,197,94,0.25);
}

/* --- Top Globe strip (offline canvas globe) --- */
.globe-strip{
  display:flex;
  justify-content:center;
  padding:14px 28px;
  background: rgba(255,255,255,0.62);
  backdrop-filter: blur(14px);
  border-bottom:1px solid var(--stroke);
}
.globe-top{width: min(1100px, 100%);}
.globe-viz{
  height: 320px;
  margin-top: 10px;
  border-radius: 16px;
  border:1px solid rgba(15,23,42,0.10);
  background: radial-gradient(800px 260px at 50% 20%, rgba(37,99,235,0.10), transparent 60%), rgba(255,255,255,0.55);
  overflow:hidden;
}
.globe-viz canvas{touch-action:none;width:100%;height:100%;display:block;}

.card-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 6px;
}

.globe-controls{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;}

.mini-btn{
  padding:8px 10px;
  border-radius: 12px;
  border:1px solid rgba(15,23,42,0.10);
  background: rgba(255,255,255,0.72);
  cursor:pointer;
  font-size: 12.5px;
  color: rgba(2,6,23,0.78);
}
.mini-btn:hover{border-color: var(--stroke-strong);}
.mini-btn.primary{
  border-color: rgba(37,99,235,0.22);
  background: rgba(37,99,235,0.10);
  color: var(--blue);
  font-weight:700;
}

.filter-strip{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap:10px;
  padding:12px 28px;
  background: rgba(255,255,255,0.70);
  backdrop-filter: blur(14px);
  border-bottom:1px solid var(--stroke);
  align-items:end;
}

.field label{
  display:block;
  font-size:12px;
  color: rgba(2,6,23,0.65);
  margin: 0 0 6px;
}

select,input{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.80);
  color: var(--ink);
  outline:none;
}
input:focus,select:focus{border-color: rgba(37,99,235,0.25); box-shadow: 0 0 0 4px rgba(37,99,235,0.08);}

.seed-row{display:flex;gap:8px;align-items:center;}
.seed-row input{flex:1}
.tiny-row{display:flex;gap:8px;align-items:center;margin-top:8px}
.check{display:flex;gap:8px;align-items:center;font-size:12px;color: rgba(2,6,23,0.72)}
.check input{width:auto}

.run{min-width: 220px;}

.dashboard{
  display:grid;
  grid-template-columns: 38% 62%;
  gap:18px;
  padding:18px 28px 18px;
}

.left-col,.right-col{display:flex;flex-direction:column;gap:18px;}

.card{
  background: var(--card);
  backdrop-filter: blur(16px);
  border:1px solid rgba(255,255,255,0.55);
  border-top-color: rgba(255,255,255,0.78);
  border-left-color: rgba(255,255,255,0.78);
  border-right-color: rgba(15,23,42,0.08);
  border-bottom-color: rgba(15,23,42,0.10);
  padding:16px 16px 14px;
  border-radius: var(--radius2);
  box-shadow: var(--shadow-soft);
}

.card h2{
  margin: 0 0 10px;
  font-size: 14px;
  letter-spacing:0.22px;
  text-transform: uppercase;
  color: rgba(2,6,23,0.75);
}

.card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 6px;
}

.badge{
  font-size:12px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.65);
  padding:6px 10px;
  border-radius:999px;
  color: rgba(2,6,23,0.70);
  white-space:nowrap;
}

.divider{
  height:1px;
  background: rgba(15,23,42,0.08);
  margin: 12px 0;
}

.small{color: rgba(2,6,23,0.68);font-size:12.5px;line-height:1.45}

.mini-viz{
  margin-top: 12px;
  border-radius: 14px;
  border:1px solid rgba(15,23,42,0.08);
  background: rgba(255,255,255,0.55);
  overflow:hidden;
}

.kpi-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin: 4px 0 10px;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 7px 10px;
  border-radius: 999px;
  border:1px solid rgba(15,23,42,0.10);
  background: rgba(255,255,255,0.65);
  color: rgba(2,6,23,0.80);
  font-size: 12.5px;
  white-space:nowrap;
}

.pill strong{color: rgba(2,6,23,0.86)}

.table-wrap{
  overflow:auto;
  border-radius:14px;
  border:1px solid rgba(15,23,42,0.08);
}

/* Compact tables used inside the country summary card */
.mini-table-wrap{
  overflow:auto;
  border-radius:14px;
  border:1px solid rgba(15,23,42,0.08);
  max-height: 240px;
  background: rgba(255,255,255,0.55);
}

.mini-table-wrap table{ background: transparent; }
.mini-table-wrap th, .mini-table-wrap td{ padding:8px 10px; font-size: 12.8px; }
.mini-table-wrap th{ font-size: 11.5px; }

.mini-details summary{
  cursor: pointer;
  user-select: none;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,0.10);
  background: rgba(255,255,255,0.62);
  font-size: 12.8px;
  color: rgba(2,6,23,0.76);
  margin-top: 10px;
}
.mini-details[open] summary{ background: rgba(255,255,255,0.72); }
.mini-details .small-note{ margin-top: 6px; color: rgba(2,6,23,0.60); font-size: 12px; }

table{width:100%;border-collapse:collapse;background: rgba(255,255,255,0.60)}
th,td{padding:10px 10px;border-bottom:1px solid rgba(15,23,42,0.06);text-align:left;font-size: 13.5px;}
th{font-size:12px;color: rgba(2,6,23,0.65);text-transform:uppercase;letter-spacing:0.2px;background: rgba(255,255,255,0.72)}
tr:hover td{background: rgba(37,99,235,0.06)}

.flag-img{vertical-align:middle;border-radius:4px;border:1px solid rgba(15,23,42,0.12);}

.help{
  display:inline-flex;
  width:16px;height:16px;
  border-radius:50%;
  align-items:center;
  justify-content:center;
  font-size:11px;
  border:1px solid rgba(15,23,42,0.12);
  background: rgba(255,255,255,0.7);
  cursor:help;
  position:relative;
}
.help:hover::after{
  content: attr(data-tip);
  position:absolute;
  left: 0;
  top: 20px;
  width: 240px;
  padding:10px 12px;
  background: rgba(255,255,255,0.92);
  border:1px solid rgba(15,23,42,0.12);
  box-shadow: var(--shadow-soft);
  border-radius: 14px;
  font-size: 12px;
  color: rgba(2,6,23,0.78);
  z-index: 30;
}

.why{padding:10px 12px;border:1px solid rgba(15,23,42,0.10);border-radius:14px;background: rgba(255,255,255,0.60)}
.why-title{font-size:12px;color: rgba(2,6,23,0.70);text-transform:uppercase;letter-spacing:0.2px;margin-bottom:6px}

.assumptions summary{
  cursor:pointer;
  font-size:12.5px;
  color: rgba(2,6,23,0.75);
}
.assumptions{margin-top: 10px}

.chart-wrap{
  border:1px solid rgba(15,23,42,0.10);
  border-radius: 16px;
  background: rgba(255,255,255,0.58);
  padding: 12px 12px 10px;
}
.chart-head{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  align-items:flex-start;
}
.chart-head .small{
  text-align:right;
  flex: 1 1 260px;
  margin-top:2px;
}
.chart-title{
  font-weight:800;
  color: rgba(2,6,23,0.80);
  font-size:13px;
  flex: 1 1 220px;
  min-width: 160px;
}

canvas{width:100%;display:block;border-radius: 12px;background: rgba(255,255,255,0.45);border:1px solid rgba(15,23,42,0.08)}

.wide{
  padding: 0 28px 26px;
  display:flex;
  flex-direction:column;
  gap:18px;
}

.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.forecast-controls,.compare-controls{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 10px 0 14px;
  align-items:end;
}

.compare-card{
  border:1px solid rgba(15,23,42,0.10);
  border-radius: 16px;
  background: rgba(255,255,255,0.55);
  padding: 12px 12px 10px;
  min-height: 120px;
}

.footer{
  padding: 16px 28px 22px;
  border-top: 1px solid rgba(15,23,42,0.08);
  background: rgba(255,255,255,0.60);
  backdrop-filter: blur(14px);
}
.footer-inner{
  display:flex;
  justify-content:space-between;
  gap:18px;
  align-items:flex-end;
}
.footer-right{text-align:right}
.footer a{color: var(--blue); text-decoration:none}
.footer a:hover{text-decoration:underline}

.panel{
  position:fixed;
  top: 14px;
  right: 14px;
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow:auto;
  border-radius: 18px;
  border:1px solid rgba(15,23,42,0.12);
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow);
  z-index: 50;
}
.panel.hidden{display:none}
.panel-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  padding: 12px 12px;
  border-bottom: 1px solid rgba(15,23,42,0.08);
}
.panel-title{font-weight:900;color: rgba(2,6,23,0.84)}
.panel-body{padding: 12px}

.toast{
  position:fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  padding: 10px 12px;
  border-radius: 999px;
  border:1px solid rgba(15,23,42,0.12);
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow-soft);
  color: rgba(2,6,23,0.78);
  z-index: 60;
}
.toast.hidden{display:none}

.skeleton-block{position:relative}
.skeleton-line{
  height: 12px;
  border-radius: 999px;
  background: rgba(2,6,23,0.06);
  overflow:hidden;
  margin: 10px 0;
  position:relative;
}
.skeleton-line::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: translateX(-60%);
  animation: sk 1.2s infinite;
}
@keyframes sk{
  0%{transform: translateX(-60%)}
  100%{transform: translateX(60%)}
}
.w60{width:60%}
.w70{width:70%}
.w80{width:80%}
.w85{width:85%}
.w90{width:90%}
.w95{width:95%}


@media(max-width: 920px){
  .topbar{flex-wrap:wrap;}
  .brand{min-width: 0;}
  .nav-links{order:3;width:100%;justify-content:flex-start;padding-top:8px;}
  .top-actions{order:2;}
}

@media(max-width: 1120px){
  .run{grid-column: 1 / -1; min-width: unset;}
  .dashboard{grid-template-columns:1fr;}
  .grid-2{grid-template-columns:1fr;}
    .globe-strip{padding:12px 18px;}
  .globe-viz{height: 280px;}
}

@media(max-width: 560px){
  .topbar{padding:12px 14px;}
  .scenario-strip,.filter-strip{padding:12px 14px;}
  .globe-strip{padding:12px 14px;}
  .globe-viz{height: 240px;}
  .dashboard{padding:14px;}
  .wide{padding: 0 14px 18px;}
  .footer{padding: 14px;}
  .footer-inner{flex-direction:column;align-items:flex-start}
  .footer-right{text-align:left}

  .chart-head .small{text-align:left;}
}


/* --- Chart sizing (Option B: forecast taller than tornado) --- */
#tornadoChart{height: 220px;}
#fanChart,#probChart{height: 340px;}

/* --- Admin-only UI (Data Health) --- */
.admin-only{display:none !important;}
body.admin-mode button.admin-only{display:inline-flex !important;}
body.admin-mode aside.admin-only{display:block !important;}

/* --- Footer link-style button --- */
.linklike{
  border:none;
  background:transparent;
  padding:0;
  cursor:pointer;
  color: var(--blue);
  font-weight:700;
}
.linklike:hover{text-decoration:underline}

/* --- Modal (Disclaimer) --- */
.modal{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
  background: rgba(2,6,23,0.45);
  backdrop-filter: blur(6px);
  z-index: 80;
}
.modal.hidden{display:none}
.modal-card{
  width: min(720px, calc(100vw - 36px));
  background: rgba(255,255,255,0.92);
  border:1px solid rgba(15,23,42,0.14);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 12px 12px;
  border-bottom: 1px solid rgba(15,23,42,0.08);
}
.modal-title{
  font-weight: 950;
  letter-spacing: 0.18px;
  color: rgba(2,6,23,0.86);
}
.modal-body{padding: 12px 12px 2px;}
.modal-actions{
  padding: 12px;
  display:flex;
  justify-content:flex-end;
  gap:10px;
  border-top: 1px solid rgba(15,23,42,0.08);
}

/* --- Welcome Gate (full-page disclaimer) --- */
.modal.gate{
  align-items:flex-start;
  padding-top: clamp(14px, 3.2vh, 34px);
  overflow:auto;
}
.gate-card{
  width: min(980px, calc(100vw - 36px));
  border-radius: 26px;
}
.gate-hero{
  display:flex;
  align-items:stretch;
  justify-content:space-between;
  gap:14px;
  padding: 16px 16px 8px;
  border-bottom: 1px solid rgba(15,23,42,0.08);
  background:
    radial-gradient(900px 220px at 10% 0%, rgba(37,99,235,0.12), transparent 62%),
    radial-gradient(900px 260px at 90% 30%, rgba(34,197,94,0.10), transparent 60%),
    rgba(255,255,255,0.88);
}
.gate-hero-text{min-width: 260px; flex: 1.1;}
.gate-sub{margin-top: 6px; color: var(--muted); max-width: 60ch;}
.eco-anim{
  flex: 1;
  min-width: 240px;
  height: 150px;
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,0.10);
  background: rgba(255,255,255,0.60);
}
.gate-actions{
  align-items:center;
  justify-content:space-between;
}

@media(max-width: 720px){
  .gate-hero{flex-direction:column;}
  .eco-anim{width:100%; min-width:0;}
  .gate-actions{flex-direction:column; align-items:stretch;}
  .gate-actions a.ghost{display:inline-flex; justify-content:center;}
}

/* small screens: keep charts compact */
@media(max-width: 1120px){
  #fanChart,#probChart{height: 310px;}
}
@media(max-width: 560px){
  #tornadoChart{height: 210px;}
  #fanChart,#probChart{height: 280px;}
}

/* ===== Legal / Terms page ===== */
.legal-wrap{
  max-width: 980px;
  margin: 28px auto 48px;
  padding: 0 18px;
}
.legal-title{
  margin: 10px 0 6px;
  font-size: 28px;
  letter-spacing: -0.02em;
}
.legal-sub{
  margin: 0 0 14px;
  color: var(--muted);
}
.legal-card h2{
  margin: 18px 0 8px;
  font-size: 16px;
}
.legal-card p, .legal-card li{
  color: #1f2937;
  line-height: 1.55;
}
.legal-card ul{
  margin: 8px 0 12px 18px;
}
.legal-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius: 999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.58);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}
.footer-contact{display:flex;flex-direction:column;gap:2px;align-items:flex-end;}
.footer-right{gap:10px;}
@media (max-width: 640px){
  .footer-contact{align-items:flex-start;}
}
