:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-soft: #f1f3ee;
  --surface-tint: #edf5e8;
  --ink: #161a17;
  --muted: #626a64;
  --line: #d9ded8;
  --green: #367116;
  --green-bright: #9be568;
  --green-soft: #e4f4da;
  --blue: #4d7283;
  --gold: #a16e13;
  --danger: #a33c35;
  --event-ring: rgba(224, 92, 103, 0.62);
  --event-text: #d14f5b;
  --focus: rgba(54, 113, 22, 0.14);
  --shadow: 0 10px 30px rgba(27, 36, 29, 0.055);
  --sans: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: Georgia, "Songti SC", "Noto Serif SC", serif;
  --r-card: 22px;
  --r-control: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { max-width: 100%; overflow-x: clip; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a, select, input[type="checkbox"], input[type="range"] { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 1000; padding: 10px 14px; background: var(--ink); color: #fff; border-radius: 10px; }
.skip-link:focus { top: 16px; }

.v2-shell { width: 100%; min-width: 0; min-height: 100dvh; display: flex; }
.v2-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 248px;
  padding: 15px 18px 22px;
  background: rgba(246, 247, 244, 0.96);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  transition: width 180ms ease, padding 180ms ease;
}
.sidebar-toggle { flex: 0 0 28px; width: 28px; height: 38px; display: grid; place-items: center; margin: 0 0 0 -20px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--green); font-size: 30px; line-height: 1; transition: background 140ms ease, color 140ms ease; }
.sidebar-toggle span { pointer-events: none; }
.sidebar-toggle:hover, .sidebar-toggle:focus-visible { background: var(--surface-soft); color: var(--ink); outline: 3px solid var(--focus); }
.v2-brand { display: flex; align-items: center; gap: 12px; padding: 0 14px 28px; }
.v2-brand > div { min-width: 0; }
.v2-brand strong { display: block; font: 600 24px/1.15 var(--serif); letter-spacing: -0.03em; }
.v2-brand span { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; letter-spacing: 0.08em; }
.v2-brand .v2-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: 50%;
  background: var(--green-bright);
  color: #173c07;
  font: 750 15px/1 var(--sans);
  letter-spacing: -0.08em;
}
.v2-sidebar:not(.is-collapsed) .v2-brand .v2-logo { transform: translateY(-4px); }
.v2-logo .logo-face, .v2-mobile-logo .logo-face { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.v2-nav { display: grid; gap: 4px; }
.v2-nav a {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  transition: background 140ms ease, color 140ms ease;
}
.v2-nav a:hover { background: var(--surface-soft); color: var(--ink); }
.v2-nav a.active { background: var(--green-soft); color: #173c07; font-weight: 700; }
.nav-svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.sidebar-spacer { flex: 1; }
.sidebar-save { margin: 20px 8px 0; padding: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.v2-sidebar.is-collapsed { width: 78px; padding-inline: 10px; }
.v2-sidebar.is-collapsed .v2-brand { justify-content: center; padding: 0 0 28px; }
.v2-sidebar.is-collapsed .v2-brand > div,
.v2-sidebar.is-collapsed .v2-nav a > span,
.v2-sidebar.is-collapsed .sidebar-save { display: none; }
.v2-sidebar.is-collapsed .v2-nav a { justify-content: center; padding-inline: 0; }
.v2-main { transition: width 180ms ease, max-width 180ms ease, margin-left 180ms ease; }
.v2-sidebar.is-collapsed + .v2-main { width: calc(100% - 78px); max-width: calc(100% - 78px); margin-left: 78px; }

.v2-main { width: calc(100% - 248px); max-width: calc(100% - 248px); margin-left: 248px; min-width: 0; }
.v2-topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 34px;
  background: rgba(246, 247, 244, 0.92);
  border-bottom: 1px solid rgba(217, 222, 216, 0.8);
  backdrop-filter: blur(18px);
}
.v2-topbar-brand { display: flex; align-items: center; }
.v2-mobile-logo { display: none; }
.v2-top-actions { display: flex; align-items: center; gap: 9px; }
.back-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 800; white-space: nowrap; }
.back-button:hover:not(:disabled), .back-button:focus-visible:not(:disabled) { border-color: var(--green); background: var(--green-soft); color: var(--green); outline: none; }
.back-button:disabled { cursor: default; opacity: 0.42; }
.back-button-icon { font-size: 18px; line-height: 1; }
.lang-switch { min-width: 44px; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: 0.03em; }
.lang-switch:hover, .lang-switch:focus-visible { border-color: var(--green); background: var(--green-soft); outline: none; }
.search-field { position: relative; width: min(300px, 30vw); }
.search-field svg { position: absolute; left: 14px; top: 13px; width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 2; pointer-events: none; }
.search-field input { padding-left: 40px; }
.v2-content { container-type: inline-size; width: 100%; min-width: 0; max-width: 1360px; margin: 0 auto; padding: 32px 34px 84px; }
.v2-screen { display: none; }
.v2-screen.active { display: block; animation: reveal 180ms ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.compact-banner {
  min-height: 0;
  padding: 6px 0 22px;
  border-bottom: 1px solid var(--line);
}
.compact-banner h2, .page-heading h2 {
  margin: 0;
  font: 600 clamp(34px, 4vw, 50px)/1.08 var(--serif);
  letter-spacing: -0.045em;
}
.compact-banner .home-breeze-title {
  display: grid;
  gap: 6px;
  color: var(--green);
  font: 600 25px/1.2 var(--serif);
  letter-spacing: -0.025em;
}
.home-breeze-title span { display: block; }
.home-breeze-title #homeBreezePeriod { color: var(--ink); }
.compact-banner .home-breeze-title #homeBreezeCopy {
  color: var(--green);
  font: 600 clamp(34px, 4vw, 50px)/1.08 var(--serif);
  letter-spacing: -0.045em;
}
.north-star-card { overflow: hidden; border-color: rgba(54, 113, 22, 0.24); background: linear-gradient(135deg, #fff 0%, #f0f7ea 100%); }
.breeze-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.breeze-title-line { display: flex; align-items: baseline; min-width: 0; gap: 9px; }
.breeze-title { margin: 0 !important; color: var(--ink); font: 600 22px/1.2 var(--serif) !important; letter-spacing: -0.025em; }
.breeze-head small { display: inline-block; color: var(--muted); font-size: 13px; line-height: 1; white-space: nowrap; }
.breeze-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.breeze-add-btn { min-width: 36px; min-height: 36px; font-size: 21px; line-height: 1; }
.breeze-viewport { min-height: 58px; display: flex; align-items: center; margin-top: 4px; outline: none; }
.north-star-card h3 { margin: 0; font: 600 clamp(24px, 3vw, 34px)/1.2 var(--serif); }
.breeze-viewport h3 { line-height: 1.1; }
.north-star-card.is-switching .breeze-viewport h3 { animation: breeze-swipe 700ms ease both; }
@keyframes breeze-swipe { 0% { opacity: 0; transform: translateY(8px); } 48% { opacity: 0; transform: translateY(3px); } 100% { opacity: 1; transform: translateY(0); } }
.breeze-editor { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(54, 113, 22, 0.16); }
.breeze-editor .textarea { min-height: 40px; height: 40px; }
.breeze-editor-actions { display: flex; gap: 8px; margin-top: 8px; }
.breeze-editor-actions .btn { min-height: 38px; padding: 8px 14px; }
.breeze-history { display: grid; gap: 8px; max-height: 392px; overflow-y: auto; margin-top: 12px; padding: 12px 4px 0 0; border-top: 1px solid rgba(54, 113, 22, 0.16); scrollbar-width: thin; }
.breeze-history-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.72); }
.breeze-history-row.is-current { background: rgba(228,244,218,.92); }
.breeze-history-copy { min-width: 0; }
.breeze-history-row small { color: var(--muted); font-size: 10px; }
.breeze-history-row p { margin: 2px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.breeze-history-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; white-space: nowrap; }
.breeze-history-actions .text-btn { flex: 0 0 auto; white-space: nowrap; }
.danger-text-btn { color: var(--danger); }
.page-heading { padding: 6px 0 27px; border-bottom: 1px solid var(--line); }
.page-heading h2, .page-heading p { margin-left: 0; padding-left: 0; text-align: left; }
.page-heading p { max-width: 700px; margin: 9px 0 0; color: var(--muted); font-size: 15px; }
.section { margin-top: 32px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head h3 { margin: 0; font: 600 25px/1.2 var(--serif); letter-spacing: -0.025em; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.grid { display: grid; gap: 16px; }
.grid > *, .form-grid > *, .calendar-overview-grid > *, .calendar-detail-grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home-top { grid-template-columns: 1fr; align-items: start; }
.home-left-stack { display: grid; gap: 16px; align-content: start; }
.home-mid { grid-template-columns: 4fr 8fr; }
.calendar-layout { grid-template-columns: minmax(330px, 0.8fr) minmax(500px, 1.2fr); align-items: start; }
.health-layout { grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr); }

.card {
  min-width: 0;
  max-width: 100%;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head h3, .card-head h4 { margin: 0; font: 600 22px/1.2 var(--serif); letter-spacing: -0.025em; }
.card-head h4 { font-size: 18px; }
.card-head p, .card-head small { display: block; margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.card-head-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.home-priority-card .card-head > div:first-child { min-width: 0; }
.home-priority-card .card-head-actions .text-btn { white-space: nowrap; }
html[lang="en"] .home-priority-card .card-head-actions .edit-btn { order: -1; }
.muted { color: var(--muted); }
.empty-state { padding: 24px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; font-size: 13px; }

.btn, .icon-btn, .text-btn, .edit-btn, .date-nav-btn {
  border: 0;
  transition: background 140ms ease, color 140ms ease, opacity 140ms ease;
}
.btn {
  min-height: 44px;
  padding: 10px 17px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}
.btn:hover { opacity: 0.86; }
.btn.secondary { background: var(--surface-soft); color: var(--ink); border: 1px solid var(--line); }
.btn.green { background: var(--green-bright); color: #173c07; }
.btn.danger { background: #f7e8e6; color: var(--danger); }
.text-btn { min-height: 40px; padding: 7px 9px; border-radius: 9px; background: transparent; color: var(--green); font-weight: 700; font-size: 12px; }
.text-btn:hover { background: var(--green-soft); }
.edit-btn { min-width: 52px; min-height: 52px; display: inline-grid; place-items: center; padding: 8px 11px; border-radius: 12px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 750; white-space: nowrap; }
.edit-btn:hover { background: #d5edc8; }
.icon-btn, .date-nav-btn { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--ink); }
.icon-btn:hover, .date-nav-btn:hover { background: var(--surface-soft); }
.date-nav-btn { white-space: nowrap; }
html[lang="en"] .date-nav-btn[data-action="today"],
html[lang="en"] .date-nav-btn[data-action="fitness-calendar-today"] { min-width: 72px; padding-inline: 12px; border-radius: 999px; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.danger-icon { color: var(--danger); }

.input, .select, .textarea, .inline-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cfd5cf;
  border-radius: var(--r-control);
  outline: none;
  background: #fff;
  color: var(--ink);
  box-shadow: none;
  font-size: 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.textarea { min-height: 92px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover, .inline-input:hover { border-color: #aeb7ae; }
.input:focus, .select:focus, .textarea:focus, .inline-input:focus,
.input:focus-visible, .select:focus-visible, .textarea:focus-visible, .inline-input:focus-visible {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 3px var(--focus);
}
.input::placeholder, .textarea::placeholder, .inline-input::placeholder { color: #959d96; }
.field { min-width: 0; display: grid; gap: 6px; }
.field label { color: var(--muted); font-size: 12px; font-weight: 600; }
.form-row { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.form-row > * { max-width: 100%; }
.form-row > .input { width: auto; min-width: 0; flex: 1 1 180px; }
.form-row > .btn { flex: 0 1 auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.helper { margin-top: 7px; color: var(--muted); font-size: 11px; }

.metric { min-height: 116px; display: flex; flex-direction: column; justify-content: space-between; }
.metric span { color: var(--muted); font-size: 11px; }
.metric strong { font-size: 30px; letter-spacing: -0.04em; }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e4e8e3; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.tag { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 9px; border-radius: 999px; background: var(--green-soft); color: #27520f; font-size: 11px; font-weight: 700; }
.tag.neutral { background: var(--surface-soft); color: var(--muted); }
.tag.blue { background: #e6f0f4; color: #345e72; }

.editable-list { display: grid; gap: 12px; }
.progress-overview-card #homeGoals { max-height: none; overflow: visible; overscroll-behavior: contain; padding-right: 5px; }
.progress-overview-card #homeGoals::-webkit-scrollbar { width: 6px; }
.progress-overview-card #homeGoals::-webkit-scrollbar-track { background: transparent; }
.progress-overview-card #homeGoals::-webkit-scrollbar-thumb { border-radius: 999px; background: transparent; }
.editable-row { display: grid; gap: 8px; padding: 13px 0; border-bottom: 1px solid #e8ebe7; }
.editable-row:last-child { border-bottom: 0; }
.editable-row-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.editable-row strong { font-size: 14px; }
.editable-row small { color: var(--muted); }
.edit-grid { display: grid; grid-template-columns: 1fr 92px; gap: 8px; }
.goal-edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, .8fr) 40px; gap: 8px; align-items: center; }
.goal-progress-control { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px; }
.goal-progress-input { width: 100%; min-width: 0; accent-color: var(--green); }
.goal-progress-input:disabled { cursor: not-allowed; opacity: .45; }
.goal-progress-control output { color: var(--green); font-size: 11px; font-weight: 800; }
.goal-add-btn { justify-self: start; margin-top: 4px; }
.priority-view { display: grid; gap: 0; padding-left: 17px; border-left: 1px solid var(--line); }
.priority-item { position: relative; padding: 0 0 20px 8px; }
.priority-item:last-child { padding-bottom: 0; }
.priority-item::before { content: ""; position: absolute; left: -22px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: #c7ccc7; box-shadow: 0 0 0 4px #fff; }
.priority-item:first-child::before { background: var(--green); }
.priority-item small { display: block; margin-bottom: 3px; color: var(--green); font-size: 10px; font-weight: 800; }
.priority-item span { font-weight: 650; }
.priority-item p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.home-priority-card.is-inspiration #homePriorities { animation: inspiration-reveal 180ms ease both; }
.home-inspiration-view { display: grid; gap: 10px; }
.home-inspiration-date { color: var(--muted); font-size: 11px; }
.inspiration-textarea { min-height: 126px; }
@keyframes inspiration-reveal { from { opacity: 0; transform: rotateY(-4deg) translateY(3px); } to { opacity: 1; transform: none; } }

.donut { width: 148px; height: 148px; margin: 6px auto 0; border-radius: 50%; display: grid; place-items: center; position: relative; background: conic-gradient(var(--green-bright) 0 var(--p), #e3e7e2 var(--p) 100%); }
.donut::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface); }
.donut-inner { position: relative; z-index: 1; text-align: center; }
.donut strong { display: block; font-size: 30px; }
.donut span { color: var(--muted); font-size: 10px; }
.center-card { display: grid; place-items: center; text-align: center; }
.progress-overview-card { display: flex; flex-direction: column; align-self: start; }
.progress-overview-card #homeGoals { min-height: 0; }
.home-stats-card { padding-top: 18px; padding-bottom: 18px; }
.home-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.home-stat { min-width: 0; padding: 13px 14px; border-radius: 15px; background: var(--surface-soft); }
.home-stat span, .home-stat small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.home-stat span { font-size: 11px; font-weight: 700; line-height: 1.35; }
.home-stat strong { display: block; margin: 6px 0 3px; font-size: 23px; line-height: 1; }
.home-stat small { font-size: 10px; line-height: 1.35; }
.goal-linked-note { display: block; color: var(--green); font-size: 10px; font-weight: 700; }
.inline-input:disabled { cursor: not-allowed; color: var(--muted); background: var(--surface-soft); opacity: 1; }
.progress-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.progress-ring-block { padding: 14px 10px 12px; border-radius: 16px; background: var(--surface-soft); text-align: center; }
.progress-ring-block > .muted { font-size: 11px; font-weight: 700; }
.compact-donut { width: 112px; height: 112px; margin-top: 10px; }
.compact-donut strong { font-size: 24px; }
.goal-divider { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.goal-divider strong { font: 600 17px var(--serif); }
.goal-divider span { color: var(--muted); font-size: 10px; }
.compact-home-calendar { padding: 20px; }
.compact-home-calendar .card-head { margin-bottom: 10px; }
.compact-home-calendar .card-head h3 { font-size: 19px; }
.compact-home-calendar .calendar-month { font-size: 18px; }
.compact-home-calendar .calendar-head { margin-bottom: 8px; }
.compact-home-calendar .weekdays,
.compact-home-calendar .calendar-grid { gap: 2px; }
.compact-home-calendar .cal-day { width: 36px; height: 36px; min-height: 36px; font-size: 11px; }
.compact-home-calendar .date-nav-btn { min-width: 38px; min-height: 38px; }
#homeTasks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.compact-home-calendar .calendar-caption { margin-top: 9px; padding-top: 9px; }

.calendar-card { padding: 24px; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.calendar-month { min-width: 0; font: 600 21px var(--serif); overflow-wrap: anywhere; }
.calendar-controls { display: flex; flex: 0 0 auto; gap: 4px; }
.weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.weekdays span { padding: 5px 0; color: var(--muted); text-align: center; font-size: 11px; }
.cal-day {
  position: relative;
  width: min(44px, 100%);
  aspect-ratio: 1;
  height: auto;
  min-height: 0;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}
.cal-day:hover { background: var(--surface-soft); }
.cal-day.selected { background: var(--green-bright); color: #173c07; border: 0; box-shadow: none; }
.cal-day.today:not(.selected) { box-shadow: inset 0 0 0 1px #9eaaa0; }
.cal-day.has-event::after,
.fitness-cal-day.has-event::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--event-ring);
  border-radius: 50%;
  pointer-events: none;
}
.cal-day.empty { pointer-events: none; }
.cal-dot { width: 4px; height: 4px; border-radius: 50%; background: #d7dbd7; }
.cal-dot.has { background: var(--gold); }
.cal-dot.done { background: var(--green); }
.cal-day.selected .cal-dot { background: var(--green); }
.calendar-caption { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.calendar-caption strong { display: block; color: var(--ink); font-size: 14px; }
.calendar-important-copy { color: var(--event-text); font-size: 0.92em; font-weight: 750; }

.day-dashboard { display: grid; gap: 14px; }
.day-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.summary-item { padding: 12px; border-radius: 14px; background: var(--surface-soft); }
.summary-item small { display: block; color: var(--muted); font-size: 10px; }
.summary-item strong { display: block; margin-top: 3px; font-size: 14px; }
.editable-summary-item { min-width: 0; }
.summary-control { width: 100%; min-width: 0; margin-top: 3px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: 700 14px/1.2 var(--sans); }
.summary-control:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.summary-control::placeholder { color: var(--muted); opacity: 1; font-weight: 600; }
.summary-control-row { display: flex; align-items: baseline; gap: 4px; min-width: 0; margin-top: 3px; }
.summary-control-row .summary-control { flex: 1 1 auto; margin-top: 0; }
.summary-control-row span { flex: 0 0 auto; color: var(--ink); font-size: 14px; font-weight: 700; }
.day-section { padding-top: 17px; border-top: 1px solid var(--line); }
.day-section:first-of-type { padding-top: 0; border-top: 0; }
.subhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.subhead > * { min-width: 0; }
.subhead h4 { margin: 0; font: 600 17px var(--serif); }
.todo-list { display: grid; gap: 4px; max-height: 296px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.todo-list::-webkit-scrollbar { width: 6px; }
.todo-list::-webkit-scrollbar-track { background: transparent; }
.todo-list::-webkit-scrollbar-thumb { border-radius: 999px; background: transparent; }
.todo-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 34px 34px; gap: 6px; align-items: center; min-height: 46px; padding: 5px 0; border-bottom: 1px solid #e9ece8; }
.todo-row:last-child { border-bottom: 0; }
.todo-row.done .inline-input { color: var(--muted); text-decoration: line-through; }
.todo-row .inline-input { min-height: 38px; padding: 7px 9px; border-color: transparent; background: transparent; }
.todo-row .inline-input:hover { border-color: var(--line); background: #fff; }
.check { width: 18px; height: 18px; accent-color: var(--green); }
.mini-actions { display: flex; gap: 2px; }
.mini-btn { min-width: 38px; min-height: 38px; padding: 6px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); }
.mini-btn:hover { background: var(--surface-soft); color: var(--ink); }
.mini-btn.danger:hover { background: #f7e8e6; color: var(--danger); }

.workout-overview { width: 100%; min-width: 0; max-width: 100%; padding: 15px; border-radius: 16px; background: var(--surface-tint); }
.workout-overview strong { display: block; font-size: 16px; }
.workout-overview p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.workout-overview > .subhead { align-items: flex-start; }
.workout-overview > .subhead > div:first-child { min-width: 0; flex: 1 1 auto; }
.workout-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 7px; margin-left: auto; }
.workout-actions .edit-btn,
.workout-actions .btn {
  width: 84px;
  min-width: 84px;
  height: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(55, 82, 61, 0.2);
  border-radius: 12px;
  background: #c8d6c8;
  color: #35513b;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.workout-actions .edit-btn:hover,
.workout-actions .btn:hover {
  background: #b8cab9;
  color: #2d4833;
  opacity: 1;
}
.workout-items { display: grid; gap: 8px; margin-top: 12px; }
.workout-item { display: grid; grid-template-columns: 28px minmax(0, 1.35fr) minmax(0, 0.85fr); align-items: start; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(54, 113, 22, 0.12); }
.workout-item b { color: var(--green); font-size: 12px; }
.workout-item span,
.workout-item small { min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; line-height: 1.45; }
.workout-item span { font-size: 12px; }
.workout-item small { color: var(--muted); font-size: 11px; text-align: right; white-space: normal; }
.workout-overview.is-completed .workout-item > * {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: currentColor;
  text-underline-offset: 2px;
}
.workout-editor { display: grid; gap: 12px; }
.workout-edit-meta { display: grid; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); gap: 8px; }
.workout-edit-list { display: grid; }
.workout-edit-row { display: grid; grid-template-columns: 28px minmax(0, 1.15fr) minmax(0, 0.85fr) 34px; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid rgba(54, 113, 22, 0.12); cursor: grab; transition: background .15s ease, opacity .15s ease, box-shadow .15s ease; }
.workout-edit-row:active { cursor: grabbing; }
.workout-edit-row.is-dragging { opacity: .45; }
.workout-edit-row.is-drag-over { background: rgba(54, 113, 22, 0.08); box-shadow: inset 0 2px 0 var(--green); }
.workout-edit-row > * { min-width: 0; }
.workout-edit-index { color: var(--green); font-size: 12px; font-weight: 700; cursor: grab; user-select: none; }
.workout-edit-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.workout-subtitle-output { display: flex; align-items: center; min-height: 46px; color: var(--muted); }
.workout-add-item { justify-self: start; }
.date-strip { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; align-items: center; margin-bottom: 14px; }
.date-strip-label { text-align: center; }
.date-strip-label strong { display: block; }
.date-strip-label small { color: var(--muted); }
.routine-list { display: grid; gap: 7px; }
.routine-list-scroll { max-height: 354px; overflow-y: auto; overscroll-behavior: contain; padding-right: 5px; }
.routine-row { display: grid; grid-template-columns: 22px 1fr; gap: 9px; padding: 10px 11px; border-radius: 12px; background: var(--surface-soft); }
.routine-row strong { display: block; font-size: 12px; }
.routine-row small { color: var(--muted); font-size: 10px; }
.routine-edit-list { display: grid; gap: 8px; }
.routine-edit-list.routine-list-scroll { max-height: 540px; }
.routine-edit-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 9px; align-items: start; padding: 10px 0; border-bottom: 1px solid #e9ece8; }
.routine-edit-fields { min-width: 0; display: grid; gap: 7px; }
.routine-edit-fields .field { gap: 4px; }
.routine-edit-fields .field > span { color: var(--muted); font-size: 10px; }
.routine-edit-fields .input { min-height: 38px; padding: 7px 10px; }
.routine-add-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

.project-list-section { container-type: inline-size; }
.project-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.project-section-actions { display: flex; align-items: flex-end; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.project-filter { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.project-filter .select { width: 142px; min-height: 44px; padding-top: 8px; padding-bottom: 8px; font-size: 12px; }
.project-card { position: relative; padding: 22px; scroll-margin-top: 86px; }
.project-head { display: flex; align-items: flex-start; gap: 12px; }
.project-title { min-width: 0; flex: 1 1 auto; padding-right: 170px; }
.project-status-control { position: absolute; top: 18px; right: 50px; width: 104px; min-width: 0; }
.project-status-control .select { min-height: 52px; }
.project-delete-btn { position: absolute; top: 10px; right: 10px; z-index: 1; width: 30px; min-width: 30px; height: 30px; min-height: 30px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(163, 60, 53, 0.12); border-radius: 50%; background: #fbefed; color: var(--danger); font-size: 16px; line-height: 1; }
.project-delete-btn:hover { background: #f4dcd8; color: var(--danger); transform: scale(1.04); }
.project-title-copy { min-width: 0; flex: 1 1 auto; }
.project-title-top { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.project-area-tag { align-self: flex-start; min-width: 0; max-width: min(100%, 18rem); white-space: normal; overflow-wrap: anywhere; text-align: left; line-height: 1.35; }
.project-symbol { width: 72px; height: 72px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; border: 1px solid transparent; border-radius: 16px; background: var(--green-soft); color: var(--green); font: 600 24px var(--serif); }
.project-symbol svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.project-symbol:hover, .project-symbol:focus-visible { border-color: rgba(54, 113, 22, 0.25); background: #d8efca; outline: none; transform: translateY(-1px); }
.project-title h3 { margin: 0; font: 600 20px/1.2 var(--serif); }
.project-title-input { display: block; width: min(100%, 36rem); min-width: 0; max-width: 100%; height: 54px; min-height: 54px; max-height: 54px; margin-top: 12px; padding: 2px 6px; overflow: hidden; resize: none; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); font: 600 20px/1.2 var(--serif); }
.project-title-input:hover, .project-title-input:focus { border-color: var(--line-strong, var(--line)); background: rgba(255,255,255,0.7); outline: none; }
.project-title-input:focus { overflow-y: auto; }
.project-title p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.project-fields { margin-top: 16px; }
.project-meta-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.project-review-control { min-width: 0; display: grid; grid-template-columns: 32px minmax(0, 1fr) 32px; align-items: end; gap: 4px; }
.project-review-bottom { min-width: 0; display: grid; grid-template-columns: 30px minmax(130px, 190px) 30px; align-items: center; gap: 4px; }
.project-review-field { min-width: 0; gap: 0; }
.project-review-input { min-height: 44px; padding: 10px 9px; font-size: 12px; }
.project-date-nav { width: 32px; min-width: 32px; height: 44px; min-height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); color: var(--muted); font-size: 18px; line-height: 1; }
.project-date-nav:disabled { cursor: not-allowed; opacity: .35; }
.project-date-nav:not(:disabled):hover { background: var(--green-soft); color: var(--green); }
.project-day-form { margin-top: 16px; padding: 15px; border: 1px solid rgba(91, 115, 129, 0.22); border-radius: 14px; background: rgba(230, 238, 241, 0.34); }
.project-day-fields { margin-top: 0; }
.project-day-fields .field > span { color: var(--blue); }
.project-update-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.project-update-actions .project-review-field > span { color: var(--muted); font-size: 10px; }
.project-update-actions small { min-width: 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.project-update-actions time { color: var(--ink); font-weight: 600; }
.project-progress { margin: 16px 0 0; }
.project-progress label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 12px; }
input[type="range"] { width: 100%; accent-color: var(--green); }
.project-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; }
.project-overview-row { display: grid; gap: 8px; }
.project-overview-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.project-overview-meta strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.project-overview-name { min-width: 0; overflow: hidden; padding: 0; border: 0; background: transparent; color: var(--ink); font: 700 12px/1.35 var(--sans); text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.project-overview-name:hover, .project-overview-name:focus-visible { color: var(--green); text-decoration: underline; outline: none; }
.project-card-target { border-color: var(--green) !important; box-shadow: 0 0 0 4px var(--green-soft), var(--shadow) !important; animation: projectCardTarget 1.4s ease both; }
@keyframes projectCardTarget { 0%, 100% { transform: translateY(0); } 18% { transform: translateY(-3px); } }
.project-overview-meta span { flex: 0 0 auto; color: var(--muted); font-size: 11px; font-weight: 700; }
.history { margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); }
.history summary { min-height: 40px; display: flex; align-items: center; color: var(--green); cursor: pointer; font-weight: 700; font-size: 12px; }
.history-item { display: grid; grid-template-columns: 78px 1fr auto; gap: 10px; align-items: start; padding: 9px 0; border-top: 1px solid #e9ece8; }
.history-item time { color: var(--muted); font-size: 11px; }
.history-item span { font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.history-more { margin-top: 4px; }
.history-more summary { min-height: 34px; color: var(--muted); font-size: 11px; }
.history-more[open] > summary { display: none; }
.history-scroll { max-height: 280px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.history-scroll::-webkit-scrollbar { width: 6px; }
.history-scroll::-webkit-scrollbar-track { background: transparent; }
.history-scroll::-webkit-scrollbar-thumb { border-radius: 999px; background: transparent; }
.history-more-list { display: grid; }
.calendar-project-log-list { max-height: 260px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.calendar-project-log-list::-webkit-scrollbar { width: 6px; }
.calendar-project-log-list::-webkit-scrollbar-track { background: transparent; }
.calendar-project-log-list::-webkit-scrollbar-thumb { border-radius: 999px; background: transparent; }

.line-chart-wrap { min-height: 260px; }
.line-chart { width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: #e3e7e3; stroke-width: 1; }
.chart-line { fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.health-trend-card { min-width: 0; }
.trend-switcher { display: flex; flex: 0 0 auto; gap: 5px; }
.trend-arrow { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-soft); color: var(--muted); font-size: 21px; line-height: 1; }
.trend-arrow:hover, .trend-arrow:focus-visible { border-color: var(--green); background: var(--green-soft); color: var(--green); outline: none; }
.trend-grid { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 5px; min-width: 0; padding: 9px 0 7px; }
.trend-cell { min-width: 0; aspect-ratio: 1; border: 1px solid #e1e6e0; border-radius: 4px; background: #f1f3ef; }
.trend-cell[title] { cursor: help; }
.mood-great { background: #8aca72; border-color: #7bbd65; }
.mood-steady { background: #b8d99a; border-color: #a8cc8b; }
.mood-okay { background: #dec78f; border-color: #d0b979; }
.mood-low { background: #d8a7af; border-color: #c9929c; }
.water-level-1 { background: linear-gradient(135deg, #e3f1f6, #cfe6ef); border-color: #c4dfe9; }
.water-level-2 { background: linear-gradient(135deg, #b9dce9, #9dc9dc); border-color: #91c2d6; }
.water-level-3 { background: linear-gradient(135deg, #82b9cf, #639fb9); border-color: #5d98b3; }
.water-level-4 { background: linear-gradient(135deg, #4d91ad, #2e708e); border-color: #2b6b87; }
.trend-range { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.trend-legend { display: flex; flex-wrap: wrap; gap: 9px 14px; margin-top: 13px; color: var(--muted); font-size: 10px; }
.trend-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.trend-legend-dot { width: 10px; height: 10px; display: inline-block; border: 1px solid transparent; border-radius: 3px; }
.calorie-line { stroke: var(--gold); }
.calorie-point { stroke: var(--gold); }
.calorie-average-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 15px; }
.calorie-average-item { min-width: 0; padding: 11px 10px; border-radius: 13px; background: var(--surface-soft); }
.calorie-average-item span { display: block; color: var(--muted); font-size: 10px; line-height: 1.35; }
.calorie-average-item strong { display: block; margin: 5px 0 3px; font-size: 16px; overflow-wrap: anywhere; }
.chart-point { fill: #fff; stroke: var(--green); stroke-width: 3; }
.chart-record-point { cursor: help; outline: none; }
.chart-record-point:focus { outline: none; }
.chart-record-point:focus-visible .chart-point { stroke-width: 4; filter: drop-shadow(0 0 3px rgba(54, 113, 22, 0.35)); }
.chart-hover-label { opacity: 0; pointer-events: none; fill: var(--ink); font: 700 11px var(--sans); paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; transition: opacity 120ms ease; }
.chart-record-point:hover .chart-hover-label, .chart-record-point:focus-visible .chart-hover-label { opacity: 1; }
.chart-label { fill: var(--muted); font: 11px var(--sans); }
.chart-summary { margin-top: 8px; color: var(--muted); font-size: 12px; }
.data-table { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 11px; }
.data-table th, .data-table td { padding: 7px 5px; border-top: 1px solid #e9ece8; text-align: left; }
.data-table th { color: var(--muted); font-weight: 600; }
.data-table th:last-child, .data-table td:last-child { width: 34px; text-align: right; }
.data-table-action { text-align: right !important; }
.data-table-scroll { max-height: 276px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.data-table-scroll::-webkit-scrollbar { width: 6px; }
.data-table-scroll::-webkit-scrollbar-track { background: transparent; }
.data-table-scroll::-webkit-scrollbar-thumb { border-radius: 999px; background: transparent; }
.water-meter { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; }
.water-cup { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-soft); }
.water-cup.full { background: #77a9bd; border-color: #77a9bd; }

.important-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.master-todo { display: grid; gap: 5px; }
.master-todo-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: start; padding: 9px 0; border-bottom: 1px solid #e9ece8; }
.master-todo-row:last-child { border-bottom: 0; }
.master-todo-row .fields { display: grid; gap: 7px; }
.master-todo-title-line { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.master-todo-title-line .tag { flex: 0 0 auto; }
.master-todo-title-line .inline-input { min-width: 0; }
.master-todo-row .fields input { min-height: 40px; }
.event-list { display: grid; gap: 3px; }
.event-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #e9ece8; }
.event-row[data-action="edit-event"] { cursor: pointer; }
.event-row[data-action="edit-event"]:hover { background: rgba(236, 244, 231, 0.42); }
.event-row[data-action="edit-event"]:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.event-date { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: #f6edd9; color: #7e5711; font-weight: 800; line-height: 1.05; }
.event-date small { display: block; font-size: 9px; font-weight: 600; }
.event-row strong { display: block; font-size: 13px; }
.event-row p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.event-repeat { display: inline-block; margin-top: 4px; color: var(--green); font-size: 10px; font-weight: 700; }

.quick-links { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.quick-link { min-height: 126px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; text-align: left; }
.quick-link svg { width: 24px; height: 24px; flex: 0 0 24px; margin-bottom: 22px; fill: none; stroke: var(--green); stroke-width: 1.8; }
.quick-link strong { display: block; min-height: 22px; font: 600 19px/1.15 var(--serif); }
.quick-link small { margin-top: 5px; color: var(--muted); line-height: 1.45; }
.home-task { min-height: 0; display: block; padding: 14px 16px; }
.home-task p { margin: 12px 0 auto; font-weight: 700; }
.home-task-row { min-width: 0; display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 9px; }
.home-task-row .check { margin: 0; }
.home-task-input { margin-top: 0; padding: 5px 0; border-color: transparent; background: transparent; font-weight: 700; }
.home-task-input:hover { border-color: var(--line); background: #fff; padding-inline: 9px; }
.home-task-input:focus { padding-inline: 9px; }
.compact-textarea { min-height: 64px; }

.master-todo-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
#masterTodoProgress { white-space: nowrap; }

.training-panels { align-items: start; }
.training-panel { padding: 20px; }
.training-panel .card-head { margin-bottom: 8px; }
.training-panel .card-head h3 { font-size: 19px; }
.section-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.v2-shell .section-head > div { margin-right: 0; }
.training-panel-editor { display: grid; gap: 12px; }
.training-panel-editor .card-head { margin-bottom: 0; }
.training-panel-editor-fields { gap: 8px; }
.supplementary-row-editor-list { display: grid; gap: 8px; }
.supplementary-row-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, .85fr) auto; gap: 8px; padding-top: 8px; border-top: 1px solid #e9ece8; }
.supplementary-row-remove { align-self: end; margin-bottom: 1px; }
.supplementary-add-row { justify-self: start; }
.training-panel-editor .empty-state { padding: 12px; }
.training-row-list { display: grid; }
.training-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr); align-items: start; gap: 14px; padding: 10px 0; border-top: 1px solid #e9ece8; }
.training-row strong { font-size: 12px; }
.training-row strong,
.training-row span { min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; line-height: 1.45; }
.training-row span { color: var(--muted); font-size: 11px; text-align: right; white-space: normal; }
.fitness-calendar-card { padding: 24px; }
.fitness-calendar-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr); gap: 24px; align-items: stretch; }
.fitness-calendar-pane { min-width: 0; padding-right: 24px; border-right: 1px solid var(--line); }
.fitness-calendar-pane .card-head { margin-bottom: 14px; }
.fitness-calendar-pane .calendar-head { margin-bottom: 12px; }
.fitness-calendar-grid { min-height: 0; }
.fitness-cal-day { position: relative; width: min(48px, 100%); aspect-ratio: 1; height: auto; min-height: 0; justify-self: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font-size: 13px; font-weight: 650; }
.fitness-cal-day:hover { background: var(--surface-soft); }
.fitness-cal-day.selected { background: var(--green-bright); color: #173c07; }
.fitness-cal-day.today:not(.selected) { box-shadow: inset 0 0 0 1px #9eaaa0; }
.fitness-cal-day.empty { pointer-events: none; }
.fitness-cal-marker { min-height: 14px; color: var(--muted); font-size: 12px; font-style: normal; line-height: 1; }
.fitness-cal-day.completed .fitness-cal-marker { color: var(--green); }
.fitness-cal-day.selected .fitness-cal-marker { color: var(--green); }
.fitness-weekly-summary { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.fitness-summary-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.fitness-summary-head h3 { margin: 0; font: 600 22px/1.2 var(--serif); }
.fitness-summary-head small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.fitness-summary-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.fitness-summary-stat { min-width: 0; padding: 14px 12px; border-radius: 14px; background: var(--surface-soft); }
.fitness-summary-stat span, .fitness-summary-stat small { display: block; color: var(--muted); font-size: 10px; }
.fitness-summary-stat strong { display: block; margin: 8px 0 4px; font-size: 22px; letter-spacing: -0.04em; }

.calendar-stack { display: grid; gap: 16px; }
.calendar-overview-card { padding: 24px; }
.calendar-overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; align-items: start; }
.calendar-compact-pane { min-width: 0; padding-right: 24px; border-right: 1px solid var(--line); }
.calendar-compact-pane .calendar-head { margin-bottom: 12px; }
.calendar-health-pane { min-width: 0; padding-left: 24px; }
.calendar-health-pane .card-head { margin-bottom: 0; }
.calendar-health-pane.day-dashboard { display: block; height: fit-content; min-height: 0; }
.calendar-health-pane .health-summary-section { padding-top: 0; border-top: 0; }
.calendar-health-pane .day-summary { gap: 8px; }
.calendar-health-pane .summary-item { padding: 10px; }
.calendar-health-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 14px; }
.calendar-health-pane .calendar-summary-copy { max-width: 100%; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.calendar-health-pane .day-section { padding-top: 12px; border-top: 0; }
.calendar-health-pane .form-grid { gap: 8px; }
.calendar-health-pane .textarea { min-height: 72px; }
.calendar-health-pane .health-notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.calendar-health-pane .health-notes-grid .wide { grid-column: auto; }
.day-panel-head-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.day-panel-nav { display: flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.day-panel-nav .mini-btn { width: 30px; min-width: 30px; height: 30px; min-height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-soft); font-size: 18px; line-height: 1; }
.day-panel-nav .mini-btn:hover, .day-panel-nav .mini-btn:focus-visible { border-color: var(--green); background: var(--green-soft); color: var(--green); outline: none; }
.calendar-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; gap: 16px; align-items: stretch; align-content: start; }
.calendar-detail-grid > .card.day-dashboard { align-self: stretch; display: block; height: auto; min-height: 0; container-type: inline-size; }
.calendar-detail-grid .workout-overview { height: fit-content; min-height: 0; }
.calendar-detail-grid .day-section { padding-top: 14px; }
.calendar-detail-grid .empty-state { padding: 16px; }
.calendar-bottom-grid > .card { height: 100%; }
.calendar-bottom-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.calendar-bottom-grid > * { min-width: 0; }
.calendar-inspiration-panel .inspiration-textarea { min-height: 112px; }
.calendar-completed-panel { min-width: 0; }
.footprints-stack { display: grid; gap: 16px; min-width: 0; }
.footprints-card, .footprints-metrics-card { min-width: 0; }
.footprints-head { align-items: flex-start; }
.footprints-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.footprints-filters label { display: grid; gap: 3px; color: var(--muted); font-size: 10px; }
.footprints-filters .select { width: 112px; min-height: 36px; padding: 6px 24px 6px 9px; font-size: 11px; }
.footprints-meta { display: flex; justify-content: space-between; gap: 12px; margin: 2px 0 8px; color: var(--muted); font-size: 11px; }
.footprints-grid { --footprint-size: 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--footprint-size), 1fr)); grid-auto-rows: max-content; align-content: start; align-items: start; gap: 5px; max-height: 390px; overflow-y: auto; overflow-x: hidden; padding: 10px 2px 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.footprints-grid.zoom-1 { grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 5px; }
.footprints-grid.zoom-2 { display: none; }
.footprints-grid.zoom-3 { --footprint-size: 13px; gap: 4px; }
.footprints-card.is-expanded .footprints-grid { max-height: min(62vh, 640px); }
.footprint-cell { width: 100%; min-height: 0; aspect-ratio: 1; align-self: start; display: grid; place-items: center; padding: 0; border: 1px solid #e1e6e0; border-radius: 8px; background: #f1f3ef; color: var(--ink); font: inherit; }
.footprint-cell.has-inspiration { border-color: transparent; background: linear-gradient(135deg, #a9d887, #73b858); color: #fff; box-shadow: none; cursor: pointer; font-size: clamp(8px, 1.2vw, 13px); font-weight: 800; line-height: 1; text-shadow: 0 1px 2px rgba(35, 83, 20, 0.2); }
.footprint-cell.has-inspiration > span { display: grid; width: 100%; height: 100%; place-items: center; line-height: 1; opacity: 0; transition: opacity 120ms ease; }
.footprints-grid.zoom-1 .footprint-cell.has-inspiration > span { opacity: 1; }
.footprints-grid.zoom-3 .footprint-cell.has-inspiration > span { opacity: 0; }
.footprint-cell.has-inspiration:hover { background: linear-gradient(135deg, #b5df98, #82c765); transform: translateY(-1px); }
.footprint-cell.has-inspiration:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.footprints-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.footprints-hint { margin-top: 9px; color: var(--muted); font-size: 12px; }
.footprints-footer .text-btn { flex: 0 0 auto; }
.footprints-record-list { display: grid; gap: 8px; max-height: 330px; overflow-y: auto; overflow-x: hidden; margin: 12px 0 4px; padding: 0 4px 0 0; scrollbar-width: thin; }
.footprints-record { width: 100%; min-width: 0; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: start; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); color: var(--ink); text-align: left; }
.footprints-record:hover, .footprints-record:focus-visible { border-color: var(--green); background: var(--green-soft); outline: none; }
.footprints-record time { color: var(--muted); font-size: 11px; }
.footprints-record span { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.55; }
.footprint-metrics-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.footprint-metric { min-width: 0; padding: 14px; border-radius: 14px; background: var(--surface-soft); }
.footprint-metric span, .footprint-metric small { display: block; color: var(--muted); font-size: 10px; line-height: 1.4; }
.footprint-metric strong { display: block; margin: 7px 0 4px; font-size: 19px; overflow-wrap: anywhere; }
.completed-project-list { max-height: 320px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.completed-project-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.completed-project-row:last-child { border-bottom: 0; }
.completed-project-row > div { min-width: 0; }
.completed-project-range { max-width: 42%; white-space: normal; text-align: right; overflow-wrap: anywhere; }
.completed-project-card-head { align-items: flex-start; }
.completed-project-tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.completed-project-filter { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.completed-project-filter .select { width: 132px; min-height: 34px; padding: 6px 26px 6px 9px; font-size: 11px; }
.completed-project-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; min-width: 0; }
.completed-project-title .tag { flex: 0 0 auto; margin-bottom: 0; }
.completed-project-title strong { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.completed-project-row p { margin: 4px 0 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.completed-project-description { color: var(--muted); }
.completed-project-description summary { cursor: pointer; list-style: none; }
.completed-project-description summary::-webkit-details-marker { display: none; }
.completed-project-description summary span { color: var(--green); font-weight: 700; }
.completed-project-description details p { margin-top: 6px; }
.completed-project-row time { flex: 0 0 42%; max-width: 42%; color: var(--muted); font-size: 10px; white-space: normal; text-align: right; overflow-wrap: anywhere; }
.completed-project-name { min-width: 0; padding: 0; border: 0; background: transparent; color: var(--ink); font: 600 14px/1.4 var(--sans); text-align: left; overflow-wrap: anywhere; }
.completed-project-name:hover, .completed-project-name:focus-visible { color: var(--green); text-decoration: underline; outline: none; }

.modal-backdrop { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; background: rgba(22, 26, 23, 0.34); }
.modal-card { width: min(680px, 100%); max-height: min(82vh, 680px); overflow: hidden; padding: 22px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); box-shadow: 0 20px 60px rgba(27, 36, 29, 0.18); }
.modal-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.modal-card-head h2 { max-width: 100%; margin: 4px 0 0; font: 600 clamp(22px, 4vw, 30px)/1.15 var(--serif); overflow-wrap: anywhere; }
.modal-card-head .eyebrow { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; }
.icon-button { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-soft); color: var(--muted); font-size: 20px; line-height: 1; }
.icon-button:hover, .icon-button:focus-visible { border-color: var(--green); color: var(--green); outline: none; }
.modal-history-scroll { max-height: min(58vh, 460px); overflow-y: auto; overscroll-behavior: contain; padding-right: 5px; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.modal-history-scroll:hover, .modal-history-scroll.is-scrolling { scrollbar-color: rgba(153, 169, 157, 0.52) transparent; }
.modal-history-scroll::-webkit-scrollbar { width: 7px; }
.modal-history-scroll::-webkit-scrollbar-track { background: transparent; }
.modal-history-scroll::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: transparent; background-clip: padding-box; }
.modal-history-scroll:hover::-webkit-scrollbar-thumb, .modal-history-scroll.is-scrolling::-webkit-scrollbar-thumb { background: rgba(153, 169, 157, 0.52); background-clip: padding-box; }
.modal-history-item { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.modal-history-item:last-child { border-bottom: 0; }
.modal-history-item time { color: var(--muted); font-size: 11px; }
.modal-history-item p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.inspiration-modal-card { width: min(560px, 100%); }
.modal-date { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.inspiration-modal-text { min-height: 120px; padding: 22px 4px 4px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 17px; line-height: 1.75; }
.inspiration-modal-actions { display: flex; justify-content: flex-end; padding-top: 18px; }
body.modal-open { overflow: hidden; }

.settings-stack { max-width: 820px; display: grid; gap: 14px; }
.settings-card h3 { margin: 0; font: 600 20px var(--serif); }
.settings-card p { margin: 5px 0 0; color: var(--muted); }
.settings-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.settings-actions a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translate(-50%, 12px); padding: 10px 15px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; opacity: 0; pointer-events: none; transition: 180ms ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.v2-footer { padding: 42px 0 0; color: var(--muted); text-align: center; font-size: 10px; letter-spacing: 0.07em; }
.mobile-nav-v2 { display: none; }

@container (min-width: 801px) {
  .home-top { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto; align-items: stretch; }
  .home-left-stack { display: contents; }
  .home-left-stack > article:first-child { grid-column: 1; grid-row: 1; }
  .home-left-stack > article:last-child { grid-column: 1; grid-row: 2; }
  .progress-overview-card { grid-column: 2; grid-row: 1 / span 2; height: 100%; min-height: 0; overflow: visible; align-self: stretch; }
  .progress-overview-card #homeGoals { flex: 1; }
}

/* Account for the fixed sidebar before keeping the calendar in two columns. */
@media (max-width: 1200px) {
  .calendar-layout { grid-template-columns: minmax(0, 1fr); }
}

@container (max-width: 800px) {
  .progress-overview-card { height: auto; max-height: none; overflow: visible; }
  .progress-overview-card #homeGoals { max-height: none; overflow: visible; padding-right: 4px; }
  .health-layout { grid-template-columns: 1fr; }
  .fitness-calendar-layout { grid-template-columns: 1fr; gap: 18px; }
  .fitness-calendar-pane { padding-right: 0; padding-bottom: 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .calendar-overview-grid { grid-template-columns: 1fr; }
  .calendar-detail-grid, .calendar-bottom-grid { grid-template-columns: 1fr; }
  .calendar-compact-pane { padding: 0 0 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .calendar-health-pane { padding: 4px 0 0; }
}

@media (max-width: 1120px) {
  .home-mid, .calendar-layout, .important-layout { grid-template-columns: 1fr; }
}

@container (max-width: 800px) {
  .project-list { grid-template-columns: 1fr; }
}

@container (min-width: 736px) {
  .v2-main.is-sidebar-collapsed .project-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body { font-size: 14px; }
  .v2-sidebar, .sidebar-toggle { display: none; }
  .v2-sidebar.is-collapsed + .v2-main { width: 100%; max-width: 100%; margin-left: 0; }
  .v2-main { width: 100%; max-width: 100%; margin-left: 0; }
  .v2-topbar { height: 64px; padding: 0 14px; }
  .v2-mobile-logo { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--green-bright); color: #173c07; font: 750 12px/1 var(--sans); letter-spacing: -0.08em; }
  .back-button { width: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 6px; background: transparent; font-size: 22px; }
  .back-button-label { display: none; }
  .search-field { width: min(210px, 54vw); }
  .lang-switch { min-width: 40px; padding-inline: 8px; }
  .v2-content { padding: 22px 14px 96px; }
  .compact-banner { padding: 2px 2px 18px; }
  .compact-banner h2, .page-heading h2 { font-size: 36px; }
  .page-heading p { font-size: 14px; }
  .input, .select, .textarea, .inline-input { font-size: 16px; }
  .grid-2, .grid-3, .grid-4, .home-top, .quick-links, .project-overview { grid-template-columns: 1fr; }
  .card { padding: 18px; border-radius: 18px; }
  .health-trend-card .card-head { align-items: center; }
  .trend-grid { grid-template-columns: repeat(18, minmax(0, 1fr)); gap: 4px; }
  .trend-arrow { width: 34px; height: 34px; }
  .card-head-actions { gap: 5px; }
  .calorie-average-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-links { grid-template-columns: 1fr 1fr; gap: 10px; }
  .quick-link { min-height: 118px; padding: 15px; }
  .calendar-layout { gap: 12px; }
  .calendar-card { padding: 16px; }
  .cal-day { width: min(40px, 100%); height: auto; min-height: 0; }
  .compact-home-calendar .cal-day { width: min(40px, 100%); height: auto; min-height: 0; }
  .calendar-overview-grid { gap: 16px; }
  .calendar-health-pane .health-notes-grid { grid-template-columns: 1fr; }
  .progress-pair { gap: 8px; }
  .home-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress-ring-block { padding-inline: 6px; }
  .compact-donut { width: 104px; height: 104px; }
  .goal-divider { align-items: flex-start; }
  .goal-divider span { max-width: 120px; text-align: right; }
  .goal-edit-grid { grid-template-columns: minmax(0, 1fr) minmax(88px, .7fr) 40px; }
  .fitness-summary-stats { gap: 7px; }
  .fitness-summary-stat { padding: 11px 9px; }
  .fitness-summary-stat strong { font-size: 18px; }
  .day-summary { grid-template-columns: 1fr 1fr; }
  .calendar-health-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .project-meta-fields { grid-template-columns: 1fr; }
  .project-review-control { grid-template-columns: 32px minmax(0, 1fr) 32px; }
  .form-grid .wide { grid-column: auto; }
  .form-row { align-items: stretch; }
  .form-row .input { min-width: 0; }
  .project-head { flex-direction: column; }
  .project-section-head { align-items: flex-start; flex-direction: column; }
  .project-section-actions { width: 100%; justify-content: space-between; align-items: center; }
  .project-filter { flex: 1 1 auto; }
  .project-filter .select { width: 100%; }
  .project-title { width: 100%; padding-right: 0; }
  .project-status-control { position: static; width: 104px; align-self: flex-end; }
  .project-update-actions { align-items: flex-start; flex-direction: column; }
  .project-review-bottom { width: 100%; grid-template-columns: 32px minmax(0, 1fr) 32px; }
  .project-update-actions .btn { width: 100%; }
  .section-actions { width: 100%; justify-content: flex-start; margin-left: 0; }
  .completed-project-card-head { flex-direction: column; }
  .completed-project-tools { width: 100%; justify-content: space-between; }
  .completed-project-row { flex-wrap: wrap; gap: 8px; }
  .completed-project-row > time { margin-left: auto; white-space: normal; text-align: right; overflow-wrap: anywhere; }
  .footprints-head { flex-direction: column; }
  .footprints-filters { width: 100%; justify-content: flex-start; }
  .footprints-filters label { flex: 1 1 120px; }
  .footprints-filters .select { width: 100%; }
  .footprints-grid { --footprint-size: 20px; max-height: 330px; gap: 4px; }
  .footprints-grid.zoom-1 { grid-template-columns: repeat(18, minmax(0, 1fr)); gap: 4px; }
  .footprints-grid.zoom-2 { display: none; }
  .footprints-grid.zoom-3 { --footprint-size: 12px; gap: 3px; }
  .footprints-footer { align-items: flex-start; flex-direction: column; gap: 7px; }
  .footprints-footer .text-btn { align-self: flex-end; }
  .footprints-record { grid-template-columns: 1fr; gap: 4px; }
  .footprint-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-backdrop { padding: 12px; }
  .modal-card { padding: 17px; }
  .modal-history-item { grid-template-columns: 1fr; gap: 4px; }
  .workout-edit-meta { grid-template-columns: 1fr; }
  .workout-edit-row { grid-template-columns: 24px minmax(0, 1fr) 34px; align-items: start; }
  .workout-edit-row .field:nth-child(2), .workout-edit-row .field:nth-child(3) { grid-column: 2; }
  .workout-row-remove { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
  .training-row { grid-template-columns: minmax(0, 1fr) minmax(0, 118px); align-items: start; }
  .training-row span { max-width: 118px; white-space: normal; }
  .supplementary-row-editor { grid-template-columns: minmax(0, 1fr) auto; }
  .supplementary-row-editor .field:first-child { grid-column: 1 / -1; }
  .supplementary-row-editor .field:nth-child(2) { grid-column: 1; }
  .supplementary-row-remove { grid-column: 2; grid-row: 2; }
  .mobile-nav-v2 {
    position: fixed;
    z-index: 30;
    left: 7px;
    right: 7px;
    bottom: max(7px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 3px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255,255,255,0.96);
    box-shadow: 0 12px 32px rgba(22, 26, 23, 0.16);
    backdrop-filter: blur(16px);
  }
  .mobile-nav-v2 a { min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 12px; color: var(--muted); font-size: 9px; }
  .mobile-nav-v2 a.active { background: var(--green-soft); color: #173c07; font-weight: 700; }
  .mobile-nav-v2 svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
}

@media (max-width: 390px) {
  .v2-topbar-brand { display: none; }
  .v2-topbar { justify-content: flex-end; }
  .search-field { width: calc(100vw - 138px); }
  .cal-day { width: min(38px, 100%); height: auto; min-height: 0; font-size: 11px; }
  .card { padding: 16px; }
  .trend-grid { grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 3px; }
  .footprints-grid.zoom-1 { grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 3px; }
  .home-stats-grid { grid-template-columns: 1fr; }
  .quick-links { grid-template-columns: 1fr 1fr; }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 960px) {
  .mobile-nav-v2 { grid-template-columns: repeat(5, minmax(70px, 1fr)); left: auto; overflow-x: auto; max-width: calc(100vw - 14px); }
  .v2-content { padding-bottom: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@container (max-width: 661px) {
  #homeTasks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container (max-width: 435px) {
  #homeTasks { grid-template-columns: 1fr; }
}

/* Keep every scrollbar quiet until its scroll surface is active. */
html, body, .v2-shell, .v2-shell *, .mobile-nav-v2 { scrollbar-width: thin; scrollbar-color: transparent transparent; }
html.is-scrolling, body.is-scrolling, .v2-shell *:hover, .v2-shell *.is-scrolling, .mobile-nav-v2:hover, .mobile-nav-v2.is-scrolling { scrollbar-color: rgba(153, 169, 157, 0.52) transparent; }
html::-webkit-scrollbar, body::-webkit-scrollbar, .v2-shell::-webkit-scrollbar, .v2-shell *::-webkit-scrollbar, .mobile-nav-v2::-webkit-scrollbar { width: 8px; height: 8px; }
html::-webkit-scrollbar-track, body::-webkit-scrollbar-track, .v2-shell::-webkit-scrollbar-track, .v2-shell *::-webkit-scrollbar-track, .mobile-nav-v2::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb, .v2-shell::-webkit-scrollbar-thumb, .v2-shell *::-webkit-scrollbar-thumb, .mobile-nav-v2::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: transparent; background-clip: padding-box; }
html.is-scrolling::-webkit-scrollbar-thumb, body.is-scrolling::-webkit-scrollbar-thumb, .v2-shell *:hover::-webkit-scrollbar-thumb, .v2-shell *.is-scrolling::-webkit-scrollbar-thumb, .mobile-nav-v2:hover::-webkit-scrollbar-thumb, .mobile-nav-v2.is-scrolling::-webkit-scrollbar-thumb { background: rgba(153, 169, 157, 0.52); background-clip: padding-box; }
html::-webkit-scrollbar-corner, body::-webkit-scrollbar-corner, .v2-shell::-webkit-scrollbar-corner, .v2-shell *::-webkit-scrollbar-corner, .mobile-nav-v2::-webkit-scrollbar-corner { background: transparent; }
