:root {
  color-scheme: dark;
  --bg: #0c1119;
  --card: #151d29;
  --card-2: #182331;
  --text: #f5f8fb;
  --muted: #91a0b2;
  --accent: #78a982;
  --accent-deep: #5e8d68;
  --low: #d95757;
  --high: #d6ad4d;
  font-family: Inter, ui-rounded, "SF Pro Display", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100svh;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, #1b2b35 0, transparent 30rem),
    var(--bg);
}

.dashboard { width: min(1120px, 100%); margin: auto; padding: clamp(14px, 3vw, 32px); }
.eyebrow, .card-label { margin: 0 0 6px; color: var(--muted); font-size: .82rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.7rem); letter-spacing: -.04em; }
.live { color: #c9d2dc; font-size: .75rem; white-space: nowrap; }
.live i, .status span { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px var(--accent); }
.card { border: 1px solid rgba(255,255,255,.07); border-radius: 26px; background: linear-gradient(145deg, rgba(28,39,53,.98), rgba(17,24,34,.98)); box-shadow: 0 20px 60px rgba(0,0,0,.2); }

.glucose { min-height: 330px; margin-top: 18px; padding: clamp(24px, 4vw, 38px); display: grid; grid-template-columns: 1.65fr minmax(210px, .75fr); gap: 38px; overflow: hidden; }
.drop { color: var(--accent); font-size: .8rem; }
.reading-row { display: flex; align-items: center; gap: 16px; margin-top: 20px; }
.reading-row strong { font-size: clamp(5.2rem, 11vw, 8.6rem); font-weight: 720; line-height: .8; letter-spacing: -.09em; }
.trend { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #14200c; font-size: 2rem; font-weight: 900; }
.unit { margin-top: 17px; color: var(--muted); font-size: 1.05rem; }
.status { display: inline-flex; align-items: center; margin-top: 42px; padding: 10px 14px; border-radius: 99px; background: rgba(185,255,102,.08); color: #d7fdb1; font-size: .88rem; }
.chart-wrap { align-self: end; position: relative; min-width: 0; }
.chart-title { display:flex; justify-content:space-between; align-items:center; margin-bottom: 10px; color: var(--muted); font-size:.8rem; }
.chart { display: block; width: 100%; overflow: visible; }
.chart .target { fill: rgba(255,255,255,.035); stroke: rgba(255,255,255,.08); stroke-dasharray: 4 8; }
.chart .area { fill: url(#area); }
.chart .line { fill: none; stroke-width: 5; stroke-linecap: round; }
.chart .line.good { stroke: var(--accent); }
.chart .line.low { stroke: var(--low); }
.chart .line.high { stroke: var(--high); }
.chart .current-point { fill: var(--accent); stroke: #1a2531; stroke-width: 5; }
.times { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; }
.range-label { position: absolute; right: 100%; margin-right: 10px; color: #6f7d8d; font-size: .7rem; }
.range-label.top { top: 31%; color: var(--high); } .range-label.bottom { top: 72%; color: var(--low); }

.details { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.clock-card, .weather-card { min-height: 285px; padding: 28px; }
.clock-content { height: 100%; display: flex; align-items: center; justify-content: space-around; gap: 22px; }
.clock { position: relative; width: 170px; aspect-ratio: 1; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; background: radial-gradient(circle, #202c3b, #121a25); box-shadow: inset 0 0 25px rgba(0,0,0,.28); }
.n { position: absolute; left: 50%; top: 50%; width: 25px; height: 25px; margin: -12.5px; display:grid; place-items:center; color: #dfe6ee; font-size: .72rem; font-style: normal; transform: rotate(calc(var(--i) * 30deg)) translateY(-69px) rotate(calc(var(--i) * -30deg)); }
.hand { position: absolute; left: 50%; bottom: 50%; width: 3px; border-radius: 8px; background: #e9eff4; transform-origin: 50% 100%; }
.hour { height: 43px; }.minute { height: 59px; width: 2px; }.second { height: 62px; width: 1px; background: var(--accent); }
.pin { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; transform: translate(-50%,-50%); border: 2px solid #182230; border-radius: 50%; background: var(--accent); }
.date-copy { display: flex; flex-direction: column; }
.date-copy { gap: 18px; }
.date-copy strong { font-size: clamp(1.7rem, 3.4vw, 2.6rem); letter-spacing: -.05em; text-transform: lowercase; white-space:nowrap; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.week span { min-width: 30px; padding: 8px 5px; border: 1px solid transparent; border-radius: 9px; color: #7d8996; font-size: .72rem; font-weight: 750; text-align:center; }
.week span.weekend { color:#7e3438; }
.week span.current { border-color: var(--accent); color: var(--accent); background:rgba(185,255,102,.06); }
.week span.weekend.current { border-color:#dc575d; color:#ff7077; background:rgba(220,87,93,.08); }

.weather-head { display: flex; justify-content: space-between; }
.temperature { margin-top: 22px; font-size: 4.7rem; font-weight: 700; line-height: .9; letter-spacing: -.07em; }
.condition { margin-top: 9px; color: var(--muted); }
.weather-icon { position: relative; width: 105px; height: 80px; }
.weather-icon::before { content: ""; position: absolute; right: 8px; top: 0; width: 54px; height: 54px; border-radius: 50%; background: #f8c861; box-shadow: 0 0 28px rgba(248,200,97,.18); }
.weather-icon span { position: absolute; left: 5px; bottom: 8px; width: 86px; height: 38px; border-radius: 28px; background: #cbd6df; box-shadow: inset 0 -7px 12px rgba(72,92,111,.18); }
.weather-icon span::before { content:""; position:absolute; left:15px; top:-23px; width:48px; height:48px; border-radius:50%; background:#cbd6df; }
.weather-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 26px; padding-top: 19px; border-top: 1px solid rgba(255,255,255,.08); }
.weather-meta div { display: flex; flex-direction: column; gap: 4px; }
.weather-meta small { color: #78889a; font-size: .62rem; letter-spacing: .08em; }
.weather-meta strong { font-size: .92rem; }
.demo-note { margin: 18px 4px 0; color: #667586; font-size: .76rem; text-align: center; }

@media (max-width: 700px) {
  .dashboard { padding: 20px 14px 26px; }
  .glucose { min-height: 0; padding: 24px 20px; grid-template-columns: 1fr; gap: 10px; }
  .reading-row { margin-top: 18px; }
  .reading-row strong { font-size: 6rem; }
  .status { margin-top: 24px; }
  .chart-wrap { margin-top: 12px; padding-left: 8px; }
  .details { grid-template-columns: 1fr; }
  .weather-card { order: 0; }
  .clock-card { order: 1; }
  .clock-content { flex-direction:column; }
  .clock-card { min-height: 390px; }
  .date-copy { width:100%; align-items:center; }
  .clock-card, .weather-card { min-height: 230px; padding: 24px 20px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .dashboard { padding: 14px 18px; }
  .glucose { min-height: 220px; padding: 22px; grid-template-columns: 1.45fr .75fr; }
  .reading-row strong { font-size: 5rem; }
  .status { margin-top: 18px; }
  .details { grid-template-columns: 1fr 1fr; }
  .clock-card, .weather-card { min-height: 215px; }
}
