@charset "UTF-8";
:root {
  color-scheme: light;
  --bg: #f4f2ed;
  --paper: #faf8f3;
  --ink: #24221f;
  --muted: #716b63;
  --line: #d9d3c9;
  --accent: #b4452e;
  --danger: #a0443b;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: var(--sans);
  --mono: var(--sans);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, a { touch-action: manipulation; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button, a, input, textarea { transition: color 180ms, background-color 180ms, border-color 180ms, opacity 180ms; }
button:disabled { cursor: wait; opacity: .5; }
button:active, .button:active { opacity: .7; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { font-weight: 500; line-height: 1.4; }
h1 { font-size: 34px; letter-spacing: 0; }
h2 { font-size: 20px; letter-spacing: 0; }
[hidden] { display: none !important; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; stroke-width: 1.5; vertical-align: middle; }
.app-shell { width: min(100% - 112px, 1024px); margin: 0 auto; }
.site-header { display: flex; align-items: center; gap: 28px; min-height: 96px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 14px; white-space: nowrap; font-size: 17px; font-weight: 500; letter-spacing: 2px; }
.brand-mark { font: italic 42px/.9 var(--display); letter-spacing: -6px; padding-right: 6px; margin-top: -5px; }
.brand-caption { padding-left: 25px; border-left: 1px solid var(--line); font-size: 8px; letter-spacing: 1.7px; color: var(--muted); }
.main-nav { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 6px; justify-content: center; min-width: 58px; min-height: 44px; padding: 8px 12px; font-size: 12px; color: var(--muted); }
.nav-item > .icon { display: none; }
.nav-item.active { color: var(--ink); }
.nav-item.active::after { position: absolute; content: ""; width: 15px; height: 1px; background: var(--ink); left: calc(50% - 7.5px); bottom: 4px; }
.nav-item:hover { color: var(--ink); background: #eeeee7; }
.nav-record { color: var(--paper); background: var(--ink); border-radius: 2px; margin-left: 8px; padding: 9px 18px; order: 4; }
.nav-record > .icon { display: block; width: 15px; height: 15px; }
.nav-record:hover, .nav-record.active { color: var(--paper); background: #44463e; }
.nav-record.active::after { display: none; }
main { min-height: 60vh; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 10; padding: 12px 18px; background: var(--ink); color: white; }
.skip-link:focus { top: 12px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 48px 0 38px; }
.eyebrow { display: block; color: var(--muted); font-size: 9px; letter-spacing: 2px; margin-bottom: 9px; }
.title-period { font-family: var(--display); color: var(--accent); margin-left: 3px; }
.edition-date { display: flex; flex-direction: column; align-items: flex-end; padding-right: 2px; }
.edition-date > span { font-family: var(--mono); color: var(--muted); font-size: 10px; letter-spacing: 1px; }
.edition-date > strong { font: 58px/1.05 var(--display); letter-spacing: -3px; }
.person-1 { --person: #94634b; --person-soft: #f2ede7; }
.person-2 { --person: #4f6975; --person-soft: #ebeff0; }
.person-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--person, var(--muted)); flex: 0 0 auto; }
.user-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); background: var(--paper); }
.weight-card { min-width: 0; padding: 23px 32px 12px; }
.weight-card + .weight-card { border-left: 1px solid var(--line); }
.weight-card-top { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.weight-card-top h2 { display: flex; align-items: baseline; gap: 9px; font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.weight-card-top .person-dot { align-self: center; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); flex: 0 0 auto; }
.icon-button .icon { width: 17px; height: 17px; }
.icon-button:hover { background: #edeee7; color: var(--ink); }
.card-record { color: var(--ink); margin-right: -12px; }
.card-record .icon { width: 21px; height: 21px; stroke-width: 1.25; }
.record-state { font-size: 11px; color: var(--muted); margin-top: -2px; }
.record-state.recorded { color: var(--person); }
.current-weight { display: flex; align-items: baseline; gap: 10px; padding-top: 25px; }
.current-weight strong { font: 88px/1 var(--display); letter-spacing: -4px; font-variant-numeric: lining-nums tabular-nums; }
.current-weight > span { font-size: 13px; color: var(--muted); }
.weight-comparison { display: flex; align-items: center; gap: 5px; min-height: 25px; margin-top: 9px; font-size: 10px; color: var(--muted); }
.weight-comparison time { margin-left: auto; }
.delta { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; font-family: var(--mono); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta .icon { width: 11px; height: 11px; }
.delta.down { color: #536957; }
.delta.up { color: #97604d; }
.delta.neutral { color: var(--muted); }
.weight-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 20px 0; margin-top: 20px; border-top: 1px solid var(--line); }
.weight-stats dt { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.weight-stats dd { font: 24px/1.3 var(--display); font-variant-numeric: lining-nums tabular-nums; }
.goal-progress { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 10px; padding: 3px 0 10px; }
.goal-progress strong { font: 10px/1.6 var(--mono); color: var(--person); }
.progress-track { width: 100%; display: block; height: 2px; border: 0; background: var(--line); accent-color: var(--person); }
.progress-track::-webkit-progress-bar { background: var(--line); }
.progress-track::-webkit-progress-value { background: var(--person); }
.progress-track::-moz-progress-bar { background: var(--person); }
.card-footer-link, .card-footer-meta { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-top: 6px; font-size: 10px; color: var(--muted); }
.card-footer-link:hover { color: var(--ink); }
.card-footer-link .icon { width: 12px; height: 12px; }
.trend-panel { margin-top: 40px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; }
.section-heading h2 { display: flex; align-items: baseline; gap: 16px; }
.section-index { color: var(--muted); font: 10px/1.5 var(--mono); }
.range-switch { display: flex; align-items: center; gap: 4px; }
.range-switch a { display: flex; align-items: center; justify-content: center; position: relative; min-width: 46px; min-height: 44px; padding: 8px 10px; color: var(--muted); font-size: 11px; text-align: center; }
.range-switch a.selected { color: var(--ink); }
.range-switch a.selected::after { position: absolute; content: ""; height: 1px; bottom: 4px; left: 10px; right: 10px; background: var(--ink); }
.range-switch a:hover { color: var(--ink); background: #eeeee6; }
.trend-people { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0; }
.trend-people a { display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 7px 12px; font-size: 11px; color: var(--muted); border: 1px solid transparent; max-width: 45%; overflow-wrap: anywhere; }
.trend-people a.selected { border-color: var(--line); color: var(--ink); background: var(--paper); }
.trend-people a:hover { background: #eeeee6; }
.chart-unit { margin-left: auto; color: var(--muted); font: 10px/1 var(--mono); }
.chart-layout { display: flex; gap: 12px; }
.chart-y-axis { display: flex; flex-direction: column; justify-content: space-between; width: 35px; height: 230px; padding: 18px 0; color: var(--muted); font: 10px/1.4 var(--mono); }
.chart-canvas { min-width: 0; flex: 1; position: relative; }
.weight-chart { display: block; width: 100%; height: 230px; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: .75; vector-effect: non-scaling-stroke; }
.chart-line { stroke: var(--person); fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-series.person-2 .chart-line { stroke-dasharray: 5 4; }
.chart-point { fill: var(--bg); stroke: var(--person); stroke-width: 1.5; vector-effect: non-scaling-stroke; cursor: pointer; }
.chart-point:hover, .chart-point:focus { fill: var(--person); stroke-width: 3; outline: none; }
.chart-x-axis { display: flex; justify-content: space-between; gap: 5px; padding-top: 12px; font: 10px/1.5 var(--mono); color: var(--muted); }
.chart-tooltip { position: absolute; top: 4px; right: 4px; padding: 7px 11px; color: white; background: var(--ink); font-size: 11px; max-width: 100%; pointer-events: none; z-index: 1; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 260px; padding: 30px 0; color: var(--muted); font-size: 12px; }
.chart-empty { min-height: 174px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 12px; position: relative; }
.empty-axis { width: 27px; height: 19px; border-bottom: 1px solid #9a9c91; border-left: 1px solid #9a9c91; margin-bottom: 10px; }
.text-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; font-size: 11px; color: var(--ink); }
.text-link .icon { width: 14px; height: 14px; }
.text-link:hover { color: var(--accent); }
.recent-panel { margin-top: 38px; }
.recent-panel > .section-heading { border-bottom: 1px solid var(--ink); padding-bottom: 12px; }
.recent-empty { min-height: 100px; }
.entry-list { margin-top: 10px; }
.entry-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); }
.entry-date strong { display: block; font: 26px/1.1 var(--display); font-variant-numeric: lining-nums tabular-nums; }
.entry-date small { display: block; color: var(--muted); font: 9px/1.5 var(--mono); margin-top: 5px; }
.entry-person { display: flex; align-items: center; gap: 7px; font-size: 12px; overflow-wrap: anywhere; }
.entry-person small { color: var(--muted); font-size: 9px; margin-left: 3px; }
.entry-description p { font-size: 11px; color: var(--muted); margin-top: 5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.entry-numbers { text-align: right; }
.entry-numbers strong { display: block; font: 29px/1.2 var(--display); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.entry-numbers strong small { font: 10px/1.5 -apple-system, BlinkMacSystemFont, sans-serif; color: var(--muted); margin-left: 5px; }
.entry-numbers .delta { display: flex; margin-top: 4px; }
.site-footer { display: flex; justify-content: space-between; gap: 16px; padding: 28px 0 36px; margin-top: 38px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.site-footer > span:last-child { letter-spacing: 1.6px; font-size: 8px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 12px 24px; border: 1px solid transparent; border-radius: 2px; font-size: 13px; cursor: pointer; }
.button .icon { width: 17px; height: 17px; }
.button-primary { background: var(--ink); color: var(--paper); }
.button-primary:hover { background: #44463e; }
.button-secondary { background: transparent; border-color: var(--line); color: var(--ink); }
.button-secondary:hover { background: #eeeee6; }
.button-danger { color: white; background: var(--danger); }
.button-danger:hover { background: #8d352c; }
.button-full { width: 100%; }
.history-panel { border-top: 1px solid var(--ink); }
.history-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.filter-switch { min-width: 0; max-width: 85%; }
.filter-switch a { max-width: 180px; overflow-wrap: anywhere; }
.count-label { color: var(--muted); font-size: 11px; white-space: nowrap; }
.history-panel .entry-row { grid-template-columns: 88px minmax(0, 1fr) auto auto; }
.entry-actions { display: flex; gap: 3px; }
.delete-button:hover { color: var(--danger); background: #f2e8e4; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 22px; margin-top: 28px; font: 11px/1.5 var(--mono); color: var(--muted); }
.pagination .button { font-size: 12px; padding: 8px 15px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.settings-card { padding: 25px 32px 30px; min-width: 0; }
.settings-card + .settings-card { border-left: 1px solid var(--line); }
.settings-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 27px; }
.settings-card-heading h2 { display: flex; align-items: center; gap: 10px; font-size: 17px; overflow-wrap: anywhere; }
.user-index { font: 14px/1 var(--sans); color: var(--muted); }
.field-label { display: flex; align-items: center; gap: 5px; margin: 24px 0 8px; font-size: 12px; }
.field-label span { color: var(--muted); font-size: 10px; }
input:not([type="radio"]):not([type="hidden"]), textarea { width: 100%; min-width: 0; min-height: 48px; display: block; appearance: none; -webkit-appearance: none; background: transparent; color: var(--ink); border: 0; border-bottom: 1px solid #c8cabf; padding: 10px 0; border-radius: 0; font-size: 16px; }
input:hover, textarea:hover { border-bottom-color: var(--ink); }
input:focus, textarea:focus { outline: none; border-bottom: 2px solid var(--ink); padding-bottom: 9px; }
input[type="date"] { text-align: left; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type="number"] { -moz-appearance: textfield; }
input::placeholder, textarea::placeholder { color: var(--muted); font-size: 13px; opacity: 1; }
textarea { min-height: 70px; resize: vertical; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.form-row > div { min-width: 0; }
.field-help { margin-top: 20px; font-size: 11px; color: var(--muted); }
.settings-actions { display: flex; justify-content: flex-end; margin-top: 28px; }
.form-error { background: #f5eae4; color: #913c32; padding: 10px 12px; margin: 18px 0; font-size: 12px; }
.sheet, .confirm-dialog { width: min(100% - 40px, 440px); max-height: calc(100dvh - 48px); padding: 30px; border: 1px solid var(--line); border-radius: 3px; background: var(--bg); color: var(--ink); overflow-y: auto; overscroll-behavior: contain; }
dialog::backdrop { background: #24252066; backdrop-filter: blur(3px); }
.modal-open { overflow: hidden; }
.sheet-handle { display: none; }
.sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.sheet-heading h1, .sheet-heading h2 { font-size: 27px; }
.sheet-heading > .icon-button { margin: -7px -12px -7px 0; }
.person-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0; border: 0; margin: 0 0 25px; }
.person-picker legend { font-size: 12px; margin-bottom: 10px; }
.person-choice { position: relative; cursor: pointer; min-width: 0; }
.person-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice-content { display: flex; align-items: center; gap: 9px; min-height: 51px; padding: 10px 12px; border: 1px solid var(--line); font-size: 12px; overflow-wrap: anywhere; }
.choice-content > span:nth-child(2) { flex: 1; }
.choice-check { opacity: 0; color: var(--ink); }
.choice-check .icon { width: 14px; height: 14px; }
.person-choice input:checked + .choice-content { border-color: var(--ink); background: var(--paper); }
.person-choice input:checked + .choice-content .choice-check { opacity: 1; }
.person-choice input:focus-visible + .choice-content { outline: 2px solid var(--accent); outline-offset: 3px; }
.weight-input-wrap { position: relative; }
.weight-input-wrap input { height: 86px; font: 500 52px/1 var(--sans) !important; letter-spacing: 0; padding: 6px 42px 6px 0 !important; }
.weight-input-wrap input::placeholder { font: 500 52px/1 var(--sans); color: #7b7e74; }
.weight-input-wrap > span { position: absolute; right: 0; bottom: 21px; font-size: 14px; color: var(--muted); }
.lookup-notice { padding: 10px 0; font-size: 11px; color: var(--accent); }
.record-form .button[type="submit"] { margin-top: 30px; justify-content: space-between; }
.standalone-record { width: min(100%, 420px); margin: 45px auto 0; }
.confirm-dialog { max-width: 380px; }
.confirm-dialog h2 { font-size: 25px; }
.confirm-dialog p { font-size: 12px; color: var(--muted); margin-top: 14px; overflow-wrap: anywhere; }
.confirm-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.toast { display: flex; align-items: center; gap: 9px; padding: 3px 8px 3px 14px; border: 1px solid var(--line); font-size: 12px; margin-top: 20px; background: var(--paper); }
.toast > .icon { width: 16px; height: 16px; }
.toast .icon-button { margin-left: auto; }
.error-page { text-align: center; padding: 80px 0; }
.error-page h1 { font-size: 30px; }
.error-page p { color: var(--muted); font-size: 13px; margin-top: 14px; }
.error-page .button { margin-top: 28px; }
@media (max-width: 900px) {
  .app-shell { width: calc(100% - 64px); }
  .brand-caption { display: none; }
  .weight-card, .settings-card { padding-left: 24px; padding-right: 24px; }
  .current-weight strong { font-size: 76px; }
}
@media (max-width: 680px) {
  .app-shell { width: calc(100% - 40px); max-width: 500px; }
  .site-header { min-height: 79px; justify-content: space-between; gap: 12px; }
  .brand { font-size: 16px; gap: 14px; letter-spacing: 2px; }
  .brand-mark { font-size: 38px; }
  .brand-caption { display: block; padding: 0; border: 0; font-size: 7px; letter-spacing: 1.5px; }
  .main-nav { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 9px max(12px, calc((100vw - 500px)/2)) calc(9px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #f8f8f4f5; backdrop-filter: blur(14px); z-index: 5; }
  .nav-item { flex-direction: column; min-width: 0; gap: 4px; padding: 6px 0; min-height: 48px; font-size: 10px; }
  .nav-item > .icon { display: block; width: 19px; height: 19px; }
  .nav-item.active::after { display: none; }
  .nav-item.active { font-weight: 600; }
  .nav-record { order: initial; margin: 0; background: transparent; color: var(--ink); }
  .nav-record > .icon { width: 29px; height: 23px; padding: 2px 5px; color: var(--paper); background: var(--ink); border-radius: 2px; }
  .nav-record:hover, .nav-record.active { color: var(--ink); background: #eeeee6; }
  .page-heading { padding: 30px 0 28px; gap: 16px; }
  h1 { font-size: 30px; letter-spacing: -1px; }
  .eyebrow { font-size: 8px; letter-spacing: 1.6px; margin-bottom: 6px; }
  .edition-date > span { font-size: 8px; letter-spacing: .5px; }
  .edition-date > strong { font-size: 45px; letter-spacing: -2px; }
  .weight-card { padding: 13px 17px 5px; }
  .weight-card-top h2 { gap: 7px; font-size: 12px; }
  .card-record { margin-right: -12px; }
  .card-record .icon { width: 18px; height: 18px; }
  .record-state { font-size: 10px; margin-top: -3px; }
  .current-weight { gap: 6px; padding-top: 22px; }
  .current-weight strong { font-size: clamp(37px, 12.8vw, 60px); letter-spacing: -2px; }
  .current-weight > span { font-size: 10px; }
  .weight-comparison { gap: 3px; font-size: 9px; min-height: 20px; margin-top: 7px; flex-wrap: wrap; }
  .weight-comparison .delta { font-size: 9px; }
  .weight-comparison time { display: none; }
  .weight-stats { display: flex; flex-direction: column; gap: 8px; padding: 16px 0; margin-top: 16px; }
  .weight-stats > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
  .weight-stats dt { font-size: 10px; margin: 0; }
  .weight-stats dd { font-size: 20px; line-height: 1.2; }
  .goal-progress { font-size: 9px; padding: 0 0 9px; gap: 4px; }
  .goal-progress strong { font-size: 9px; }
  .card-footer-meta, .card-footer-link { font-size: 9px; margin-top: 1px; }
  .trend-panel { margin-top: 28px; }
  .section-heading { gap: 10px; }
  .section-heading h2 { font-size: 18px; gap: 11px; }
  .section-index { font-size: 9px; }
  .range-switch { gap: 0; }
  .range-switch a { font-size: 10px; padding: 8px; min-width: 44px; }
  .range-switch a.selected::after { left: 9px; right: 9px; bottom: 5px; }
  .trend-people { gap: 3px; margin: 8px 0 12px; }
  .trend-people a { padding: 7px 9px; font-size: 10px; gap: 6px; }
  .chart-unit { font-size: 9px; }
  .weight-chart { height: 185px; }
  .chart-y-axis { height: 185px; padding: 13px 0; width: 28px; font-size: 9px; }
  .chart-layout { gap: 6px; }
  .chart-x-axis { font-size: 8px; padding-top: 9px; }
  .chart-tooltip { font-size: 10px; }
  .chart-empty { min-height: 145px; }
  .empty-state { font-size: 11px; }
  .recent-panel { margin-top: 28px; }
  .recent-panel > .section-heading { padding-bottom: 8px; }
  .recent-empty { min-height: 80px; }
  .text-link { font-size: 10px; }
  .entry-row { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; padding: 16px 0; }
  .entry-date strong { font-size: 23px; }
  .entry-date small { font-size: 8px; }
  .entry-person { font-size: 11px; gap: 6px; flex-wrap: wrap; }
  .entry-person small { font-size: 8px; margin: 0; }
  .entry-description p { font-size: 10px; }
  .entry-numbers strong { font-size: 26px; }
  .entry-numbers strong small { font-size: 9px; margin-left: 3px; }
  .entry-numbers .delta { font-size: 9px; }
  .site-footer { padding: 21px 0 calc(98px + env(safe-area-inset-bottom)); margin-top: 28px; font-size: 9px; }
  .site-footer > span:last-child { font-size: 7px; letter-spacing: 1px; }
  .desktop-record { display: none; }
  .history-toolbar { padding: 9px 0; gap: 8px; }
  .filter-switch { max-width: 86%; }
  .filter-switch a { font-size: 10px; padding: 8px 10px; min-width: 44px; max-width: 112px; }
  .count-label { font-size: 10px; }
  .history-panel .entry-row { grid-template-columns: 52px minmax(0, 1fr) auto 36px; gap: 8px; }
  .history-panel .entry-numbers strong { font-size: 24px; }
  .entry-actions { flex-direction: column; gap: 0; }
  .entry-actions .icon-button { margin-left: -4px; }
  .entry-actions .icon { width: 15px; height: 15px; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-card { padding: 23px 0 28px; }
  .settings-card + .settings-card { border-left: 0; border-top: 1px solid var(--line); }
  .settings-card-heading { margin-bottom: 20px; }
  .settings-card-heading h2 { font-size: 16px; }
  .settings-actions { margin-top: 24px; }
  .settings-actions .button { width: 100%; justify-content: space-between; }
  .sheet { width: 100%; max-width: 500px; margin: auto auto 0; max-height: calc(100dvh - 16px); border-radius: 12px 12px 0 0; padding: 11px 24px calc(26px + env(safe-area-inset-bottom)); }
  .sheet-handle { display: block; width: 28px; height: 2px; background: #c5c7bb; margin: 0 auto 24px; }
  .sheet-heading { margin-bottom: 28px; }
  .sheet-heading h1, .sheet-heading h2 { font-size: 26px; }
  .person-picker { gap: 10px; margin-bottom: 22px; }
  .field-label { margin-top: 22px; }
  .weight-input-wrap input, .weight-input-wrap input::placeholder { font-size: 48px !important; }
  .standalone-record { margin-top: 32px; }
  .confirm-dialog { width: calc(100% - 40px); padding: 26px; }
  .error-page h1 { font-size: 26px; }
}
@media (max-width: 360px) {
  .app-shell { width: calc(100% - 32px); }
  .weight-card { padding-left: 13px; padding-right: 13px; }
  .weight-card-top h2 { font-size: 11px; gap: 5px; }
  .weight-card-top .person-dot { width: 4px; height: 4px; }
  .current-weight strong { font-size: 39px; }
  .weight-stats dd { font-size: 18px; }
  .history-panel .entry-row { grid-template-columns: 48px minmax(0,1fr) auto 32px; gap: 6px; }
  .history-panel .entry-numbers strong { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* A compact editorial canvas, sized to the visible mobile viewport. */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
h1, h2, .brand { letter-spacing: 0; }
.entry-date strong { font: 500 18px/1.3 var(--sans); }
.entry-numbers strong { font: 500 26px/1.3 var(--sans); }
.home-document { height: 100%; overflow: hidden; scrollbar-gutter: auto; overscroll-behavior: none; }
.home-page { height: var(--app-height, 100dvh); min-height: 0; overflow: hidden; overscroll-behavior: none; background: var(--bg); }
.home-page .app-shell { width: min(100% - 48px, 560px); height: 100%; }
.home-page main { height: 100%; min-height: 0; display: flex; }
.home-view { display: grid; grid-template-rows: 44px minmax(0, 1fr); gap: clamp(16px, 4dvh, 36px); width: 100%; min-height: 0; padding: max(12px, env(safe-area-inset-top)) 0 max(20px, env(safe-area-inset-bottom)); }
.home-topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.home-user-menu { position: relative; z-index: 3; max-width: calc(100% - 64px); }
.home-user-menu summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 0; color: var(--ink); cursor: pointer; list-style: none; font-size: 15px; font-weight: 500; }
.home-user-menu summary > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-user-menu summary::-webkit-details-marker { display: none; }
.home-user-menu summary .icon { width: 12px; height: 12px; transform: rotate(90deg); color: var(--muted); }
.home-user-menu summary:hover { color: var(--accent); }
.home-menu-content { position: absolute; top: calc(100% + 8px); left: -8px; width: 224px; max-width: calc(100vw - 32px); max-height: calc(var(--app-height, 100dvh) - 100px); overflow: auto; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px #24221f12; }
.home-menu-content a, .home-install-button { display: block; width: 100%; min-height: 48px; padding: 11px 14px; font-size: 15px; border-radius: 6px; overflow-wrap: anywhere; text-align: left; }
.home-install-button { border: 0; background: transparent; color: var(--ink); }
.home-menu-content a:hover, .home-install-button:hover, .home-menu-content a[aria-current] { background: #eae5dc; }
.home-menu-content a[aria-current] { font-weight: 500; }
.home-menu-divider { border-top: 1px solid var(--line); margin: 6px 8px; }
.home-record-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border-radius: 50%; background: transparent; color: var(--ink); }
.home-record-button .icon { width: 23px; height: 23px; stroke-width: 1.25; }
.home-record-button:hover, .home-record-button:active { background: #e6e0d6; }
.person-viewport { min-width: 0; min-height: 0; touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; cursor: grab; }
.person-viewport:active { cursor: grabbing; }
.person-panel { height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(132px, .85fr) minmax(112px, 1fr); gap: clamp(20px, 4dvh, 36px); animation: person-appear 180ms ease-out; }
.home-reading { display: flex; flex-direction: column; justify-content: center; min-width: 0; min-height: 0; padding-bottom: clamp(16px, 3dvh, 28px); border-bottom: 1px solid var(--line); }
.home-reading-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); }
.home-reading-meta p { font-size: 13px; }
.home-reading-meta time { font-variant-numeric: tabular-nums; }
.home-weight-value { display: flex; align-items: baseline; gap: 12px; margin: 18px 0 0 -5px; font: 400 clamp(68px, min(27vw, 23dvh), 132px)/1 var(--sans); letter-spacing: -5px; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.home-weight-value small { font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.home-trend { min-height: 0; display: flex; flex-direction: column; }
.home-trend-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.home-trend-heading h2 { font-size: 13px; font-weight: 500; }
.chart-year { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.home-page .chart-layout { --plot-height: 200px; flex: 1; min-height: 0; gap: 10px; }
.home-page .chart-y-axis { height: var(--plot-height); width: 32px; flex-shrink: 0; padding: max(0px, calc(var(--plot-height) / 10 - 9px)) 0; font: 12px/18px var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.home-page .chart-canvas { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) 28px; }
.home-page .weight-chart { height: 100%; min-height: 0; overflow: visible; }
.home-page .chart-grid { stroke: var(--line); stroke-width: .65; }
.home-page .chart-line { stroke: var(--ink); stroke-width: 2; stroke-dasharray: none; }
.chart-date-guide { display: none; }
.chart-datum { outline: none; cursor: pointer; }
.chart-hit { fill: transparent; }
.chart-halo { fill: var(--accent); opacity: 0; pointer-events: none; }
.home-page .chart-point { fill: var(--accent); stroke: var(--bg); stroke-width: 2; opacity: 0; pointer-events: none; }
.chart-datum.is-latest .chart-point, .chart-datum.is-active .chart-point, .chart-datum:focus-visible .chart-point { opacity: 1; }
.chart-datum.is-latest .chart-halo { opacity: .09; }
.chart-datum.is-active .chart-halo, .chart-datum:focus-visible .chart-halo { opacity: .18; }
.chart-crosshair { stroke: var(--muted); stroke-width: .65; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.home-page .chart-x-axis { color: var(--muted); font: 12px/18px var(--sans); padding-top: 10px; font-variant-numeric: tabular-nums; }
.chart-x-axis.is-positioned { position: relative; display: block; height: auto; min-height: 0; }
.chart-x-axis.is-positioned time { position: absolute; white-space: nowrap; }
.home-page .chart-tooltip { display: grid; grid-template-columns: auto auto; column-gap: 5px; align-items: baseline; right: auto; font: 12px/1.5 var(--sans); padding: 10px 13px; border-radius: 6px; background: var(--ink); font-variant-numeric: tabular-nums; }
.chart-tooltip-date { grid-column: 1 / -1; font-size: 11px; color: #e8e3db; margin-bottom: 2px; }
.chart-tooltip-weight { font-size: 20px; line-height: 1.3; font-weight: 500; }
.chart-tooltip small { font-size: 11px; color: #e8e3db; white-space: nowrap; }
.home-chart-empty { flex: 1; min-height: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; border-bottom: 1px solid var(--line); }
.home-page .toast { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(100% - 48px, 320px); margin: 0; z-index: 6; border-radius: 8px; font-size: 14px; }
.sheet { max-height: calc(var(--app-height, 100dvh) - 16px); }
.install-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.install-heading h2 { font-size: 22px; }
.install-dialog ol { padding-left: 22px; margin: 0 0 28px; font-size: 15px; }
.install-dialog li + li { margin-top: 12px; }
.offline-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; text-align: center; }
.offline-page h1 { font-size: 24px; margin-bottom: 12px; }
.offline-page p { color: var(--muted); font-size: 15px; margin-bottom: 24px; }
@keyframes person-appear { from { opacity: .4; transform: translateX(5px); } to { opacity: 1; transform: translateX(0); } }
@media (max-width: 680px) {
  .nav-item { font-size: 12px; }
  .entry-date strong { font-size: 17px; }
  .history-panel .entry-numbers strong { font-size: 24px; }
}
@media (max-height: 500px) {
  .home-view { gap: 12px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .person-panel { gap: 16px; grid-template-rows: minmax(110px, .85fr) minmax(86px, 1fr); }
  .home-reading { padding-bottom: 12px; }
  .home-weight-value { margin-top: 10px; font-size: clamp(56px, min(24vw, 21dvh), 100px); letter-spacing: -3px; }
  .home-trend-heading { margin-bottom: 6px; }
  .home-page .chart-canvas { grid-template-rows: minmax(0, 1fr) 24px; }
  .home-page .chart-x-axis { padding-top: 6px; }
}
@media (min-width: 600px) and (max-height: 500px) {
  .home-page .app-shell { width: min(100% - 64px, 960px); }
  .person-panel { grid-template-rows: 1fr; grid-template-columns: .85fr 1.15fr; gap: 32px; }
  .home-reading { padding: 0 24px 0 0; border-bottom: 0; border-right: 1px solid var(--line); }
  .home-reading-meta { display: block; }
  .home-reading-meta time { display: block; margin-top: 4px; }
  .home-weight-value { font-size: clamp(56px, 11vw, 100px); }
}
