* { box-sizing: border-box; }

:root {
  --nav: #182226;
  --paper: #f5f1e9;
  --card: rgba(255,255,255,.94);
  --ink: #182229;
  --muted: #66747a;
  --line: #d8dfde;
  --green: #23be73;
  --light-green: #8fd13f;
  --yellow: #f2c23b;
  --orange: #ee7b26;
  --red: #dc4545;
  --blue: #087eb8;
}

html { background: #152024; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 18px 12px;
  color: white;
  background: linear-gradient(165deg, #223035, #101719);
  box-shadow: 5px 0 22px rgba(0,0,0,.22);
}

.brand {
  display: grid;
  gap: 7px;
  place-items: center;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  width: 100%;
  border: 0;
  background: none;
  cursor: pointer;
}
.brand > img { width: 78px; height: 78px; object-fit: contain; }
.sidebar nav { display: grid; gap: 6px; margin-top: 30px; }
.sidebar nav a {
  display: grid;
  min-height: 74px;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 11px;
  color: #e7ecee;
  font-size: 12px;
  letter-spacing: .05em;
  text-decoration: none;
  text-transform: uppercase;
}
.sidebar nav a img { width: 34px; height: 34px; object-fit: contain; }
.sidebar nav a small { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.sidebar nav a:hover,
.sidebar nav a:focus-visible,
.sidebar nav a.active {
  border-color: #f0b429;
  color: #fff;
  background: rgba(255,255,255,.08);
  outline: none;
}
.sidebar nav a.active { color: #76e3aa; }
.sidebar-motto {
  margin: auto 4px 5px;
  color: #b3ca38;
  font: italic 16px/1.5 Georgia, serif;
}

main { min-width: 0; }
.hero {
  position: relative;
  display: flex;
  min-height: 270px;
  align-items: flex-end;
  justify-content: space-between;
  overflow: hidden;
  padding: 34px 5vw;
  color: white;
  background:
    linear-gradient(90deg, rgba(8,24,25,.86), rgba(8,24,25,.18) 54%, rgba(8,24,25,.48)),
    url("../images/daily-header-lacing-mc-v3.png") center 42% / cover;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 5px;
  background: linear-gradient(90deg, var(--green), #f0b429, var(--orange));
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { margin: 0; font-size: clamp(42px, 5vw, 72px); line-height: .95; }
.hero p:not(.eyebrow) { max-width: 650px; margin: 12px 0 0; font-size: clamp(15px, 1.5vw, 21px); }
.eyebrow {
  margin: 0 0 7px;
  color: #16885a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .15em;
}
.hero .eyebrow { color: #a8f0c9; }
.hero-date { text-align: right; text-shadow: 0 2px 12px #000; }
.hero-account-name {
  display: block;
  margin: 0 0 12px;
  color: #fff;
  background: transparent;
  font-size: clamp(15px, 1.35vw, 21px);
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.15;
  text-decoration: none;
  text-transform: uppercase;
  text-shadow: 0 2px 12px #000;
}
.hero-account-name:hover,
.hero-account-name:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}
.hero-account-name:focus-visible {
  border-radius: 4px;
  outline: 2px solid rgba(255,255,255,.85);
  outline-offset: 5px;
}
.hero-date span { display: block; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; }
.hero-date strong { font-size: clamp(21px, 2vw, 31px); }
.preferences-toggle {
  position: absolute;
  z-index: 4;
  top: 22px;
  right: 22px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 11px;
  color: white;
  background: rgba(9,31,27,.72);
  cursor: pointer;
  font-size: 20px;
}
.preferences-menu {
  position: fixed;
  z-index: 50;
  top: 18px;
  left: 150px;
  width: 225px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 13px;
  color: #17352c;
  background: rgba(255,255,255,.97);
  box-shadow: 0 14px 32px rgba(0,0,0,.24);
}
.preferences-menu[hidden] { display: none; }
.preferences-menu > strong { display: block; font-size: 16px; }
.preferences-menu > p { margin: 5px 0 12px; color: #687771; font-size: 11px; }
.preferences-menu label {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding: 9px;
  align-items: center;
  border-radius: 8px;
  background: #f2f6f2;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.preferences-menu label small { margin-left: auto; color: #728078; }
.preferences-close {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  color: #607069;
  background: transparent;
  font-size: 21px;
  line-height: 1;
}
.preferences-close:hover,
.preferences-close:focus-visible { color: #17352c; background: #e8efe9; outline: none; }

.content {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(265px, .65fr);
  grid-auto-flow: row dense;
  gap: 18px;
  padding: 22px;
}
.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 9px 26px rgba(32,49,52,.08);
}
.entry-card { grid-column: 1; padding: 24px; }
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.section-heading h2 { margin: 0; font-size: 25px; }
.entry-card > .section-heading { align-items: center; }
.weekly-reflection {
  flex: 1 1 420px;
  max-width: 560px;
  margin-inline: auto;
  padding-left: 18px;
  border-left: 2px solid rgba(211, 154, 19, .42);
  color: var(--muted);
}
.weekly-reflection span {
  display: block;
  margin-bottom: 4px;
  color: #a96e00;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}
.weekly-reflection q {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(14px, 1.15vw, 18px);
  font-style: italic;
  font-weight: 600;
  line-height: 1.35;
}
.weekly-reflection q u {
  text-decoration-color: #d39a13;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}
.date-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.date-controls { display: flex; align-items: end; gap: 8px; }
.today-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #f3f8f5;
  color: var(--green);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}
.today-button:hover { background: #e7f2ec; }
.date-field input,
.notes-grid input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fbfdfc;
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 22px;
}
.optional-metrics-grid { margin-top: 14px; }
.optional-metrics-grid label > span:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.optional-metrics-grid em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.optional-metrics-grid .input-with-unit input { font-size: 21px; }
.optional-metrics-help { margin-top: 9px; color: var(--muted); font-size: 12px; }
.optional-metrics-help summary { width: max-content; color: #087eb8; font-weight: 800; cursor: pointer; }
.optional-metrics-help p { max-width: 760px; margin: 7px 0 0; line-height: 1.5; }
.walk-breakdown {
  margin-top: 16px;
  padding: 17px 18px;
  border: 1px solid rgba(35, 112, 72, .28);
  border-radius: 13px;
  background: linear-gradient(145deg, #edf6ef 0%, #deece3 100%);
  box-shadow: 0 10px 26px rgba(24, 78, 56, .12);
}
.walk-breakdown-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.walk-breakdown-heading h3 { margin: 2px 0 0; font-size: 17px; }
.walk-breakdown .eyebrow { color: #087b4d; }
.walk-breakdown-heading > strong {
  padding: 5px 9px;
  border-radius: 999px;
  color: #175d3b;
  background: rgba(255, 255, 255, .62);
  font-size: 13px;
}
.walk-list { display: grid; gap: 8px; margin-top: 12px; }
.walk-row {
  display: grid;
  grid-template-columns: minmax(76px, .7fr) repeat(4, minmax(62px, 1fr)) auto;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  align-items: center;
  border: 1px solid rgba(35, 112, 72, .2);
  border-radius: 10px;
  background: white;
  box-shadow: 0 3px 10px rgba(24, 78, 56, .06);
}
.walk-row > strong { color: #183c2e; }
.walk-stat { display: grid; gap: 2px; }
.walk-stat small { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.walk-stat span { color: #314840; font-size: 12px; font-weight: 750; }
.walk-actions { display: flex; gap: 5px; }
.walk-actions button {
  border: 1px solid #cbd9d1;
  border-radius: 7px;
  padding: 6px 8px;
  color: #315646;
  background: #f8fbf9;
  font-size: 10px;
  font-weight: 800;
}
.walk-actions button[data-walk-action="delete"] { color: #9a493d; }
.number-grid > label,
.weekly-measures > label,
.weekly-measures > .weekly-waist-field {
  display: grid;
  gap: 8px;
  color: #32434a;
  font-size: 13px;
  font-weight: 800;
}
.input-with-unit {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f9fbfa;
}
.input-with-unit:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35,190,115,.12);
}
.input-with-unit input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 14px;
  color: var(--ink);
  background: transparent;
  font-size: 25px;
  font-weight: 750;
}
.input-with-unit small { padding-right: 12px; color: var(--muted); }

.promises {
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: 18px;
  margin-top: 20px;
  padding: 18px;
  border-radius: 13px;
  background: #edf7f1;
}
.promises h3 { margin: 0; font-size: 17px; line-height: 1.25; }
.promise-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.promise-grid label {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  border: 1px solid #b9d9c7;
  border-radius: 9px;
  padding: 8px 10px;
  color: #184b35;
  background: rgba(255,255,255,.8);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}
.promise-grid input { position: absolute; opacity: 0; }
.promise-grid label span {
  display: grid;
  width: 23px;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid #a2b0ab;
  border-radius: 6px;
  color: transparent;
  background: #fff;
  font-weight: 900;
}
.promise-grid label:has(input:checked) span {
  border-color: var(--green);
  color: white;
  background: var(--green);
}
.promise-grid label:not(:has(input:checked)) {
  border-color: #e2b4a9;
  color: #7b3527;
  background: #fff4f0;
}

.notes-grid { margin-top: 14px; }
.observation-field { display: grid; gap: 6px; }
.notes-field-heading { display: flex; align-items: center; gap: 12px; }
.notes-field-heading label { color: var(--muted); font-size: 12px; font-weight: 800; }
.observation-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.observation-input { position: relative; display: block; width: 84%; }
.observation-input > input {
  width: 100%;
  border-color: #bfd0c8;
  padding-right: 50px;
  background: #f1f6f3;
  box-shadow: inset 0 1px 2px rgba(24,65,48,.05);
}
.observation-input > input:hover { border-color: #9fb9ad; background: #edf4f0; }
.observation-input > input:focus { border-color: #23be73; background: #fbfdfc; }
.observation-emoji-picker {
  position: absolute;
  top: 50%;
  right: 7px;
  display: flex;
  align-items: center;
  gap: 4px;
  transform: translateY(-50%);
}
.observation-emoji-toggle,
.observation-emoji-menu button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 18px;
  line-height: 1;
}
.observation-emoji-toggle { opacity: .38; filter: grayscale(1); }
.observation-emoji-toggle:hover,
.observation-emoji-toggle:focus-visible,
.observation-emoji-toggle[aria-expanded="true"] {
  opacity: 1;
  filter: none;
  background: #e8f1ec;
  outline: none;
}
.observation-emoji-menu {
  display: flex;
  padding: 2px 4px;
  align-items: center;
  gap: 2px;
  border: 1px solid #d8dfde;
  border-radius: 9px;
  background: rgba(251, 253, 252, .98);
  box-shadow: 0 5px 14px rgba(24, 34, 41, .12);
}
.observation-emoji-menu[hidden] { display: none; }
.observation-emoji-menu button:hover,
.observation-emoji-menu button:focus-visible { background: #e8f1ec; outline: none; }
.observation-input:has(.observation-emoji-menu:not([hidden])) > input { padding-right: 260px; }
.scratch-pad-open {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  border: 1px solid #c9ddd2;
  border-radius: 999px;
  padding: 4px 10px;
  color: #17613f;
  background: #f3faf6;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}
.scratch-pad-open:hover,
.scratch-pad-open:focus-visible { border-color: #76af91; background: #e8f5ed; outline: none; }
.scratch-pad-indicator { width: 7px; height: 7px; border-radius: 50%; background: #b9c6c0; }
.scratch-pad-indicator.has-note { background: #20b86c; box-shadow: 0 0 0 3px rgba(32,184,108,.14); }
.scratch-pad-calendar-mark {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #20b86c;
  box-shadow: 0 0 0 2px rgba(32,184,108,.12);
}
.entry-actions { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-top: 18px; }
.entry-actions-tools { display: flex; align-items: center; gap: 10px; }
.entry-actions > .scratch-pad-open { justify-self: center; }
.entry-actions-primary { display: flex; justify-self: end; justify-content: flex-end; gap: 10px; }
.calculator-launch {
  min-height: 45px;
  border: 1px solid #21734f;
  border-radius: 9px;
  padding: 0 18px;
  color: #145b3c;
  background: #eef8f2;
  font-weight: 850;
}
.calculator-launch:hover,
.calculator-launch:focus-visible { border-color: #128953; background: #e2f3e9; outline: none; }
.save-button,
.secondary-button {
  min-height: 45px;
  border-radius: 9px;
  padding: 0 20px;
  font-weight: 850;
}
.save-button { border: 0; color: white; background: linear-gradient(#27b96f, #128953); box-shadow: 0 6px 15px rgba(19,137,83,.22); }
.secondary-button { border: 1px solid #aebcba; color: #35494d; background: white; }
.save-button:hover { filter: brightness(1.05); }
.save-button.full { width: 100%; margin-top: 20px; }
.save-status { min-height: 1em; margin: 8px 0 0; color: #128953; text-align: right; }

.today-score {
  grid-column: 2;
  display: grid;
  grid-template-rows: 1fr auto;
  align-content: center;
  justify-items: center;
  padding: 22px;
  text-align: center;
}
.today-score-content { display: grid; align-content: center; justify-items: center; }
.score-orb {
  width: 82px;
  aspect-ratio: 1;
  margin: 7px 0 10px;
  border: 0;
  border-radius: 50%;
  box-shadow: inset -15px -17px 22px rgba(0,0,0,.16), inset 8px 8px 14px rgba(255,255,255,.42), 0 9px 20px rgba(0,0,0,.16);
}
.today-score strong { font-size: 31px; }
.today-score-content > span { margin-top: 2px; color: var(--muted); }
.text-button { border: 0; margin-top: 12px; color: #087eb8; background: none; font-weight: 800; }

.daily-gauges { width: 100%; }
.daily-gauges-card { display: flex; grid-column: 2; flex-direction: column; padding: 20px 16px 14px; text-align: center; }
.calendar-card { grid-column: 1; }
.weekly-card { grid-column: 2; }
.milestones-card { grid-column: 1; }
.daily-gauges-heading { display: flex; align-items: center; justify-content: center; gap: 7px; }
.daily-gauges-heading .eyebrow { margin: 0; }
.gauge-info-button { display: grid; width: 20px; aspect-ratio: 1; place-items: center; border: 1px solid #9eafad; border-radius: 50%; color: #496064; background: #fff; font: 850 12px/1 Georgia, serif; }
.gauge-info { margin: 9px 0; border-radius: 9px; padding: 12px; color: #3f5357; background: #f2f7f5; font-size: 10px; line-height: 1.4; text-align: left; }
.gauge-info-intro strong, .gauge-info-intro span { display: block; }
.gauge-info-intro span { margin-top: 3px; }
.gauge-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.gauge-info-grid section { border: 1px solid #d8e5df; border-radius: 8px; padding: 9px; background: rgba(255,255,255,.72); }
.gauge-info-grid section > strong { display: block; color: #174b36; font-size: 10px; }
.gauge-info-grid p { margin: 6px 0; }
.gauge-info-grid small { display: block; color: #60736f; font-size: 9px; line-height: 1.4; }
.legend-light { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: baseline; }
.legend-light.green { background: #23ad68; }
.legend-light.yellow { background: #e7b72f; }
.legend-light.orange { background: #ed791f; }
.legend-light.red { background: #dc4545; }
.legend-light.deep-red { background: #941f2c; }
.arrow-legend b { color: #173f34; font-size: 12px; }
.gauge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.daily-gauge { display: grid; justify-items: center; min-width: 0; }
.daily-gauge output { min-height: 28px; color: var(--ink); font-size: 24px; font-weight: 900; line-height: 1; }
.gauge-unit { min-height: 14px; color: var(--muted); font-size: 9px; }
.gauge-tube { position: relative; display: grid; height: 105px; place-items: center; margin: 3px 0 5px; }
.gauge-tube input { --gauge-fill: 0%; width: 92px; height: 18px; margin: 0; transform: rotate(-90deg); border-radius: 999px; outline: none; background: linear-gradient(to right, var(--gauge-low) 0, var(--gauge-high) var(--gauge-fill), #e5e9e8 var(--gauge-fill), #e5e9e8 100%); appearance: none; }
.gauge-tube input::-webkit-slider-thumb { width: 21px; height: 21px; border: 3px solid #fff; border-radius: 50%; background: var(--gauge-high); box-shadow: 0 1px 5px rgba(0,0,0,.35); appearance: none; }
.gauge-tube input::-moz-range-thumb { width: 17px; height: 17px; border: 3px solid #fff; border-radius: 50%; background: var(--gauge-high); box-shadow: 0 1px 5px rgba(0,0,0,.35); }
.hydration-gauge { --gauge-low: #dc4545; --gauge-high: #075da8; }
.stress-gauge { --gauge-low: #24b56f; --gauge-high: #dc4545; }
.sleep-gauge { --gauge-low: #dc4545; --gauge-high: #315fa8; }
.gauge-stepper { display: grid; width: 100%; grid-template-columns: 18px minmax(0, 1fr) 18px; align-items: center; gap: 2px; }
.gauge-stepper strong { min-width: 0; font-size: 10px; }
.gauge-stepper button { display: grid; width: 18px; aspect-ratio: 1; place-items: center; border: 1px solid #afbfbc; border-radius: 50%; padding: 0; color: #345057; background: #fff; font-size: 14px; font-weight: 850; line-height: 1; }
.gauge-stepper button:hover, .gauge-stepper button:focus-visible { border-color: #158d58; color: #0d7045; background: #eff9f4; outline: none; }
.gauge-save { min-height: 27px; margin-top: 5px; border: 0; border-radius: 7px; padding: 0 9px; color: #fff; background: #1b8f5a; font-size: 10px; font-weight: 850; }
.daily-gauge small { min-height: 24px; margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.2; }
.gauge-indicators {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-top: 4px;
  padding-top: 7px;
  border-top: 1px solid #e1e9e5;
}
.gauge-indicators.no-light { padding-top: 13px; }
.gauge-average, .gauge-trend {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #52666a;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.15;
}
.gauge-average span, .gauge-trend span { min-width: 0; }
.gauge-light {
  display: inline-block;
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(16, 48, 39, .16);
  border-radius: 50%;
  background: #aab6b2;
  box-shadow: 0 0 0 2px rgba(170, 182, 178, .14);
}
.gauge-light.green { background: #23ad68; box-shadow: 0 0 0 2px rgba(35, 173, 104, .16); }
.gauge-light.yellow { background: #e7b72f; box-shadow: 0 0 0 2px rgba(231, 183, 47, .16); }
.gauge-light.orange { background: #ed791f; box-shadow: 0 0 0 2px rgba(237, 121, 31, .16); }
.gauge-light.red { background: #dc4545; box-shadow: 0 0 0 2px rgba(220, 69, 69, .16); }
.gauge-light.deep-red { background: #941f2c; box-shadow: 0 0 0 2px rgba(148, 31, 44, .18); }
.gauge-light.neutral { background: #7f969d; box-shadow: none; }
.gauge-light.pending { background: #c5cfcc; box-shadow: none; }
.gauge-trend b { min-width: 18px; color: #173f34; font-size: 15px; line-height: 1; letter-spacing: -4px; text-align: center; }
.gauge-message-area { flex: 1; min-height: 108px; margin-top: 12px; border-top: 0; border-radius: 10px; padding: 10px 11px; text-align: left; background: #f5f8f6; }
.gauge-message-title { margin: 0; color: #28704f; font-size: 12px; font-weight: 900; }
.gauge-messages { display: grid; gap: 8px; margin-top: 7px; }
.gauge-message { margin: 0; border-left: 3px solid #75b794; padding: 6px 0 6px 9px; color: #43565a; font-size: 11px; line-height: 1.4; }
.gauge-message strong { color: #20383d; }
.gauge-message a { color: #087eb8; font-weight: 800; }
.mini-gauge-chart { position: absolute; z-index: 20; top: calc(100% + 118px); bottom: auto; left: 50%; width: 214px; min-height: 112px; transform: translateX(-50%) translateY(-4px); border: 1px solid #cad8d3; border-radius: 11px; padding: 10px 11px 8px; color: #32484c; background: rgba(255,255,255,.98); box-shadow: 0 12px 30px rgba(24,46,42,.18); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s ease, transform .15s ease; }
.daily-gauge:first-child .mini-gauge-chart { left: -12px; transform: translateY(-4px); }
.daily-gauge:last-child .mini-gauge-chart { right: -12px; left: auto; transform: translateY(-4px); }
.gauge-tube:hover .mini-gauge-chart, .gauge-tube:focus-within .mini-gauge-chart { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
.daily-gauge:first-child .gauge-tube:hover .mini-gauge-chart, .daily-gauge:first-child .gauge-tube:focus-within .mini-gauge-chart, .daily-gauge:last-child .gauge-tube:hover .mini-gauge-chart, .daily-gauge:last-child .gauge-tube:focus-within .mini-gauge-chart { transform: translateY(0); }
.mini-gauge-chart > strong { display: block; font-size: 11px; }
.mini-gauge-chart > span { display: block; margin-top: 23px; color: var(--muted); font-size: 11px; text-align: center; }
.mini-gauge-chart svg { display: block; width: 100%; height: 75px; margin-top: 4px; overflow: visible; }
.mini-gauge-chart text { fill: #758387; font-size: 8px; }
.mini-chart-axis { stroke: #d9e2df; stroke-width: 1; }
.mini-chart-missing { fill: #cbd4d1; }

.calendar-card { padding: 22px; }
.calendar-key { display: flex; gap: 6px; }
.calendar-tools { display: grid; justify-items: end; gap: 8px; }
.calendar-navigation { display: flex; gap: 6px; }
.calendar-navigation button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--green);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}
.calendar-navigation button:hover { background: #edf6f1; }
.calendar-key span { width: 14px; aspect-ratio: 1; border-radius: 50%; }
.weekday-row,
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.weekday-row { margin: 18px 0 8px; color: var(--muted); font-size: 11px; font-weight: 900; text-align: center; }
.calendar-day {
  position: relative;
  display: grid;
  min-height: 62px;
  place-items: center;
  border: 1px solid #edf0ef;
  border-radius: 10px;
  color: #7f8a8d;
  background: #fbfcfb;
}
.calendar-day .day-number { position: absolute; left: 7px; top: 5px; font-size: 10px; font-weight: 800; }
.calendar-day.empty { border-color: transparent; background: transparent; }
.dot {
  width: 28px;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  box-shadow: inset -6px -7px 9px rgba(0,0,0,.15), inset 4px 4px 7px rgba(255,255,255,.45);
}
.dot:hover { transform: scale(1.12); }
.dot.future { background: #e5e8e6; box-shadow: none; cursor: default; }
.green { background: var(--green); }
.light-green { background: var(--light-green); }
.yellow { background: var(--yellow); }
.orange { background: var(--orange); }
.red { background: var(--red); }

.weekly-card,
.milestones-card,
.walk-calculator { padding: 22px; }
.week-range { color: var(--muted); font-size: 13px; }
.weekly-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 12px; }
.notes-search-open {
  min-height: 30px;
  border: 1px solid #b9d4c7;
  border-radius: 999px;
  padding: 5px 11px;
  color: #17613f;
  background: #edf6f1;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}
.notes-search-open::before { content: "⌕"; margin-right: 5px; font-size: 15px; line-height: 0; }
.notes-search-open:hover,
.notes-search-open:focus-visible { border-color: #17613f; background: #e1f2e7; outline: 3px solid rgba(23, 97, 63, .12); }
.weekly-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 18px; }
.weekly-stat { padding: 12px; border-radius: 10px; background: #f2f6f4; }
.weekly-stat span { display: block; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.weekly-stat strong { display: block; margin-top: 5px; font-size: 18px; }
details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
summary { color: #30454b; font-weight: 850; cursor: pointer; }
.week-notes p,
.previous-weeks p { margin: 8px 0; color: var(--muted); font-size: 13px; }
.previous-week { padding: 10px 0; border-bottom: 1px solid #e7ebea; }
.previous-week-notes {
  margin-top: 9px;
  border-left: 3px solid #d8e7df;
  padding: 2px 0 2px 11px;
}
.previous-week-notes-title {
  color: #30454b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.week-note {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 2px 8px;
  font-weight: 400;
}
.week-note > strong { color: #30454b; font-weight: 700; }
.week-note > span { grid-column: 2; min-width: 0; overflow-wrap: anywhere; }
.week-note b { color: #4b6259; font-weight: 700; }
.week-note-link {
  border: 0;
  padding: 2px 0;
  min-height: 24px;
  color: inherit;
  background: none;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.week-note-link:hover { color: #126b43; }
.week-note-link:focus-visible { outline: 2px solid #126b43; outline-offset: 3px; }
.no-week-notes { font-style: italic; }

.badge { border-radius: 999px; padding: 6px 10px; color: #126b43; background: #dcf5e7; font-size: 12px; font-weight: 850; }
.latest-milestone {
  margin-top: 18px;
  border-radius: 13px;
  padding: 17px;
  color: #fff;
  background: linear-gradient(135deg, #17613f, #1a9d61);
}
.latest-milestone span { display: block; color: #b9f3d2; font-size: 11px; font-weight: 900; letter-spacing: .1em; }
.latest-milestone strong { display: block; margin-top: 4px; font-size: 20px; }
.daily-walk-average {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 3px 12px;
  margin-top: 13px;
  border: 1px solid #dfe8e3;
  border-radius: 11px;
  padding: 11px 13px;
  background: #f4f8f6;
}
.daily-walk-average span { color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .09em; }
.daily-walk-average strong { color: #17613f; font-size: 17px; }
.daily-walk-average small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.milestone-list { display: grid; gap: 8px; margin-top: 13px; }
.milestone-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid #e7ebea;
  padding: 9px 2px;
}
.milestone-item i { display: grid; width: 25px; aspect-ratio: 1; place-items: center; border-radius: 50%; color: white; background: var(--green); font-style: normal; }
.milestone-item.locked i { color: #89928f; background: #e4e8e6; }
.milestone-item span { font-size: 13px; font-weight: 750; }
.milestone-item small { color: var(--muted); }

.walk-calculator {
  align-self: stretch;
  background:
    radial-gradient(circle at 95% 2%, rgba(35,190,115,.12), transparent 31%),
    var(--card);
}
.floating-calculator {
  position: fixed;
  z-index: 1000;
  top: 92px;
  right: 28px;
  width: min(430px, calc(100vw - 40px));
  max-height: calc(100vh - 120px);
  overflow: auto;
  align-self: auto;
  border-color: #b9d4c7;
  box-shadow: 0 22px 60px rgba(18, 48, 39, .28);
}
.floating-calculator[hidden] { display: none; }
.floating-calculator > .section-heading { padding-right: 42px; }
.calculator-close {
  position: absolute;
  z-index: 2;
  top: 13px;
  right: 13px;
  display: grid;
  width: 32px;
  aspect-ratio: 1;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #c94747;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.calculator-close:hover,
.calculator-close:focus-visible { background: #a92f2f; outline: 3px solid rgba(201, 71, 71, .2); }
.calculator-badge {
  border-radius: 999px;
  padding: 6px 10px;
  color: #8a6312;
  background: #fff1c7;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.calculator-modes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-top: 18px;
}
.calculator-mode {
  min-height: 38px;
  border: 1px solid #cad8d1;
  border-radius: 9px;
  color: #3d544a;
  background: rgba(255,255,255,.8);
  font-size: 12px;
  font-weight: 850;
}
.calculator-mode:hover,
.calculator-mode:focus-visible {
  border-color: #23be73;
  outline: none;
}
.calculator-mode.active {
  border-color: #17613f;
  color: white;
  background: linear-gradient(135deg, #17613f, #1a9d61);
  box-shadow: 0 5px 14px rgba(23,97,63,.2);
}
.calculator-fields {
  display: grid;
  gap: 9px;
  margin-top: 15px;
}
.calculator-fields label,
.projection-panel label {
  display: grid;
  gap: 5px;
  color: #42564e;
  font-size: 12px;
  font-weight: 800;
}
.calculator-fields label.is-required {
  border-radius: 10px;
  padding: 8px;
  background: #fff3cc;
}
.calculator-fields label.is-output { opacity: .48; }
.calculator-input {
  display: flex;
  min-height: 42px;
  align-items: center;
  overflow: hidden;
  border: 1px solid #d3ddda;
  border-radius: 9px;
  background: #fbfdfc;
}
.calculator-input:focus-within {
  border-color: #23be73;
  box-shadow: 0 0 0 3px rgba(35,190,115,.12);
}
.calculator-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 9px 10px;
  color: var(--ink);
  background: transparent;
  outline: none;
}
.calculator-input small {
  padding-right: 10px;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}
.calculator-result {
  margin-top: 15px;
  border-radius: 12px;
  padding: 14px;
  color: white;
  background: linear-gradient(135deg, #17613f, #1a9d61);
}
.calculator-result span {
  display: block;
  color: #b9f3d2;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.calculator-result strong {
  display: block;
  margin-top: 5px;
  font-size: 23px;
}
.projection-panel {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.projection-panel label { margin-top: 12px; }
.projection-results {
  margin-top: 10px;
  border-radius: 9px;
  padding: 11px;
  color: #466058;
  background: #eef5f0;
  font-size: 12px;
  line-height: 1.55;
}
.projection-results strong { color: #17613f; }
.calculator-note {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: 88vh;
  overflow: auto;
  border: 0;
  border-radius: 18px;
  padding: 27px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 25px 80px rgba(0,0,0,.36);
}
dialog::backdrop { background: rgba(9,18,20,.66); backdrop-filter: blur(3px); }
.dialog-close { position: absolute; right: 13px; top: 10px; border: 0; color: #657175; background: none; font-size: 29px; }
.score-summary { display: flex; align-items: center; gap: 15px; }
.score-summary .dot { width: 58px; }
.score-summary h2 { margin: 0; font-size: 29px; }
.daily-measurement {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 18px;
  margin-top: 18px;
  padding: 13px 15px;
  border: 1px solid #d9e7dc;
  border-radius: 12px;
  background: #f3f8f4;
}
.daily-measurement span { color: var(--muted); }
.daily-measurement strong { color: var(--green-dark); font-size: 18px; }
.daily-measurement small { grid-column: 1 / -1; color: var(--muted); font-style: italic; }
.score-section { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.score-section header { display: flex; justify-content: space-between; }
.score-section h3 { margin: 0; }
.score-section ul { display: grid; gap: 7px; padding: 0; list-style: none; }
.score-section li { display: flex; justify-content: space-between; gap: 20px; }
.impact { border-radius: 8px; padding: 9px 11px; color: #5a4934; background: #fff6dd; font-size: 13px; }
.score-conclusion { margin-top: 18px; border-radius: 10px; padding: 14px; color: #174b35; background: #e5f6ec; font-weight: 700; }
.dialog-intro { color: var(--muted); }
.weekly-dialog { width: min(760px, calc(100vw - 28px)); }
.notes-search-dialog,
.scratch-pad-dialog { width: min(680px, calc(100vw - 28px)); }
.notes-search-dialog h2,
.scratch-pad-dialog h2 { margin: 3px 36px 0 0; font-size: 28px; }
.scratch-pad-dialog[open] { display: flex; max-height: 88vh; overflow: hidden; flex-direction: column; }
.scratch-pad-date { margin: 6px 0 0; color: #17613f; font-size: 13px; font-weight: 850; }
.scratch-pad-field { display: grid; gap: 7px; margin-top: 18px; color: #30454b; font-size: 12px; font-weight: 850; }
.scratch-pad-field textarea {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  border: 1px solid #cbd9d2;
  border-radius: 11px;
  padding: 13px;
  color: var(--ink);
  background: #fbfdfc;
  font: inherit;
  font-size: 15px;
  line-height: 1.55;
  outline: none;
}
.scratch-pad-field textarea:focus { border-color: #23be73; box-shadow: 0 0 0 3px rgba(35,190,115,.14); }
.scratch-pad-actions { display: flex; min-height: 50px; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.scratch-pad-status { color: #128953; font-size: 12px; font-weight: 750; }
.scratch-pad-search { display: flex; min-height: 0; margin-top: 20px; border-top: 1px solid var(--line); padding-top: 2px; flex: 1; flex-direction: column; }
.scratch-pad-search .notes-search-results { min-height: 110px; max-height: none; flex: 1; overscroll-behavior: contain; }
.scratch-pad-dialog .notes-search-result mark { border-radius: 3px; padding: 0 2px; color: inherit; background: #ffed9a; }
.scratch-pad-show-more {
  width: 100%;
  min-height: 42px;
  border: 1px solid #9bc8ae;
  border-radius: 10px;
  color: #17613f;
  background: #edf8f1;
  font-weight: 850;
}
.scratch-pad-show-more:hover,
.scratch-pad-show-more:focus-visible { border-color: #218557; background: #e0f2e7; outline: 3px solid rgba(23,97,63,.12); }
.notes-search-field { display: grid; gap: 7px; margin-top: 20px; color: #30454b; font-size: 12px; font-weight: 850; }
.notes-search-field input {
  width: 100%;
  min-height: 47px;
  border: 1px solid #cbd9d2;
  border-radius: 11px;
  padding: 10px 13px;
  color: var(--ink);
  background: #fbfdfc;
  font: inherit;
  font-size: 16px;
  outline: none;
}
.notes-search-field input:focus { border-color: #23be73; box-shadow: 0 0 0 3px rgba(35, 190, 115, .14); }
.notes-search-summary { margin: 14px 0 9px; color: var(--muted); font-size: 12px; font-weight: 750; }
.notes-search-results { display: grid; gap: 9px; max-height: 48vh; overflow: auto; padding-right: 4px; }
.notes-search-result {
  width: 100%;
  border: 1px solid #dde7e2;
  border-radius: 11px;
  padding: 12px 13px;
  color: inherit;
  background: #f7faf8;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.notes-search-result:hover,
.notes-search-result:focus-visible { border-color: #76af91; background: #eef7f2; outline: 3px solid rgba(23, 97, 63, .12); }
.notes-search-result header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.notes-search-result header strong { color: #173f30; font-size: 14px; }
.notes-search-result header span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.notes-search-result p { margin: 7px 0 0; color: #4d625a; font-size: 13px; line-height: 1.45; }
.scratch-pad-dialog .notes-search-result p { white-space: pre-line; }
.notes-search-result b { color: #30454b; }
.notes-search-result footer { margin-top: 8px; color: #17613f; font-size: 11px; font-weight: 850; }
.notes-search-empty { margin: 0; border-radius: 11px; padding: 18px; color: var(--muted); background: #f4f7f5; text-align: center; }
.search-note-target { animation: search-note-highlight 1.8s ease-out; }
@keyframes search-note-highlight {
  0%, 28% { border-radius: 9px; box-shadow: 0 0 0 5px rgba(35, 190, 115, .24); background: rgba(35, 190, 115, .09); }
  100% { box-shadow: 0 0 0 0 rgba(35, 190, 115, 0); background: transparent; }
}
@media (prefers-reduced-motion: reduce) { .search-note-target { animation: none; } }
.weekly-profile {
  margin-top: 20px;
  border: 1px solid #cfe0d6;
  border-radius: 12px;
  padding: 0;
  background: #f4f8f5;
}
.weekly-profile summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 14px 16px;
  color: #173f30;
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}
.weekly-profile summary::-webkit-details-marker { display: none; }
.weekly-profile summary::before { content: "▸"; color: var(--green); }
.weekly-profile[open] summary::before { content: "▾"; }
.weekly-profile summary span { margin-right: auto; }
.weekly-profile summary strong {
  border-radius: 999px;
  padding: 4px 9px;
  color: #17613f;
  background: #e1f2e7;
  font-size: 11px;
}
.weekly-profile.is-incomplete summary strong { color: #914b17; background: #fff0d8; }
.weekly-profile .weekly-section-note { margin: 0 16px; }
.weekly-profile .weekly-measures { margin: 14px 16px 16px; }
.weekly-section { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.weekly-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.weekly-section-heading h3 { margin: 2px 0 0; font-size: 17px; }
.weekly-section-heading .eyebrow { margin: 0; }
.weekly-section-note { color: var(--muted); font-size: 12px; line-height: 1.45; }
.weekly-score-preview {
  display: flex;
  align-items: baseline;
  gap: 2px;
  border-radius: 999px;
  padding: 7px 11px;
  color: #17613f;
  background: #e4f3e9;
  font-size: 19px;
}
.weekly-score-preview small { font-size: 11px; }
.lifestyle-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.lifestyle-grid label { display: grid; gap: 5px; color: #33464d; font-size: 13px; font-weight: 800; }
.lifestyle-grid select { min-height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 0 9px; background: #fbfdfc; }
.weekly-measures { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.weekly-measures .input-with-unit input { font-size: 18px; padding: 10px; }
.weekly-select {
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 11px;
  color: var(--ink);
  background: #f9fbfa;
  font-size: 15px;
  font-weight: 750;
}
.weekly-goals { margin-bottom: 20px; }

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 92px minmax(0, 1fr); }
  .sidebar { padding-inline: 7px; }
  .brand > span:last-child, .sidebar-motto { display: none; }
  .content { grid-template-columns: 1fr; }
  .today-score { display: block; text-align: left; }
  .today-score-content { grid-template-columns: auto auto 1fr auto; justify-items: start; gap: 12px; }
  .today-score .eyebrow { display: none; }
  .score-orb { width: 52px; margin: 0; }
  .entry-card, .today-score, .daily-gauges-card, .calendar-card, .weekly-card, .milestones-card { grid-column: 1; grid-row: auto; }
  .daily-gauges-heading .eyebrow { display: block; }
  .calendar-card, .weekly-card, .walk-calculator { grid-column: 1; }
  .preferences-menu { left: 104px; }
}
@media (max-width: 700px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  .brand { display: none; }
  .sidebar nav { display: flex; margin: 0; }
  .sidebar nav a { min-width: 72px; min-height: 58px; }
  .sidebar nav a span { font-size: 23px; }
  .hero { min-height: 205px; padding: 25px 20px; background-position: center, center 48%; }
  .hero-date { display: none; }
  .content { padding: 12px; }
  .entry-card, .calendar-card, .weekly-card, .milestones-card, .walk-calculator { padding: 16px; }
  .entry-card > .section-heading { flex-wrap: wrap; }
  .weekly-reflection {
    order: 3;
    flex-basis: 100%;
    max-width: none;
    margin-top: 4px;
  }
  .number-grid, .promises, .notes-grid, .weekly-measures { grid-template-columns: 1fr; }
  .observation-row { grid-template-columns: minmax(0, 1fr); }
  .observation-input { width: 100%; }
  .date-controls { width: 100%; align-items: stretch; flex-direction: column; }
  .calendar-heading { align-items: flex-start; }
  .walk-row { grid-template-columns: 1fr 1fr; }
  .walk-row > strong, .walk-actions { grid-column: 1 / -1; }
  .walk-actions { justify-content: flex-end; }
  .promise-grid, .lifestyle-grid { grid-template-columns: 1fr; }
  .entry-actions { display: flex; align-items: stretch; flex-direction: column; }
  .entry-actions > .scratch-pad-open { order: 4; align-self: center; min-height: 44px; }
  .entry-actions-tools { order: 2; display: grid; grid-template-columns: 1fr; }
  .entry-actions-primary { order: 3; display: grid; grid-template-columns: 1fr 1fr; }
  .entry-actions-primary #addWalk[hidden] + #saveEntry { grid-column: 1 / -1; }
  .gauge-info-grid { grid-template-columns: 1fr; }
  .floating-calculator {
    top: auto;
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
    max-height: 82vh;
  }
  .weekly-stats { grid-template-columns: repeat(2, 1fr); }
  .calendar-day { min-height: 48px; }
  .preferences-menu { top: 72px; left: 12px; }
}

.profile-reminder {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid #c9dfd3;
  border-radius: 14px;
  background: linear-gradient(135deg, #f4faf6, #edf6f1);
  color: #153f31;
  box-shadow: 0 8px 22px rgba(24, 78, 56, .08);
}
.profile-reminder[hidden] { display: none; }
.profile-reminder-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #1d8c5b; color: #fff; font-weight: 900; }
.profile-reminder strong { display: block; font-size: 16px; }
.profile-reminder p { margin: 4px 0 0; color: #557067; font-size: 13px; line-height: 1.45; }
.profile-reminder-action { padding: 10px 14px; border-radius: 999px; background: #176744; color: #fff; font-size: 13px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.profile-reminder-action:hover { background: #104f34; }

.weekly-checkin-nudge,
.weekly-checkin-current {
  grid-column: 1 / -1;
  align-items: center;
  border: 1px solid #d9cfaa;
  border-radius: 14px;
  color: #29453b;
  background: linear-gradient(135deg, #fffdf6, #f8f3e5);
  box-shadow: 0 8px 22px rgba(91, 73, 24, .07);
}
.weekly-checkin-nudge { display: flex; justify-content: space-between; gap: 20px; padding: 15px 18px; }
.weekly-checkin-nudge[hidden],
.weekly-checkin-current[hidden] { display: none; }
.weekly-checkin-nudge-copy strong { display: block; font-size: 16px; }
.weekly-checkin-nudge-copy p { margin: 4px 0 0; color: #66746e; font-size: 13px; line-height: 1.45; }
.weekly-checkin-nudge-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.weekly-checkin-nudge-actions button { border: 0; cursor: pointer; font: inherit; }
.weekly-checkin-update { padding: 10px 14px; border-radius: 999px; color: #fff; background: #176744; font-size: 13px; font-weight: 800; white-space: nowrap; }
.weekly-checkin-update:hover,
.weekly-checkin-update:focus-visible { background: #104f34; outline: 3px solid rgba(23, 103, 68, .18); outline-offset: 2px; }
.weekly-checkin-later { padding: 8px 4px; color: #6c6757; background: transparent; font-size: 12px; font-style: italic; white-space: nowrap; }
.weekly-checkin-later:hover,
.weekly-checkin-later:focus-visible { color: #29453b; text-decoration: underline; outline: none; }
.weekly-checkin-current { display: flex; width: fit-content; gap: 8px; padding: 9px 13px; border-color: #c9dfd3; color: #176744; background: #f2f8f4; font-size: 13px; }
.weekly-checkin-current span { font-size: 16px; font-weight: 900; }

@media (max-width: 700px) {
  .profile-reminder { grid-template-columns: auto 1fr; }
  .profile-reminder-action { grid-column: 1 / -1; text-align: center; }
  .weekly-checkin-nudge { align-items: flex-start; flex-direction: column; gap: 12px; }
  .weekly-checkin-nudge-actions { width: 100%; flex-wrap: wrap; }
}

/* Use the empty sixth cell of the existing Personal Profile grid. */
.weekly-measures > label:has(#weeklyWaist) { align-self: start; }
.waist-progress { min-width: 0; align-self: start; color: #32434a; font-size: 13px; line-height: 1.45; }
.waist-progress-heading { display: flex; align-items: baseline; gap: 12px; margin-bottom: 5px; font-weight: 800; }
.waist-progress button { border: 0; padding: 2px 0; background: transparent; color: var(--green); font: inherit; font-weight: 700; cursor: pointer; }
.waist-progress button:hover { text-decoration: underline; }
.waist-progress button:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.waist-progress strong { font-weight: 800; }
.waist-progress-actions { display: flex; gap: 16px; margin-top: 5px; }
#startingWaistEditor label { display: block; margin-bottom: 5px; font-weight: 800; }

/* Waist label help and spacing within the existing profile grid. */
@media (min-width: 641px) { .waist-progress { margin-left: 16px; } }
.weekly-waist-field { align-self: start; min-width: 0; }
.waist-label-row { display: flex; align-items: center; gap: 6px; }
#waistMeasurementInfo { display: inline-grid; place-items: center; width: 15px; height: 15px; padding: 0; border: 1px solid #9eafad; border-radius: 50%; color: #496064; background: #fff; font: 700 11px/1 Georgia, serif; cursor: pointer; }
#waistMeasurementInfo:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
#waistMeasurementTip { position: fixed; inset: auto; margin: 0; box-sizing: border-box; width: 300px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow: auto; padding: 12px 14px; border: 1px solid #d8e5df; border-radius: 9px; background: #f8fbf9; color: #32434a; box-shadow: 0 5px 20px #183e3026; font: 400 13px/1.5 system-ui, sans-serif; }
#waistMeasurementTip strong { color: #174b36; font-weight: 800; }
#waistMeasurementTip p { margin: 6px 0 0; }

/* Keep the existing vertical navigation reachable on short screens. */
@media (min-width: 701px) and (max-height: 650px) {
  .sidebar { overflow-y: auto; }
  .sidebar > * { flex-shrink: 0; }
}

/* Distinguish saved individual walks without changing their fields or geometry. */
@media (min-width: 600px) and (min-height: 600px),
       (min-width: 960px) and (orientation: landscape) {
  .walk-row { background: #f1f5fa; }
}

/* Milestones: keep record dates subordinate and readable in every presentation. */
.milestones-card .milestone-detail { text-align: right; min-width: 0; }
.milestones-card .milestone-detail time { display: block; margin-top: 3px; font-size: 11px; line-height: 1.4; }
.milestones-card .milestone-item { grid-template-columns: 28px minmax(0, 1fr) minmax(0, auto); }
@media (max-width: 600px) {
  .milestones-card .milestone-item { grid-template-columns: 28px minmax(0, 1fr); }
  .milestones-card .milestone-detail { grid-column: 2; text-align: left; }
}

/* Phone relocates this presentation to Summary; Full retains Milestones. */
html[data-motionc-presentation="phone"] #dailyWalkAverage { display: none; }

/* Phone-only gauge ownership and stepper affordance. No layout dimensions change. */
html[data-motionc-presentation="phone"] .gauge-tube input { touch-action: none; }
/* A moving native thumb must not become the browser's scroll anchor. */
html[data-motionc-presentation="phone"] .gauge-tube { overflow-anchor: none; }
html[data-motionc-presentation="phone"] .gauge-stepper { position: relative; }
html[data-motionc-presentation="phone"] .gauge-stepper button {
  position: static;
  color: #fff;
  background: #345057;
  border-color: #345057;
  /* The existing 18px box plus 3px on each side makes a 24px visible circle. */
  box-shadow: 0 0 0 3px #345057;
}
html[data-motionc-presentation="phone"] .gauge-stepper button::after {
  content: "";
  position: absolute;
  bottom: -3px;
  height: 44px;
  /* Reserve the centre for the slider, and keep neighbouring targets separate. */
  width: min(44px, calc(50% - 12px));
}
html[data-motionc-presentation="phone"] .gauge-stepper button:first-child::after { left: -3px; }
html[data-motionc-presentation="phone"] .gauge-stepper button:last-child::after { right: -3px; }
html[data-motionc-presentation="phone"] .gauge-stepper button:hover,
html[data-motionc-presentation="phone"] .gauge-stepper button:active,
html[data-motionc-presentation="phone"] .gauge-stepper button:focus-visible {
  color: #fff;
  background: #345057;
  border-color: #345057;
  box-shadow: 0 0 0 3px #345057;
}
html[data-motionc-presentation="phone"] .gauge-stepper button:focus-visible {
  outline: 2px solid #345057;
  outline-offset: 5px;
}
/* The baseline's 92px minimum inner rows crowd each other below 350px.
   Move only the two inner minus controls into their available label-side space. */
@media (max-width: 349px) {
  html[data-motionc-presentation="phone"] :is(.stress-gauge, .sleep-gauge) .gauge-stepper button:first-child { margin-left: 10px; }
  html[data-motionc-presentation="phone"] :is(.stress-gauge, .sleep-gauge) .gauge-stepper button:first-child::after {
    left: 7px;
    width: min(34px, calc(50% - 22px));
  }
}

/* Explicit scroll hit targets outside the 24px control strip around the unchanged 21px thumb/92px track. */
html[data-motionc-presentation="phone"] .gauge-scroll-guard { position: absolute; touch-action: auto; }
html[data-motionc-presentation="phone"] :is(.gauge-scroll-guard-left, .gauge-scroll-guard-right) {
  top: 0; bottom: 0; width: calc(50% - 12px);
}
html[data-motionc-presentation="phone"] .gauge-scroll-guard-left { left: 0; }
html[data-motionc-presentation="phone"] .gauge-scroll-guard-right { right: 0; }
html[data-motionc-presentation="phone"] :is(.gauge-scroll-guard-top, .gauge-scroll-guard-bottom) {
  left: calc(50% - 12px); width: 24px; height: calc(50% - 46px);
}
html[data-motionc-presentation="phone"] .gauge-scroll-guard-top { top: 0; }
html[data-motionc-presentation="phone"] .gauge-scroll-guard-bottom { bottom: 0; }

/* Phone Milestones ends with its final visible metric, without a trailing divider. */
html[data-motionc-presentation="phone"] #milestoneList > .milestone-item:last-child { border-bottom: 0; }

/* Phone Milestones now contains only its weight-loss hero. */
html[data-motionc-presentation="phone"] #milestoneList:empty { display: none; }

/* Phone Milestones no longer presents a tracked-count badge. */
html[data-motionc-presentation="phone"] #milestoneCount { display: none; }

/* Unified writing: one viewport-bounded modal, fixed header, naturally scrolling body. */
.entry-actions > .scratch-pad-open.secondary-button {
  min-height: 44px; padding: 10px 18px; font-size: 14px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid #aebcba; color: #35494d; background: white;
}
.scratch-pad-dialog[open] {
  position: fixed; inset: auto 0 auto; margin: 0 auto; padding: 0;
  top: calc(var(--scratch-top, 0px) + max(12px, (var(--scratch-height, 100dvh) - 900px) / 2));
  max-height: min(900px, calc(var(--scratch-height, 100dvh) - 24px));
  width: min(680px, calc(100vw - 28px)); max-width: calc(100vw - 28px);
  display: flex; flex-direction: column; overflow: hidden;
}
.scratch-pad-header { position: relative; flex: 0 0 auto; padding: 20px 24px 14px; border-bottom: 1px solid var(--line); }
.scratch-pad-header .eyebrow { margin-top: 0; }
.scratch-pad-header .dialog-close { top: 10px; right: 10px; min-width: 44px; min-height: 44px; }
.scratch-pad-body { min-height: 0; overflow-y: auto; padding: 0 24px 24px; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; scroll-padding-block: 16px; }
.scratch-pad-section + .scratch-pad-section { border-top: 1px solid var(--line); margin-top: 20px; }
.scratch-pad-dialog .scratch-pad-field { margin-top: 18px; font-size: 14px; }
.scratch-pad-dialog .scratch-pad-field textarea { min-height: 170px; font-size: 16px; overscroll-behavior-y: auto; }
.scratch-pad-dialog #observation { min-height: 100px; height: 100px; }
.scratch-pad-help { margin: 6px 0 0; color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.5; }
.scratch-pad-dialog .scratch-pad-actions { flex-wrap: wrap; }
.scratch-pad-dialog .scratch-pad-actions .save-button { margin-left: auto; min-height: 44px; }
.scratch-highlight-emoji { position: relative; height: 30px; margin-top: 4px; }
.scratch-highlight-emoji .observation-emoji-picker { position: static; transform: none; display: flex; justify-content: flex-end; }
.scratch-highlight-emoji .observation-emoji-menu { position: static; flex-wrap: wrap; }
.scratch-pad-dialog .scratch-pad-search { flex: none; }
.scratch-pad-dialog .scratch-pad-search .notes-search-results { flex: none; max-height: 320px; min-height: 110px; overflow-y: auto; overscroll-behavior-y: auto; }
@media (max-width: 480px) {
  .scratch-pad-header { padding: 16px 16px 12px; }
  .scratch-pad-body { padding: 0 16px 20px; }
  .scratch-pad-dialog h2 { font-size: 26px; }
}

/* Keep the final phone cards stacked, including wide landscape viewports. */
html[data-motionc-presentation="phone"] :is(.calendar-card, .milestones-card, .weekly-card) {
  grid-column: 1 / -1;
}
