/* ── Body Weight Stats ── */
.bw-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.bw-stat { background: var(--card); border-radius: 14px; padding: 12px 6px; text-align: center; }
.bw-stat-val { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.bw-stat-lbl { font-size: 0.6rem; color: var(--muted); margin-top: 3px; letter-spacing: 0.5px; text-transform: uppercase; }

/* ── Chart (shared by BW and Exercise History) ── */
.bw-chart-wrap { background: var(--card); border-radius: 20px; padding: 16px 8px 10px; margin-bottom: 22px; position: relative; overflow: visible; }
.bw-chart-header { padding: 0 8px 12px; display: flex; justify-content: space-between; align-items: center; }
.bw-chart-title { font-size: 0.9rem; font-weight: 700; }
.bw-range-row { display: flex; gap: 6px; }
.bw-range-btn { background: none; border: 1px solid var(--border-med); color: var(--muted); font-size: 0.7rem; padding: 4px 11px; border-radius: 20px; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.bw-range-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.bw-chart-svg { width: 100%; display: block; touch-action: none; }
.bw-tooltip { position: absolute; background: rgba(15,15,26,0.96); border: 1px solid rgba(233,69,96,0.4); border-radius: 10px; padding: 7px 12px; pointer-events: none; opacity: 0; transition: opacity 0.15s; z-index: 10; top: 10px; }
.bw-tooltip.visible { opacity: 1; }
.bw-tooltip-val { font-size: 0.95rem; font-weight: 700; color: #fff; }
.bw-tooltip-date { font-size: 0.7rem; color: var(--muted); margin-top: 1px; }

/* ── Calendar (shared by BW and Exercise History) ── */
.bw-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.bw-cal-month-lbl { font-size: 1rem; font-weight: 700; }
.bw-cal-nav { background: var(--card); border: none; color: var(--text); width: 36px; height: 36px; border-radius: 10px; font-size: 1.15rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.bw-cal-nav:active { opacity: 0.7; }
.bw-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.bw-cal-dow { text-align: center; font-size: 0.6rem; color: var(--muted); padding: 4px 0 8px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; }
.bw-cal-day { aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; font-size: 0.83rem; position: relative; transition: background 0.12s; }
.bw-cal-day:active { background: var(--subtle-bg-hover) !important; }
.bw-cal-day.other-month { color: var(--text-faint); }
.bw-cal-day.today { background: rgba(233,69,96,0.18); color: var(--accent); font-weight: 700; }
.bw-cal-day.has-data::after { content: ''; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--green); }
.bw-cal-day.selected { background: var(--accent) !important; color: #fff !important; font-weight: 700; }
.bw-cal-day.selected::after { display: none; }
.bw-cal-day.future { color: var(--text-faint); cursor: default; pointer-events: none; }

/* ── Delete All Button ── */
.bw-delete-all-btn { width: 100%; background: none; border: 1px solid rgba(233,69,96,0.25); color: rgba(233,69,96,0.6); padding: 14px; border-radius: 16px; font-size: 0.9rem; font-weight: 600; font-family: inherit; cursor: pointer; margin-top: 24px; }
.bw-delete-all-btn:active { background: rgba(233,69,96,0.08); }

/* ── BW Entry Sheet ── */
.bw-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.65); display: none; align-items: flex-end; justify-content: center; }
.bw-overlay.open { display: flex; }
.bw-sheet { background: var(--card); border-radius: 28px 28px 0 0; padding: 12px 24px 44px; width: 100%; max-width: 500px; transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.32,0.72,0,1); position: relative; }
.bw-overlay.open .bw-sheet { transform: translateY(0); }
.bw-sheet-handle { width: 40px; height: 4px; background: var(--subtle-bg-hover); border-radius: 2px; margin: 0 auto 22px; }
.sheet-close-btn { position: absolute; top: 12px; right: 16px; background: rgba(255,255,255,0.08); border: none; color: var(--muted); width: 32px; height: 32px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 1; }
.sheet-close-btn:active { background: rgba(255,255,255,0.15); }
.bw-sheet-dateLbl { font-size: 0.8rem; color: var(--muted); text-align: center; margin-bottom: 4px; }
.bw-sheet-title { font-size: 1.15rem; font-weight: 700; text-align: center; margin-bottom: 24px; }
.bw-input-row { background: var(--subtle-bg); border-radius: 18px; display: flex; align-items: center; gap: 10px; padding: 16px 20px; margin-bottom: 20px; }
.bw-input-row input { background: none; border: none; outline: none; color: var(--text); font-size: 2.2rem; font-weight: 700; font-family: inherit; flex: 1; width: 0; min-width: 0; }
.bw-input-row .bw-unit { font-size: 1.1rem; color: var(--muted); font-weight: 600; }
.bw-btn-save { width: 100%; background: var(--green); border: none; color: #fff; padding: 16px; border-radius: 16px; font-size: 1rem; font-weight: 700; font-family: inherit; cursor: pointer; margin-bottom: 10px; }
.bw-btn-save:active { opacity: 0.85; }
.bw-btn-del { width: 100%; background: none; border: 1px solid rgba(233,69,96,0.3); color: var(--accent); padding: 14px; border-radius: 16px; font-size: 0.95rem; font-weight: 600; font-family: inherit; cursor: pointer; display: none; }
.bw-btn-del.visible { display: block; }
.bw-btn-del:active { background: rgba(233,69,96,0.1); }

/* ── Photo ── */
.bw-photo-area { margin-bottom: 20px; }
.bw-add-photo-btn { width: 100%; background: var(--subtle-bg); border: 1px dashed var(--border-med); color: var(--muted); padding: 14px; border-radius: 16px; font-size: 0.9rem; font-family: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.bw-add-photo-btn:active { background: var(--subtle-bg-hover); }
.bw-thumb-wrap { position: relative; display: inline-block; }
.bw-thumb-img { width: 110px; height: 110px; object-fit: cover; border-radius: 14px; display: block; cursor: pointer; border: 2px solid var(--border-med); }
.bw-thumb-img:active { opacity: 0.8; }
.bw-thumb-remove { position: absolute; top: -8px; right: -8px; background: var(--accent); border: none; color: #fff; width: 24px; height: 24px; border-radius: 50%; font-size: 0.75rem; cursor: pointer; display: flex; align-items: center; justify-content: center; font-weight: 700; }

/* ── Full-size Photo Viewer ── */
.bw-viewer { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.94); display: none; align-items: center; justify-content: center; }
.bw-viewer.open { display: flex; }
.bw-viewer img { max-width: 96vw; max-height: 88vh; border-radius: 12px; object-fit: contain; }
.bw-viewer-close { position: absolute; top: calc(var(--safe-top) + 18px); right: 20px; background: rgba(255,255,255,0.12); border: none; color: #fff; width: 38px; height: 38px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
