/* Health — Athletic Performance Design System */

@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap');

:root {
  --forest: #0b1f17;
  --forest-mid: #143528;
  --forest-soft: #1a4534;
  --lime: #c8ff3d;
  --lime-dim: #a8d932;
  --mist: #e7eee9;
  --mist-deep: #d4ddd7;
  --ink: #06140f;
  --ink-muted: #3d5248;
  --ember: #ff6b35;
  --teal: #2dd4bf;
  --amber: #f5a623;
  --surface: #ffffff;
  --surface-2: #f3f7f4;
  --border: rgba(6, 20, 15, 0.1);
  --shadow: 0 12px 40px rgba(11, 31, 23, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --nav-h: 64px;
  --bottom-nav-h: 72px;
  --font-display: 'Syne', sans-serif;
  --font-body: 'Figtree', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

[data-theme='dark'] {
  --mist: #0b1f17;
  --mist-deep: #0a1812;
  --ink: #f2f7f4;
  --ink-muted: #9bb5a8;
  --surface: #143528;
  --surface-2: #1a4534;
  --border: rgba(200, 255, 61, 0.12);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--mist);
  background-image:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(200, 255, 61, 0.18), transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(45, 212, 191, 0.1), transparent 45%),
    linear-gradient(165deg, var(--mist) 0%, var(--mist-deep) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

[data-theme='dark'] body {
  background-image:
    radial-gradient(ellipse 70% 45% at 15% -5%, rgba(200, 255, 61, 0.12), transparent 50%),
    radial-gradient(ellipse 50% 35% at 95% 5%, rgba(45, 212, 191, 0.08), transparent 45%),
    linear-gradient(165deg, #0b1f17 0%, #06140f 100%);
}

body.has-bottom-nav {
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}

a {
  color: var(--forest-mid);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color 0.2s var(--ease);
}

[data-theme='dark'] a {
  color: var(--lime);
}

a:hover {
  color: var(--lime-dim);
}

[data-theme='dark'] a:hover {
  color: #e0ff7a;
}

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

/* —— Typography —— */
.brand-mark,
.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  text-transform: uppercase;
}

.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}

.page-sub {
  color: var(--ink-muted);
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.section-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}

/* —— Layout —— */
/* Opacity-only enter: a lingering transform on <main> breaks Bootstrap
   position:fixed modals (containing-block). Fill-mode backwards so no
   animated properties stick after the animation ends. */
.app-main {
  animation: pageEnter 0.45s var(--ease) backwards;
}

@keyframes pageEnter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.app-container {
  width: min(1100px, calc(100% - 2rem));
  margin-inline: auto;
  padding-block: 1.5rem 2rem;
}

@media (min-width: 992px) {
  .app-container {
    padding-block: 2rem 3rem;
  }
}

/* —— Top nav —— */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--forest) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(200, 255, 61, 0.15);
}

.app-nav .nav-inner {
  width: min(1100px, calc(100% - 2rem));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.app-nav .wordmark {
  color: var(--lime) !important;
  font-size: 1.35rem;
  text-decoration: none;
}

.app-nav .wordmark:hover {
  color: #e0ff7a !important;
}

.app-nav .nav-links {
  display: none;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 992px) {
  .app-nav .nav-links {
    display: flex;
  }
}

.app-nav .nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.9rem;
  color: rgba(231, 238, 233, 0.75);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.app-nav .nav-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.app-nav .nav-links a.active {
  color: var(--lime);
}

.app-nav .nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 6px;
  height: 2px;
  background: var(--lime);
  border-radius: 2px;
  transform-origin: center;
  animation: navUnderline 0.35s var(--ease) both;
}

@keyframes navUnderline {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(200, 255, 61, 0.25);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--lime);
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease), border-color 0.2s var(--ease);
}

.icon-btn:hover {
  background: rgba(200, 255, 61, 0.12);
  border-color: var(--lime);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn .icon-sun {
  display: none;
}

[data-theme='dark'] .icon-btn .icon-moon {
  display: none;
}

[data-theme='dark'] .icon-btn .icon-sun {
  display: block;
}

/* —— Bottom nav (mobile) —— */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  display: flex;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--forest) 94%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(200, 255, 61, 0.18);
}

@media (min-width: 992px) {
  .bottom-nav {
    display: none;
  }

  body.has-bottom-nav {
    padding-bottom: 0;
  }
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 44px;
  color: rgba(231, 238, 233, 0.55);
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 10px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}

.bottom-nav a svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav a.active {
  color: var(--lime);
  background: rgba(200, 255, 61, 0.1);
  transform: translateY(-1px);
}

.bottom-nav a:hover {
  color: #fff;
}

/* —— Buttons —— */
.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.7rem 1.35rem;
  border: none;
  border-radius: 10px;
  background: var(--lime);
  color: var(--forest) !important;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--lime-dim) 70%, #000);
}

.btn-accent:hover {
  background: #d4ff5c;
  color: var(--forest) !important;
  transform: translateY(-1px);
}

.btn-accent:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--lime-dim) 70%, #000);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none !important;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.15s var(--ease);
}

.btn-ghost:hover {
  border-color: var(--lime-dim);
  background: var(--surface-2);
  color: var(--ink);
}

.btn-ghost:active {
  transform: scale(0.97);
}

.btn-danger-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0.4rem;
  border: 1px solid color-mix(in srgb, var(--ember) 35%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--ember) 8%, transparent);
  color: var(--ember);
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
}

.btn-danger-soft:hover {
  background: color-mix(in srgb, var(--ember) 16%, transparent);
}

.btn-danger-soft:active {
  transform: scale(0.94);
}

.btn-icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.15s var(--ease);
}

.btn-icon-action:hover {
  color: var(--forest-mid);
  border-color: var(--lime-dim);
}

.btn-icon-action.is-saved {
  color: var(--forest);
  background: var(--lime);
  border-color: var(--lime);
}

.btn-icon-action svg,
.btn-danger-soft svg,
.btn-ghost svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* —— Panels & stats —— */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
}

.stat-hero {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-hero .stat-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.75rem, 8vw, 3.75rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--ink);
}

.stat-hero .stat-unit {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.macro-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.macro-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.875rem;
}

.macro-chip .macro-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  font-weight: 700;
}

.macro-chip.protein {
  border-color: color-mix(in srgb, var(--teal) 40%, transparent);
}

.macro-chip.carbs {
  border-color: color-mix(in srgb, var(--amber) 40%, transparent);
}

.macro-chip.fat {
  border-color: color-mix(in srgb, var(--lime) 40%, transparent);
}

.macro-chip.fiber {
  border-color: color-mix(in srgb, var(--teal) 55%, transparent);
}

.stat-sub {
  margin: 0 0 0.75rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.stat-sub strong {
  color: var(--ink);
  font-weight: 700;
}

.quick-list .empty-hint-li {
  list-style: none;
  color: var(--ink-muted);
  font-style: italic;
}

.today-grid {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .today-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.quick-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quick-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.quick-list li:last-child {
  border-bottom: none;
}

.quick-list .muted {
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.empty-hint {
  color: var(--ink-muted);
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.panel-actions .btn-accent,
.panel-actions .btn-ghost {
  flex: 1;
  min-width: 140px;
}

/* —— Charts —— */
.trends-section {
  margin-top: 0.5rem;
}

.chart-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .chart-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .chart-grid-wide {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .chart-grid-wide {
    grid-template-columns: repeat(3, 1fr);
  }
}

.chart-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 0.75rem;
  box-shadow: var(--shadow);
}

.chart-panel h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.chart-wrap {
  height: 180px;
  position: relative;
}

@media (max-width: 575px) {
  .chart-wrap {
    height: 160px;
  }
}

/* —— Date rail —— */
.date-rail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.date-rail .date-input {
  flex: 1 1 140px;
  max-width: 180px;
  min-height: 44px;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
}

.date-rail .btn-ghost.is-today {
  border-color: var(--lime);
  background: color-mix(in srgb, var(--lime) 18%, var(--surface));
  color: var(--forest);
  font-weight: 700;
}

[data-theme='dark'] .date-rail .btn-ghost.is-today {
  color: var(--lime);
}

.date-rail-spacer {
  flex: 1;
  min-width: 0.5rem;
}

/* —— Log composer —— */
.log-composer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.log-composer textarea {
  width: 100%;
  min-height: 96px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.log-composer textarea:focus {
  outline: none;
  border-color: var(--lime-dim);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 25%, transparent);
}

.photo-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1.5px dashed color-mix(in srgb, var(--ink-muted) 35%, transparent);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}

.photo-drop:hover,
.photo-drop:focus-within {
  border-color: var(--lime-dim);
  color: var(--ink);
  background: color-mix(in srgb, var(--lime) 8%, var(--surface-2));
}

.photo-drop input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.photo-drop svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

.composer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.feedback {
  font-weight: 600;
  font-size: 0.9rem;
}

.feedback.is-error {
  color: var(--ember);
}

.feedback.is-ok {
  color: var(--forest-mid);
}

[data-theme='dark'] .feedback.is-ok {
  color: var(--lime);
}

.feedback.is-pending {
  color: var(--ink-muted);
}

/* —— Entry lists —— */
.entry-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.entry-row {
  display: grid;
  gap: 0.65rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.entry-row.entry-header {
  padding: 0.35rem 1.1rem;
  background: transparent;
  border: none;
  box-shadow: none;
}

.entry-row.entry-header .field-label {
  display: block;
  margin: 0;
}

@media (min-width: 768px) {
  .entry-row.food-entry {
    grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(52px, 0.55fr)) auto;
    align-items: center;
  }
}

.entry-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.entry-field .field-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.entry-field [contenteditable] {
  min-height: 36px;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 600;
  word-break: break-word;
}

.entry-field [contenteditable]:focus {
  outline: none;
  border-color: var(--lime-dim);
  background: var(--surface-2);
}

.entry-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

@media (max-width: 767px) {
  .entry-row.food-entry {
    grid-template-columns: 1fr 1fr;
  }

  .entry-row.food-entry .entry-field-name {
    grid-column: 1 / -1;
  }

  .entry-row.food-entry .entry-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .desktop-only-label {
    display: inline;
  }
}

@media (min-width: 768px) {
  .entry-field .field-label.mobile-label {
    display: none;
  }
}

.totals-bar {
  position: sticky;
  bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 0.5rem);
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1rem;
  padding: 0.9rem 1.15rem;
  background: var(--forest);
  color: #e7eee9;
  border-radius: var(--radius);
  border: 1px solid rgba(200, 255, 61, 0.25);
  box-shadow: 0 8px 28px rgba(11, 31, 23, 0.35);
}

@media (min-width: 992px) {
  .totals-bar {
    bottom: 1rem;
  }
}

.totals-bar .totals-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lime);
}

.totals-bar .totals-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-weight: 700;
}

.totals-bar .totals-metrics span {
  font-size: 0.9rem;
}

.totals-bar .totals-metrics em {
  font-style: normal;
  color: rgba(231, 238, 233, 0.55);
  font-weight: 600;
  font-size: 0.75rem;
  margin-right: 0.25rem;
}

.meta-badge {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--lime) 18%, var(--surface-2));
  color: var(--ink-muted);
}

.totals-bar[hidden] {
  display: none !important;
}

.builder-controls-top {
  margin-bottom: 0.75rem;
  align-items: flex-end;
}

.builder-field-grow {
  flex: 1 1 180px;
  min-width: 0;
}

.places-manage-link {
  align-self: flex-end;
  white-space: nowrap;
}

.place-equipment-preview {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
  line-height: 1.4;
}

.place-equipment-preview.is-empty a {
  color: var(--lime);
  font-weight: 700;
}

.place-text-input,
.place-notes-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
}

.place-notes-input {
  resize: vertical;
  min-height: 110px;
  font-weight: 500;
}

.place-text-input:focus,
.place-notes-input:focus {
  outline: none;
  border-color: var(--lime-dim);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 25%, transparent);
}

.places-back {
  margin: 0 0 1rem;
}

.place-form-panel,
.places-list-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.place-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.place-default-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.place-default-check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--lime);
}

.places-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.place-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 0.9rem 1rem;
}

.place-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.place-card-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.place-default-badge {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--forest);
  color: #e7eee9;
}

.place-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.place-card-notes {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.meta-badge {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--lime) 18%, var(--surface-2));
  color: var(--ink-muted);
}

.totals-bar[hidden] {
  display: none !important;
}

.section-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

.section-sub {
  margin: 0.25rem 0 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.composer-heading {
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.workout-builder {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.builder-header {
  margin-bottom: 1rem;
}

.muscle-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.muscle-chip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.muscle-chip:hover {
  border-color: var(--lime-dim);
}

.muscle-chip.is-selected,
.muscle-chip[aria-pressed='true'] {
  background: var(--forest);
  border-color: var(--forest);
  color: #e7eee9;
}

.builder-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.builder-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 140px;
}

.builder-select {
  min-height: 42px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
}

.builder-select:focus {
  outline: none;
  border-color: var(--lime-dim);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 25%, transparent);
}

.active-session {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.session-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.session-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  width: 100%;
}

.session-actions .btn-accent,
.session-actions .btn-ghost {
  flex: 1 1 0;
  justify-content: center;
  text-align: center;
  min-height: 44px;
  padding-inline: 0.75rem;
  font-size: 0.9rem;
}

.session-progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.session-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--lime);
  transition: width 0.25s var(--ease);
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.session-group-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: var(--ink);
}

.session-focus {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-left: 0.35rem;
}

.session-set {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.45rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  margin-bottom: 0.35rem;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.session-set.is-next {
  border-color: var(--lime-dim);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--lime) 18%, transparent);
}

.session-set.is-done {
  opacity: 0.72;
  background: color-mix(in srgb, var(--lime) 10%, var(--surface-2));
}

.session-set-label {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.1;
  padding-bottom: 0.55rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.session-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0;
  min-width: 0;
  flex: 1 1 0;
}

.session-input-wrap .field-label {
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.session-input {
  width: 100%;
  min-height: 40px;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
}

.session-input:focus {
  outline: none;
  border-color: var(--lime-dim);
}

.session-done-btn {
  flex: 0 0 2.75rem;
  width: 2.75rem;
  max-width: 2.75rem;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

.session-done-btn.is-done,
.session-done-btn[aria-pressed='true'] {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--forest);
}

#sessionFeedback {
  margin-top: 0.85rem;
}

@media (min-width: 641px) {
  .session-actions {
    width: auto;
  }

  .session-actions .btn-accent,
  .session-actions .btn-ghost {
    flex: 0 0 auto;
  }

  .session-set {
    gap: 0.65rem;
    padding: 0.75rem;
  }

  .session-set-label {
    font-size: 0.85rem;
  }

  .session-done-btn {
    flex-basis: auto;
    width: auto;
    max-width: none;
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 640px) {
  .active-session {
    padding: 0.9rem 0.85rem;
  }

  .session-header {
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
  }

  .session-set-label {
    padding-bottom: 0.45rem;
    min-width: 2.4rem;
  }

  .session-set-label,
  .session-done-btn {
    grid-column: auto;
  }
}

/* —— Workout groups —— */
.workout-groups {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.workout-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.workout-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  padding: 0.85rem 1.15rem;
  border: none;
  background: var(--forest);
  color: #e7eee9;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.workout-group-header:hover {
  background: var(--forest-mid);
}

.workout-group-header .chevron {
  display: inline-flex;
  transition: transform 0.25s var(--ease);
}

.workout-group-header[aria-expanded='true'] .chevron {
  transform: rotate(180deg);
}

.workout-group-header .chevron svg {
  width: 18px;
  height: 18px;
  stroke: var(--lime);
  fill: none;
  stroke-width: 2.5;
}

.workout-sets {
  display: none;
  padding: 0.65rem;
  background: var(--surface-2);
}

.workout-sets.is-open {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.entry-row.workout-entry {
  box-shadow: none;
}

@media (min-width: 768px) {
  .entry-row.workout-entry {
    grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
    align-items: center;
  }
}

@media (max-width: 767px) {
  .entry-row.workout-entry {
    grid-template-columns: 1fr 1fr;
  }

  .entry-row.workout-entry .entry-field-wide {
    grid-column: 1 / -1;
  }

  .entry-row.workout-entry .entry-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

/* —— Auth —— */
.auth-stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  background-color: var(--forest);
  background-image:
    radial-gradient(ellipse 90% 60% at 20% 10%, rgba(200, 255, 61, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 80%, rgba(45, 212, 191, 0.12), transparent 50%),
    repeating-linear-gradient(
      -28deg,
      transparent,
      transparent 40px,
      rgba(200, 255, 61, 0.03) 40px,
      rgba(200, 255, 61, 0.03) 41px
    );
}

.auth-form {
  width: 100%;
  max-width: 400px;
  animation: pageEnter 0.5s var(--ease) backwards;
}

.auth-form .brand-mark {
  display: block;
  font-size: clamp(2.75rem, 10vw, 3.5rem);
  color: var(--lime);
  margin-bottom: 0.5rem;
}

.auth-form .auth-tagline {
  color: rgba(231, 238, 233, 0.7);
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0 0 1.75rem;
}

.auth-form .form-panel {
  background: rgba(20, 53, 40, 0.65);
  border: 1px solid rgba(200, 255, 61, 0.2);
  border-radius: var(--radius);
  padding: 1.5rem 1.35rem;
  backdrop-filter: blur(8px);
}

.auth-form .form-label {
  color: rgba(231, 238, 233, 0.75);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-form .form-control {
  min-height: 48px;
  background: rgba(6, 20, 15, 0.45);
  border: 1px solid rgba(200, 255, 61, 0.18);
  color: #e7eee9;
  border-radius: 10px;
}

.auth-form .form-control:focus {
  background: rgba(6, 20, 15, 0.6);
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(200, 255, 61, 0.2);
  color: #fff;
}

.auth-form .form-control::placeholder {
  color: rgba(231, 238, 233, 0.35);
}

.auth-form .auth-footer {
  margin-top: 1.25rem;
  text-align: center;
  color: rgba(231, 238, 233, 0.55);
  font-size: 0.9rem;
}

.auth-form .auth-footer a {
  color: var(--lime);
  font-weight: 700;
  text-decoration: none;
}

.auth-form .auth-footer a:hover {
  text-decoration: underline;
}

.auth-form .qr-wrap {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
  padding: 1rem;
  background: #fff;
  border-radius: var(--radius-sm);
}

.auth-form .qr-wrap img {
  max-width: 200px;
  height: auto;
}

.auth-form .auth-help {
  color: rgba(231, 238, 233, 0.7);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.auth-alert {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ember) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--ember) 45%, transparent);
  color: #ffc9b3;
  font-weight: 600;
  text-align: center;
}

/* —— Modals (Bootstrap) —— */
.modal {
  z-index: 1080;
}

.modal-backdrop {
  z-index: 1070;
}

.modal-content {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.modal-header,
.modal-footer {
  border-color: var(--border);
}

.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
}

.btn-close {
  filter: none;
}

[data-theme='dark'] .btn-close {
  filter: invert(1) grayscale(100%);
}

/* —— Native confirm dialogs (food / workout delete) —— */
.confirm-dialog {
  margin: auto;
  border: none;
  border-radius: 20px;
  padding: 0;
  width: min(380px, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  color: var(--ink);
  background: var(--surface);
  box-shadow:
    0 0 0 1px rgba(255, 107, 53, 0.28),
    0 28px 56px rgba(0, 0, 0, 0.45);
  overflow: clip;
}

.confirm-dialog:focus {
  outline: none;
}

.confirm-dialog::backdrop {
  background: rgba(6, 20, 15, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.confirm-dialog[open] {
  animation: confirmIn 0.28s var(--ease) both;
}

@keyframes confirmIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.confirm-dialog .confirm-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.15rem;
  width: 100%;
  padding: 1.75rem 1.5rem 1.5rem;
  box-sizing: border-box;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 107, 53, 0.16), transparent 60%);
}

.confirm-dialog .confirm-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 16px;
  background: rgba(255, 107, 53, 0.12);
  border: 1px solid rgba(255, 107, 53, 0.4);
  color: #ff6b35;
  flex-shrink: 0;
}

.confirm-dialog .confirm-icon svg {
  display: block;
  width: 26px;
  height: 26px;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.confirm-dialog .confirm-copy {
  text-align: center;
}

.confirm-dialog .confirm-copy h2 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
}

.confirm-dialog .confirm-copy p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink-muted);
  font-weight: 500;
}

.confirm-dialog .confirm-footer {
  display: flex;
  flex-direction: row;
  gap: 0.65rem;
  width: 100%;
  margin-top: 0.25rem;
}

.confirm-dialog .confirm-footer > * {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  min-height: 48px;
  justify-content: center;
}

.confirm-dialog .confirm-footer .btn-ghost {
  background: transparent;
  border: 1px solid rgba(200, 255, 61, 0.28);
  color: var(--ink);
}

[data-theme='dark'] .confirm-dialog .confirm-footer .btn-ghost {
  color: #e7eee9;
  border-color: rgba(200, 255, 61, 0.28);
  background: rgba(255, 255, 255, 0.04);
}

.confirm-dialog .confirm-footer .btn-ghost:hover {
  border-color: var(--lime);
  background: rgba(200, 255, 61, 0.08);
}

.confirm-dialog .confirm-footer .btn-ember {
  box-shadow: 0 3px 0 #c24a22;
}

.confirm-dialog .confirm-footer .btn-ember:hover {
  background: #ff7a4a;
  transform: translateY(-1px);
}

.confirm-dialog .confirm-footer .btn-ember:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #c24a22;
}

.btn-ember {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--ember);
  border: none;
  color: #fff !important;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  min-height: 44px;
  border-radius: 10px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn-ember:hover {
  background: #e85a28;
  color: #fff !important;
}

/* —— Forms override (app pages) —— */
.form-control,
.form-select {
  border-radius: 10px;
  border-color: var(--border);
  background: var(--surface);
  color: var(--ink);
  min-height: 44px;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--lime-dim);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 25%, transparent);
  background: var(--surface);
  color: var(--ink);
}

/* —— Admin —— */
.admin-page .page-title {
  margin-bottom: 1.25rem;
}

.admin-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.admin-table-wrap table {
  margin: 0;
  color: var(--ink);
}

.admin-table-wrap thead th {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--forest) !important;
  color: var(--lime) !important;
  border-color: var(--forest-mid) !important;
  white-space: nowrap;
}

.admin-table-wrap td {
  vertical-align: middle;
  border-color: var(--border) !important;
}

.admin-table-wrap .datatable-wrapper .datatable-top,
.admin-table-wrap .datatable-wrapper .datatable-bottom {
  padding: 0.5rem 0;
  color: var(--ink-muted);
}

.admin-table-wrap .datatable-wrapper .datatable-input,
.admin-table-wrap .datatable-wrapper .datatable-selector {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  min-height: 40px;
  padding: 0.35rem 0.65rem;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.action-buttons .btn {
  min-height: 36px;
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: 8px;
}

.badge-yes,
.badge-no {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-yes {
  background: color-mix(in srgb, var(--lime) 25%, transparent);
  color: var(--forest);
}

[data-theme='dark'] .badge-yes {
  color: var(--lime);
}

.badge-no {
  background: var(--surface-2);
  color: var(--ink-muted);
}

.row-deactivated {
  opacity: 0.65;
}

/* —— Utility —— */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.text-muted-athletic {
  color: var(--ink-muted) !important;
}

.greeting-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
}

.day-grade-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.day-grade-panel[hidden] {
  display: none !important;
}

.day-grade-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.day-grade-overall {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.grade-letter {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--lime);
}

.grade-letter-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.grade-table {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.grade-row {
  display: grid;
  grid-template-columns: 7.5rem 3.25rem 1fr;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.grade-cat {
  font-weight: 700;
  color: var(--ink);
}

.grade-mark {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--lime);
}

.grade-notes {
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.grade-protein-gap {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--ink);
}

.grade-block {
  margin-top: 0.85rem;
}

.grade-block h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.grade-block p {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.5;
}

@media (max-width: 640px) {
  .greeting-actions {
    align-items: stretch;
    width: 100%;
  }

  .grade-row {
    grid-template-columns: 1fr auto;
  }

  .grade-notes {
    grid-column: 1 / -1;
  }
}

.greeting-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1.5rem;
}

.greeting-date {
  font-weight: 600;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.btn-ghost svg,
.btn-icon-action svg,
.btn-danger-soft svg,
.icon-btn svg,
.bottom-nav a svg,
.photo-drop svg {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workout-group-header .chevron svg {
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .app-main,
  .auth-form,
  .app-nav .nav-links a.active::after {
    animation: none !important;
  }

  .btn-accent,
  .btn-ghost,
  .icon-btn,
  .bottom-nav a {
    transition: none !important;
  }
}

/* Bootstrap card/list overrides when used in themed pages */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
}

.list-group-item {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
}

.table {
  color: var(--ink);
}

.alert {
  border-radius: 10px;
}
