:root{
  --bg: #0f172a;
  --bg-soft: #0b1223;
  --card: #0b1223;
  --text: #e5e7eb;
  --text-muted: #a7b0c2;
  --primary: #06b6d4; /* cyan */
  --primary-600: #0891b2;
  --ring: rgba(6,182,212,0.45);
  --border: #1f2937;
  --shadow: 0 10px 30px rgba(2,6,23,0.6), 0 2px 8px rgba(0,0,0,0.4);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height:1.6;
  color:var(--text);
  background: linear-gradient(180deg, #0a0f1f 0%, #0a0f1f 40%, #0f172a 100%);
}

/* Header */
.site-header{
  border-bottom:1px solid var(--border);
  backdrop-filter:saturate(140%) blur(6px);
  position:sticky; top:0; z-index:10;
  background-color:rgba(10,15,31,0.7);
}
.site-header .wrap{
  max-width:1100px; margin:0 auto; padding:14px 16px;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
}
.brand{color:#fff; font-weight:700; text-decoration:none; letter-spacing:0.2px; font-size:1.1rem}
.site-nav a{color:var(--text-muted); margin-left:14px; text-decoration:none}
.site-nav a:hover{color:#fff}

/* Layout */
.layout{
  max-width:1100px; margin:24px auto; padding:0 16px;
  display:grid; grid-template-columns:1fr; gap:24px;
}
.sidebar{display:grid; gap:24px}
@media (min-width: 960px){
  .layout{grid-template-columns: minmax(0,1fr) 320px}
}

/* Cards */
.card{
  background:linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border:1px solid var(--border);
  border-radius:16px; box-shadow:var(--shadow);
  padding:20px;
}
.card__header{margin-bottom:12px}
.card__header h1,.card__header h2{margin:0 0 6px}
.muted{color:var(--text-muted); margin:0}

/* Segmented control */
.seg{display:inline-flex; background:#0a1020; border:1px solid var(--border); border-radius:10px; padding:4px; gap:4px; margin-top:10px}
.seg__btn{appearance:none; border:0; background:transparent; color:var(--text-muted); padding:8px 12px; border-radius:8px; cursor:pointer; font-weight:700}
.seg__btn--active{background:var(--primary); color:#fff}

/* Form */
.form{display:grid; grid-template-columns:1fr; gap:14px; margin-top:8px}
.field label{display:block; font-weight:600; margin:0 0 6px}
.input-group{display:flex; align-items:stretch}
.input-group input{
  flex:1; padding:12px 12px; border:1px solid var(--border); border-right:none;
  background:var(--bg-soft); color:var(--text); border-top-left-radius:10px; border-bottom-left-radius:10px;
  outline:none; transition:border-color .2s, box-shadow .2s
}
.input-group input:focus{border-color:var(--primary); box-shadow:0 0 0 3px var(--ring)}
.unit{
  display:inline-flex; align-items:center; padding:0 12px; background:#0a1020; border:1px solid var(--border);
  color:var(--text-muted); border-top-right-radius:10px; border-bottom-right-radius:10px; font-size:0.9rem
}
.btn{appearance:none; border:0; border-radius:10px; padding:12px 14px; cursor:pointer; font-weight:700}
.btn-primary{background:var(--primary); color:#fff}
.btn-primary:hover{background:var(--primary-600)}

/* Result */
.result{margin-top:12px}
.result__row{display:flex; align-items:center; gap:12px; margin-bottom:12px}
.result__value{font-size:2rem; font-weight:800}
.chip{display:inline-flex; align-items:center; gap:8px; border:1px solid var(--border); padding:6px 10px; border-radius:999px; color:#cbd5e1}
.chip--under{background:rgba(34,211,238,.08)}
.chip--normal{background:rgba(16,185,129,.10)}
.chip--over{background:rgba(245,158,11,.10)}
.chip--obese{background:rgba(239,68,68,.10)}

.gauge{margin-top:8px}
.gauge__track{position:relative; height:10px; border-radius:999px; overflow:hidden; display:grid; grid-template-columns:1fr 1fr 1fr 1fr}
.gauge__seg--under{background:linear-gradient(90deg,#0891b2,#22d3ee)}
.gauge__seg--normal{background:linear-gradient(90deg,#10b981,#84cc16)}
.gauge__seg--over{background:linear-gradient(90deg,#f59e0b,#ef4444)}
.gauge__seg--obese{background:linear-gradient(90deg,#ef4444,#991b1b)}
.gauge__pointer{position:relative; top:-6px; width:0; height:0; border-left:6px solid transparent; border-right:6px solid transparent; border-bottom:10px solid #fff; filter:drop-shadow(0 1px 2px rgba(0,0,0,.5))}
.gauge__legend{display:flex; justify-content:space-between; color:var(--text-muted); font-size:.85rem; margin-top:8px}
.gauge__legend strong{color:#e2e8f0}

/* Form help */
.help{color:var(--text-muted); font-size:0.9rem; margin-top:6px}

/* Ads */
.ad{position:relative; display:flex; align-items:center; justify-content:center; gap:8px; background:#0a1020; border:1px dashed #334155; color:#94a3b8; border-radius:12px}
.ad__label{position:absolute; top:6px; left:8px; font-size:.75rem; color:#cbd5e1; opacity:.9}
.ad__slot{display:flex; align-items:center; justify-content:center; font-weight:700; letter-spacing:.5px; opacity:.9}

/* Fixed sizes */
.ad--leaderboard{min-height:90px; padding:10px; margin:0; border-radius:0; border-left:0; border-right:0}
.ad--leaderboard .ad__slot{width:728px; height:90px}
.ad--leaderboard .ad__slot--mobile{display:none}
.ad--mrec{min-height:250px; padding:8px}
.ad--mrec .ad__slot{width:300px; height:250px}
.ad--skyscraper{min-height:600px; padding:8px}
.ad--skyscraper .ad__slot{width:160px; height:600px}
.ad--halfpage{min-height:600px; padding:8px}
.ad--halfpage .ad__slot{width:300px; height:600px}
.ad--mobile-banner{display:none; margin:0; padding:8px}
.ad--mobile-banner .ad__slot{width:320px; height:50px}

/* One-slot responsive ad (fewer ads) */
.ad--single{padding:8px; margin-top:12px}
.ad--single .ad__slot--leaderboard{display:none; width:728px; height:90px}
.ad--single .ad__slot--mrec{display:flex; width:300px; height:250px}
@media (min-width: 960px){
  .ad--single .ad__slot--leaderboard{display:flex}
  .ad--single .ad__slot--mrec{display:none}
}

/* Responsive ad visibility */
@media (max-width: 959px){
  .site-header .site-nav{display:flex; flex-wrap:wrap}
  .ad--leaderboard .ad__slot{display:none}
  .ad--leaderboard .ad__slot--mobile{display:flex}
  .sidebar{display:none}
  .ad--mobile-banner{display:none}
}

/* Footer */
.site-footer{border-top:1px solid var(--border); margin-top:24px; padding:16px; text-align:center; color:var(--text-muted)}

/* Consent banner */
.consent{position:fixed; inset:auto 12px 12px 12px; max-width:720px; margin:0 auto; z-index:50; background:#0a1020; border:1px solid var(--border); border-radius:14px; box-shadow:var(--shadow); padding:14px}
.consent__title{margin:0 0 6px; font-weight:800}
.consent__text{margin:0 0 12px; color:var(--text-muted)}
.consent__actions{display:flex; gap:8px; justify-content:flex-end}
.btn-ghost{background:transparent; color:#e5e7eb; border:1px solid var(--border)}
.btn-ghost:hover{border-color:#334155}
