:root {
  --ink: #182019;
  --muted: #727a71;
  --line: #dde3da;
  --paper: #f4f6f1;
  --card: #ffffff;
  --green: #247a43;
  --green-dark: #185c31;
  --green-soft: #e5f2e7;
  --lime: #b9df83;
  --danger: #b5483e;
  --shadow: 0 14px 38px rgba(28, 51, 31, 0.065);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { color: inherit; }
.app-shell { width: min(1240px, calc(100% - 64px)); margin: 0 auto; }
.topbar { height: 96px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { color: var(--ink); text-decoration: none; display: flex; gap: 11px; align-items: center; font-size: 22px; font-weight: 750; letter-spacing: -.8px; }
.brand-mark { width: 27px; height: 27px; border-radius: 8px; background: var(--green); display: flex; align-items: flex-end; justify-content: center; gap: 2.5px; padding: 6px; }
.brand-mark i { width: 3px; display: block; background: white; border-radius: 2px; }
.brand-mark i:nth-child(1) { height: 7px; }.brand-mark i:nth-child(2) { height: 14px; }.brand-mark i:nth-child(3) { height: 10px; }
.header-actions { display: flex; align-items: center; gap: 22px; }
.today { color: var(--muted); font-size: 14px; }
.button { border: 0; border-radius: 12px; min-height: 44px; padding: 0 18px; font-weight: 650; cursor: pointer; transition: .18s ease; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-primary { background: var(--green); color: #fff; box-shadow: 0 5px 14px rgba(36,122,67,.18); }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { background: #eef1eb; }
.button-danger { background: var(--danger); color: #fff; }
.plus { font-size: 21px; font-weight: 400; line-height: 0; margin-top: -2px; }
.mobile-label { display: none; }
main { padding: 72px 0 48px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.eyebrow { margin: 0 0 10px; color: var(--green); text-transform: uppercase; letter-spacing: 1.7px; font-size: 11px; font-weight: 800; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: clamp(42px, 6vw, 70px); letter-spacing: -3.7px; line-height: .98; }
.hero-copy { color: var(--muted); margin: 20px 0 0; font-size: 16px; }
.range-control { padding: 4px; display: flex; background: #e9ede6; border-radius: 12px; white-space: nowrap; }
.range-control button { background: transparent; border: 0; border-radius: 9px; padding: 9px 14px; color: var(--muted); font-size: 12px; font-weight: 650; cursor: pointer; }
.range-control button.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(28,51,31,.08); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 52px; }
.stat { background: rgba(255,255,255,.65); border: 1px solid var(--line); padding: 22px; border-radius: 17px; min-height: 126px; }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 650; }
.stat-value { font-family: Georgia, serif; font-size: 36px; letter-spacing: -1.5px; margin: 18px 0 3px; line-height: 1; }
.stat-note { color: var(--muted); font-size: 11px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; margin: 72px 0 22px; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 30px; font-weight: 500; letter-spacing: -1px; }
.section-heading > p { color: var(--muted); font-size: 13px; }
.exercise-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.exercise-card { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); min-height: 302px; display: flex; flex-direction: column; }
.exercise-card::after { content: ""; width: 160px; height: 160px; position: absolute; right: -90px; top: -95px; background: var(--green-soft); border-radius: 50%; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; position: relative; z-index: 1; }
.exercise-name { display: flex; gap: 13px; align-items: center; }
.exercise-icon { width: 42px; height: 42px; border-radius: 13px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-family: Georgia, serif; font-size: 20px; font-weight: 700; }
.exercise-name h3 { margin: 0 0 4px; font-size: 16px; }
.exercise-name p { margin: 0; color: var(--muted); font-size: 11px; }
.card-menu { display: flex; gap: 3px; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 9px; display: grid; place-items: center; cursor: pointer; color: var(--muted); background: transparent; font-size: 19px; }
.icon-button:hover { background: var(--paper); color: var(--ink); }
.metric-row { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 28px; }
.latest-value { font-family: Georgia, serif; font-size: 35px; line-height: 1; letter-spacing: -1.5px; }
.latest-value small { font-family: inherit; font-size: 15px; color: var(--muted); letter-spacing: 0; }
.target-chip { background: var(--green-soft); color: var(--green-dark); padding: 6px 9px; border-radius: 20px; font-size: 10px; font-weight: 750; }
.chart-wrap { height: 88px; margin: 18px -4px 7px; position: relative; }
.chart-wrap svg { width: 100%; height: 100%; overflow: visible; }
.chart-line { fill: none; stroke: var(--green); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: url(#areaGradient); opacity: .7; }
.target-line { stroke: #a7aea5; stroke-width: 1; stroke-dasharray: 3 4; }
.chart-empty { height: 100%; display: grid; place-items: center; color: #9aa198; font-size: 12px; border-bottom: 1px dashed var(--line); }
.card-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 12px; border-top: 1px solid #edf0eb; }
.card-bottom > span { color: var(--muted); font-size: 11px; }
.log-button { background: transparent; color: var(--green); border: 0; font-size: 12px; font-weight: 750; cursor: pointer; padding: 7px; }
.empty-state { grid-column: 1 / -1; border: 1px dashed #cbd3c8; border-radius: 22px; min-height: 290px; display: grid; place-items: center; text-align: center; padding: 40px; }
.empty-icon { width: 54px; height: 54px; border-radius: 17px; background: var(--green-soft); color: var(--green); margin: 0 auto 18px; display: grid; place-items: center; font-size: 27px; }
.empty-state h3 { font-family: Georgia, serif; font-size: 25px; font-weight: 500; margin: 0; }
.empty-state p { color: var(--muted); max-width: 350px; line-height: 1.6; font-size: 13px; margin: 10px auto 20px; }
.activity-section { margin-top: 32px; }.activity-heading { margin-bottom: 16px; }
.activity-list { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.activity-row { min-height: 69px; display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 22px; padding: 10px 20px; border-bottom: 1px solid #edf0eb; }
.activity-row:last-child { border: 0; }
.activity-main { display: flex; align-items: center; gap: 12px; min-width: 0; }.activity-main .exercise-icon { width: 36px; height: 36px; border-radius: 10px; font-size: 16px; flex: none; }
.activity-main strong { display: block; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }.activity-main span, .activity-date { color: var(--muted); font-size: 11px; }
.activity-amount { font-family: Georgia, serif; font-size: 18px; min-width: 80px; text-align: right; }
.activity-delete { border: 0; background: transparent; color: #a2a8a0; cursor: pointer; padding: 8px; font-size: 16px; }.activity-delete:hover { color: var(--danger); }
footer { min-height: 120px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
footer > span { color: var(--ink); font-weight: 800; font-size: 17px; }
.modal { width: min(500px, calc(100% - 28px)); border: 0; border-radius: 22px; padding: 0; color: var(--ink); box-shadow: 0 30px 90px rgba(22,39,24,.25); }
.modal::backdrop { background: rgba(17,27,18,.48); backdrop-filter: blur(4px); }
.modal form { padding: 28px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; }.modal-head h2 { margin: 0; font-family: Georgia, serif; font-weight: 500; font-size: 28px; }
.modal label, .modal legend { display: block; font-size: 12px; font-weight: 700; margin-top: 19px; }.modal input:not([type="radio"]) { width: 100%; height: 48px; padding: 0 14px; border: 1px solid #d8ddd5; border-radius: 11px; margin-top: 8px; outline: 0; }.modal input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.modal fieldset { border: 0; padding: 0; margin: 0; }.optional { float: right; color: var(--muted); font-weight: 500; }.modal small { color: var(--muted); display: block; margin-top: 6px; font-weight: 400; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }.segmented label { margin: 0; }.segmented input { position: absolute; opacity: 0; }.segmented span { display: grid; place-items: center; height: 45px; background: var(--paper); color: var(--muted); border: 1px solid transparent; border-radius: 11px; cursor: pointer; }.segmented input:checked + span { background: var(--green-soft); border-color: #bdd8c1; color: var(--green-dark); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 28px; }.form-error { min-height: 16px; color: var(--danger); font-size: 12px; margin: 10px 0 -8px; }
.confirm-modal { text-align: center; max-width: 410px; }.danger-icon { margin: 4px auto 17px; width: 44px; height: 44px; border-radius: 50%; background: #f8e7e5; color: var(--danger); display: grid; place-items: center; font-weight: 800; }.confirm-modal h2 { font-family: Georgia, serif; font-weight: 500; margin: 0; }.confirm-modal p { color: var(--muted); font-size: 13px; line-height: 1.6; }.confirm-modal .modal-actions { justify-content: center; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: var(--ink); color: white; padding: 11px 17px; border-radius: 10px; font-size: 12px; opacity: 0; pointer-events: none; transition: .25s; z-index: 10; }.toast.show { opacity: 1; transform: translate(-50%, 0); }
.skeleton { min-height: 302px; border-radius: 20px; background: linear-gradient(100deg, #e9ede6 20%, #f7f8f5 40%, #e9ede6 60%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position-x: -200%; } }

@media (max-width: 760px) {
  .app-shell { width: min(100% - 32px, 600px); }.topbar { height: 76px; }.today { display: none; }.desktop-label { display: none; }.mobile-label { display: inline; }.button { min-height: 42px; padding: 0 14px; }
  main { padding-top: 44px; }.hero { display: block; }.hero-copy { font-size: 14px; line-height: 1.5; }.range-control { width: 100%; margin-top: 30px; }.range-control button { flex: 1; }
  .stats-grid { grid-template-columns: 1fr 1fr; margin-top: 30px; gap: 10px; }.stat { min-height: 112px; padding: 17px; }.stat-value { font-size: 30px; margin-top: 15px; }
  .section-heading { margin-top: 50px; }.exercise-grid { grid-template-columns: 1fr; }.exercise-card { min-height: 294px; padding: 20px; }
  .activity-row { grid-template-columns: 1fr auto auto; gap: 8px; padding: 9px 13px; }.activity-date { display: none; }.activity-amount { min-width: 58px; }.modal form { padding: 22px; }.modal-actions .button { flex: 1; }
  footer { min-height: 100px; }footer p { font-size: 10px; }
}

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