@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,400,0,0');

:root {
  --meanif-green: #3d8d24;
  --meanif-green-dark: #2c7118;
  --meanif-orange: #ff8b19;
  --meanif-success: #2f9e44;
  --meanif-warning: #f59f00;
  --meanif-danger: #e03131;
  --meanif-card-radius: 14px;
  --meanif-content-width: 1440px;
  --meanif-section-gap: 1rem;
  --meanif-bg: #f7f8f5;
  --meanif-surface: #ffffff;
  --meanif-text: #20251f;
  --meanif-muted: #6c7469;
  --meanif-border: #e1e7dd;
  --meanif-green-soft: #eef7e9;
  --meanif-orange-soft: #fff2e6;
  --meanif-blue: #3189ee;
  --meanif-blue-soft: #eef6ff;
  --meanif-yellow: #f4b400;
  --bs-primary: var(--meanif-green);
  --bs-success: var(--meanif-success);
  --bs-warning: var(--meanif-warning);
  --bs-danger: var(--meanif-danger);
  --bs-link-color: var(--meanif-green);
  --bs-link-hover-color: var(--meanif-green-dark);
  --bs-body-bg: var(--meanif-bg);
  --bs-body-color: var(--meanif-text);
  --bs-border-color: var(--meanif-border);
  --bs-border-radius: var(--meanif-card-radius);
}

[data-bs-theme="dark"] {
  --meanif-bg: #131713;
  --meanif-surface: #1b211b;
  --meanif-text: #edf3e9;
  --meanif-muted: #aab4a4;
  --meanif-border: #343d31;
  --meanif-green-soft: #23371d;
  --meanif-orange-soft: #3a291a;
  --meanif-blue-soft: #1c2e40;
  --bs-body-bg: var(--meanif-bg);
  --bs-body-color: var(--meanif-text);
  --bs-border-color: var(--meanif-border);
  --bs-link-color: #8fd36a;
  --bs-link-hover-color: #b6e39a;
}

body {
  background: var(--meanif-bg);
  color: var(--meanif-text);
}

a,
button,
.btn,
[role="button"],
.dropdown-item,
.list-group-item-action {
  -webkit-tap-highlight-color: rgba(61, 141, 36, 0.16);
  touch-action: manipulation;
  transition: transform .05s ease, box-shadow .15s ease, background-color .15s ease,
      border-color .15s ease, color .15s ease, opacity .15s ease;
}

button:active,
.btn:active,
a.btn:active,
.dropdown-item:active,
.list-group-item-action:active,
.navbar .nav-link:active {
  transform: scale(.985);
}

.btn,
.dropdown-item,
.list-group-item-action,
.navbar .nav-link {
  cursor: pointer;
}

.btn:focus-visible,
.dropdown-item:focus-visible,
.list-group-item-action:focus-visible,
.navbar .nav-link:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 .2rem rgba(61, 141, 36, 0.22);
}

.meanif-navbar .nav-link.active,
.meanif-navbar .dropdown-item.active {
  color: var(--meanif-green-dark);
  font-weight: 700;
}

[data-bs-theme="dark"] .meanif-navbar .nav-link.active,
[data-bs-theme="dark"] .meanif-navbar .dropdown-item.active {
  color: var(--bs-link-color);
}

.meanif-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--meanif-green);
}

.meanif-brand-word {
  font-family: Georgia, serif;
  font-weight: 700;
  color: var(--meanif-green-dark);
  font-size: 1.45rem;
  line-height: 1;
}

.meanif-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--meanif-green-soft);
  color: var(--meanif-green-dark);
  font-weight: 800;
  font-size: .9rem;
}

.meanif-shell {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

.meanif-shell .card:not(:has(.card-body, .card-header)) {
  padding: 1.15rem;
}

.meanif-metric-card {
  height: 100%;
  border-color: var(--meanif-border);
  box-shadow: 0 8px 28px rgba(29, 49, 20, 0.055);
}

.meanif-metric-icon {
  width: 2rem;
  height: 2rem;
  display: inline-grid;
  place-items: center;
  border-radius: 0.55rem;
  background: var(--meanif-green-soft);
}

.meanif-metric-value {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
}

.meanif-muted,
.muted {
  color: var(--meanif-muted);
}

.meanif-progress,
.meanif-progress-track {
  height: 0.65rem;
  border-radius: 999px;
  background: var(--meanif-border);
  overflow: hidden;
}

.meanif-progress > div,
.meanif-progress-fill {
  height: 100%;
  border-radius: inherit;
}

.meanif-stage-bar {
  position: relative;
  background: var(--meanif-border);
  border-radius: 6px;
  height: 18px;
  overflow: hidden;
}


.meanif-sync-dropdown {
  min-width: 18rem;
  max-width: min(24rem, 90vw);
}

.meanif-sync-summary.dropdown-toggle::after {
  margin-left: .35rem;
  vertical-align: .15em;
}

.meanif-sync-ok {
  color: var(--meanif-success);
  font-weight: 600;
}

.meanif-sync-row {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .45rem .5rem;
  border-radius: .4rem;
  text-decoration: none;
  color: inherit;
  white-space: normal;
}

.meanif-sync-row--link {
  cursor: pointer;
}

.meanif-sync-row:not(.meanif-sync-row--link) {
  cursor: default;
}

.meanif-sync-row + .meanif-sync-row {
  margin-top: .15rem;
}

.meanif-sync-row:hover,
.meanif-sync-row:focus-visible {
  background: var(--meanif-green-soft, rgba(13, 110, 253, .08));
  outline: none;
}

.meanif-sync-badge {
  display: inline-flex;
  width: 1.7rem;
  height: 1.7rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
}

.meanif-sync-badge--garmin { background: #0a7; }
.meanif-sync-badge--oura { background: #4a63d2; }
.meanif-sync-badge--ihealth { background: #1d8f6e; }
.meanif-sync-badge--withings { background: #1f6feb; }

.meanif-sync-row-body {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 0;
}

.meanif-sync-row-top {
  display: flex;
  align-items: center;
  gap: .45rem;
}

.meanif-sync-label {
  font-weight: 600;
}

.meanif-sync-indicator {
  font-weight: 700;
  line-height: 1;
}

.meanif-sync-message {
  font-size: .82rem;
  color: var(--meanif-muted, #6c757d);
}

.meanif-today-panel .meanif-today-label {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--meanif-muted);
  margin-bottom: .2rem;
}

.meanif-today-panel .meanif-metric-value {
  font-size: 1.35rem;
  margin-bottom: .25rem;
}

.meanif-weight-strip {
  background: var(--meanif-green-soft);
}

.meanif-gold-summary {
  font-size: 1.05rem;
}

.table-responsive {
  position: relative;
}

.meanif-stats-table {
  --meanif-sticky-top: 0;
  --meanif-column-line: rgba(108, 116, 105, 0.18);
}

.meanif-stats-table thead th {
  position: sticky;
  top: var(--meanif-sticky-top);
  z-index: 2;
  background: var(--meanif-surface);
  box-shadow: inset 0 -1px 0 var(--meanif-border);
}

.meanif-stats-table th,
.meanif-stats-table td {
  border-right: 1px solid var(--meanif-column-line);
}

.meanif-stats-table th:last-child,
.meanif-stats-table td:last-child {
  border-right: 0;
}

.meanif-stats-table th:first-child,
.meanif-stats-table td:first-child {
  text-align: left;
}

.meanif-stats-table td:nth-child(n+2),
.meanif-stats-table th:nth-child(n+2) {
  text-align: center;
  white-space: nowrap;
}

.meanif-settings input[type="submit"] {
  display: inline-block;
  padding: .25rem .6rem;
  border: 1px solid var(--meanif-green);
  border-radius: .4rem;
  background: var(--meanif-green);
  color: #fff;
  font-weight: 600;
}

.meanif-settings .help-text {
  color: var(--meanif-muted);
  font-size: .9em;
  margin-top: .4rem;
}

.integration-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--meanif-border);
}

.integration-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.integration-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .6rem;
}

.panel {
  background: var(--meanif-surface);
  border: 1px solid var(--meanif-border);
  border-radius: var(--meanif-card-radius);
  padding: 1rem;
  margin: 1rem 0;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-end;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin: 1rem 0;
}

.meanif-gold-summary .meanif-star {
  color: var(--meanif-yellow);
  font-size: 1.6rem;
  line-height: 1;
}

.meanif-gold-star-wrap {
  min-width: 60px;
  text-align: center;
}

.meanif-gold-star {
  display: inline-block;
  line-height: 1;
  color: #d4a017;
  text-shadow: 0 3px 12px rgba(212, 160, 23, 0.35);
}

.meanif-gold-star--redeemable {
  border: none;
  background: transparent;
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
}

.meanif-gold-star--redeemable:hover {
  transform: scale(1.08) rotate(-4deg);
}

.meanif-gold-star--flashing {
  animation: meanif-gold-star-flash 1s infinite alternate ease-in-out;
}

@keyframes meanif-gold-star-flash {
  from {
    filter: brightness(1);
    transform: scale(1);
  }
  to {
    filter: brightness(1.28);
    transform: scale(1.06);
  }
}

.meanif-stats-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.flash {
  border-radius: var(--bs-border-radius);
  padding: .75rem 1rem;
  margin-bottom: 1rem;
}

.flash-success {
  background: var(--meanif-green-soft);
  color: var(--meanif-green-dark);
}

.flash-error {
  background: #fff0f0;
  color: var(--meanif-danger);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--meanif-section-gap);
}

.heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.kicker {
  margin: 0;
  color: var(--meanif-muted);
  font-weight: 600;
}

.form-inline,
.inline {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.meanif-action-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
}

.nag-screen {
  margin-bottom: 1rem;
}

.nag-screen__content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
}

.history-card summary {
  cursor: pointer;
  font-weight: 700;
}

[data-bs-theme="dark"] .meanif-brand-word {
  color: #b6e39a;
}

[data-bs-theme="dark"] .flash-error {
  background: #3a1f1f;
}

footer.meanif-footer,
#footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--meanif-border);
  color: var(--meanif-muted);
  text-align: center;
}

.weight-status-row,
.weight-trend-header,
.weight-trend-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

.weight-trend-header {
  justify-content: space-between;
  margin-bottom: .75rem;
}

.weight-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.weight-status-dot--sm {
  width: 10px;
  height: 10px;
}

.weight-trend-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
  margin-top: .5rem;
}

.weight-trend-metric {
  background: var(--meanif-surface);
  border: 1px solid var(--meanif-border);
  border-radius: .75rem;
  padding: .75rem;
}

.weight-trend-metric__label {
  font-size: .85rem;
  color: var(--meanif-muted);
  font-weight: 600;
  margin-bottom: .25rem;
}

.weight-chart-wrap {
  margin-top: .9rem;
  padding: .75rem;
  border-radius: .75rem;
  background: var(--meanif-surface);
  border: 1px solid var(--meanif-border);
}

.weight-month-chart {
  width: 100%;
  max-width: 920px;
  height: 240px;
  display: block;
}

.weight-trend-activities-by-day {
  margin-top: 1rem;
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined', 'Segoe UI Symbol', sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 1.05em;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  vertical-align: text-bottom;
  white-space: nowrap;
  user-select: none;
}

.activity-complete {
  color: var(--meanif-success);
  font-weight: 700;
}

.fitness-activity-icon {
  color: #556b2f;
  margin-right: 0.25rem;
  opacity: 0.9;
  vertical-align: middle;
}

.fitness-activity-label {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.fitness-activity-value {
  display: inline-block;
  min-width: 1.2em;
  text-align: left;
}

.meanif-account-name {
  max-width: 10rem;
}

table.weight-trend-table {
  width: 100%;
  table-layout: auto;
}

table.weight-trend-table th,
table.weight-trend-table td {
  vertical-align: middle;
  white-space: nowrap;
}

table.weight-trend-table thead th {
  top: var(--meanif-sticky-top);
  z-index: 3;
}

table.weight-trend-table th.col-month,
table.weight-trend-table td.col-month { min-width: 4.5rem; }
table.weight-trend-table th.col-trend,
table.weight-trend-table td.col-trend { min-width: 7rem; }
table.weight-trend-table th.col-weight,
table.weight-trend-table td.col-weight { min-width: 3.5rem; }
table.weight-trend-table th.col-fasting,
table.weight-trend-table td.col-fasting { min-width: 3.8rem; }
table.weight-trend-table th.col-water,
table.weight-trend-table td.col-water { min-width: 2.8rem; }
table.weight-trend-table th.col-pushups,
table.weight-trend-table td.col-pushups { min-width: 2.8rem; }
table.weight-trend-table th.col-calories,
table.weight-trend-table td.col-calories { min-width: 3.2rem; }
table.weight-trend-table th.col-alcohol,
table.weight-trend-table td.col-alcohol { min-width: 3rem; }
table.weight-trend-table th.col-activities,
table.weight-trend-table td.col-activities {
  min-width: 12rem;
  white-space: normal;
  line-height: 1.3;
}
table.weight-trend-table th.col-oura,
table.weight-trend-table td.col-oura { min-width: 12rem; }
table.weight-trend-table .oura-heart {
  display: inline-block;
  min-width: 3.6em;
}
table.weight-trend-table.hide-oura-details .oura-details { display: none; }
table.weight-trend-table.hide-oura-details th.col-oura,
table.weight-trend-table.hide-oura-details td.col-oura {
  min-width: 3.8em;
  width: 3.8em;
}
table.weight-trend-table.compact-cells { font-size: .92rem; }
table.weight-trend-table.compact-cells th,
table.weight-trend-table.compact-cells td { padding: .28rem .3rem; }
table.weight-trend-table.compact-cells th.col-month,
table.weight-trend-table.compact-cells td.col-month { min-width: 3.2rem; }
table.weight-trend-table.compact-cells th.col-trend,
table.weight-trend-table.compact-cells td.col-trend { min-width: 4.8rem; }
table.weight-trend-table.compact-cells .trend-full { display: none; }
table.weight-trend-table.compact-cells .trend-compact { display: inline !important; }
table.weight-trend-table .trend-compact { display: none; }
table.weight-trend-table.very-compact .trend-compact .trend-label { display: none; }
table.weight-trend-table.very-compact th.col-trend,
table.weight-trend-table.very-compact td.col-trend {
  min-width: 1.4rem;
  width: 1.4rem;
  text-align: center;
}
table.weight-trend-table.hide-water th.col-water,
table.weight-trend-table.hide-water td.col-water,
table.weight-trend-table.hide-alcohol th.col-alcohol,
table.weight-trend-table.hide-alcohol td.col-alcohol,
table.weight-trend-table.hide-pushups th.col-pushups,
table.weight-trend-table.hide-pushups td.col-pushups { display: none; }
table.weight-trend-table tr.weight-trend-row--selected {
  background: var(--meanif-green-soft);
}

.meanif-metric-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.35rem;
  justify-items: end;
  min-width: 4.5rem;
}

.meanif-metric-cell__value {
  justify-self: end;
  text-align: right;
  white-space: nowrap;
}

.meanif-metric-cell__stars,
.meanif-metric-cell__meta {
  justify-self: start;
  text-align: left;
  white-space: nowrap;
  min-width: 3.2em;
}

.meanif-metric-cell--stars-total {
  min-width: 5rem;
}

.meanif-oura-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  line-height: 1.15;
}

.meanif-oura-cell__hearts {
  white-space: nowrap;
}

.meanif-oura-cell__details {
  font-size: 0.78rem;
  color: var(--meanif-muted);
  white-space: nowrap;
}

.meanif-stats-table.compact th,
.meanif-stats-table.compact td,
.meanif-weekly-gold-stars-table.compact th,
.meanif-weekly-gold-stars-table.compact td {
  padding: 0.25rem 0.3rem;
  font-size: 0.9rem;
}

.meanif-stats-table.compact th[data-column="period"],
.meanif-stats-table.compact td[data-column="period"] {
  white-space: nowrap;
}

.meanif-weekly-gold-stars-table th:first-child,
.meanif-weekly-gold-stars-table td:first-child {
  text-align: left;
}

.meanif-weekly-gold-stars-table th:nth-child(n+2),
.meanif-weekly-gold-stars-table td:nth-child(n+2) {
  text-align: center;
}

.meanif-weekly-gold-stars-table.compact th,
.meanif-weekly-gold-stars-table.compact td {
  text-align: center;
  vertical-align: middle;
}

.meanif-weekly-gold-stars-table.compact th[data-column="week"],
.meanif-weekly-gold-stars-table.compact td[data-column="week"] {
  text-align: center;
  white-space: nowrap;
}

.meanif-weekly-gold-stars-table.compact .meanif-metric-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  min-width: 0;
  column-gap: 0;
}

.meanif-weekly-gold-stars-table.compact .meanif-metric-cell__value,
.meanif-weekly-gold-stars-table.compact .meanif-metric-cell__stars,
.meanif-weekly-gold-stars-table.compact .meanif-metric-cell__meta {
  justify-self: center;
  text-align: center;
  min-width: 0;
  line-height: 1.1;
}

.meanif-weekly-gold-stars-table.compact .meanif-metric-cell__meta {
  display: none;
}

.meanif-weekly-gold-stars-table.compact .meanif-oura-cell {
  align-items: center;
}

.meanif-weekly-gold-stars-table.compact .meanif-oura-cell__details {
  display: none;
}

@media (max-width: 640px) {
  .sessions-table--compact-columns .sessions-table--full-label {
    display: none;
  }
}

.perf-flamegraph-frame {
  width: 100%;
  height: 700px;
  border: 1px solid var(--meanif-border);
  border-radius: .5rem;
}

.perf-flat {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .85rem;
  white-space: pre;
  overflow-x: auto;
}


.progress-bar.meanif-progress-bar {
  background-color: var(--meanif-progress-fill, var(--bs-primary));
}

.meanif-stage-progress {
  height: 0.7rem;
}

.dropdown-item.meanif-sync-row {
  white-space: normal;
}
