.screen.health-mode .health-view { padding-top: 5.5cqw; }
.screen.health-mode .health-stack > .health-card.health-records-card {
  width: calc(100% - 4.6cqw);
  margin-left: 2.3cqw;
  padding: 5.2cqw 3.2cqw 4.4cqw;
  border-radius: 6.2cqw;
  overflow: visible;
  --hr-green: #769e51;
  --hr-green-deep: #638741;
  --hr-pale: #eef3df;
  --hr-ink: #555d59;
  --hr-muted: #91968e;
  --hr-line: rgba(199,190,171,.56);
}

.hr-head { position: relative; padding: 0 .8cqw 3.5cqw; }
.hr-title { display: flex; align-items: center; gap: 2.1cqw; color: #505658; font-size: clamp(18px,4.55cqw,30px); font-weight: 680; }
.hr-title svg { width: 5.2cqw; height: 5.2cqw; flex: 0 0 auto; color: var(--hr-green); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hr-title small { display: block; margin-top: 1.1cqw; color: var(--hr-muted); font-size: clamp(11px,2.75cqw,18px); font-weight: 400; }
.hr-date-nav { display: grid; grid-template-columns: 9cqw 1fr 9cqw; align-items: center; gap: 1cqw; margin-top: 3.8cqw; padding: 1.2cqw; border-radius: 4.2cqw; background: rgba(244,242,229,.74); }
.hr-date-nav button { min-height: 8.4cqw; border: 0; border-radius: 3cqw; background: transparent; cursor: pointer; }
.hr-date-nav button:active { background: rgba(225,233,205,.72); transform: scale(.97); }
.hr-date-arrow { color: #7f887c; font-size: clamp(19px,5cqw,30px); }
.hr-date-arrow:disabled { opacity: .25; cursor: default; }
.hr-date-current { color: #59615c; font-size: clamp(14px,3.7cqw,24px); font-weight: 680; }

.hr-calendar { position: absolute; z-index: 12; left: .8cqw; right: .8cqw; top: 26.5cqw; padding: 3.2cqw; border: 1px solid rgba(210,201,181,.72); border-radius: 5cqw; background: rgba(253,250,241,.98); box-shadow: 0 18px 42px rgba(103,92,70,.2); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.hr-calendar-head { display: grid; grid-template-columns: 9cqw 1fr 9cqw; align-items: center; margin-bottom: 2.2cqw; }
.hr-calendar-head button { min-height: 8cqw; border: 0; border-radius: 2.5cqw; background: transparent; color: #7b8579; font-size: 20px; }
.hr-calendar-head strong { text-align: center; color: #5e665f; font-size: clamp(13px,3.25cqw,20px); }
.hr-weekdays,.hr-calendar-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 1cqw; }
.hr-weekdays span { padding: 1cqw 0; text-align: center; color: #a0a299; font-size: clamp(9px,2.3cqw,14px); }
.hr-calendar-day { position: relative; aspect-ratio: 1; border: 0; border-radius: 2.5cqw; background: transparent; color: #6f756f; font-size: clamp(11px,2.8cqw,17px); }
.hr-calendar-day.has-data::after { content: ""; position: absolute; left: 50%; bottom: .7cqw; width: .8cqw; height: .8cqw; border-radius: 50%; background: var(--hr-green); transform: translateX(-50%); }
.hr-calendar-day.selected { background: var(--hr-green); color: #fff; font-weight: 680; }
.hr-calendar-day.selected::after { background: #fff; }

.hr-day { border: 1px solid rgba(220,211,191,.58); border-radius: 5.2cqw; background: rgba(255,253,247,.72); overflow: hidden; }
.hr-score { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 2.6cqw; align-items: center; margin: 3.2cqw 3.2cqw 0; padding: 3.1cqw 3.2cqw; border-radius: 4cqw; background: rgba(238,243,223,.8); }
.hr-score-number { color: var(--hr-green-deep); font-size: clamp(27px,7.1cqw,44px); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.hr-score-number span { margin-left: .5cqw; font-size: clamp(11px,2.8cqw,17px); font-weight: 650; }
.hr-score-copy strong { display: block; color: #5f685f; font-size: clamp(13px,3.35cqw,21px); font-weight: 680; }
.hr-score-copy span { display: block; margin-top: 1.1cqw; color: #7f867d; font-size: clamp(10px,2.6cqw,16px); line-height: 1.4; }
.hr-mood { width: 10cqw; height: 10cqw; display: grid; place-items: center; border: 0; border-radius: 3.2cqw; background: rgba(255,255,255,.56); font-size: clamp(22px,5.7cqw,36px); }

.hr-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1.4cqw; padding: 2.2cqw 3.2cqw 3.2cqw; }
.hr-stat { min-width: 0; border: 0; border-radius: 3.2cqw; background: rgba(246,243,232,.78); padding: 2.5cqw .8cqw 2.1cqw; text-align: center; }
.hr-stat:active { background: rgba(229,236,207,.7); transform: scale(.97); }
.hr-stat svg { display: block; width: 4.8cqw; height: 4.8cqw; margin: 0 auto; color: #7f9770; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hr-stat strong { display: block; min-width: 0; margin-top: 1.2cqw; overflow: hidden; color: #606961; font-size: clamp(12px,3.15cqw,20px); font-weight: 680; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.hr-stat small { margin-left: .2cqw; color: #858d83; font-size: clamp(7px,1.9cqw,12px); font-weight: 500; }

.hr-group { padding: 2.7cqw 3.2cqw 3cqw; border-top: 1px dashed var(--hr-line); }
.hr-heading { display: flex; align-items: center; justify-content: space-between; gap: 2cqw; margin-bottom: 1.4cqw; color: #687168; font-size: clamp(13px,3.35cqw,21px); font-weight: 680; }
.hr-heading-main { display: flex; align-items: center; gap: 1.7cqw; }
.hr-heading svg { width: 5.2cqw; height: 5.2cqw; padding: 1cqw; border-radius: 2cqw; background: var(--hr-pale); color: var(--hr-green); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hr-total { color: #75845e; font-size: clamp(11px,2.7cqw,17px); font-weight: 650; white-space: nowrap; }
.hr-meal { width: 100%; min-height: 11cqw; display: grid; grid-template-columns: 10.5cqw minmax(0,1fr) auto 2.8cqw; gap: 1.7cqw; align-items: center; border: 0; border-radius: 2.8cqw; background: transparent; padding: 1.8cqw .7cqw 1.8cqw 7cqw; text-align: left; }
.hr-meal:active,.hr-event:active { background: rgba(229,236,207,.58); }
.hr-meal-label { color: #8f938c; font-size: clamp(11px,2.7cqw,17px); }
.hr-meal-value { min-width: 0; color: #565d59; font-size: clamp(13px,3.2cqw,20px); line-height: 1.45; text-wrap: pretty; }
.hr-meal-value.empty { color: var(--hr-green-deep); }
.hr-meal-calorie { color: #8b907f; font-size: clamp(10px,2.5cqw,16px); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hr-action { color: #a5a79f; font-size: 15px; }
.hr-add-icon { display: block; width: 6.6cqw; height: 6.6cqw; color: var(--hr-green-deep); fill: rgba(237,243,223,.76); stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.hr-log { max-height: 50cqw; overflow-y: auto; overflow-x: hidden; margin: .5cqw 0 2cqw 7cqw; padding-right: 1.5cqw; scrollbar-width: thin; scrollbar-color: rgba(118,158,81,.66) rgba(225,221,207,.5); scrollbar-gutter: stable; }
.hr-log::-webkit-scrollbar { width: 6px; }
.hr-log::-webkit-scrollbar-track { border-radius: 99px; background: rgba(225,221,207,.5); }
.hr-log::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(118,158,81,.66); }
.hr-event { position: relative; width: 100%; min-height: 12.5cqw; display: grid; grid-template-columns: 9cqw 3cqw minmax(0,1fr) auto; gap: 1.7cqw; align-items: center; border: 0; border-radius: 2.7cqw; background: transparent; padding: 1.8cqw .5cqw; text-align: left; }
.hr-event:not(:last-child)::after { content: ""; position: absolute; z-index: 0; left: 13.2cqw; top: 50%; width: 1px; height: 100%; background: rgba(155,174,130,.52); }
.hr-event time { color: #92978f; font-size: clamp(10px,2.55cqw,16px); font-variant-numeric: tabular-nums; }
.hr-event-dot { position: relative; z-index: 1; width: 2cqw; height: 2cqw; margin-left: .4cqw; border: 2px solid #f9f8ef; border-radius: 50%; background: var(--hr-green); box-shadow: 0 0 0 1px rgba(118,158,81,.35); }
.hr-event-copy b { display: block; color: #626a64; font-size: clamp(12px,3cqw,19px); font-weight: 650; }
.hr-event-copy small { display: block; margin-top: .5cqw; color: #8e938c; font-size: clamp(10px,2.5cqw,16px); line-height: 1.35; }
.hr-source { color: #71805f; font-size: clamp(10px,2.5cqw,16px); font-weight: 650; white-space: nowrap; }
.hr-empty { padding: 5cqw 2cqw; color: #93978f; font-size: clamp(12px,2.9cqw,18px); line-height: 1.55; text-align: center; }
.hr-quick { display: flex; flex-wrap: wrap; gap: 1.5cqw; padding: 1cqw 0 0 7cqw; }
.hr-quick button { border: 1px solid rgba(204,197,177,.58); border-radius: 2.7cqw; background: rgba(255,255,255,.48); padding: 2cqw 2.4cqw; color: #6f7c6c; font-size: clamp(10px,2.55cqw,16px); }
.hr-add { width: calc(100% - 6.4cqw); margin: 3cqw 3.2cqw 3.5cqw; border: 0; border-radius: 3.7cqw; background: var(--hr-green); color: #fff; padding: 3.1cqw; font-size: clamp(13px,3.35cqw,21px); font-weight: 680; box-shadow: 0 8px 18px rgba(109,145,74,.18); }

.hr-shade { position: absolute; inset: 0; z-index: 20; background: rgba(58,54,45,.2); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .24s ease, visibility 0s linear .24s; backdrop-filter: blur(2px); }
.hr-shade.open { opacity: 1; pointer-events: auto; }
.hr-shade.open { visibility: visible; transition-delay: 0s; }
.hr-sheet { position: absolute; z-index: 21; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; height: 88%; max-height: 760px; overflow: hidden; visibility: hidden; pointer-events: none; border-radius: 7cqw 7cqw 0 0; background: #fbf8ef; box-shadow: 0 -22px 55px rgba(87,78,61,.22); transform: translateY(105%); transition: transform .3s cubic-bezier(.2,.75,.25,1), visibility 0s linear .3s; }
.hr-sheet.open { visibility: visible; pointer-events: auto; transform: translateY(0); transition-delay: 0s; }
.screen.health-editor-open .tab-bar { opacity: 0; visibility: hidden; pointer-events: none; }
.hr-sheet-grab { width: 9cqw; height: 1cqw; margin: 2.2cqw auto 1cqw; border-radius: 99px; background: #d9d4c7; }
.hr-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 2.3cqw 4.2cqw 3cqw; border-bottom: 1px solid var(--hr-line); }
.hr-sheet-title strong { display: block; color: #555d59; font-size: clamp(17px,4.3cqw,27px); }
.hr-sheet-title span { display: block; margin-top: .8cqw; color: var(--hr-muted); font-size: clamp(10px,2.6cqw,16px); }
.hr-close { width: 8cqw; height: 8cqw; border: 0; border-radius: 50%; background: #eeeadd; color: #6f736f; font-size: 18px; }
.hr-form { flex: 1; min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior: contain; padding: 3.5cqw 4.2cqw 25cqw; }
.hr-form-section { padding: 3.4cqw 0 3.8cqw; border-bottom: 1px dashed rgba(194,184,164,.56); }
.hr-form-section:first-child { padding-top: .6cqw; }
.hr-form-section h3 { margin: 0 0 1cqw; color: #5f685f; font-size: clamp(14px,3.55cqw,22px); }
.hr-form-hint { margin: 0 0 2.5cqw; color: #969a92; font-size: clamp(10px,2.55cqw,16px); line-height: 1.5; }
.hr-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 2.3cqw; }
.hr-field { min-width: 0; }
.hr-field.wide { grid-column: 1 / -1; }
.hr-field label { display: block; margin: 0 0 1.3cqw .4cqw; color: #8f938c; font-size: clamp(10px,2.55cqw,16px); }
.hr-field input,.hr-field select,.hr-field textarea { width: 100%; border: 1px solid rgba(206,197,178,.6); border-radius: 3cqw; background: rgba(255,255,255,.58); color: #565d5a; outline: none; padding: 2.7cqw 3cqw; font-size: clamp(13px,3.2cqw,20px); }
.hr-field textarea { min-height: 17cqw; resize: vertical; line-height: 1.5; }
.hr-field input:focus,.hr-field select:focus,.hr-field textarea:focus { border-color: #8ead6d; box-shadow: 0 0 0 3px rgba(142,173,109,.12); }
.hr-type-choices,.hr-choice-row { display: flex; flex-wrap: wrap; gap: 1.7cqw; }
.hr-choice { border: 1px solid rgba(204,196,177,.62); border-radius: 999px; background: rgba(255,255,255,.54); padding: 2.1cqw 3cqw; color: #6f7771; font-size: clamp(11px,2.7cqw,17px); }
.hr-choice.active { border-color: rgba(118,158,81,.56); background: var(--hr-pale); color: var(--hr-green-deep); font-weight: 650; }
.hr-specific { display: none; }
.hr-specific.active { display: block; }
.hr-sheet-actions { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: .72fr 1.28fr; gap: 2.3cqw; padding: 2.8cqw 4.2cqw max(3.5cqw,env(safe-area-inset-bottom)); border-top: 1px solid var(--hr-line); background: rgba(251,248,239,.96); backdrop-filter: blur(14px); }
.hr-sheet-actions.new { grid-template-columns: 1fr; }
.hr-btn { border: 0; border-radius: 3.5cqw; padding: 3.2cqw; font-size: clamp(13px,3.2cqw,20px); font-weight: 680; }
.hr-btn.secondary { background: #ebe7dc; color: #8a6259; }
.hr-btn.primary { background: var(--hr-green); color: #fff; box-shadow: 0 8px 18px rgba(109,145,74,.2); }
.hr-btn:disabled { opacity: .55; }

@media (max-width: 360px) {
  .hr-score { grid-template-columns: auto minmax(0,1fr) auto; gap: 2cqw; }
  .hr-meal { padding-left: 4.5cqw; grid-template-columns: 9cqw minmax(0,1fr) auto 2.5cqw; }
}
