:root {
  --bg: #060b0a;
  --surface: rgba(11, 17, 16, 0.9);
  --surface-strong: #101917;
  --surface-dark: #09110f;
  --surface-dark-soft: #101b19;
  --surface-dark-row: #152321;
  --ink: #effaf5;
  --muted: #8ea39c;
  --line: rgba(92, 114, 107, 0.28);
  --primary: #00ff99;
  --primary-deep: #00c978;
  --accent: #00ff99;
  --accent-soft: rgba(0, 255, 153, 0.08);
  --blue: #38ffc1;
  --dark-text: #effaf5;
  --dark-muted: #8ea39c;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(0, 255, 153, 0.05), transparent 26%),
    radial-gradient(circle at bottom right, rgba(47, 120, 255, 0.05), transparent 24%),
    linear-gradient(180deg, #040807 0%, #09110f 42%, #0d1714 100%);
}

#app-top-anchor {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(180, 220, 204, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 220, 204, 0.02) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.48), transparent 82%);
}

.mobile-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 10px 16px 92px;
}

.topbar,
.hero-card,
.panel,
.summary-card,
.progress-card,
.bottom-nav {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  padding: 18px 18px 16px;
  border-radius: 24px;
}

.topbar h1,
.hero-card h2,
.panel-header h3,
.logger-title-group h3 {
  margin: 0;
  font-family: "Aptos Display", "Franklin Gothic Medium", "Arial Narrow", sans-serif;
}

.topbar h1 {
  font-size: 1.5rem;
  line-height: 1.05;
}

.topbar-badge,
.filter-status,
.panel-header .eyebrow,
.summary-card span,
.progress-card span,
.nav-label,
.set-table-head {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-badge {
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(0, 255, 153, 0.12);
  color: var(--accent);
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary-deep);
  font-weight: 800;
}

.screen-stack {
  display: grid;
  gap: 18px;
  margin-top: 0;
}

.view-panel {
  display: none;
  gap: 16px;
  justify-items: center;
}

.view-panel.active {
  display: grid;
}

.view-panel > section {
  width: min(100%, 480px);
  margin-inline: auto;
}

.hero-card,
.panel {
  padding: 18px;
  border-radius: var(--radius-xl);
}

.hero-card h2 {
  font-size: 2rem;
  line-height: 0.98;
  margin-bottom: 10px;
}

.hero-copy,
.filter-status,
.preview-copy,
.entry-meta,
.entry-notes,
.progress-card p {
  color: var(--muted);
}

.hero-card.alt {
  background: linear-gradient(180deg, rgba(13, 21, 19, 0.97), rgba(10, 16, 15, 0.94));
}

.hero-card.warm {
  background: linear-gradient(180deg, rgba(14, 24, 21, 0.97), rgba(11, 19, 17, 0.94));
}

.workout-view .workout-hero,
.workout-view .exercise-picker-panel,
.workout-view .workout-session-panel,
.workout-view .summary-card,
.workout-view .workout-start-panel {
  background: linear-gradient(180deg, rgba(9, 15, 14, 0.98), rgba(15, 23, 21, 0.96));
  color: var(--dark-text);
  border-color: rgba(0, 255, 153, 0.08);
}

.workout-view .hero-copy,
.workout-view .filter-status,
.workout-view label,
.workout-view .summary-card span {
  color: var(--dark-muted);
}

.start-workout-card {
  display: grid;
  gap: 16px;
  text-align: center;
  justify-items: center;
  min-height: 180px;
  align-content: center;
}

.start-workout-card h3 {
  margin: 0;
  font-family: "Aptos Display", "Franklin Gothic Medium", "Arial Narrow", sans-serif;
  font-size: 1.45rem;
}

.start-workout-button,
.session-link-button {
  width: 100%;
}

.workout-view .eyebrow {
  color: var(--accent);
}

.summary-strip,
.progress-grid,
.entry-list,
.muscle-tag-row,
.exercise-session-list,
.session-add-exercise-area,
.macro-progress-stack,
.meal-sections,
.meal-entry-list,
.food-search-results {
  display: grid;
  gap: 10px;
}

.summary-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-card,
.progress-card {
  padding: 16px;
  border-radius: var(--radius-lg);
}

.summary-card span,
.progress-card span {
  display: block;
  color: var(--muted);
}

.summary-card strong,
.progress-card strong,
.entry-title-row strong {
  display: block;
  margin-top: 6px;
  font-size: 1.2rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}

.stack-form,
.field-block {
  display: grid;
  gap: 10px;
}

.stack-form {
  gap: 16px;
}

.field-grid {
  display: grid;
  gap: 12px;
}

.field-grid.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  font-weight: 700;
  color: var(--muted);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid rgba(0, 255, 153, 0.16);
  border-radius: var(--radius-md);
  background: rgba(16, 25, 23, 0.92);
  color: var(--ink);
}

.workout-view input,
.workout-view select {
  background: rgba(17, 27, 25, 0.96);
  border-color: rgba(0, 255, 153, 0.12);
  color: var(--dark-text);
}

input:focus,
select:focus {
  outline: 2px solid rgba(0, 255, 153, 0.18);
  border-color: rgba(0, 255, 153, 0.42);
}

.exercise-preview {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(14, 22, 20, 0.88);
  border: 1px solid rgba(0, 255, 153, 0.08);
}

.search-results-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(12, 18, 17, 0.86);
  border: 1px solid rgba(0, 255, 153, 0.08);
  max-height: 320px;
  overflow-y: auto;
}

.search-results-label {
  margin: 0;
  color: var(--dark-muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-results-list {
  display: grid;
  gap: 8px;
}

.search-result-button {
  width: 100%;
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid rgba(0, 255, 153, 0.08);
  border-radius: 16px;
  background: rgba(16, 24, 22, 0.9);
  color: var(--dark-text);
}

.search-result-button strong {
  font-family: "Aptos Display", "Franklin Gothic Medium", "Arial Narrow", sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.search-result-button span {
  color: var(--dark-muted);
  font-size: 0.88rem;
}

.workout-view .exercise-preview {
  background: rgba(14, 21, 20, 0.94);
  border-color: rgba(0, 255, 153, 0.08);
}

.preview-title {
  margin: 0;
  font-weight: 800;
}

.preview-copy {
  margin: 0;
}

.muscle-tag-row {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.muscle-tag {
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  text-align: center;
}

.action-button {
  border: 0;
  border-radius: 18px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #00ff99, #00c978);
  color: #04100b;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 255, 153, 0.1);
}

.workout-view .action-button {
  background: linear-gradient(135deg, #00ff99, #00c978);
  color: #04100b;
  box-shadow: 0 8px 18px rgba(0, 255, 153, 0.08);
}

.entry-card {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(14, 22, 20, 0.9);
  border: 1px solid rgba(0, 255, 153, 0.08);
}

.diary-summary-panel,
.diary-meals-panel,
.meal-card,
.food-picker-card {
  background: linear-gradient(180deg, rgba(13, 21, 19, 0.97), rgba(10, 16, 15, 0.94));
}

.diary-view .diary-summary-panel {
  position: sticky;
  top: 8px;
  z-index: 15;
  padding: 12px 13px;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.diary-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  margin-bottom: 9px;
}

.diary-summary-title {
  display: grid;
  gap: 3px;
}

.diary-summary-title .eyebrow {
  margin-bottom: 0;
}

.diary-summary-title strong {
  font-family: "Aptos Display", "Franklin Gothic Medium", "Arial Narrow", sans-serif;
  font-size: 1.08rem;
}

.diary-summary-date-copy {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.food-picker-head,
.fatsecret-attribution {
  display: grid;
  gap: 10px;
}

.daily-calorie-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 255, 153, 0.1);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.macro-progress-stack {
  gap: 8px;
}

.macro-progress-row {
  display: grid;
  gap: 4px;
  padding: 0;
}

.macro-progress-row-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.macro-progress-row-head strong,
.meal-card-header h3,
.meal-entry-copy strong {
  margin: 0;
  font-family: "Aptos Display", "Franklin Gothic Medium", "Arial Narrow", sans-serif;
}

.macro-progress-row-head strong {
  font-size: 0.84rem;
}

.macro-progress-row-head span,
.meal-entry-copy p,
.food-draft-totals span {
  color: var(--muted);
  font-size: 0.74rem;
}

.macro-progress-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.diary-date-nav {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  padding: 7px 10px;
  border-radius: 18px;
  background: rgba(12, 19, 17, 0.92);
  border: 1px solid var(--line);
}

.date-nav-button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(111, 134, 126, 0.28);
  border-radius: 50%;
  padding: 0;
  background: rgba(255, 255, 255, 0.02);
  color: #d6e5df;
  font-size: 1.3rem;
  line-height: 1;
}

.diary-date-nav-copy {
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
}

.diary-date-nav-copy .eyebrow {
  margin-bottom: 0;
}

.diary-date-nav-copy strong {
  font-family: "Aptos Display", "Franklin Gothic Medium", "Arial Narrow", sans-serif;
  font-size: 1rem;
}

.diary-meals-panel .panel-header {
  margin-bottom: 10px;
}

.diary-view .diary-meals-panel {
  padding: 14px;
}

.macro-progress-fill {
  height: 100%;
  border-radius: inherit;
}

.macro-progress-fill.calories {
  background: linear-gradient(90deg, #cd5b2f, #ec9359);
}

.macro-progress-fill.protein {
  background: linear-gradient(90deg, #2f8f5b, #4fbb7e);
}

.macro-progress-fill.carbs {
  background: linear-gradient(90deg, #4d84ff, #7ca5ff);
}

.macro-progress-fill.fat {
  background: linear-gradient(90deg, #a26bdb, #c48ef3);
}

.meal-card {
  padding: 13px;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.meal-card-header,
.meal-header-actions,
.food-selection-summary,
.food-picker-actions,
.meal-entry-row,
.meal-entry-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.meal-card-header {
  align-items: center;
  margin-bottom: 8px;
}

.meal-header-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.meal-add-button {
  width: auto;
  padding: 8px 12px;
  border-radius: 12px;
  box-shadow: none;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.meal-sections,
.meal-entry-list {
  gap: 8px;
}

.meal-card-title-group {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.meal-card-calories {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.food-search-page-shell {
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: 16px 16px 104px;
  background: rgba(4, 10, 9, 0.82);
  backdrop-filter: blur(18px);
  overflow-y: auto;
}

.food-search-page {
  width: min(100%, 480px);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.food-search-page-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.food-page-title {
  display: grid;
  gap: 4px;
}

.food-page-title h3 {
  margin: 0;
  font-family: "Aptos Display", "Franklin Gothic Medium", "Arial Narrow", sans-serif;
  font-size: 1.35rem;
}

.food-search-input {
  border-color: rgba(0, 255, 153, 0.24);
  background: rgba(14, 24, 22, 0.98);
  box-shadow:
    inset 0 0 0 1px rgba(0, 255, 153, 0.06),
    0 0 0 1px rgba(0, 255, 153, 0.03);
}

.food-search-input::placeholder {
  color: rgba(190, 255, 226, 0.72);
}

.food-search-input:focus {
  outline: 2px solid rgba(0, 255, 153, 0.24);
  border-color: rgba(0, 255, 153, 0.46);
  box-shadow:
    inset 0 0 0 1px rgba(0, 255, 153, 0.12),
    0 0 0 3px rgba(0, 255, 153, 0.08);
}

.food-search-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.food-tab-button {
  border: 1px solid rgba(0, 255, 153, 0.1);
  border-radius: 16px;
  padding: 12px 10px;
  background: rgba(15, 24, 22, 0.9);
  color: var(--muted);
  font-weight: 800;
}

.food-tab-button.active {
  background: linear-gradient(135deg, #00ff99, #00c978);
  color: #04100b;
  border-color: transparent;
}

.search-page-card {
  gap: 16px;
}

.food-search-stage {
  display: grid;
  gap: 14px;
}

.food-results-panel,
.food-selection-panel {
  display: grid;
  gap: 12px;
}

.food-detail-overlay-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: start center;
  padding: 12px 12px 10px;
  background: rgba(2, 8, 7, 0.52);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.food-detail-overlay {
  width: min(100%, 480px);
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(15, 24, 22, 0.98), rgba(10, 16, 15, 0.96));
  border: 1px solid rgba(0, 255, 153, 0.1);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.42);
  max-height: min(calc(100dvh - 20px), 420px);
  overflow: hidden;
}

.food-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
}

.food-detail-header h3 {
  margin: 0 0 4px;
  font-family: "Aptos Display", "Franklin Gothic Medium", "Arial Narrow", sans-serif;
  font-size: 1.02rem;
}

.food-detail-overlay .field-grid.two-up {
  grid-template-columns: minmax(0, 1.3fr) minmax(92px, 0.7fr);
  gap: 8px;
}

.food-detail-overlay .preview-copy {
  font-size: 0.84rem;
  line-height: 1.25;
}

.food-detail-overlay .eyebrow {
  margin-bottom: 4px;
}

.food-picker-card {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(0, 255, 153, 0.08);
}

.food-search-results {
  max-height: 280px;
  overflow-y: auto;
}

.provider-pill {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.provider-pill.live {
  background: rgba(0, 255, 153, 0.12);
  color: var(--accent);
}

.provider-pill.fallback {
  background: rgba(77, 132, 255, 0.12);
  color: var(--blue);
}

.picker-feedback {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(16, 24, 22, 0.92);
  border: 1px solid rgba(0, 255, 153, 0.08);
  color: var(--muted);
}

.picker-feedback.error {
  background: rgba(255, 94, 94, 0.12);
  color: #ff9d9d;
  border-color: rgba(255, 94, 94, 0.22);
}

.food-result-button {
  background: rgba(16, 24, 22, 0.94);
  border-color: rgba(0, 255, 153, 0.08);
  color: var(--ink);
}

.food-result-button.active {
  border-color: rgba(0, 255, 153, 0.28);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 153, 0.2);
}

.food-result-button span {
  color: var(--muted);
}

.food-selection-summary {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(16, 24, 22, 0.9);
  border: 1px solid rgba(0, 255, 153, 0.08);
}

.food-selection-tools {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.diary-inline-button {
  width: auto;
  padding: 8px 10px;
  color: var(--muted);
  border-color: rgba(0, 255, 153, 0.12);
  font-size: 0.84rem;
}

.favorite-star-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(234, 190, 37, 0.28);
  border-radius: 50%;
  padding: 0;
  background: rgba(255, 248, 214, 0.86);
  color: #d0a300;
  font-size: 1.18rem;
  line-height: 1;
}

.favorite-star-button.active {
  background: rgba(255, 235, 140, 0.92);
  border-color: rgba(208, 163, 0, 0.35);
  color: #f2bc00;
}

.food-draft-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(16, 24, 22, 0.92);
  border: 1px solid rgba(0, 255, 153, 0.08);
  font-size: 0.82rem;
}

.food-macro-chart {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(12, 19, 17, 0.92);
  border: 1px solid rgba(0, 255, 153, 0.08);
}

.food-macro-chart.empty {
  grid-template-columns: 1fr;
}

.food-macro-chart-visual {
  width: 94px;
  height: 94px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.food-macro-chart-visual.empty {
  background: rgba(255, 255, 255, 0.05);
}

.food-macro-chart-visual.empty span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.food-macro-chart-center {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  gap: 2px;
  text-align: center;
  background: rgba(6, 11, 10, 0.96);
  border: 1px solid rgba(0, 255, 153, 0.08);
}

.food-macro-chart-center strong,
.food-macro-legend-item strong {
  margin: 0;
  font-family: "Aptos Display", "Franklin Gothic Medium", "Arial Narrow", sans-serif;
}

.food-macro-chart-center strong {
  font-size: 0.84rem;
}

.food-macro-chart-center span,
.food-macro-legend-item span {
  color: var(--muted);
  font-size: 0.68rem;
}

.food-macro-chart-legend {
  display: grid;
  gap: 6px;
}

.food-macro-legend-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
}

.food-macro-legend-item strong {
  font-size: 0.84rem;
}

.food-macro-swatch {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.food-detail-overlay .field-block {
  gap: 6px;
}

.food-detail-overlay label {
  font-size: 0.82rem;
}

.food-detail-overlay input,
.food-detail-overlay select {
  padding: 11px 12px;
}

.food-detail-overlay .food-picker-actions {
  margin-top: 2px;
}

.meal-entry-row {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 24, 22, 0.88);
  border: 1px solid var(--line);
}

.meal-entry-copy p {
  margin: 4px 0 0;
}

.meal-entry-edit {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.meal-entry-edit:hover strong,
.meal-entry-edit:focus-visible strong {
  color: var(--accent);
}

.meal-entry-edit:focus-visible {
  outline: 2px solid rgba(0, 255, 153, 0.18);
  outline-offset: 4px;
  border-radius: 12px;
}

.meal-entry-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.meal-entry-calories {
  font-weight: 800;
  color: #d7e5df;
}

.meal-entry-delete {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.meal-entry-delete:hover {
  color: var(--accent);
}

.fatsecret-attribution {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.fatsecret-attribution img {
  width: min(100%, 220px);
  height: auto;
}

.fatsecret-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.entry-title-row,
.entry-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.entry-title-row {
  margin-bottom: 10px;
}

.entry-meta-row {
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.metric-chip {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #d7e5df;
  font-weight: 700;
}

.empty-state {
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed rgba(92, 114, 107, 0.35);
  background: rgba(13, 21, 19, 0.72);
  color: var(--muted);
}

.empty-state.dark {
  background: rgba(13, 21, 19, 0.78);
  border-color: rgba(0, 255, 153, 0.12);
  color: var(--dark-muted);
}

.logger-card {
  padding: 18px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(6, 11, 10, 0.98), rgba(12, 19, 17, 0.96));
  color: var(--dark-text);
  border: 1px solid rgba(0, 255, 153, 0.08);
  overflow: hidden;
}

.logger-header {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 24px;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.logger-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(0, 255, 153, 0.2), rgba(0, 255, 153, 0.08));
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 800;
}

.logger-title-group h3 {
  font-size: 1.2rem;
  color: var(--accent);
}

.logger-title-group h3 span {
  color: inherit;
}

.logger-title-group p {
  margin: 6px 0 0;
  color: var(--dark-muted);
  font-size: 0.92rem;
}

.logger-menu-button {
  border: 0;
  background: transparent;
  color: var(--dark-muted);
  font-size: 1.7rem;
  line-height: 1;
  padding: 0;
}

.logger-notes input {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dark-text);
  font-size: 1rem;
}

.logger-notes input::placeholder {
  color: var(--dark-muted);
}

.logger-notes input:focus {
  outline: none;
}

.rest-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
  color: var(--accent);
  font-size: 1rem;
}

.rest-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid currentColor;
  font-size: 0.8rem;
}

.set-table {
  display: grid;
  gap: 8px;
  width: 100%;
  overflow-x: hidden;
}

.set-table-head,
.set-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1.35fr) 74px 64px 44px;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.set-table-head {
  color: var(--dark-muted);
  padding: 2px 4px;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
}

.set-row {
  padding: 8px 4px;
  border-radius: 16px;
}

.set-row.completed,
.set-row.current {
  background: transparent;
}

.set-row.completed {
  background: rgba(47, 143, 91, 0.22);
  box-shadow: inset 0 0 0 1px rgba(111, 215, 154, 0.18);
}

.set-row.future {
  background: rgba(255, 255, 255, 0.03);
}

.set-row.swiping {
  background: rgba(255, 84, 84, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 120, 120, 0.22);
}

.set-label {
  font-size: 1.35rem;
  font-weight: 800;
  text-align: center;
  line-height: 1;
}

.set-label-button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
}

.set-label-button:hover .set-label {
  color: var(--accent);
}

.set-previous {
  color: var(--dark-muted);
  font-size: 0.84rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.set-input {
  text-align: center;
  min-width: 0;
  padding: 10px 6px;
  border-radius: 12px;
  font-size: 0.98rem;
  font-weight: 800;
}

.set-input:disabled {
  opacity: 0.78;
  cursor: not-allowed;
}

.set-check {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--dark-text);
  font-size: 1.1rem;
  font-weight: 800;
  justify-self: end;
}

.set-check:disabled {
  opacity: 0.65;
}

.set-check.checked {
  background: var(--accent);
  color: #04100b;
}

.add-set-button {
  width: 100%;
  margin-top: 16px;
  border: 0;
  border-radius: 20px;
  padding: 18px;
  background: rgba(15, 23, 21, 0.96);
  color: var(--dark-text);
  font-size: 1rem;
  font-weight: 700;
}

.add-exercise-button {
  margin-top: 20px;
  background: linear-gradient(135deg, #00ff99, #00c978);
  color: #04100b;
}

.add-set-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.session-link-button {
  border: 1px solid rgba(0, 255, 153, 0.12);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(0, 255, 153, 0.04);
  color: var(--dark-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: min(calc(100% - 20px), 520px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border-radius: 16px;
  z-index: 30;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  transition: transform 160ms ease, opacity 160ms ease;
}

.bottom-nav.keyboard-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(18px);
}

.nav-button {
  border: 0;
  border-radius: 14px;
  padding: 7px 8px 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 2px;
}

.nav-icon {
  position: relative;
  width: 20px;
  height: 18px;
  font-size: 0;
  line-height: 1;
  opacity: 0.95;
}

.nav-icon::before,
.nav-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  color: currentColor;
}

.nav-button[data-target-view="workout"] .nav-icon::before {
  width: 18px;
  height: 10px;
  background:
    linear-gradient(currentColor, currentColor) center / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 1px center / 2px 10px no-repeat,
    linear-gradient(currentColor, currentColor) calc(100% - 1px) center / 2px 10px no-repeat,
    linear-gradient(currentColor, currentColor) 4px center / 2px 6px no-repeat,
    linear-gradient(currentColor, currentColor) calc(100% - 4px) center / 2px 6px no-repeat;
  border-radius: 999px;
}

.nav-button[data-target-view="progress"] .nav-icon::before {
  width: 18px;
  height: 18px;
  background:
    linear-gradient(currentColor, currentColor) left 2px bottom 3px / 2px 6px no-repeat,
    linear-gradient(currentColor, currentColor) center bottom 3px / 2px 10px no-repeat,
    linear-gradient(currentColor, currentColor) right 2px bottom 3px / 2px 14px no-repeat,
    linear-gradient(currentColor, currentColor) center calc(100% - 2px) / 16px 2px no-repeat;
}

.nav-button[data-target-view="diary"] .nav-icon::before {
  width: 16px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.nav-button[data-target-view="diary"] .nav-icon::after {
  width: 10px;
  height: 8px;
  background:
    linear-gradient(currentColor, currentColor) center 0 / 10px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center 50% / 10px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 6px 2px no-repeat;
}

.nav-button.active {
  background: rgba(0, 255, 153, 0.14);
  color: var(--accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 560px) {
  .summary-strip,
  .progress-grid {
    grid-template-columns: 1fr;
  }

  .hero-card h2 {
    font-size: 1.75rem;
  }

  .field-grid.two-up {
    grid-template-columns: 1fr;
  }

  .food-search-page-shell {
    padding: 12px 12px 98px;
  }

  .food-detail-overlay-shell {
    padding: 10px 10px 8px;
    place-items: start center;
  }

  .food-detail-header {
    flex-direction: row;
  }

  .food-detail-overlay {
    max-height: min(calc(100dvh - 16px), 390px);
    gap: 8px;
    padding: 10px;
  }

  .food-search-page-header,
  .food-selection-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .food-detail-overlay .field-grid.two-up {
    grid-template-columns: minmax(0, 1.25fr) minmax(84px, 0.75fr);
    gap: 8px;
  }

  .food-macro-chart {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    text-align: left;
  }

  .food-macro-chart-visual {
    width: 88px;
    height: 88px;
  }

  .food-macro-chart-center {
    width: 50px;
    height: 50px;
  }

  .food-macro-chart-center strong {
    font-size: 0.8rem;
  }

  .food-macro-chart-legend {
    width: 100%;
    gap: 5px;
  }

  .food-detail-overlay .food-selection-tools {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
  }

  .food-search-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .food-tab-button {
    padding: 10px 8px;
    font-size: 0.82rem;
  }

  .diary-view .diary-summary-panel {
    top: 6px;
    padding: 12px;
  }

  .diary-summary-head {
    flex-direction: row;
    align-items: start;
  }

  .macro-progress-stack {
    gap: 6px;
  }

  .diary-date-nav {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 10px;
    padding: 10px;
  }

  .date-nav-button {
    width: 40px;
    height: 40px;
    font-size: 1.35rem;
  }

  .diary-date-nav-copy strong {
    font-size: 1rem;
  }

  .panel-header,
  .food-selection-summary,
  .food-picker-actions,
  .meal-entry-row,
  .meal-entry-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .daily-calorie-pill,
  .meal-entry-calories {
    text-align: left;
  }

  .daily-calorie-pill {
    font-size: 0.74rem;
  }

  .meal-card-header,
  .meal-header-actions {
    flex-direction: row;
    align-items: center;
  }

  .meal-add-button {
    padding: 7px 11px;
    font-size: 0.78rem;
  }

  .bottom-nav {
    bottom: 8px;
    padding: 5px;
    gap: 5px;
  }

  .nav-button {
    padding: 7px 8px 6px;
  }

  .nav-label {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
  }

  .set-table-head,
  .set-row {
    grid-template-columns: 34px minmax(0, 1fr) 62px 52px 38px;
    gap: 6px;
  }

  .set-label {
    font-size: 1.08rem;
  }

  .set-input {
    padding: 8px 4px;
    font-size: 0.9rem;
  }

  .set-previous {
    font-size: 0.74rem;
  }

  .set-check {
    width: 36px;
    height: 36px;
    font-size: 0.92rem;
  }

  .set-table-head {
    font-size: 0.58rem;
  }
}
