:root {
  /* Fit-Check brand palette (forest / warm paper / amber) */
  --forest: #1B3A2B;
  --pine: #234F38;
  --sage: #7C9885;
  --amber: #E8A33D;
  --coral: #D9694F;

  --bg: #F5F7F1;        /* warm paper */
  --card-bg: #ffffff;
  --border: #DCE5DE;    /* green-tinted line */
  --text: #16241B;      /* ink */
  --muted: #5A6E60;
  --faint: #93A398;

  --p1: #234F38;        /* person 1 — pine green */
  --p1-soft: #E4EDE6;
  --p2: #D9694F;        /* person 2 — coral */
  --p2-soft: #FBE7E1;

  --track: #E7EDE7;
  --shadow-sm: 0 1px 2px rgba(27, 58, 43, 0.06);
  --shadow-md: 0 12px 34px -10px rgba(27, 58, 43, 0.18);
  --radius: 18px;

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 112px; /* room for floating tab bar + raised FAB */
}

/* Brand type system */
h1, h2, h3, .view-head h2, .app-header h1 { font-family: var(--serif); letter-spacing: -0.01em; }
.view-date, .stat-label, .act-stat-label, .act-bar-month, .act-bar-total,
.coach-activity-label, .share-code, .eyebrow { font-family: var(--mono); }

.hidden { display: none !important; }

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 247, 241, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}

.app-header-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 11px; }

.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  flex: none;
}
.brand-mark svg { display: block; }

.app-header h1 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -0.01em; color: var(--forest); }
.subtitle { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); font-style: italic; font-family: var(--serif); }

.icon-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: color .15s, transform .15s;
}
.icon-btn:hover { color: var(--text); }
.icon-btn:active { transform: scale(0.94); }

/* ---------- Layout ---------- */
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 18px 8px;
}

.view-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 20px;
}
.view-head h2 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; color: var(--forest); }
.view-date { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }

/* editorial eyebrow labels */
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--sage); font-weight: 500;
}
.section-eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin: 6px 0 12px;
}

/* Today hero band */
.hero-band {
  position: relative; overflow: hidden;
  background: var(--forest); color: #fff;
  border-radius: 22px; padding: 26px 24px 28px; margin-bottom: 26px;
  box-shadow: var(--shadow-md);
}
.hero-rings { position: absolute; top: -8px; right: -8px; width: 148px; height: 148px; z-index: 0; pointer-events: none; }
.hero-rings svg { width: 100%; height: 100%; }
.hero-eyebrow, .hero-title, .hero-date { position: relative; z-index: 1; }
.hero-eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--amber); font-weight: 500; display: block;
}
.hero-title {
  font-family: var(--serif); font-weight: 600; font-size: 30px; line-height: 1.05;
  color: #fff; margin: 12px 0 0; letter-spacing: -0.01em;
}
.hero-date { font-family: var(--mono); font-size: 12px; color: #B9D2C2; margin: 10px 0 0; letter-spacing: 0.04em; }

.section-note { margin: -6px 0 16px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

/* ---------- Person grid & cards ---------- */
.person-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 460px) {
  .person-grid { grid-template-columns: 1fr; }
}

.person-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.person-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}
.person-card.person-1::before { background: var(--p1); }
.person-card.person-2::before { background: var(--p2); }

.pc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pc-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: #fff;
}
.person-1 .pc-avatar { background: var(--p1); }
.person-2 .pc-avatar { background: var(--p2); }
.pc-name { font-weight: 700; font-size: 15px; line-height: 1.1; }
.pc-goal { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* Calorie ring */
.ring-wrap { position: relative; width: 118px; height: 118px; margin: 4px auto 14px; }
.ring { transform: rotate(-90deg); width: 118px; height: 118px; }
.ring-track { fill: none; stroke: var(--track); stroke-width: 11; }
.ring-fill { fill: none; stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.4,0,.2,1); }
.person-1 .ring-fill { stroke: var(--p1); }
.person-2 .ring-fill { stroke: var(--p2); }
.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.ring-pct { font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; color: var(--forest); }
.ring-cal { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 2px; }

/* Macro bars */
.macro-bars { display: flex; flex-direction: column; gap: 9px; }
.mb-row { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 8px; }
.mb-label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.mb-track { height: 6px; background: var(--track); border-radius: 4px; overflow: hidden; }
.mb-fill { height: 100%; border-radius: 4px; transition: width .7s cubic-bezier(.4,0,.2,1); }
.person-1 .mb-fill { background: var(--p1); }
.person-2 .mb-fill { background: var(--p2); }
.mb-val { font-size: 11.5px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

/* Split card (meal result, no targets) */
.split-macros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 4px; }
.sm-cell { background: var(--bg); border-radius: 10px; padding: 8px 4px; text-align: center; }
.sm-val { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sm-key { font-size: 10px; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.4px; }
.pc-note {
  margin-top: 12px; font-size: 12px; color: var(--muted);
  line-height: 1.45; padding: 9px 11px; border-radius: 10px;
}
.person-1 .pc-note { background: var(--p1-soft); }
.person-2 .pc-note { background: var(--p2-soft); }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty-emoji { font-size: 40px; margin-bottom: 10px; }
.empty-state p { margin: 0 0 16px; font-size: 14.5px; }

/* ---------- Log view ---------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 34px 20px;
  border: 2px dashed var(--border);
  border-radius: 14px;
  color: var(--p1);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-align: center;
}
.dropzone:hover { border-color: var(--p1); background: var(--p1-soft); }
.dropzone-title { font-size: 15px; font-weight: 700; color: var(--text); }
.dropzone-hint { font-size: 12.5px; color: var(--muted); }

.meal-preview {
  width: 100%; max-height: 300px; object-fit: cover;
  border-radius: 14px; margin-top: 14px; display: block;
}

.result-meal { margin: 20px 0 12px; }
.result-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--faint); font-weight: 700; }
.result-meal h3 { margin: 3px 0 0; font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }

/* ---------- Buttons ---------- */
.primary-btn {
  width: 100%;
  background: var(--forest);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 14px;
  transition: transform .12s, opacity .15s;
}
.primary-btn:hover { opacity: 0.92; }
.primary-btn:active { transform: scale(0.985); }
.primary-btn:disabled { opacity: 0.5; cursor: default; }

/* meal context: who ate + portion note */
.meal-context { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.mc-field { display: flex; flex-direction: column; gap: 7px; }
.mc-label { font-size: 13px; font-weight: 600; color: var(--text); }
.mc-optional { font-weight: 400; color: var(--faint); }
.seg {
  display: flex; gap: 4px; padding: 4px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
}
.seg-btn {
  flex: 1; padding: 9px 8px; border: none; background: transparent;
  border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted);
  cursor: pointer; transition: background .15s, color .15s, box-shadow .15s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.seg-btn.active { background: var(--card-bg); color: var(--text); box-shadow: var(--shadow-sm); }
#portion-note {
  width: 100%; padding: 11px 12px; font-size: 14px; color: var(--text);
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
#portion-note:focus { outline: none; border-color: var(--p1); box-shadow: 0 0 0 3px var(--p1-soft); }
#portion-note::placeholder { color: var(--faint); }

/* "or describe it" divider + description box */
.or-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0 4px; color: var(--faint);
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.or-divider::before, .or-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
#meal-description-input {
  width: 100%; padding: 11px 12px; font-size: 14px; line-height: 1.5; color: var(--text);
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
  resize: vertical; font-family: inherit;
}
#meal-description-input:focus { outline: none; border-color: var(--p1); box-shadow: 0 0 0 3px var(--p1-soft); }
#meal-description-input::placeholder { color: var(--faint); }

/* clarifying question */
.clarify-box {
  margin-top: 14px; padding: 14px; border-radius: 12px;
  background: var(--p1-soft); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.clarify-lead { font-size: 12px; font-weight: 600; color: var(--p1); }
.clarify-q { font-size: 15px; font-weight: 600; color: var(--text); }
#clarify-answer {
  width: 100%; padding: 11px 12px; font-size: 14px; color: var(--text);
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
}
#clarify-answer:focus { outline: none; border-color: var(--p1); box-shadow: 0 0 0 3px var(--p1-soft); }
.clarify-box .primary-btn { margin-top: 0; }

/* history entry edit panel */
.he-actions { display: flex; gap: 8px; margin-top: 10px; }
.he-edit-btn, .delete-entry-btn {
  flex: 1; padding: 8px 10px; font-size: 13px; font-weight: 600;
  border-radius: 9px; cursor: pointer; border: 1px solid var(--border);
  background: var(--bg); color: var(--muted); transition: background .15s, color .15s;
}
.he-edit-btn:hover { color: var(--text); }
.delete-entry-btn:hover { color: var(--p2); border-color: var(--p2); }
.he-editor {
  margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 14px;
}
.portion-frac {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 14px; color: var(--muted);
}
.portion-frac input {
  width: 64px; padding: 9px 10px; font-size: 14px; color: var(--text);
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 9px;
}
.portion-frac input:focus { outline: none; border-color: var(--p1); box-shadow: 0 0 0 3px var(--p1-soft); }
.pf-hint { flex-basis: 100%; font-size: 12px; color: var(--faint); }
.he-editor-actions { display: flex; gap: 10px; }
.he-editor-actions .ghost-btn,
.he-editor-actions .primary-btn { flex: 1; margin-top: 0; }

.ghost-btn {
  background: var(--card-bg);
  color: var(--p1);
  border: 1px solid var(--p1);
  border-radius: 11px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ghost-btn:active { transform: scale(0.97); }

.status-text { color: var(--muted); font-size: 13px; min-height: 18px; margin: 12px 0 0; text-align: center; }

/* ---------- Settings form ---------- */
.people-form { display: flex; flex-direction: column; gap: 14px; }
.person-form { display: flex; flex-direction: column; gap: 11px; }
.person-form-head { display: flex; align-items: center; gap: 8px; }
.person-form-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-1 { background: var(--p1); }
.dot-2 { background: var(--p2); }

.macro-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 5px; font-weight: 500; }

input, select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 12px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--p1);
  box-shadow: 0 0 0 3px var(--p1-soft);
}

/* ---------- History ---------- */
.history-entry {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}
.he-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.he-meal { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; }
.he-time { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.he-splits { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.he-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: 999px;
}
.he-chip.person-1 { background: var(--p1-soft); color: var(--p1); }
.he-chip.person-2 { background: var(--p2-soft); color: #c1571a; }
.he-total { font-size: 12px; color: var(--muted); margin-top: 6px; }
.delete-entry-btn {
  background: transparent; color: var(--faint);
  border: none; padding: 6px 0 0; font-size: 12px;
  cursor: pointer; margin-top: 6px; font-weight: 600;
}
.delete-entry-btn:hover { color: #d64545; }

/* ---------- Tab bar (sleek floating) ---------- */
.tab-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 30;
  width: calc(100% - 28px);
  max-width: 440px;
  background: var(--forest);
  border-radius: 26px;
  box-shadow: 0 14px 36px -8px rgba(27, 58, 43, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 12px 12px;
}
.tab {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: #7E9A88;
  font-size: 10.5px; font-weight: 600;
  padding: 2px 6px;
  flex: 1;
  transition: color .15s;
}
.tab.active { color: #fff; }
.tab-log { flex: 1; }
.tab-fab {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--forest);
  display: grid; place-items: center;
  box-shadow: 0 8px 18px rgba(232, 163, 61, 0.5);
  margin-top: -30px;
  transition: transform .15s;
}
.tab-log:active .tab-fab { transform: scale(0.92); }

/* ---------- activity (Strava) ---------- */
:root { --run: var(--p1); --walk: #B57420; --walk-soft: #F6E8D2; }

/* sharing (linked household) */
.sharing-section { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border); }
.share-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.share-head h3 { font-size: 16px; font-weight: 700; color: var(--text); }
.share-linked { font-size: 12px; font-weight: 600; color: var(--p1); }
.share-code-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.share-code {
  font-family: monospace; font-size: 20px; font-weight: 700; letter-spacing: .12em;
  color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 14px;
}
.share-join { display: flex; gap: 8px; margin-top: 12px; }
.share-join input {
  flex: 1; padding: 11px 12px; font-size: 15px; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card-bg); color: var(--text);
}
.share-join input:focus { outline: none; border-color: var(--p1); box-shadow: 0 0 0 3px var(--p1-soft); }
.share-leave {
  width: 100%; margin-top: 14px; background: none; border: 1px solid var(--border);
  color: var(--muted); border-radius: 12px; padding: 11px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.share-leave:hover { color: var(--p2); border-color: var(--p2); }

/* Today's coaching */
.coach-section { margin-top: 24px; }
.coach-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.coach-title { font-size: 15px; font-weight: 700; color: var(--text); }
.coach-btn {
  background: var(--forest); color: #fff; border: none; border-radius: 100px;
  padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity .15s;
}
.coach-btn:hover { opacity: .9; }
.coach-btn:disabled { opacity: .5; cursor: default; }
.coach-cards { display: flex; flex-direction: column; gap: 12px; }
.coach-card {
  background: var(--card-bg); border: 1px solid var(--border); border-left-width: 3px;
  border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.coach-card.person-1 { border-left-color: var(--p1); }
.coach-card.person-2 { border-left-color: var(--p2); }
.coach-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.coach-activity { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.coach-activity-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
.coach-chip {
  background: var(--bg); border: 1px solid var(--border); color: var(--muted);
  font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 20px; cursor: pointer; transition: .15s;
}
.coach-chip.active { background: var(--p1); border-color: var(--p1); color: #fff; }
.coach-card.person-2 .coach-chip.active { background: var(--p2); border-color: var(--p2); }
.coach-chip:hover:not(.active) { color: var(--text); }
.coach-note { font-size: 14px; line-height: 1.55; color: var(--text); }
.coach-note.muted { color: var(--faint); font-style: italic; }

/* Strava connect control */
.act-connect { margin-bottom: 16px; }
.strava-connect-btn {
  width: 100%; background: #fc4c02; color: #fff; border: none; border-radius: 12px;
  padding: 13px 16px; font-size: 15px; font-weight: 700; cursor: pointer; transition: opacity .15s, transform .12s;
}
.strava-connect-btn:hover { opacity: .92; }
.strava-connect-btn:active { transform: scale(0.985); }
.strava-hint { font-size: 12px; color: var(--faint); margin-top: 8px; text-align: center; }
.strava-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px;
}
.strava-status { font-size: 13px; font-weight: 600; color: var(--text); display: inline-flex; align-items: center; gap: 7px; }
.strava-dot { width: 8px; height: 8px; border-radius: 50%; background: #fc4c02; display: inline-block; }
.strava-actions { display: flex; gap: 8px; }
.strava-mini {
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 9px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--border); color: var(--text); transition: border-color .15s, color .15s;
}
.strava-mini:hover { border-color: var(--faint); }
.strava-mini.ghost { color: var(--muted); }
.strava-mini.ghost:hover { color: var(--p2); border-color: var(--p2); }

/* wearable "coming soon" teaser */
.wearable-soon-btn {
  width: 100%; background: var(--card-bg); color: var(--text); border: 1px dashed var(--border);
  border-radius: 12px; padding: 13px 16px; font-size: 15px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: border-color .15s;
}
.wearable-soon-btn:hover { border-color: var(--faint); }
.soon-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--p1-soft); color: var(--p1); padding: 3px 8px; border-radius: 20px;
}

/* dashboard "remaining today" line */
.pc-remaining {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--muted); text-align: center;
}
.pc-remaining.over { color: var(--p2); }

.act-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.act-stat {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 12px; box-shadow: var(--shadow-sm);
}
.act-stat-label {
  font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 6px;
}
.act-stat-val { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.act-stat-val small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.act-stat-sub { font-size: 11px; color: var(--faint); margin-top: 5px; }
@media (max-width: 640px) {
  .act-summary { gap: 8px; }
  .act-stat { padding: 12px 10px; }
  .act-stat-val { font-size: 19px; }
}

.act-section-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 12px; }
.act-section-title { font-size: 15px; font-weight: 700; color: var(--text); }
.act-legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.act-legend span { display: inline-flex; align-items: center; gap: 5px; }
.act-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.act-dot.run { background: var(--run); }
.act-dot.walk { background: var(--walk); }

.act-chart { padding: 18px 14px 12px; }
.act-bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; }
.act-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.act-bar-total { font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.act-bar-stack { width: 100%; max-width: 34px; display: flex; flex-direction: column-reverse; border-radius: 5px 5px 3px 3px; overflow: hidden; }
.act-bar-seg { width: 100%; }
.act-bar-run { background: var(--run); }
.act-bar-walk { background: var(--walk); }
.act-bar-month { font-size: 11px; color: var(--muted); margin-top: 8px; font-weight: 500; }

.act-filters { display: flex; gap: 6px; }
.act-fbtn {
  background: var(--bg); border: 1px solid var(--border); color: var(--muted);
  font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 20px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.act-fbtn.active { background: var(--run); border-color: var(--run); color: #fff; }
.act-fbtn:hover:not(.active) { color: var(--text); border-color: var(--faint); }

.act-row {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px;
  padding: 13px 15px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.act-row-top { display: flex; align-items: center; gap: 9px; }
.act-badge { font-size: 10px; font-weight: 700; letter-spacing: .03em; padding: 3px 9px; border-radius: 20px; }
.act-badge.run { background: var(--p1-soft); color: var(--run); }
.act-badge.walk { background: var(--walk-soft); color: var(--walk); }
.act-row-title { font-size: 14px; font-weight: 600; color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-row-date { font-size: 12px; color: var(--faint); white-space: nowrap; }
.act-row-stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 9px; }
.act-metric { font-size: 13px; color: var(--muted); }
.act-metric b { color: var(--text); font-weight: 700; }
