/* Demo Home — Vitals Ring redesign shared frame (vrbuild 2026-11-16).
   Sections: Medicines / Labs / Medical (vitals.js), Nutrition + Health Today (nutrition.js).
   vr2: Dogs (dogs.js) + Groceries (groceries.js) on the same frame; 8-segment ring incl. Receipts. */
#vitalsSheet, #nutritionSheet, #healthTodaySheet { width: min(1080px, calc(100% - 36px)); min-height: min(860px, calc(100dvh - 60px)); }
#healthTodaySheet { min-height: 0; }
#dogsOverlay > #dogsSheet, #reefDashOverlay > #reefDashSheet, #groceriesOverlay > #groceriesSheet { width: min(1080px, calc(100% - 36px)); min-height: min(860px, calc(100dvh - 60px)); }
.vx-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vx-head .titles { flex: 0 1 auto; min-width: 0; }
.vx-head > .icon-btn { flex: 0 0 auto; }
.vx-back {
  appearance: none; cursor: pointer; font: inherit; color: var(--sky, #72d9f8);
  background: rgba(114,217,248,0.06); border: 1px solid rgba(114,217,248,0.28); border-radius: 999px;
  padding: 7px 12px; min-height: 36px; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
}
.vx-qs { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.vx-qs-b {
  appearance: none; cursor: pointer; width: 36px; height: 36px; padding: 7px; border-radius: 11px;
  background: rgba(11,16,24,0.6); border: 1px solid rgba(114,217,248,0.18); color: var(--muted, #8ea3b5);
  display: grid; place-items: center; transition: border-color .2s, color .2s, box-shadow .2s;
}
.vx-qs-b svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.vx-qs-b.on { color: #72d9f8; border-color: #72d9f8; box-shadow: 0 0 12px rgba(114,217,248,0.35); }
.vx-qs-b:hover { color: var(--text, #edf4fa); }

.vx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 12px; }
.vx-kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vx-kpi {
  background: rgba(11,16,24,0.72); border: 1px solid rgba(114,217,248,0.18); border-radius: 14px; padding: 10px 12px; min-width: 0;
}
.vx-kpi.vx-hero { border-color: rgba(114,217,248,0.55); box-shadow: 0 0 18px rgba(114,217,248,0.12) inset; }
.vx-kpi.warn { border-color: rgba(224,180,74,0.55); }
.vx-kpi.alert { border-color: rgba(255,138,150,0.55); }
.vx-kpi-l { font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted, #8ea3b5); }
.vx-kpi-v { font-family: "Oswald", sans-serif; font-size: 26px; font-weight: 700; line-height: 1.15; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vx-kpi-v small { font-size: 14px; color: var(--muted, #8ea3b5); font-weight: 600; }
.vx-kpi-v.vx-sm { font-size: 19px; white-space: normal; }
.vx-kpi-s { font-size: 11.5px; color: var(--muted, #8ea3b5); font-weight: 650; }
.vx-tile { appearance: none; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.vx-spark { display: block; width: 100%; height: 22px; margin-top: 4px; }
.vx-band { fill: rgba(114,217,248,0.14); }
.cy { color: #72d9f8; } .am { color: #e0b44a; } .rd { color: #ff8a96; }

.vx-tabs {
  position: sticky; top: -16px; z-index: 5; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -18px 14px; padding: 10px 18px; background: linear-gradient(180deg, #121a25 70%, rgba(18,26,37,0));
}
.vx-tabs::-webkit-scrollbar { display: none; }
.vx-tab {
  appearance: none; cursor: pointer; font: inherit; flex: 0 0 auto; color: var(--muted, #8ea3b5);
  background: #1c2733; border: 1px solid rgba(114,217,248,0.18); border-radius: 999px;
  padding: 8px 16px; min-height: 38px; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
}
.vx-tab.on { color: #05090e; background: #72d9f8; border-color: #72d9f8; box-shadow: 0 0 14px rgba(114,217,248,0.4); }

.vx-card { background: rgba(11,16,24,0.72); border: 1px solid rgba(114,217,248,0.16); border-radius: 16px; padding: 14px; margin: 0 0 12px; min-width: 0; }
.vx-center { text-align: center; }
.vx-cap { font-size: 10.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted, #8ea3b5); margin: 0 0 8px; }
.vx-cap span { float: right; letter-spacing: 0.06em; text-transform: none; font-weight: 650; }
.vx-src { font-size: 11px; color: var(--muted, #8ea3b5); margin: 8px 4px; }
.vx-insight { font-size: 12.5px; color: var(--muted, #8ea3b5); margin-top: 8px; }
.vx-insight b { color: var(--text, #edf4fa); }
.vx-grid2 { display: grid; grid-template-columns: minmax(250px, 320px) 1fr; gap: 12px; }
.vx-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.vx-group { margin-bottom: 10px; }

/* Labs */
.vx-att { list-style: none; margin: 0; padding: 0; }
.vx-att-row {
  appearance: none; cursor: pointer; font: inherit; color: inherit; width: 100%; text-align: left; background: none; border: 0;
  border-top: 1px solid rgba(114,217,248,0.1); padding: 10px 2px;
  display: grid; grid-template-columns: minmax(0, 1.4fr) 120px minmax(0, 1fr) 64px; gap: 12px; align-items: center;
}
.vx-att-name strong { display: block; font-size: 14px; }
.vx-att-name em, .vx-att-val em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted, #8ea3b5); }
.vx-att-val { font-weight: 800; }
.vx-att-spark .vt-spark-svg { height: 34px; }
details.vx-panel { border-top: 1px solid rgba(114,217,248,0.1); padding: 4px 0; }
details.vx-panel > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 10px; padding: 8px 2px; font-weight: 800; }
details.vx-panel > summary::-webkit-details-marker { display: none; }
details.vx-panel > summary::before { content: "▸"; color: #72d9f8; margin-right: 6px; }
details.vx-panel[open] > summary::before { content: "▾"; }
details.vx-panel > summary span:first-child { flex: 1; }
.vx-todos { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.vx-eq { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; align-items: stretch; }
.vx-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.vx-link { appearance: none; cursor: pointer; font: inherit; color: inherit; width: 100%; text-align: left; display: flex; gap: 10px; align-items: center;
  background: rgba(11,16,24,0.6); border: 1px solid rgba(114,217,248,0.14); border-radius: 12px; padding: 8px 10px; }
.vx-link em { font-style: normal; color: var(--muted, #8ea3b5); font-size: 12px; flex: 1; min-width: 0; }
.vx-list { display: grid; gap: 8px; }
.vx-row { background: rgba(11,16,24,0.6); border: 1px solid rgba(114,217,248,0.14); border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.vx-row .vt-lab-note { grid-column: 1 / -1; }
.vx-row-main strong { display: block; }
.vx-row-main span, .vx-row-side { font-size: 12px; color: var(--muted, #8ea3b5); }
.vx-day { background: rgba(11,16,24,0.55); border: 1px solid rgba(114,217,248,0.12); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; }
.vx-day header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; margin-bottom: 4px; }
.vx-day h5 { margin: 0; font-size: 14px; }

/* Modal */
.vx-modal { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 18px; }
.vx-modal-bg { position: absolute; inset: 0; background: rgba(2,5,9,0.72); border: 0; cursor: pointer; }
.vx-modal-card { position: relative; width: min(720px, 100%); max-height: calc(100dvh - 36px); overflow: auto;
  background: linear-gradient(180deg, #161f2c, #0d131c); border: 1px solid rgba(114,217,248,0.4); border-radius: 22px; padding: 16px 18px;
  box-shadow: 0 0 40px rgba(114,217,248,0.12); }
.vx-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.vx-modal-head h4 { margin: 2px 0 0; font-family: "Oswald", sans-serif; font-size: 22px; letter-spacing: 0.06em; text-transform: uppercase; }

/* Nutrition */
.vx-bar { display: grid; grid-template-columns: 72px 1fr minmax(150px, auto); gap: 10px; align-items: center; margin: 9px 0; font-size: 12.5px; }
.vx-bar-l { font-family: "Oswald", sans-serif; letter-spacing: 0.1em; text-transform: uppercase; font-size: 12px; }
.vx-bar-t { position: relative; height: 10px; border-radius: 6px; background: rgba(255,255,255,0.07); overflow: hidden; }
.vx-bar-t b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: rgba(114,217,248,0.5); }
.vx-bar.vx-herobar .vx-bar-t { height: 16px; }
.vx-bar.vx-herobar .vx-bar-t b { background: #72d9f8; box-shadow: 0 0 10px rgba(114,217,248,0.7); }
.vx-bar.ok .vx-bar-t b { background: #72d9f8; }
.vx-bar.over .vx-bar-t b { background: #e0b44a; }
.vx-bar-band { position: absolute; top: 0; bottom: 0; background: rgba(237,244,250,0.16); border-left: 2px solid rgba(237,244,250,0.7); border-right: 2px solid rgba(237,244,250,0.7); z-index: 1; }
.vx-bar-cap { position: absolute; top: -2px; bottom: -2px; width: 2px; background: rgba(237,244,250,0.75); z-index: 1; }
.vx-bar-t b { z-index: 0; }
.vx-bar-v strong { font-size: 14px; }
.vx-bar-v em { font-style: normal; color: var(--muted, #8ea3b5); }
.vx-bar-v small { display: block; color: var(--muted, #8ea3b5); font-size: 10.5px; }
.vx-bar.vx-herobar .vx-bar-l { font-size: 14px; }
.vx-bar.vx-herobar strong { font-size: 18px; }
.vx-arc { width: 100%; max-width: 240px; height: auto; }
.vx-arc circle { fill: none; }
.vx-arc-track { stroke: rgba(255,255,255,0.07); stroke-width: 14; }
.vx-arc-band { stroke: rgba(237,244,250,0.22); stroke-width: 20; }
.vx-arc-val { stroke: #72d9f8; stroke-width: 14; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(114,217,248,0.8)); }
.vx-arc-val.over { stroke: #e0b44a; filter: none; }
.vx-arc-n { fill: var(--text, #edf4fa); font-family: "Oswald", sans-serif; font-size: 34px; font-weight: 700; }
.vx-arc-s { fill: var(--muted, #8ea3b5); font-size: 11px; }
.vx-arc-l { fill: #72d9f8; font-size: 12px; font-weight: 800; }
.vx-arc-l.over { fill: #e0b44a; }
.vx-split { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,0.06); margin: 4px 0; }
.vx-split i { display: block; }
.vx-split-l { font-size: 11.5px; color: var(--muted, #8ea3b5); }
.vx-meal {
  appearance: none; cursor: pointer; font: inherit; color: inherit; width: 100%; text-align: left; background: none; border: 0;
  border-top: 1px solid rgba(114,217,248,0.1); padding: 9px 2px;
  display: grid; grid-template-columns: 46px 78px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 12.5px;
}
.vx-meal-k { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; font-family: "Oswald", sans-serif; letter-spacing: 0.08em; text-transform: uppercase; font-size: 11.5px; }
.vx-meal-t, .vx-meal-n { color: var(--muted, #8ea3b5); white-space: nowrap; }
.vx-meal-f { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vx-meal.off { box-shadow: inset 3px 0 0 #e0b44a; padding-left: 8px; }
.vx-chip-off { display: inline-block; font-size: 9.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 1px 7px; border-radius: 999px; border: 1px solid #e0b44a; color: #e0b44a; vertical-align: 1px; }
.vx-segs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.vx-gap { flex: 1; }
.vx-seg { appearance: none; cursor: pointer; font: inherit; color: var(--muted, #8ea3b5); background: #1c2733; border: 1px solid rgba(114,217,248,0.18);
  border-radius: 10px; padding: 6px 12px; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.vx-seg.on { color: #72d9f8; border-color: #72d9f8; }
.vx-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.vx-charts .vx-card { margin: 0; }
.vx-chart { width: 100%; height: 170px; display: block; }
.vx-b.ok { fill: #72d9f8; } .vx-b.lo { fill: rgba(114,217,248,0.42); } .vx-b.hi { fill: #ff8a96; } .vx-b.warn { fill: #e0b44a; }
.vx-avg { fill: none; stroke: #edf4fa; stroke-width: 1.6; opacity: 0.8; }
.vx-capline { stroke: #e0b44a; stroke-dasharray: 5 4; stroke-width: 1.4; }
.vx-off { fill: #e0b44a; font-size: 10px; }
.vx-foods { font-size: 14px; margin: 10px 0; }
.vx-macros li { grid-template-columns: 1fr auto !important; }
.vx-hero-card .vx-bar { grid-template-columns: 90px 1fr minmax(170px, auto); }

/* Ring additions */
.vr-badge { display: none; margin-top: 2px; font-size: 9.5px; font-weight: 800; letter-spacing: 0.06em; color: #72d9f8; white-space: nowrap;
  text-shadow: 0 0 6px rgba(114,217,248,0.6); }
.vr-badge.on { display: block; }
.vr-badge.warn { color: #e0b44a; text-shadow: none; }
.vr-badge.alert { color: #ff8a96; text-shadow: none; }
.vr-close { position: absolute; top: -6%; right: -6%; z-index: 3; width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  background: rgba(11,16,24,0.8); border: 1px solid rgba(114,217,248,0.4); color: #edf4fa; font-size: 20px; line-height: 1; }

/* vr2: Labs all-clear */
.vx-clear { border-color: rgba(160,230,140,0.35); background: linear-gradient(180deg, rgba(160,230,140,0.07), rgba(11,16,24,0.72)); }
.vx-clear-top { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; }
.vx-clear-ic { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 800;
  color: #a0e68c; border: 1.5px solid rgba(160,230,140,0.6); box-shadow: 0 0 16px rgba(160,230,140,0.25); }
.vx-clear-h { font-family: "Oswald", sans-serif; font-size: 22px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #a0e68c; }
.vx-clear-s { color: var(--muted, #8ea3b5); font-size: 12.5px; font-weight: 650; margin-top: 2px; }
.vx-clear-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.vx-clear-grid > div { background: rgba(11,16,24,0.6); border: 1px solid rgba(114,217,248,0.14); border-radius: 12px; padding: 9px 11px; min-width: 0; }
.vx-clear-grid span { display: block; font-size: 9.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted, #8ea3b5); }
.vx-clear-grid b { display: block; font-family: "Oswald", sans-serif; font-size: 17px; font-weight: 600; margin-top: 3px; color: var(--text, #edf4fa); }
.vx-clear-grid em { display: block; font-style: normal; font-size: 11px; font-weight: 650; color: var(--muted, #8ea3b5); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.vx-clear-panels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.vx-ok { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 9.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: #a0e68c; border: 1px solid rgba(160,230,140,0.4); background: rgba(160,230,140,0.08); white-space: nowrap; }

/* vr2: Dogs + Groceries inside the shared frame */
#dogsSheet .vx-tabs, #groceriesSheet .vx-tabs { margin-bottom: 12px; }
#groceriesSheet .gr-toolbar .gr-head-actions .btn { min-height: 40px; }

/* vr2: 8-segment ring — narrower label boxes so diagonal neighbours never touch */
.vr-lab { width: 25%; }

@media (max-width: 760px) {
  .vx-grid2, .vx-charts { grid-template-columns: 1fr; }
  .vx-kpis, .vx-kpis-4 { grid-template-columns: 1fr 1fr; }
  .vx-qs { order: 5; width: 100%; margin-left: 0; justify-content: space-between; }
  .vx-qs-b { width: 38px; height: 38px; }
  .vx-att-row { grid-template-columns: minmax(0, 1fr) auto; }
  .vx-att-spark { display: none; }
  .vx-bar { grid-template-columns: 62px 1fr; }
  .vx-bar-v { grid-column: 2; }
  .vx-hero-card .vx-bar { grid-template-columns: 70px 1fr; }
  .vx-meal { grid-template-columns: 42px 70px minmax(0, 1fr); }
  .vx-meal-n { grid-column: 2 / -1; }
  .vx-kpi-v { font-size: 22px; }
  .vr-close { top: -12%; right: 0; }
  .vx-clear-grid { grid-template-columns: 1fr 1fr; }
  .vx-head { gap: 8px; }
  .vx-head .titles { flex: 1 1 0; }
  .vx-head h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 22px; }
  .vx-head > .icon-btn { order: 3; margin-left: auto; }
  .vx-qs { flex-wrap: nowrap; gap: 4px; }
  .vx-qs-b { flex: 1 1 0; min-width: 0; max-width: 40px; width: auto; height: 36px; padding: 6px; }
  .vx-qs-b svg { width: 18px; height: 18px; }
  #groceriesSheet .gr-toolbar .gr-head-actions { width: 100%; }
  #groceriesSheet .gr-toolbar .gr-head-actions .btn { flex: 1 1 auto; }
  #dogsSheet .vx-tabs, #groceriesSheet .vx-tabs { overflow-x: auto; flex-wrap: nowrap; }
}
/* vr2: iPhone ring fits inside the 390px screen with room for the × */
@media (max-width: 480px) {
  .vr-overlay .vr-wheel { width: min(336px, calc(100vw - 54px)); height: min(336px, calc(100vw - 54px)); }
  .vr-overlay .vr-lab { width: 27%; }
  .vr-close { top: -16%; right: 2%; }
}
