[id^="hydratum-root-"]:not([data-mounted="true"]) {
    opacity: 0;
    visibility: hidden;
}
[id^="hydratum-root-"][data-mounted="true"] {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease-in;
}

.hydratum-v2,
.hydratum-v2 * {
  box-sizing: border-box;
}

.hydratum-v2 {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 16px;
  color: #111827;
}

/* Micro-animations (subtle) */
.h-fade {
  animation: hFadeIn 180ms ease-out;
}

@keyframes hFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 960px) {
  .hydratum-v2 {
    padding: 24px;
  }
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
  vertical-align: middle;
}

/* Header */
.h-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.10), rgba(16, 185, 129, 0.10));
  margin-bottom: 16px;
}

.h-title {
  min-width: 240px;
}

.h-app {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 20px;
}

.h-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.h-sub {
  margin-top: 4px;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.4;
  max-width: 64ch;
}

.h-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.h-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: #111827;
}

.h-tab:hover {
  border-color: rgba(0, 0, 0, 0.22);
}

.h-tab.active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.h-tab .material-symbols-outlined {
  font-size: 18px;
  line-height: 1;
}

/* Cards */
.h-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  margin-bottom: 16px;
}

.h-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  margin-bottom: 12px;
}

.h-card-title-split {
  justify-content: space-between;
}

.h-inf {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  opacity: 0.65;
  cursor: help;
}

.h-inf:hover {
  opacity: 0.9;
}

.h-card-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.h-card-subtitle {
  font-weight: 800;
  margin: 12px 0 8px;
}

.h-muted {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.4;
}

.h-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  margin: 16px 0;
}

.h-spacer {
  height: 12px;
}

.h-link {
  background: none;
  border: none;
  color: #111827;
  text-decoration: underline;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}

/* Buttons */
.h-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #111827;
  background: #111827;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
}

.h-btn:hover {
  filter: brightness(0.96);
}

.h-btn-ghost {
  background: #fff;
  color: #111827;
  border-color: rgba(0, 0, 0, 0.18);
}

.h-btn-full {
  width: 100%;
}

.h-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Inputs */
.h-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-bottom: 12px;
  align-items: center;
}

.h-label {
  font-weight: 800;
  font-size: 13px;
}

.h-field input,
.h-field select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
  color: #111827;
}

.h-field input[type='checkbox'] {
  width: auto;
}

.h-help {
  grid-column: 1 / -1;
  color: #6b7280;
  font-size: 12px;
  margin-top: -4px;
}

@media (max-width: 640px) {
  .h-row {
    grid-template-columns: 1fr;
  }
}

/* Pills */
.h-pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.h-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  color: #111827;
}

.h-pill.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

/* Hero */
.h-hero {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.10), rgba(16, 185, 129, 0.10));
  margin-bottom: 16px;
}

.h-hero-title {
  font-weight: 900;
  font-size: 16px;
}

.h-hero-text {
  color: #4b5563;
  font-size: 13px;
  margin-top: 4px;
  max-width: 70ch;
}

@media (max-width: 640px) {
  .h-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .h-hero-right {
    width: 100%;
  }
  .h-hero-right .h-btn {
    width: 100%;
  }
}

/* Profile summary */
.h-profile-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.h-profile-item {
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  background: #fafafa;
}

.h-profile-k {
  color: #6b7280;
  font-size: 12px;
}

.h-profile-v {
  font-weight: 900;
  margin-top: 2px;
}

/* Subnav */
.h-subnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.h-subtab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  color: #111827;
}

.h-subtab .material-symbols-outlined {
  font-size: 18px;
  line-height: 1;
}

.h-subtab.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

/* Calculator layout */
.h-calc-layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: 'right' 'left';
  gap: 16px;
  align-items: start;
}

.h-calc-left {
  grid-area: left;
}

.h-calc-right {
  grid-area: right;
}

@media (min-width: 1100px) {
  .h-calc-layout {
    grid-template-columns: minmax(0, 1fr) 420px;
    grid-template-areas: 'left right';
  }
  .h-calc-right .h-results {
    position: sticky;
    top: 16px;
  }
}

/* Results */
.h-goal-main {
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.h-base-line {
  color: #6b7280;
  font-size: 13px;
  margin-top: 4px;
}

.h-ruler {
  display: flex;
  gap: 6px;
}

.h-seg {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #f3f4f6;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.h-seg-label {
  font-size: 12px;
  font-weight: 800;
  color: #374151;
}

.h-seg-val {
  font-size: 12px;
  color: #6b7280;
}

.seg-base { background: rgba(59, 130, 246, 0.12); }
.seg-sport { background: rgba(16, 185, 129, 0.12); }
.seg-climate { background: rgba(245, 158, 11, 0.14); }
.seg-fever { background: rgba(239, 68, 68, 0.12); }
.seg-diarrhea { background: rgba(168, 85, 247, 0.12); }
.seg-urine { background: rgba(99, 102, 241, 0.12); }
.seg-alcohol { background: rgba(14, 165, 233, 0.12); }

.h-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.h-break-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  background: #fafafa;
}

.h-break-left {
  min-width: 0;
}

.h-break-title {
  font-weight: 900;
  font-size: 13px;
}

.h-break-note {
  color: #6b7280;
  font-size: 12px;
  margin-top: 2px;
}

.h-break-val {
  font-weight: 950;
  white-space: nowrap;
}

.h-eq {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.h-eq-item {
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.h-eq-n {
  font-weight: 950;
  font-size: 18px;
}

.h-eq-l {
  color: #6b7280;
  font-size: 13px;
}

/* Stepper & quick chips */
.h-stepper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.h-step {
  width: 40px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
  cursor: pointer;
  font-weight: 950;
  font-size: 18px;
  line-height: 1;
}

.h-chip {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
  cursor: pointer;
  font-weight: 900;
  font-size: 13px;
  color: #111827;
}

.h-chip.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.h-quick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Urine grid */
.h-urine-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 520px) {
  .h-urine-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.h-urine-swatch {
  position: relative;
  height: 44px;
  border-radius: 12px;
  border: 2px solid rgba(0, 0, 0, 0.10);
  cursor: pointer;
  font-weight: 950;
  color: rgba(0, 0, 0, 0.55);
}

.h-urine-swatch.active {
  border-color: #111827;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.85);
}

.h-urine-check {
  font-size: 22px;
  line-height: 1;
}

/* BMI */
.h-bmi-value {
  font-weight: 950;
  font-size: 18px;
}

/* Split */
.h-split {
  display: flex;
  gap: 8px;
  align-items: center;
}

.h-split-unit {
  font-size: 12px;
  color: #6b7280;
}

/* Badges */
.h-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid rgba(0, 0, 0, 0.12);
  white-space: nowrap;
}

.h-badge-info { background: rgba(59, 130, 246, 0.10); }
.h-badge-warn { background: rgba(245, 158, 11, 0.12); }
.h-badge-alert { background: rgba(239, 68, 68, 0.12); }

/* Weather (auto summary) */
.h-weather-auto {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.h-weather-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.h-weather-cond {
  font-weight: 950;
}

.h-weather-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.h-weather-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 720px) {
  .h-weather-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.h-metric {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.6);
}

.h-metric-k {
  font-size: 12px;
  color: #6b7280;
  font-weight: 900;
}

.h-metric-v {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 950;
}

.h-weather-actions {
  display: flex;
  justify-content: flex-end;
}

/* Skeleton loaders */
.h-skel-line,
.h-skel-block,
.h-skel-btn {
  position: relative;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 12px;
}

.h-skel-line {
  height: 10px;
  margin: 10px 0;
}

.h-skel-head {
  margin-bottom: 6px;
}

.h-skel-block {
  height: 140px;
}

.h-skel-btn {
  height: 38px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.08);
}

.h-skel-line::after,
.h-skel-block::after,
.h-skel-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -160px;
  height: 100%;
  width: 160px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: hShimmer 1.15s ease-in-out infinite;
}

@keyframes hShimmer {
  0% { left: -160px; }
  100% { left: 100%; }
}

/* Insights */
.h-rule {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 12px;
  background: #fafafa;
  margin-top: 10px;
}

.h-rule-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.h-rule-title {
  font-weight: 950;
}

.h-rule-body {
  margin-top: 6px;
  color: #374151;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-line;
}

.h-rule-refs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.h-ref-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  font-size: 12px;
  text-decoration: none;
  color: #111827;
}

.h-ref-chip:hover {
  text-decoration: underline;
}

.h-ref-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  background: #fafafa;
  margin-top: 10px;
}

@media (max-width: 640px) {
  .h-ref-row {
    grid-template-columns: 1fr;
  }
  .h-ref-row .h-ref-slug {
    font-weight: 950;
  }
}

.h-ref-slug {
  font-weight: 900;
}

.h-ref-cit {
  font-size: 13px;
}

/* New (2.4.0) — richer recommendations + citations */
.h-reco {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  padding: 12px;
  background: #fafafa;
  margin-top: 10px;
}

.h-reco-info  { border-left: 4px solid rgba(59, 130, 246, 0.85); }
.h-reco-warn  { border-left: 4px solid rgba(245, 158, 11, 0.85); }
.h-reco-alert { border-left: 4px solid rgba(239, 68, 68, 0.80); }

.h-reco-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.h-reco-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 950;
  min-width: 0;
}

.h-reco-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.h-reco-body {
  margin-top: 6px;
  color: #374151;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-line;
}

.h-evidence {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.h-evidence-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 900;
}

.h-evidence-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.h-evidence-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  font-size: 12px;
  text-decoration: none;
  color: #111827;
}

.h-evidence-chip:hover {
  text-decoration: underline;
}

.h-ref-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  background: #fafafa;
  margin-top: 10px;
}

.h-ref-ord {
  flex: 0 0 auto;
  min-width: 56px;
  font-weight: 950;
  color: #111827;
}

.h-ref-title {
  font-weight: 950;
  font-size: 13px;
}

.h-ref-link {
  color: #111827;
  text-decoration: none;
}

.h-ref-link:hover {
  text-decoration: underline;
}

.h-ref-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}

.h-ref-slug {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Planner */
.h-planner-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.h-planner-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  background: #fafafa;
  font-size: 13px;
}

/* Shop */
.h-shop-grid {
  display: grid;
  grid-template-columns: repeat(var(--hydratum-shop-cols, auto-fit), minmax(220px, 1fr));
  gap: 16px;
  align-items: stretch;
}

/* Ensure cards are equal height within each grid row (stable "App Store" look) */
.h-shop-grid > div {
  display: flex;
}

.h-shop-grid > div > .h-product {
  width: 100%;
  height: 100%;
}

.h-shop-grid-featured {
  /* Slightly wider tiles for the Featured section */
  grid-template-columns: repeat(var(--hydratum-shop-cols, auto-fit), minmax(240px, 1fr));
}

.h-product {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: var(--hydratum-shop-card-min-height, 420px);
}

/* Keep meta + badges from expanding card height unpredictably */
.h-product .h-product-meta {
  max-height: 62px; /* ~2 tag rows */
  overflow: hidden;
}

.h-product .h-badge-row {
  flex-wrap: nowrap;
  overflow: hidden;
}

.h-product .h-badge {
  white-space: nowrap;
}

.h-product-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #f3f4f6;
  display: block;
}

.h-product-img.h-product-img-ph {
  display: flex;
  align-items: center;
  justify-content: center;
}

.h-product-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.h-product-body .h-btn-full {
  /* Keep the primary CTA anchored at the bottom for consistent card heights */
  margin-top: auto;
}

.h-product-title {
  font-weight: 950;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 2.3em;
}

.h-product-vendor {
  font-size: 12px;
  color: #6b7280;
}

.h-product-excerpt {
  font-size: 13px;
  color: #374151;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.h-shop-filters {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.h-shop-search input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
}

.h-shop-count {
  margin-top: -4px;
}

.h-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.h-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.18);
}

.h-tag-muted {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.10);
}

/* ---------- Hydratum V2.5 UX refinements ---------- */

.h-page {
  width: 100%;
}

/* Compact profile summary in Calculator */
.h-card.h-card-compact {
  padding: 12px;
}

/* Profile summary: looks "disabled" (informational, not interactive) */
.h-profile-mini {
  background: #f8fafc;
}

.h-profile-mini-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.h-profile-mini .h-card-title {
  margin-bottom: 6px;
}

.h-chip.h-chip-static {
  cursor: default;
  user-select: text;
  font-weight: 900;
}

.h-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.h-icon-btn:hover {
  background: #f3f4f6;
}

.h-icon-btn:active {
  transform: translateY(1px);
}

/* Live preview / gauge */
.h-preview .h-card-body {
  padding-top: 6px;
}

.h-gauge {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.10);
}

.h-gauge-base {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(59, 130, 246, 0.16);
}

.h-gauge-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(59, 130, 246, 0.85);
  transition: width 240ms ease;
}

.h-preview-meta {
  margin-top: 8px;
  color: rgba(17, 24, 39, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.h-preview-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

/* Results layout */
.h-results-layout {
  display: grid;
  gap: 14px;
  align-items: start;
  grid-template-columns: 1fr;
}

@media (min-width: 980px) {
  .h-results-layout {
    grid-template-columns: 1fr 1fr;
  }
}

/* Pie chart */
.h-pie-layout {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 16px;
  align-items: center;
}

/* Interactive donut chart */
.h-donut-wrap {
  position: relative;
  width: 190px;
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.h-donut {
  width: 190px;
  height: 190px;
}

.h-donut-seg {
  transition: transform 120ms ease, opacity 120ms ease, filter 120ms ease;
  transform-origin: 110px 110px;
}

.h-donut-seg.is-active {
  transform: scale(1.03);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18));
}

.h-donut-seg.is-dim {
  opacity: 0.28;
}

.h-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  pointer-events: none;
}

.h-donut-k {
  font-weight: 800;
  font-size: 13px;
  color: #374151;
}

.h-donut-v {
  font-weight: 950;
  font-size: 18px;
  color: #111827;
}

.h-donut-p {
  margin-top: 4px;
  font-weight: 800;
  font-size: 12px;
  color: #6b7280;
}

.h-legend-btn {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 6px 8px;
  text-align: left;
  cursor: pointer;
}

.h-legend-btn:hover {
  border-color: rgba(0, 0, 0, 0.12);
  background: #f9fafb;
}

.h-legend-btn.active {
  border-color: rgba(17, 24, 39, 0.20);
  background: #f3f4f6;
}

@media (max-width: 420px) {
  .h-pie-layout {
    grid-template-columns: 1fr;
  }
}

.h-pie {
  width: 160px;
  height: 160px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  position: relative;
}

.h-pie-hole {
  position: absolute;
  inset: 28px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.h-pie-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Compatibility: JS uses these class names */
.h-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  display: inline-block;
  flex: 0 0 auto;
}

/* Nicer legend bullet (used in Results → Daily target breakdown) */
.h-dot--ring {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.18), 0 1px 2px rgba(15, 23, 42, 0.12);
}

.h-pie-legend-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.h-pie-legend-label {
  font-weight: 700;
  color: #374151;
}

.h-pie-legend-val {
  font-weight: 900;
  color: #111827;
}

.h-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

.h-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.h-legend-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.h-legend-label {
  font-size: 12px;
  font-weight: 900;
  color: rgba(17, 24, 39, 0.86);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.h-legend-value {
  font-size: 12px;
  font-weight: 1000;
  color: rgba(17, 24, 39, 0.92);
}

/* Weather location details */
.h-weather-loc {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.h-weather-loc-row {
  display: flex;
  gap: 8px;
}

.h-weather-loc-label {
  font-weight: 900;
  color: rgba(17, 24, 39, 0.80);
  min-width: 86px;
}

.h-weather-loc-val {
  font-weight: 800;
  color: rgba(17, 24, 39, 0.92);
}

/* Planner (Your plan) */
.h-plan {
  display: grid;
  gap: 14px;
}

.h-plan-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.h-progress {
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.10);
}

.h-progress-bar {
  height: 100%;
  background: rgba(16, 185, 129, 0.85);
  transition: width 240ms ease;
}

.h-plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.h-plan-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 980px) {
  .h-plan-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.h-slot-card {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}

.h-slot-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.h-slot-label {
  font-weight: 1000;
  color: rgba(17, 24, 39, 0.92);
}

.h-slot-target {
  font-size: 12px;
  font-weight: 900;
  color: rgba(17, 24, 39, 0.65);
}

.h-slot-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.10);
}

.h-slot-fill {
  height: 100%;
  background: rgba(59, 130, 246, 0.85);
  transition: width 240ms ease;
}

.h-slot-vals {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 900;
  color: rgba(17, 24, 39, 0.72);
}

.h-plan-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.h-log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
}

.h-log-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.h-dot {
  opacity: 0.35;
}

.h-tag-water {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.18);
}

.h-tag-ors {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.20);
}

/* Alcohol (richer controls) */
.h-alcohol-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

@media (max-width: 420px) {
  .h-alcohol-grid {
    grid-template-columns: 1fr;
  }
}

.h-alcohol-card {
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.h-alcohol-label {
  font-weight: 1000;
  color: rgba(17, 24, 39, 0.92);
}

.h-alcohol-meta {
  font-size: 12px;
  font-weight: 900;
  color: rgba(17, 24, 39, 0.60);
  margin-top: 2px;
}

.h-alcohol-summary {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.h-checkline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}

.h-range {
  width: 100%;
}

/* ----------------------------- */
/* Numeric fields (better typing) */
/* ----------------------------- */

.h-stepper-input {
  width: 100%;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #ffffff;
  padding: 10px 12px;
  text-align: center;
  font-weight: 900;
  font-size: 16px;
}

.h-stepper-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.65);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
}

/* ----------------------------- */
/* Calculator: Profile (low emphasis) */
/* ----------------------------- */

.h-profile-inline {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px dashed rgba(0, 0, 0, 0.16);
  background: rgba(0, 0, 0, 0.02);
  color: rgba(17, 24, 39, 0.90);
  opacity: 0.88;
}

.h-profile-inline:hover {
  background: rgba(0, 0, 0, 0.03);
}

.h-profile-inline-title {
  font-weight: 1000;
}

.h-profile-inline-meta {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 850;
  color: rgba(17, 24, 39, 0.60);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.h-profile-inline-edit {
  font-weight: 1000;
  font-size: 13px;
}

/* ----------------------------- */
/* Alcohol: Hero summary */
/* ----------------------------- */

.h-alcohol-hero {
  display: flex;
  gap: 14px;
  align-items: stretch;
  justify-content: space-between;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: rgba(59, 130, 246, 0.06);
  margin-bottom: 12px;
}

.h-alcohol-bac {
  flex: 1;
  min-width: 0;
}

.h-alcohol-bac-label {
  font-size: 12px;
  font-weight: 1000;
  color: rgba(17, 24, 39, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.h-alcohol-bac-value {
  font-size: 28px;
  font-weight: 1100;
  margin-top: 6px;
  color: rgba(17, 24, 39, 0.95);
}

.h-alcohol-bac-sub {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 850;
  color: rgba(17, 24, 39, 0.62);
  line-height: 1.3;
}

.h-alcohol-meta {
  display: grid;
  gap: 10px;
  min-width: 220px;
}

.h-alcohol-metric {
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: #ffffff;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.h-alcohol-metric-k {
  font-size: 12px;
  font-weight: 1000;
  color: rgba(17, 24, 39, 0.55);
}

.h-alcohol-metric-v {
  font-weight: 1100;
  color: rgba(17, 24, 39, 0.92);
}

@media (max-width: 780px) {
  .h-alcohol-hero {
    flex-direction: column;
  }
  .h-alcohol-meta {
    min-width: 0;
  }
}

/* ----------------------------- */
/* Profile: BMI interpretation table */
/* ----------------------------- */

.h-bmi-status {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 900;
  color: rgba(17, 24, 39, 0.62);
}

.h-bmi-table {
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  overflow: hidden;
  background: #ffffff;
}

.h-bmi-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.h-bmi-row:first-child {
  border-top: none;
}

.h-bmi-head {
  background: rgba(17, 24, 39, 0.03);
  font-size: 12px;
  font-weight: 1100;
  color: rgba(17, 24, 39, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.h-bmi-row.is-active,
.h-bmi-row.active {
  /* Pastel highlight for the row matching the current BMI */
  background: rgba(99, 102, 241, 0.10);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.18);
}

.h-bmi-label {
  font-weight: 1000;
}

.h-bmi-range {
  text-align: right;
  font-weight: 1100;
  color: rgba(17, 24, 39, 0.82);
}

/* --- Shop "App Store" UI polish (v3.3+) --- */
.h-disclaimer {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 13px;
  color: #0f172a;
}

.h-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 6px;
}

.h-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 800;
}

.h-badge-verified {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.10);
  color: #065f46;
}

.h-badge-featured {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.10);
  color: #1d4ed8;
}

.h-badge-amazon {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
}

.h-product-bullets {
  margin: 10px 0 0 18px;
  padding: 0;
  font-size: 13px;
  color: rgba(17, 24, 39, 0.92);
}

.h-product-bullets li {
  margin: 4px 0;
  /* Keep list cards visually aligned (single-line bullets with ellipsis) */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.h-product-bullets-full li {
  /* Full bullets on the product page */
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.h-product-why {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 13px;
  color: rgba(17, 24, 39, 0.92);
}

.h-product-why-label {
  display: block;
  font-weight: 1000;
  margin-bottom: 4px;
}

.h-product-caution {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(17, 24, 39, 0.55);
}

/* Product page (intermediate step before outbound affiliate link) */
.h-product-page {
  margin-top: 10px;
}

.h-product-page-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 720px) {
  .h-product-page-grid {
    grid-template-columns: 280px 1fr;
    align-items: start;
  }
}

.h-product-page-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #f3f4f6;
  display: block;
}

.h-product-page-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.h-product-page-title {
  font-weight: 1000;
  font-size: 18px;
  line-height: 1.15;
}

.h-product-section {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.h-product-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 900;
  color: rgba(17, 24, 39, 0.7);
  margin-bottom: 6px;
}

.h-product-aff-note {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(17, 24, 39, 0.6);
}

.h-featured-row {
  display: flex;
  gap: 12px;
  overflow: auto;
  padding: 4px 0;
}

.h-featured-item {
  min-width: 260px;
  max-width: 360px;
  flex: 0 0 auto;
}

.h-product-compact {
  min-height: 400px;
}

.h-product-compact .h-product-body {
  padding: 10px 12px;
}

.h-product-compact .h-product-excerpt {
  display: none;
}
