/* #region zone:health.mono.overview — หัวทักทาย bento น้ำตาล แถบสัปดาห์ และกราฟสีตามช่วง */
html:root .page-head {
  margin: 0 0 28px;
  align-items: flex-end;
  gap: var(--sp-5);
}

html:root .page-title {
  margin: 5px 0 var(--sp-2);
  --health-text-fluid: clamp(40px, 5vw, 72px);
  font-size: var(--health-text-fluid);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.045em;
}

html:root .page-head-text > .muted {
  margin: 0;
  font-size: var(--u-text-lg);
}

html:root .tz-note {
  color: var(--mono-muted);
}

html:root .summary {
  min-height: 0;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--mono-muted);
  box-shadow: none;
}

html:root .summary::after {
  display: none;
}

html:root .summary-label {
  color: var(--mono-muted);
  padding-inline: 0;
}

html:root .summary p {
  margin: var(--sp-1) 0 0;
  color: var(--mono-muted);
  font-size: 15px;
}

html:root .quick {
  margin: 0 0 14px;
  gap: 10px;
}

html:root .quick {
  grid-template-columns: minmax(0, 1fr);
}

@container workspace (min-width: 560px) {
  html:root .quick {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  html:root .quick-btn {
    grid-column: span 2;
  }
  html:root .quick-btn:nth-child(n + 4) {
    grid-column: span 3;
  }
}

@container workspace (min-width: 760px) {
  html:root .quick {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  html:root .quick-btn:nth-child(n) {
    grid-column: auto;
  }
}

html:root .quick-btn {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    'mark title'
    'mark hint';
  align-content: center;
  row-gap: 0;
  min-height: 64px;
  padding: var(--sp-2) var(--sp-5) var(--sp-2) var(--sp-2);
  column-gap: var(--sp-3);
  border: 1px solid var(--mono-faint);
  border-radius: var(--u-radius-pill);
  background: transparent;
  box-shadow: none;
  color: var(--mono-ink);
}

html:root .quick-btn:hover {
  border-color: var(--mono-faint);
  background: var(--mono-card);
  box-shadow: none;
  transform: none;
}

html:root .quick-mark {
  margin-bottom: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--mono-card);
  color: var(--mono-ink);
}

html:root .quick-btn:hover .quick-mark,
html:root .quick-btn:focus-visible .quick-mark {
  background: var(--mono-ink);
  color: var(--mono-bg);
}

html:root .quick-btn small {
  color: var(--mono-muted);
}

html:root #overview .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  grid-auto-rows: auto;
  gap: 14px;
}

html:root #overview .grid > .card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

html:root .card,
html:root .mini {
  min-width: 0;
  padding: 26px;
  border: 0;
  border-radius: 32px;
  background: var(--mono-card);
  box-shadow: none;
}

html:root #overview .card--glucose {
  grid-column: auto;
  grid-row: auto;
  padding: var(--sp-8);
  background: var(--mono-hard);
  color: var(--mono-on-hard);
}

html:root #overview .card--glucose > h2,
html:root #overview .card--glucose .muted,
html:root #overview .card--glucose .stat-note,
html:root #overview .card--glucose .stat-unit,
html:root #overview .card--glucose .trend,
html:root #overview .card--glucose .caption {
  color: var(--mono-soft-on-hard);
}

html:root #overview .card > h2,
html:root #overview .mini > h3,
html:root #overview .progress > h2 {
  font-family: 'Geist Mono Health', 'Anuphan Health', ui-monospace, monospace;
  font-size: var(--u-text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mono-muted);
}

html:root #overview .card--glucose > h2 {
  color: var(--mono-soft-on-hard);
}

html:root #overview .card--glucose .stat-num {
  --health-text-fluid: clamp(112px, 13vw, 190px);
  font-size: var(--health-text-fluid);
  line-height: 0.8;
  color: var(--mono-on-hard);
}

html:root #overview .stat-num {
  font-size: var(--health-text-stat);
  line-height: 1;
}

html:root .glucose-scale {
  display: grid;
  gap: 9px;
}

html:root .glucose-scale-track {
  position: relative;
  height: 10px;
  display: grid;
  grid-template-columns: 18fr 27fr 24fr 31fr;
  gap: var(--sp-1);
}

html:root .glucose-scale-band {
  border-radius: var(--u-radius-pill);
  opacity: 0.42;
}

html:root .glucose-scale-band--low {
  background: var(--mono-blue);
}

html:root .glucose-scale-band--normal {
  background: var(--mono-green);
  opacity: 1;
}

html:root .glucose-scale-band--risk {
  background: var(--mono-amber);
}

html:root .glucose-scale-band--high {
  background: var(--mono-red);
}

html:root .glucose-scale-marker {
  position: absolute;
  top: -7px;
  width: 4px;
  height: 24px;
  border-radius: 4px;
  background: var(--mono-on-hard);
  box-shadow: 0 0 0 3px var(--mono-hard);
}

html:root .glucose-scale-labels {
  display: grid;
  grid-template-columns: 18fr 27fr 24fr 31fr;
  color: var(--mono-soft-on-hard);
  font-family: 'Geist Mono Health', 'Anuphan Health', ui-monospace, monospace;
  font-size: 11px;
}

html:root .glucose-scale-labels span:last-child {
  text-align: right;
}

html:root #overview .card--glucose .segmented {
  background: rgba(255, 255, 255, 0.12);
}

html:root #overview .card--glucose .segmented button {
  background: transparent;
  color: #d4d4d4;
}

html:root #overview .card--glucose .more {
  background: transparent;
  color: var(--mono-on-hard);
  border: 1px solid var(--mono-soft-on-hard);
}

html:root #overview .card--glucose .more:hover {
  background: rgba(255, 255, 255, 0.14);
}

html:root #overview .card--glucose .segmented button[aria-pressed='true'] {
  background: var(--mono-on-hard);
  color: #000000;
}

html:root #overview .card--glucose .chart {
  --chart-surface: var(--mono-hard);
  --chart-note: var(--mono-on-hard);
  border: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
}

html:root[data-theme='dark'] #overview .card--glucose .chart {
  --band-low: #1c3550;
  --band-normal: #17392e;
  --band-risk: #4a3a14;
  --band-high: #4d2420;
}

html:root #overview .card--glucose .dot--low {
  fill: var(--mono-blue);
}
html:root #overview .card--glucose .dot--normal {
  fill: var(--mono-green);
}
html:root #overview .card--glucose .dot--risk {
  fill: var(--mono-amber);
}
html:root #overview .card--glucose .dot--high {
  fill: var(--mono-red);
}
html:root[data-theme='dark'] #overview .card--glucose .band-label {
  fill: var(--mono-on-hard);
}

html:root #overview .card--glucose .chart-svg :where(.tick, .band-label, .point-label) {
  fill: var(--mono-soft-on-hard);
}
html:root #overview .card--glucose .chart-svg .point-label--single {
  fill: var(--mono-ink);
}

html:root #overview .card--glucose .gridline {
  stroke: rgba(255, 255, 255, 0.2);
}

html:root #overview .card--glucose .sentence {
  background: rgba(255, 255, 255, 0.1);
  color: var(--mono-on-hard);
}

html:root .move-ring {
  width: 104px;
  height: 104px;
  float: left;
  margin: 2px 18px 10px 0;
}

html:root .move-ring circle {
  fill: none;
  stroke-width: 10px;
}

html:root .move-ring-track {
  stroke: var(--mono-card-2);
}

html:root .move-ring-fill {
  stroke: var(--mono-orange);
  stroke-linecap: round;
}

html:root .move-ring text {
  fill: var(--mono-ink);
  font-size: 19px;
  font-weight: 600;
}

html:root #overview .grid > .card:nth-child(3) .mini-moves li::before {
  color: var(--mono-orange);
}

html:root .medicine-empty {
  margin: 0;
  color: var(--mono-muted);
  font-size: var(--u-body);
  font-weight: 400;
}

/* BP history remains readable without a horizontal scroll area. */
html:root #bp-today .data-table {
  width: 100%;
  table-layout: fixed;
  overflow-wrap: anywhere;
}
html:root #bp-today .data-table :is(th, td) {
  padding: var(--sp-1);
  font-size: var(--u-text-xs);
}
html:root #bp-today .bp-single-range {
  stroke: var(--chart-1);
  stroke-width: 6;
  stroke-linecap: round;
  opacity: 0.5;
}

@media (max-width: 599px) {
  html:root #bp-today .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  html:root #bp-today .data-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  html:root #bp-today .data-table td::before {
    display: block;
    color: var(--mono-muted);
  }
  html:root #bp-today .data-table td:nth-child(1)::before {
    content: 'เวลาไทย';
  }
  html:root #bp-today .data-table td:nth-child(2)::before {
    content: 'SYS/DIA mmHg';
  }
  html:root #bp-today .data-table td:nth-child(3)::before {
    content: 'ชีพจร bpm';
  }
  html:root #bp-today .data-table td:nth-child(4)::before {
    content: 'หมวดค่า';
  }
}

html:root #overview .progress {
  margin-top: 14px;
}

html:root #overview .mini-row {
  gap: 14px;
}

html:root #overview .mini:first-child .ring-fill {
  stroke: var(--mono-cyan);
}

html:root #overview .grid > .card:nth-child(2) .bar span {
  background: var(--mono-orange);
}

html:root .week-strip {
  display: none;
}

@media (max-width: 1279px) {
  html:root #overview .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 599px) {
  html:root #overview .page-head {
    margin: 0 58px var(--sp-3) 0;
    min-height: 44px;
    display: block;
  }

  html:root #overview .page-title {
    font-size: var(--health-text-stat-small);
    line-height: 34px;
  }

  html:root #overview .page-head-text > .muted,
  html:root #overview .page-actions,
  html:root #overview .summary,
  html:root #overview > .quick {
    display: none;
  }

  html:root .week-strip {
    margin-bottom: var(--sp-3);
    display: flex;
    gap: var(--sp-1);
  }

  html:root .week-day {
    min-width: 0;
    min-height: 68px;
    padding: var(--sp-2) 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    border-radius: 16px;
    color: var(--mono-muted);
    font-size: 11px;
  }

  html:root .week-day strong {
    color: var(--mono-ink);
    font-size: 15px;
  }

  html:root .week-day i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--mono-green);
  }

  /* the current day is filled with the ink colour (white in dark): its letters take the page colour, 7:1 or more */
  html:root .week-day.is-current {
    background: var(--mono-ink);
    color: var(--mono-bg);
  }

  html:root .week-day.is-current strong {
    color: var(--mono-bg);
  }

  html:root #overview .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 10px;
  }

  html:root .card,
  html:root .mini {
    padding: var(--sp-4);
    border-radius: var(--u-radius-card);
  }

  html:root #overview .card--glucose {
    grid-column: 1 / -1;
    grid-row: auto;
    padding: 22px;
    border-radius: var(--u-radius-dialog);
  }

  html:root #overview .card--glucose .stat-num {
    --health-text-fluid: clamp(86px, 28vw, 110px);
    font-size: var(--health-text-fluid);
  }

  html:root #overview .card--glucose .segmented {
    margin: var(--sp-4) 0 var(--sp-3);
  }

  html:root #overview .card--glucose .caption {
    margin: var(--sp-2) 0;
  }

  html:root #overview .card--glucose .card-foot {
    margin-top: var(--sp-4);
  }

  html:root #overview .card--glucose .card-foot .more {
    width: 100%;
  }

  html:root #overview .grid > .card:not(.card--glucose) {
    min-height: 178px;
  }

  html:root #overview .grid > .card:not(.card--glucose) .stat-num {
    font-size: var(--health-text-stat-small);
  }

  html:root .move-ring {
    width: 68px;
    height: 68px;
    float: none;
    margin: 0;
  }

  html:root #overview .grid > .card:not(.card--glucose) {
    grid-column: 1 / -1;
  }

  html:root #overview .grid > .card:nth-child(3) .clip-with-tv {
    margin-top: var(--sp-3);
  }

  html:root #overview .progress .mini-row {
    grid-template-columns: minmax(0, 1fr);
  }

  html:root .glucose-scale-labels {
    font-size: var(--health-text-micro);
  }
}
/* #endregion */
