:root {
  color-scheme: light;
  --bg: #f6f7f1;
  --paper: #fffefa;
  --ink: #192c25;
  --muted: #52635a;
  --line: #dce4da;
  --green: #244a39;
  --accent: #407454;
  --lime: #d9ee9c;
  --nav: 68px;
  --gutter: clamp(16px, 4vw, 28px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-synthesis: none;
  -webkit-tap-highlight-color: transparent;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, select { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:disabled { cursor: wait; opacity: .6; }
button, input, select, textarea { border: 1px solid var(--line); }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #427f5c; outline-offset: 3px; }
main:focus { outline: none; }
svg { flex: none; vertical-align: middle; }
p, h1, h2 { margin: 0; }
p { line-height: 1.48; }
h1, h2 { line-height: 1.15; letter-spacing: -.032em; }
h1 { font-size: clamp(1.85rem, 5.5vw, 2.55rem); font-weight: 780; }
h2 { font-size: 1.13rem; font-weight: 740; }
ul { margin: 0; padding: 0; list-style: none; }
abbr { text-decoration: none; }
.shell {
  width: min(100%, 800px);
  margin: auto;
  padding: max(15px, env(safe-area-inset-top)) var(--gutter) calc(var(--nav) + env(safe-area-inset-bottom) + 23px);
}
.top { display: flex; align-items: center; justify-content: space-between; padding-bottom: 13px; border-bottom: 1px solid var(--line); margin-bottom: 15px; }
.brand { display: inline-flex; align-items: center; gap: 11px; line-height: 1.08; border-radius: 14px; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; background: var(--green); border-radius: 15px; color: #e1f2ab; }
.brand strong { display: block; font-size: 1.29rem; letter-spacing: -.045em; }
.today-label { display: block; margin-top: 5px; font-size: .78rem; color: var(--muted); }
.icon-button, .small-button, .primary, .secondary, .danger, .text-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; border-radius: 13px; font-size: .875rem; font-weight: 700; line-height: 1.12;
  transition: background-color .14s ease, border-color .14s ease;
}
.icon-button { width: 44px; flex: 0 0 44px; padding: 0; background: var(--paper); }
.menu-button { border-color: #d1ddcf; }
.primary { background: var(--lime); border-color: #c9e087; color: #203926; padding: 0 13px; }
.secondary, .small-button { background: var(--paper); padding: 0 12px; }
.secondary { border-color: #d2ded1; }
.small-button { padding: 0 8px; font-size: .77rem; }
.danger { background: #922f30; color: white; border-color: #922f30; padding: 0 12px; }
.text-danger { background: transparent; border-color: transparent; color: #922f30; padding: 0 4px; margin-right: auto; }
button:active, .secondary:active { filter: brightness(.95); }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 13px; }
.page-heading p { color: var(--muted); font-size: .89rem; margin-top: 4px; }
.page-heading .primary { flex-shrink: 0; }
.overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 13px; }
.overview {
  text-align: left; width: 100%;
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 105px;
  background: var(--tile); border: 1px solid var(--edge); color: var(--tile-ink);
  border-radius: 17px; padding: 9px 11px 10px; transition: border-color .14s ease;
}
.mint { --tile: #e7efe3; --edge: #d8e5d4; --tile-ink: #294737; --chip: #d4e5d2; }
.peach { --tile: #f7ebdc; --edge: #eddecc; --tile-ink: #603f24; --chip: #efdbc3; }
.blue { --tile: #e5edf5; --edge: #d5e2ee; --tile-ink: #28445e; --chip: #d2e1f0; }
.violet { --tile: #f1eaf2; --edge: #e8dbe9; --tile-ink: #533951; --chip: #e8daeb; }
.overview-top { display: flex; align-items: center; justify-content: space-between; }
.overview-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 11px; background: var(--chip, #e4efde); color: inherit; flex: none; }
.overview-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.overview h2 { font-size: .72rem; letter-spacing: .003em; font-weight: 650; }
.overview strong { font-size: clamp(.95rem, 3.65vw, 1.19rem); font-weight: 760; letter-spacing: -.037em; line-height: 1.14; }
.overview-copy > span { font-size: .71rem; line-height: 1.15; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; }
.eyebrow { font-size: .66rem; text-transform: uppercase; letter-spacing: .105em; font-weight: 750; color: var(--muted); line-height: 1.24; margin-bottom: 4px; }
.calendar { padding: 11px 10px 10px; }
.calendar-top, .agenda-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.calendar-top { padding: 0 3px; margin-bottom: 7px; }
.calendar-top h2 { font-size: clamp(1.04rem, 4vw, 1.29rem); }
.calendar-actions { display: flex; align-items: center; gap: 3px; }
.calendar-actions .icon-button { border-color: transparent; background: #f0f4eb; }
.weekdays, .month-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; }
.weekdays { text-align: center; font-size: .71rem; font-weight: 720; color: var(--muted); padding: 4px 0 2px; }
.day {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 44px; background: transparent; border: 1px solid transparent; border-radius: 10px;
  padding: 2px 0; font-size: .83rem; font-weight: 650;
}
.day.today { color: #203e2c; background: #e5efdb; border-color: #bfd4ba; font-weight: 850; }
.day.selected { background: #edf4e6; border-color: #578161; color: #203e2c; }
.day.selected.today { background: #dcecc9; border-color: #578161; }
.day-dots { display: flex; flex-wrap: wrap; gap: 2px; align-content: start; justify-content: center; width: min(100% - 4px, 60px); min-height: 5px; }
.dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px; display: inline-block; background: var(--dot); }
.day .dot { width: 5px; height: 5px; flex-basis: 5px; }
.expanded { padding: 13px 11px 12px; }
.expanded .calendar-top { margin-bottom: 10px; }
.expanded .day { min-height: clamp(51px, 13vw, 72px); font-size: .98rem; }
.expanded .day .dot { width: 7px; height: 7px; flex-basis: 7px; }
.agenda { margin-top: 12px; padding: 13px; }
.agenda-heading { flex-wrap: wrap; }
.agenda-heading h2 { font-size: 1.05rem; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 100px; background: #edf1e9; color: #42574a; font-weight: 670; font-size: .7rem; padding: 4px 7px; line-height: 1.13; overflow-wrap: anywhere; }
.empty { margin-top: 9px; color: var(--muted); font-size: .85rem; }
.entry-list { margin-top: 8px; }
.reminder { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: start; gap: 6px; padding: 6px 0; border-top: 1px solid var(--line); }
.entry-copy { align-self: center; overflow-wrap: anywhere; padding: 3px 0; }
.entry-copy > strong { font-size: .95rem; }
.entry-copy > p { font-size: .83rem; color: var(--muted); margin-top: 3px; white-space: pre-wrap; }
.entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; color: var(--muted); font-size: .75rem; }
.completion { display: grid; place-items: center; width: 44px; height: 44px; background: transparent; border: 0; border-radius: 12px; position: relative; }
.completion::before { content: ''; position: absolute; inset: 10px; border: 1.5px solid #819587; border-radius: 50%; }
.completion svg { visibility: hidden; position: relative; }
.is-done .completion::before { background: var(--green); border-color: var(--green); }
.is-done .completion svg { visibility: visible; color: white; }
.is-done .entry-copy strong { text-decoration: line-through; color: var(--muted); }
.reminder .icon-button { border-color: transparent; }
select, input:not([type="radio"]), textarea { background: var(--paper); border: 1px solid #cbd9cc; border-radius: 11px; padding: 10px; min-height: 44px; font-size: 1rem; }
select { max-width: 100%; text-overflow: ellipsis; }
#reminder-status { font-size: .83rem; }
input::placeholder, textarea::placeholder { color: #66746b; opacity: 1; }
.bottom {
  position: fixed; z-index: 5; inset: auto 0 0; min-height: var(--nav); border-top: 1px solid #d9e2d6;
  padding-bottom: env(safe-area-inset-bottom); background: #fcfdf8;
}
.bottom-inner { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, 590px); margin: auto; }
.tab { min-height: var(--nav); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .72rem; color: #51625a; font-weight: 700; }
.tab span { display: grid; place-items: center; width: 49px; height: 32px; border-radius: 15px; }
.tab[aria-current="page"] { color: #244431; }
.tab[aria-current="page"] span { color: #1d402d; background: #e0edcf; }
.gym-grid { display: grid; gap: 9px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gym-day { display: flex; flex-direction: column; align-items: flex-start; min-height: 110px; padding: 12px; gap: 8px; position: relative; }
.gym-day > svg { position: absolute; top: 14px; right: 12px; color: var(--muted); }
.gym-day p { color: var(--muted); margin-top: 3px; font-size: .8rem; }
.gym-day h2 { font-size: 1rem; }
.gym-letter { display: grid; place-items: center; border-radius: 12px; height: 36px; width: 36px; background: #e9f1e5; color: #284c37; font-weight: 800; }
.gym-today { border-color: #75a07d; background: #edf5e5; }
.gym-today .gym-letter { color: white; background: var(--green); }
.back { display: inline-flex; align-items: center; min-height: 44px; gap: 5px; font-size: .87rem; font-weight: 720; color: var(--muted); }
.roomy-empty { padding: 25px 14px; display: grid; justify-items: center; gap: 7px; text-align: center; color: var(--muted); }
.roomy-empty h2 { color: var(--ink); }
.roomy-empty p { font-size: .9rem; }
.placeholder { padding: 37px 15px; }
.placeholder .secondary { margin-top: 7px; }
.exercise-list { display: grid; gap: 9px; }
.exercise { padding: 12px; }
.exercise-title { overflow-wrap: anywhere; }
.exercise-title p { font-size: .76rem; color: var(--muted); margin-top: 3px; }
.weight-label { grid-column: 1 / -1; font-size: .78rem; font-weight: 720; }
.weight-input { display: flex; align-items: center; gap: 7px; min-width: 0; }
.weight-input input { width: min(100%, 120px); }
.weight-input span { color: var(--muted); font-size: .84rem; }
.backup-panel { padding: clamp(15px, 4vw, 25px); }
.backup-panel h2 { margin-top: 10px; }
.backup-panel p { color: var(--muted); margin-top: 6px; max-width: 51ch; }
.backup-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
dialog { border: 1px solid var(--line); background: var(--paper); color: var(--ink); max-height: 100dvh; }
dialog::backdrop { background: #142c2378; }
body:has(dialog[open]) { overflow: hidden; }
.drawer {
  position: fixed; inset: 0 0 0 auto; width: min(100%, 340px); max-width: calc(100% - 30px); height: 100dvh;
  margin: 0; padding: max(15px, env(safe-area-inset-top)) 13px max(13px, env(safe-area-inset-bottom));
  border: 0; border-radius: 19px 0 0 19px;
}
.drawer[open] { animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: .4; } }
.drawer-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 3px 10px; border-bottom: 1px solid var(--line); }
.drawer-top h2 { font-size: 1.55rem; }
.drawer-links { overflow: auto; min-height: 0; }
.drawer-links a { display: grid; grid-template-columns: 23px minmax(0, 1fr) 18px; align-items: center; gap: 8px; padding: 0 8px; min-height: 44px; border-radius: 11px; font-size: .93rem; font-weight: 650; }
.drawer-links svg { color: var(--muted); }
.drawer-links a[aria-current="page"] { background: #e7f0e0; }
.sheet { position: fixed; margin: auto; width: min(100% - 20px, 475px); border-radius: 20px; padding: 0; max-height: calc(100dvh - 20px); overflow: auto; }
.sheet[open] { animation: lift .16s ease-out; }
@keyframes lift { from { transform: translateY(12px); opacity: .4; } }
.editor-form { padding: 14px; }
.sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.sheet-heading h2 { font-size: 1.36rem; }
.sheet-fields { display: grid; gap: 10px; padding-top: 10px; }
.sheet-fields label:not(.swatch) { display: block; min-width: 0; font-size: .85rem; font-weight: 700; }
.sheet-fields label small { color: var(--muted); font-weight: 500; }
.sheet-fields input:not([type="radio"]), .sheet-fields textarea, .sheet-fields select { display: block; width: 100%; margin-top: 4px; }
.sheet-fields textarea { resize: vertical; min-height: 70px; }
.field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: 8px; }
.field-note { color: var(--muted); font-size: .8rem; }
.sheet-fields fieldset { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
.sheet-fields legend { font-size: .85rem; font-weight: 700; padding: 0; }
.swatches { display: flex; flex-wrap: wrap; margin-top: 4px; }
.swatch { position: relative; display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.swatch > span:first-of-type { width: 26px; height: 26px; border-radius: 50%; background: var(--dot); }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--dot); }
.swatch input:focus-visible + span { outline: 3px solid var(--green); outline-offset: 6px; }
.confirm-copy { color: var(--muted); }
.form-error { color: #922f30; font-size: .84rem; margin-top: 8px; }
.sheet-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.toast { position: fixed; z-index: 8; left: 50%; bottom: calc(var(--nav) + env(safe-area-inset-bottom) + 9px); transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); padding: 10px 14px; border-radius: 12px; font-size: .86rem; background: var(--green); color: white; box-shadow: 0 6px 20px #132a2233; }
.loading { color: var(--muted); padding: 20px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (hover: hover) {
  .overview:hover { border-color: currentColor; }
  .icon-button:hover, .secondary:hover, .small-button:hover, .drawer-links a:hover { background: #eaf0e6; }
  .primary:hover { background: #cde685; }
  .day:not(.selected):not(.today):hover { background: #f0f4eb; }
  .tab:hover span { background: #e7efe1; }
  .gym-day:hover { border-color: #75a07d; }
}

@media (min-width: 580px) {
  .shell { padding-top: max(22px, env(safe-area-inset-top)); }
  .top { margin-bottom: 19px; }
  .overview-grid { gap: 11px; }
  .overview { min-height: 112px; padding: 11px 13px; }
  .calendar { padding: 12px 16px; }
  .expanded { padding: 15px 17px; }
  .gym-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .agenda { padding: 14px 17px; }
  .sheet .editor-form { padding: 17px; }
}

@media (max-width: 350px) {
  .shell { --gutter: 12px; }
  .add-home span { display: none; }
  .page-heading .primary { padding-inline: 8px; }
  .page-heading h1 { font-size: 1.7rem; }
  .calendar-top h2 { font-size: 1rem; }
  .calendar .eyebrow { font-size: .58rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.reminder-index { margin-top: 15px; }
.reminder-index > .agenda-heading { padding: 0 3px; margin-bottom: 8px; }
.list-stack, .compact-list { display: grid; gap: 9px; }
.list-panel { min-width: 0; padding: 9px 12px 12px; }
.list-panel h2 { display: flex; align-items: center; gap: 6px; }
.row-actions { display: flex; gap: 3px; align-items: center; justify-content: flex-end; }
.drag-handle { cursor: grab; touch-action: none; user-select: none; -webkit-touch-callout: none; color: var(--muted); }
.drag-handle:active { cursor: grabbing; }
.list-panel.dragging, .drawer-row.dragging { opacity: .54; }
.list-panel.drop-target, .drawer-row.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; }
.drawer-content { display: flex; flex-direction: column; gap: 6px; height: 100%; }
.drawer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-radius: 11px; }
.drawer-row > .icon-button { background: transparent; border-color: transparent; }
.drawer-footer { display: flex; justify-content: center; margin-top: auto; padding-top: 7px; border-top: 1px solid var(--line); }
.drawer-footer [aria-current="page"] { background: #e7f0e0; }
.inline-list { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.sheet-fields .inline-list-fields { border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.inline-list-fields .row-actions { flex-wrap: wrap; }
.today-names { display: grid; gap: 0; }
.today-names li { overflow-wrap: anywhere; padding: 8px 1px; }
.today-names li + li { border-top: 1px solid var(--line); }
.popup-add { justify-self: start; }
.compact-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; }
.compact-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.compact-list > .compact-row, .metric-card, .details-panel { padding: 12px; }
.compact-row p, .details-panel p { color: var(--muted); font-size: .82rem; margin-top: 4px; }
.compact-row .preserve-lines { white-space: pre-wrap; }
.details-panel .secondary { margin-top: 10px; }
.exercise .compact-row { align-items: start; margin-bottom: 5px; }
.compact-edit .icon-button { width: 36px; min-height: 36px; flex-basis: 36px; border-radius: 10px; }
.compact-edit svg { width: 15px; height: 15px; }
.exercise-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.exercise-entry > .icon-button { align-self: center; background: #e8f0e3; }
.autosave-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; }
.auto-status { font-size: .76rem; color: var(--muted); }
.auto-status:empty { display: none; }
.autosave-form input[aria-invalid] { border-color: #922f30; }
.autosave-form input[aria-invalid] ~ span { color: #922f30; }
.chart-scale, .chart-dates { display: flex; justify-content: space-between; gap: 6px; font-size: .79rem; font-weight: 650; color: var(--muted); }
.progress-chart svg { width: 100%; display: block; }
.chart-grid { stroke: var(--line); fill: none; stroke-width: 1; }
.chart-line { stroke: var(--accent); fill: none; stroke-width: 2.8; stroke-linejoin: round; }
.chart-dot { fill: var(--green); stroke: var(--paper); stroke-width: 1.5; }
.chart-history { margin-top: 3px; padding: 9px 0 0; border-top: 1px solid var(--line); font-size: .87rem; }
.chart-history summary { cursor: pointer; min-height: 36px; padding-top: 7px; }
.chart-history li { padding: 7px 1px; display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); }
.car-facts { padding: 5px 13px; margin: 0; }
.car-facts div { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 12px 0; }
.car-facts div + div { border-top: 1px solid var(--line); }
.car-facts dt { color: var(--muted); font-size: .89rem; }
.car-facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.document-drop { display: grid; justify-items: center; gap: 8px; padding: 16px 11px; text-align: center; border-style: dashed; }
.document-drop p, .document-drop small { color: var(--muted); }
.document-drop.drop-active { background: #e7f0e0; border-color: var(--accent); }
.doc-list { margin-top: 9px; }
.document-name { overflow-wrap: anywhere; }
