:root {
  --fm-primary: #4A9E8F;
  --fm-primary-dark: #357A6E;
  --fm-primary-soft: #E8F5F3;
  --fm-mint: #10B981;
  --fm-sky: #3B82F6;
  --fm-coral: #EF4444;
  --fm-gold: #F59E0B;
  --fm-bg: #F8F9FA;
  --fm-bg-alt: #F3F4F6;
  --fm-surface: #ffffff;
  --fm-border: #E5E7EB;
  --fm-text: #111827;
  --fm-muted: #6B7280;
  --fm-radius: 16px;
  --fm-radius-sm: 12px;
  --fm-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  --fm-shadow-sm: 0 2px 8px rgba(0, 0, 0, .06);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--fm-text);
  background: var(--fm-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--fm-primary); text-decoration: none; }
a:hover { color: var(--fm-primary-dark); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: none;
}

.btn-light {
  background: transparent;
  border: 0;
  color: var(--fm-primary);
}

.btn-light:hover,
.btn-light:focus {
  background: var(--fm-primary-soft);
  color: var(--fm-primary-dark);
}

.btn-outline-primary {
  background: transparent;
  border: 1.5px solid var(--fm-primary);
  color: var(--fm-primary);
  border-radius: 14px;
  padding: 16px 24px;
  font-size: 17px;
  font-weight: 600;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: var(--fm-primary-soft);
  border-color: var(--fm-primary);
  color: var(--fm-primary-dark);
}

.btn-outline-dark {
  background: transparent;
  border: 1.5px solid var(--fm-primary);
  color: var(--fm-primary);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

.btn-outline-dark:hover,
.btn-outline-dark:focus {
  background: var(--fm-primary-soft);
  color: var(--fm-primary-dark);
  border-color: var(--fm-primary);
}

.fm-logo {
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--fm-text);
  letter-spacing: -.02em;
  text-transform: lowercase;
}

.fm-navbar {
  background: var(--fm-surface);
  border-bottom: 1px solid var(--fm-border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  padding: .65rem 0;
}

.fm-nav-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--fm-muted);
  font-size: .9rem;
  font-weight: 600;
  padding: .45rem .8rem;
  border-radius: 99px;
}

.fm-nav-link:hover { background: var(--fm-bg); color: var(--fm-text); }
.fm-nav-link.active { background: var(--fm-primary-soft); color: var(--fm-primary); }

.fm-main { padding-bottom: 0; }
.fm-page-pad { padding-bottom: 5.25rem; }

.fm-auth-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: #fff;
}

.fm-auth-wrap { width: 100%; max-width: 430px; }

.fm-auth-title {
  color: var(--fm-text);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.5px;
  margin: 0 0 6px;
}

.fm-auth-subtitle {
  color: var(--fm-muted);
  font-size: 16px;
  margin: 0 0 36px;
}

.fm-auth-card,
.fm-card,
.fm-preview {
  background: var(--fm-surface);
  border: 0;
  border-radius: var(--fm-radius);
  box-shadow: var(--fm-shadow-sm);
  overflow: hidden;
}

.fm-auth-card { padding: 0; box-shadow: none; border-radius: 0; overflow: visible; }
.fm-card-header { padding: 1rem 1rem .75rem; border-bottom: 1px solid var(--fm-bg-alt); }
.fm-card-body { padding: 1rem; }

.fm-card-label {
  display: block;
  color: var(--fm-primary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: .2rem;
}

.form-label,
label {
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.fm-input {
  border: 1.5px solid var(--fm-border);
  border-radius: var(--fm-radius-sm);
  min-height: 48px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--fm-text);
  background: #fff;
}

.fm-input:focus {
  border-color: var(--fm-primary);
  box-shadow: 0 0 0 3px rgba(74, 158, 143, .16);
}

.fm-btn-primary {
  background: var(--fm-primary);
  color: #fff;
  border: 0;
  border-radius: 12px;
  font-weight: 600;
  padding: 13px 20px;
  font-size: 15px;
}

.btn-lg.fm-btn-primary {
  border-radius: 14px;
  padding: 16px 24px;
  font-size: 17px;
}

.fm-btn-primary:hover { background: var(--fm-primary-dark); color: #fff; }
.fm-link { font-weight: 700; }

.fm-btn-mint {
  background: var(--fm-mint);
  color: #fff;
  border: 0;
  border-radius: 12px;
  font-weight: 600;
  padding: 13px 20px;
  font-size: 15px;
}

.fm-btn-mint:hover { background: #059669; color: #fff; }

.fm-btn-sky {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  font-weight: 600;
  padding: 13px 20px;
  font-size: 15px;
}

.btn-sm.fm-btn-primary,
.btn-sm.fm-btn-mint,
.btn-sm.fm-btn-sky {
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}

.fm-btn-sky:hover { background: #bae6fd; color: #075985; }

.fm-public-nav { position: absolute; inset: 0 0 auto; z-index: 10; }

.fm-welcome-logo {
  width: 88px;
  height: 88px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background: var(--fm-primary-soft);
  box-shadow: 0 4px 12px rgba(74, 158, 143, .15);
  font-size: 42px;
}

.fm-welcome-shell {
  min-height: calc(100vh - 8rem);
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.fm-welcome-features {
  width: 100%;
  display: grid;
  gap: 14px;
  margin-top: 24px;
  text-align: left;
}

.fm-welcome-features div {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--fm-bg);
  border-radius: 12px;
  color: #374151;
  font-size: 15px;
  font-weight: 500;
}

.fm-welcome-features span {
  font-size: 22px;
  line-height: 1;
}

.fm-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: #fff;
  padding: 4rem 0 2rem;
}

.fm-hero-title {
  font-size: 36px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--fm-text);
  text-transform: lowercase;
}

.fm-hero-sub {
  max-width: 34rem;
  color: #6B7280;
  line-height: 26px;
  font-size: 17px;
}

.fm-badge {
  display: inline-flex;
  align-items: center;
  color: var(--fm-primary);
  background: var(--fm-primary-soft);
  border: 1px solid rgba(74, 158, 143, .18);
  border-radius: 999px;
  padding: .35rem .75rem;
  font-size: .78rem;
  font-weight: 800;
}

.fm-preview { padding: 1.25rem; box-shadow: var(--fm-shadow); }
.fm-preview-header, .fm-page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.fm-page-header { margin-bottom: 1.25rem; }
.fm-page-header h1 { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin: 0; }

.fm-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin: 1.25rem 0;
}

.fm-mini-tile {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .5rem;
  background: var(--fm-bg);
  border: 1px solid var(--fm-border);
  border-radius: var(--fm-radius-sm);
  padding: 1rem;
  color: var(--fm-text);
  font-weight: 700;
}

.fm-mini-tile i { color: var(--fm-primary); font-size: 1.35rem; }
.fm-surface-list { display: grid; gap: .7rem; color: var(--fm-muted); font-size: .95rem; }
.fm-surface-list i { color: var(--fm-mint); margin-right: .45rem; }

.fm-flash-container {
  position: fixed;
  top: 76px;
  right: 1rem;
  z-index: 1100;
  max-width: min(380px, calc(100vw - 2rem));
}

.fm-flash { box-shadow: var(--fm-shadow); border-radius: var(--fm-radius-sm); }

.fm-stat {
  background: var(--fm-surface);
  border: 1px solid var(--fm-border);
  border-radius: var(--fm-radius);
  padding: 1rem;
  box-shadow: var(--fm-shadow-sm);
}

.fm-stat span { display: block; font-size: 1.75rem; line-height: 1; font-weight: 800; }
.fm-stat small { color: var(--fm-muted); font-weight: 700; }
.fm-stat.danger span { color: var(--fm-coral); }

.fm-list { display: grid; gap: .75rem; }
.fm-list.flat { gap: 0; }

.fm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--fm-surface);
  border: 0;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--fm-shadow-sm);
}

.fm-list.flat .fm-row { border-radius: 0; box-shadow: none; border-width: 0 0 1px; padding-inline: 0; }
.fm-list.flat .fm-row:first-child { padding-top: 0; }
.fm-list.flat .fm-row:last-child { border-bottom: 0; padding-bottom: 0; }

.fm-row-main { min-width: 0; flex: 1; }
.fm-row-main strong { font-size: 14px; font-weight: 600; color: var(--fm-text); }
.fm-row-actions { display: flex; align-items: center; gap: .4rem; }

.fm-avatar {
  --pet-color: #4A9E8F;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--pet-color);
  color: var(--fm-text);
  font-weight: 800;
  font-size: 22px;
}

.fm-avatar.lg { width: 58px; height: 58px; flex-basis: 58px; font-size: 1.35rem; }

.fm-avatar.dog { --pet-color: #FEF3C7; }
.fm-avatar.cat { --pet-color: #EDE9FE; }
.fm-avatar.bird { --pet-color: #D1FAE5; }
.fm-avatar.rabbit { --pet-color: #FFE4D6; }
.fm-avatar.other { --pet-color: #F3F4F6; }

.fm-avatar-img {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  object-fit: cover;
  border-radius: 999px;
}

.fm-avatar-img.lg { width: 58px; height: 58px; flex-basis: 58px; }

.fm-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--fm-bg-alt);
  color: var(--fm-muted);
  font-size: 11px;
  font-weight: 600;
}

.fm-pill.done { background: #D1FAE5; color: #065F46; }
.fm-pill.scheduled { background: #DBEAFE; color: #1E40AF; }
.fm-pill.missed { background: #FEE2E2; color: #991B1B; }
.fm-pill.skipped { background: #FEF3C7; color: #92400E; }

.fm-empty {
  min-height: 300px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  gap: .7rem;
  background: var(--fm-surface);
  border: 0;
  border-radius: 16px;
  color: var(--fm-muted);
  padding: 2rem;
}

.fm-empty i { color: var(--fm-primary); font-size: 2rem; }

.fm-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin: 1rem 0;
}

.fm-metrics span {
  background: var(--fm-bg);
  border: 1px solid var(--fm-border);
  border-radius: var(--fm-radius-sm);
  padding: .7rem;
  color: var(--fm-muted);
  font-size: .85rem;
}

.fm-metrics strong { display: block; color: var(--fm-text); font-size: 1.25rem; }

.fm-day-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .45rem;
}

.fm-day-grid label { display: block; }
.fm-day-grid input { position: absolute; opacity: 0; pointer-events: none; }
.fm-day-grid span {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--fm-border);
  border-radius: var(--fm-radius-sm);
  color: var(--fm-muted);
  font-weight: 800;
  cursor: pointer;
}

.fm-day-grid input:checked + span { background: var(--fm-primary); color: #fff; border-color: var(--fm-primary); }

.fm-achievements { display: flex; flex-wrap: wrap; gap: .5rem; }
.fm-achievement {
  display: inline-flex;
  gap: .35rem;
  align-items: center;
  border-radius: 999px;
  background: #f6efd9;
  color: #73561a;
  padding: .45rem .7rem;
  font-weight: 700;
  font-size: .88rem;
}

.fm-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .7rem;
}

.fm-section-header h2 {
  margin: 0;
  color: var(--fm-text);
  font-size: 18px;
  font-weight: 700;
}

.fm-section-header a {
  color: var(--fm-primary);
  font-size: 13px;
  font-weight: 600;
}

.fm-reminder-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--fm-bg-alt);
}

.fm-reminder-row:last-child { border-bottom: 0; }

.fm-time-box {
  min-width: 76px;
  text-align: center;
  background: var(--fm-primary-soft);
  color: var(--fm-primary-dark);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}

.fm-meal-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--fm-bg-alt);
  color: var(--fm-muted);
}

.fm-meal-icon.breakfast { background: #FEF3C7; color: #B45309; }
.fm-meal-icon.lunch { background: #D1FAE5; color: #047857; }
.fm-meal-icon.dinner { background: #E8F5F3; color: #357A6E; }
.fm-meal-icon.snack { background: #FFEDD5; color: #C2410C; }
.fm-meal-icon.medication { background: #EDE9FE; color: #6D28D9; }
.fm-meal-icon.custom { background: #F3F4F6; color: #4B5563; }
.fm-meal-icon.info { background: #E8F5F3; color: #357A6E; }

.fm-info {
  background: var(--fm-bg);
  border: 1px solid var(--fm-border);
  border-radius: var(--fm-radius);
  padding: .85rem;
}

.fm-info span {
  display: block;
  color: var(--fm-muted);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: .25rem;
}

.fm-info strong { color: var(--fm-text); }

.fm-note {
  background: #E8F5F3;
  border: 1px solid #cfe9e3;
  border-radius: var(--fm-radius);
  color: #245b51;
  padding: 1rem;
}

.fm-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--fm-surface);
  border-top: 1px solid var(--fm-border);
  box-shadow: 0 -6px 18px rgba(31, 31, 31, .07);
}

.fm-bottom-nav-item {
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  color: var(--fm-muted);
  font-size: .72rem;
  font-weight: 500;
}

.fm-bottom-nav-item i { font-size: 1.18rem; }
.fm-bottom-nav-item.active { color: var(--fm-primary); background: var(--fm-primary-soft); }

.fm-log-shell {
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border-radius: 24px 24px 16px 16px;
  box-shadow: var(--fm-shadow);
  padding: 12px 20px 24px;
}

.fm-log-handle {
  width: 36px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 99px;
  background: var(--fm-border);
}

.fm-log-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.fm-log-header h1 {
  margin: 0;
  color: var(--fm-text);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.3px;
}

.fm-icon-button {
  width: 40px;
  height: 40px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--fm-muted);
  background: transparent;
}

.fm-icon-button:hover {
  color: var(--fm-text);
  background: var(--fm-bg-alt);
}

.fm-log-form {
  display: grid;
  gap: 20px;
}

.fm-field-label {
  display: block;
  margin-bottom: 10px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.fm-field-hint {
  margin-top: 6px;
  color: #9CA3AF;
  font-size: 12px;
}

.fm-chip-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.fm-pet-chip,
.fm-meal-chip {
  cursor: pointer;
  user-select: none;
}

.fm-pet-chip input,
.fm-meal-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.fm-pet-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 7px 12px 7px 8px;
  border: 1.5px solid var(--fm-border);
  border-radius: 99px;
  background: #fff;
  color: var(--fm-muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.fm-pet-chip:has(input:checked) {
  border-color: var(--fm-primary);
  background: var(--fm-primary-soft);
  color: var(--fm-primary-dark);
  font-weight: 600;
}

.fm-pet-chip img,
.fm-pet-chip-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
  background: var(--fm-bg-alt);
  font-size: 13px;
}

.fm-pet-chip-avatar.dog { background: #FEF3C7; }
.fm-pet-chip-avatar.cat { background: #EDE9FE; }
.fm-pet-chip-avatar.bird { background: #D1FAE5; }
.fm-pet-chip-avatar.rabbit { background: #FFE4D6; }
.fm-pet-chip-avatar.other { background: #F3F4F6; }

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

.fm-meal-chip span {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--fm-border);
  border-radius: 99px;
  background: #fff;
  color: var(--fm-muted);
  font-size: 13px;
  font-weight: 500;
}

.fm-meal-chip input:checked + span {
  border-color: var(--fm-primary);
  background: var(--fm-primary-soft);
  color: var(--fm-primary-dark);
  font-weight: 600;
}

.fm-time-card {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--fm-bg);
  color: var(--fm-muted);
}

.fm-time-card i {
  color: var(--fm-muted);
  font-size: 18px;
}

.fm-time-card strong {
  display: block;
  color: var(--fm-text);
  font-size: 14px;
  font-weight: 600;
}

.fm-time-card span {
  display: block;
  color: var(--fm-muted);
  font-size: 12px;
}

.fm-edit-time {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--fm-primary);
  font-size: 12px;
  font-weight: 600;
}

.fm-time-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.fm-time-fields[hidden] { display: none; }

.fm-detail-shell {
  max-width: 620px;
}

.fm-submit-wide {
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
  font-size: 15px;
}

.fm-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.fm-photo-picker {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1.5px solid var(--fm-border);
  border-radius: 16px;
  background: #fff;
  color: var(--fm-text);
}

.fm-photo-picker:hover {
  border-color: var(--fm-primary);
  background: #FAFFFE;
}

.fm-photo-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.fm-photo-picker strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.fm-photo-picker small {
  display: block;
  color: var(--fm-muted);
  font-size: 12px;
}

.fm-photo-picker i {
  margin-left: auto;
  color: var(--fm-primary);
  font-size: 20px;
}

.fm-photo-preview {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 18px;
  background: var(--fm-bg);
}

.fm-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fm-photo-emoji {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.fm-photo-emoji.dog,
.fm-species-chip.dog .fm-species-icon { background: #FEF3C7; }
.fm-photo-emoji.cat,
.fm-species-chip.cat .fm-species-icon { background: #EDE9FE; }
.fm-photo-emoji.bird,
.fm-species-chip.bird .fm-species-icon { background: #D1FAE5; }
.fm-photo-emoji.rabbit,
.fm-species-chip.rabbit .fm-species-icon { background: #FFE4D6; }
.fm-photo-emoji.other,
.fm-species-chip.other .fm-species-icon { background: #F3F4F6; }

.fm-species-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.fm-species-chip,
.fm-unit-toggle label,
.fm-day-chip {
  cursor: pointer;
  user-select: none;
}

.fm-species-chip input,
.fm-unit-toggle input,
.fm-day-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.fm-species-chip {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 6px;
  border: 1.5px solid var(--fm-border);
  border-radius: 14px;
  background: #fff;
  color: var(--fm-muted);
  font-size: 12px;
  font-weight: 500;
}

.fm-species-chip:has(input:checked) {
  border-color: var(--fm-primary);
  background: var(--fm-primary-soft);
  color: var(--fm-primary-dark);
  font-weight: 600;
}

.fm-species-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 18px;
}

.fm-weight-row {
  align-items: end;
}

.fm-unit-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fm-unit-toggle span,
.fm-day-chip span {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--fm-border);
  border-radius: 12px;
  background: #fff;
  color: var(--fm-muted);
  font-size: 14px;
  font-weight: 500;
}

.fm-unit-toggle input:checked + span,
.fm-day-chip input:checked + span {
  border-color: var(--fm-primary);
  background: var(--fm-primary-soft);
  color: var(--fm-primary-dark);
  font-weight: 600;
}

.fm-day-chip-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.fm-input-icon {
  position: relative;
}

.fm-input-icon i {
  position: absolute;
  top: 50%;
  left: 13px;
  z-index: 1;
  transform: translateY(-50%);
  color: var(--fm-muted);
}

.fm-input-icon .fm-input {
  padding-left: 40px;
}

.fm-switch-row {
  cursor: pointer;
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
  background: var(--fm-bg);
}

.fm-switch-row strong {
  display: block;
  color: var(--fm-text);
  font-size: 14px;
  font-weight: 600;
}

.fm-switch-row small {
  display: block;
  color: var(--fm-muted);
  font-size: 12px;
}

.fm-switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.fm-switch-track {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #D1D5DB;
  transition: background .18s ease;
}

.fm-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(17, 24, 39, .18);
  transition: transform .18s ease;
}

.fm-switch-row input:checked + .fm-switch-track {
  background: var(--fm-primary);
}

.fm-switch-row input:checked + .fm-switch-track::after {
  transform: translateX(20px);
}

.fm-error-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #FEE2E2;
  color: #991B1B;
  font-size: 12px;
  font-weight: 500;
}

.fm-empty.compact {
  min-height: 260px;
}

@media (max-width: 767px) {
  .fm-page-header { align-items: flex-start; flex-direction: column; }
  .fm-row { align-items: flex-start; }
  .fm-row-actions { flex-direction: column; align-items: stretch; }
  .fm-day-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fm-preview-grid { grid-template-columns: 1fr; }
  .fm-log-shell {
    margin: -8px -4px 0;
    border-radius: 24px 24px 0 0;
    box-shadow: none;
  }
  .fm-two-column { grid-template-columns: 1fr; }
  .fm-species-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fm-meal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fm-day-chip-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
