/* 
   LAYOUT COMPONENTS - App Structure & Shared Components
   Main layout, navigation, containers, shared UI components, and responsive design
*/

/* ========================================
   MAIN LAYOUT STRUCTURE
   ======================================== */

.main-container {
  gap: 1.5%;
  align-items: start;
  padding: 0;
  height: auto;
  min-height: fit-content;
  width: 100%;
  grid-template-columns: 1fr;
  overflow: visible;
}

.tab-content {
  height: calc(100vh - 60px); /* REVERTED navigation to px */
  overflow: visible;
}

.tab {
  display: none;
  overflow-y: auto;
  height: 100%;
}

.tab.active { 
  display: block; 
}

/* ========================================
   NAVIGATION BAR - REVERTED to px/vh
   ======================================== */

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  backdrop-filter: blur(10px); /* REVERTED to px */
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem; 
  justify-content: center;
}

.nav-btn {
  border: 1px solid transparent; /* REVERTED to px */
  padding: 0.5rem 1.2rem; 
  display: flex;
  align-items: center;
  gap: 0.4rem; 
  font-size: var(--size-sm);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  font-weight: 600;
  margin: 0;
  text-align: center;
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  min-height: 44px; /* REVERTED to px */
  min-width: 44px; /* REVERTED to px */
}

.nav-btn svg {
  width: 1.2rem; 
  height: 1.2rem; 
  transition: transform 0.2s;
}

.nav-action-btn {
  width: auto !important;
  margin: 0 !important;
  padding: var(--space-sm) !important;
  min-width: 44px; /* REVERTED to px */
  min-height: 44px; /* REVERTED to px */
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent; /* REVERTED to px */
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.nav-action-btn svg {
  width: 1.2rem; 
  height: 1.2rem; 
  transition: transform 0.2s;
}

.nav-action-btn:hover svg {
  transform: scale(1.1);
}

/* Add visual separation between nav tabs and action buttons */
#crisisBtn {
  margin-left: 1rem; 
}

.import-all-file-input {
  display: none;
}

/* Enhanced Cloud Dropdown Styling */
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem); 
  right: 0;
  border: 1px solid transparent; /* REVERTED to px */
  border-radius: var(--radius-md);
  z-index: 1000;
  min-width: 200px; /* REVERTED to px */
  overflow: hidden;
  display: none; /* Hidden by default */
}

/* Consistent dropdown positioning for all nav dropdowns */
.nav-dropdown-container {
  position: relative;
  display: inline-block;
}

.nav-dropdown-container .nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  min-width: 250px;
  overflow: hidden;
  display: none;
}

/* Enhanced dropdown sections */
.dropdown-section {
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.dropdown-section:last-child {
  border-bottom: none;
}

.dropdown-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  padding: 0 1rem;
  color: var(--color-gray);
}

.checkbox-option,
.radio-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.checkbox-option:hover,
.radio-option:hover {
  background: var(--color-light-gray);
}

.checkbox-option input[type="checkbox"],
.radio-option input[type="radio"] {
  margin: 0;
  transform: scale(1.1);
}

.radio-option label {
  margin: 0;
  cursor: pointer;
  font-size: 0.9rem;
}

/* Ensure dropdown appears above other content on mobile */
@media (max-width: 768px) {
  .nav-dropdown-menu {
    position: fixed !important;
    top: 61px !important;
    right: 1rem !important;
    left: 1rem !important;
    z-index: 9999 !important;
    transform: none !important;
    width: auto !important;
    max-width: calc(100vw - 2rem) !important;
  }

  .nav-buttons {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0.25rem; 
    overflow: visible;
    max-width: 100%;
  }
}

/* Enhanced dropdown sections */
.dropdown-section {
  padding: 0.75rem 0;
}

.dropdown-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  padding: 0 1rem;
}

.dropdown-section-title .dropdown-icon {
  width: 1rem;
  height: 1rem;
}

.dropdown-divider {
  height: 1px;
  margin: 0.5rem 0;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.checkbox-option input[type="checkbox"] {
  margin: 0;
  transform: scale(1.1);
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.theme-preview {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  flex-shrink: 0;
}

/* Google Drive connected state styling */
.dropdown-item.connected {
  font-weight: 600;
}

/* ========================================
   FLOATING BUTTONS (only for future use)
   ======================================== */

/* ========================================
   ACHIEVE VISION CARD
   ======================================== */

.achieve-card {
  border-radius: var(--radius-md);
  padding: 1.5%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 400px; /* REVERTED to px */
}

.achieve-vision-wrapper {
  position: relative;
  width: 100%;
  min-height: 350px; /* REVERTED to px */
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vision-content {
  width: 100%;
  height: 100%;
  min-height: 350px; /* REVERTED to px */
  display: flex;
  align-items: center;
  justify-content: center;
}

.vision-content img,
.vision-content iframe,
.vision-content video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.vision-content .quote-content {
  font-size: clamp(1.5rem, 4vw, 3rem); /* REVERTED to rem/vw */
  text-align: center;
  line-height: 1.4;
  padding: 2rem; 
  font-weight: 600;
}

/* ========================================
   GAMIFICATION OVERLAYS
   ======================================== */
/* Gamification container - now works for both achieve card and thumbnail */
.gp-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  pointer-events: auto;
}

.gp-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  pointer-events: auto;
  z-index: 200;
  gap: none;
}

.gp-overlay .gp-cell {
  opacity: 1;
  transition: opacity 0.4s ease-in-out, background 0.4s;
}

.gp-overlay .gp-cell.cleared {
  opacity: 0;
}

/* Modal GP overlay should inherit main grid structure */
.vision-reward-modal .gp-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  pointer-events: auto;
  z-index: 200;
  gap: none;
  border-radius: var(--radius-sm);
  /* Grid template will be set dynamically to match main overlay */
}

.vision-reward-modal .gp-overlay .gp-cell {
  opacity: 1;
  transition: opacity 0.4s ease-in-out, background 0.4s, transform 0.2s ease;
  cursor: pointer;
  border: none;
  min-height: auto;
}

.vision-reward-modal .gp-overlay .gp-cell:hover {
  transform: scale(0.95);
}

.vision-reward-modal .gp-overlay .gp-cell:active {
  transform: scale(0.9);
}

.vision-reward-modal .gp-overlay .gp-cell.cleared {
  opacity: 0;
  transform: scale(0.8);
}

.gp-filter {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: auto;
  z-index: 150;
  background-image: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 1px, /* REVERTED to px */
      rgba(255,255,255,0.02) 1px, /* REVERTED to px */
      rgba(255,255,255,0.02) 2px /* REVERTED to px */
    );
  transition: backdrop-filter 0.3s ease-out, opacity 0.3s ease-out;
  opacity: 1;
}

.gp-filter::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Vision content filters */
/* Thumbnail-specific gamification scaling */
.vision-thumbnail-card .gp-container {
  border-radius: calc(var(--radius-md) - 2px); /* REVERTED to px */
  overflow: hidden;
}

.vision-thumbnail-card .gp-overlay {
  border-radius: calc(var(--radius-md) - 2px); /* REVERTED to px */
  /* Smaller grid for thumbnail - 6x6 instead of larger grid */
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
}

.vision-thumbnail-card .gp-overlay .gp-cell.cleared {
  opacity: 0;
}

/* Vision content in thumbnail with filters */
.vision-thumbnail-card .thumbnail-vision-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: calc(var(--radius-md) - 2px); /* REVERTED to px */
  overflow: hidden;
}

.vision-thumbnail-card .thumbnail-vision-content.greyscale {
  filter: grayscale(100%);
  transition: filter 0.5s ease-in-out;
}

.vision-thumbnail-card .thumbnail-vision-content.greyscale img,
.vision-thumbnail-card .thumbnail-vision-content.greyscale video,
.vision-thumbnail-card .thumbnail-vision-content.greyscale iframe {
  filter: grayscale(100%) contrast(33%) opacity(67%);
  transition: filter 0.5s ease-in-out;
}

.vision-thumbnail-card .thumbnail-vision-content.complete {
  filter: none;
}

.vision-thumbnail-card .thumbnail-vision-content img,
.vision-thumbnail-card .thumbnail-vision-content iframe,
.vision-thumbnail-card .thumbnail-vision-content video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-md) - 2px); /* REVERTED to px */
}

/* Thumbnail quote content */
.vision-thumbnail-card .thumbnail-quote-content {
  font-size: var(--size-xxs); 
  text-align: center;
  line-height: 1.2;
  padding: 0.5rem; 
  font-weight: 600;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

/* Thumbnail filter effects */
.vision-thumbnail-card .gp-filter {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: auto;
  z-index: 150;
  border-radius: calc(var(--radius-md) - 2px); /* REVERTED to px */
  background-image: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 1px, /* REVERTED to px */
      rgba(255,255,255,0.02) 1px, /* REVERTED to px */
      rgba(255,255,255,0.02) 2px /* REVERTED to px */
    );
  transition: backdrop-filter 0.3s ease-out, opacity 0.3s ease-out;
  opacity: 1;
}

.vision-content.greyscale {
  filter: grayscale(100%);
  transition: filter 0.5s ease-in-out;
}

.vision-content.greyscale img,
.vision-content.greyscale video,
.vision-content.greyscale iframe {
  filter: grayscale(100%) contrast(33%) opacity(67%);
  transition: filter 0.5s ease-in-out;
}

.vision-content.complete {
  filter: none;
}

/* Gamification cells */

.gp-cell.color-reveal {
  background: transparent !important;
}

/* ========================================
   SHARED CARD STYLES
   ======================================== */

.counter-card,
.trackables-card,
.diet-card,
.tool-card,
.playlists-card,
.container-card {
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: fit-content;
}

.playlists-card {
  overflow: visible;
  min-height: fit-content;
  max-height: none;
}

.playlists-card #playlistsList {
  overflow: visible;
  max-height: none;
  width: 100%;
}

.playlist-item {
  overflow: visible;
}

.playlist-grid-container {
  overflow: visible;
}

.no-playlists {
  text-align: center;
  font-style: italic;
  padding: 2rem;
  margin: 0;
}

/* ========================================
   SHARED WORKSPACE VIEWS & CONTAINMENT
   ======================================== */

.activity-workspace {
  border: 2px solid transparent;
  border-top: none;
  border-radius: 0 12px 12px 12px;
  min-height: 500px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.workspace-view {
  position: relative;
  width: 100%;
  height: 100%;
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.workspace-view:not(.active) {
  display: none !important; /* Completely hide inactive tabs */
}

.workspace-view.active {
  display: flex !important;
  flex-direction: column;
  position: relative;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   SHARED INPUT STYLES
   ======================================== */

input[type="text"],
input[type="number"],
input[type="time"],
textarea,
select {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: var(--size-sm);
  font-family: inherit;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
  outline: none;
}

input[type="number"] {
  width: 100%;
  text-align: center;
  -moz-appearance: textfield;
  min-width: 80px;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

textarea {
  resize: vertical;
  min-height: 4.5vh; /* Keep vh for viewport relation */
  width: 100%;
}

select {
  cursor: pointer;
  width: var(--select-width, auto);
  min-width: var(--select-min-width, 8ch);
  max-width: 100%;
  flex-shrink: 0;
  font-size: var(--size-md);
}

.task-input {
  width: 100%;
  padding: var(--space-sm);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: var(--size-sm);
}

/* Responsive dropdown width adjustments */
@media (max-width: 768px) {
  select {
    /* Ensure mobile dropdowns don't get too wide */
    max-width: min(100%, 40ch);
  }
  
  /* Override for very narrow mobile containers */
  .form-row select {
    max-width: min(100%, 30ch);
  }
}

/* ========================================
   SHARED BUTTON STYLES
   ======================================== */

button {
  border: none;
  padding: var(--space-sm) var(--space-xl);
  border-radius: var(--radius-sm);
  font-size: var(--size-sm);
  cursor: pointer;
  margin-top: var(--space-sm);
  width: 100%;
  transition: all 0.2s;
  font-family: inherit;
}

button:disabled { 
  cursor: not-allowed; 
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--size-sm);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  gap: var(--space-xs);
  white-space: nowrap;
}

.btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--size-xs);
}

/* ========================================
   SHARED FORM COMPONENTS
   ======================================== */

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--size-xs);
  margin-bottom: var(--space-sm);
  font-size: var(--size-sm);
  cursor: pointer;
  min-height: 44px; /* REVERTED to px */
  padding: 8px 0; /* REVERTED to px */
}

/* Ensure minimum touch targets */
button,
.checkbox-label input[type="checkbox"],
.nav-btn,
input[type="checkbox"] {
  min-height: 44px; /* REVERTED to px */
  min-width: 44px; /* REVERTED to px */
}

/* ========================================
   TEXT OVERFLOW HANDLING
   ======================================== */

.counter-name,
.task-input,
.food-name,
.exercise-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ========================================
   SHARED SECTION STYLES
   ======================================== */

.card-section,
.rules-section {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid transparent; /* REVERTED to px */
}

.card-section:last-child,
.rules-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* ========================================
   COUNTERS SPECIFIC LAYOUT
   ======================================== */

.counters-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.counter-card {
  position: relative;
}

.counter-name {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 2px solid transparent; /* REVERTED to px */
  border-radius: var(--radius-sm);
  font-size: var(--size-lg);
  font-weight: bold;
  text-align: center;
  margin: 0 0 var(--space-lg) 0;
}

.counter-name:focus { 
  outline: none; 
}

.input-group { 
  display: flex; 
  align-items: center; 
  gap: var(--space-md); 
  margin-bottom: var(--space-lg); 
}

.input-group label { 
  min-width: 6%; 
  flex-shrink: 0; 
  font-size: var(--size-sm); 
  font-weight: 500; 
}

.inc-dec-btn {
  width: 3%; 
  min-width: 2.5vw; /* Keep vw for responsive scaling */
  font-weight: bold; 
  cursor: pointer; 
  user-select: none;
  transition: all .2s;
  font-size: var(--size-md);
  border: 1px solid transparent; /* REVERTED to px */
}

.inc-dec-btn:first-child { 
  border-radius: var(--radius-sm) 0 0 var(--radius-sm); 
  border-right: none; 
}

.inc-dec-btn:last-child { 
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; 
  border-left: none; 
}

/* Counter Progress Bar */
.progress-container { 
  position: relative; 
  margin-bottom: var(--space-xl); 
}

.progress-display {
  height: 10vh; /* Keep vh for viewport relation */
  min-height: 100px; /* REVERTED to px */
  border-radius: var(--radius-md);
  display: flex; 
  align-items: center; 
  justify-content: center;
  overflow: hidden; 
  position: relative;
}

.progress-fill {
  position: absolute; 
  inset: 0 auto auto 0;
  width: 0%; 
  height: 100%;
  transition: width .3s ease;
}

.progress-text {
  position: relative; 
  z-index: 1;
  padding: var(--space-md);
  text-align: center; 
  font-weight: bold;
  display: flex; 
  flex-direction: column; 
  justify-content: center; 
  align-items: center;
  width: 100%; 
  height: 100%; 
  white-space: nowrap; 
  line-height: 1.2;
}

.progress-btn {
  z-index: 2;
  position: absolute; 
  top: 50%; 
  transform: translateY(-50%);
  width: 3vw; /* Keep vw for responsive scaling */
  max-height: 60px; /* REVERTED to px */
  height: 60%;
  border: 2px solid transparent; /* REVERTED to px */
  border-radius: var(--radius-sm);
  font-size: var(--size-xl); 
  font-weight: bold;
  cursor: pointer; 
  user-select: none; 
  transition: all .2s;
}

.dec-progress { 
  left: .5rem; 
}

.inc-progress { 
  right: .5rem; 
}

/* ========================================
   DIET CARD SPECIFIC STYLING
   ======================================== */

.stats-inputs { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 1vw; /* Keep vw for responsive scaling */
  align-items: flex-start; 
  margin-bottom: var(--space-lg); 
}

.stat-input-group { 
  display: inline-block; 
  min-width: 8vw; /* Keep vw for responsive scaling */
}

.stat-input-group label { 
  display: block; 
  font-size: var(--size-sm); 
  white-space: nowrap; 
  margin-bottom: var(--space-xs); 
}

.activity-input, .sex-input { 
  min-width: 12vw; /* Keep vw for responsive scaling */
  max-width: 25vw; /* Keep vw for responsive scaling */
  width: 100%; 
}

.calorie-display { 
  display: flex; 
  gap: 2vw; /* Keep vw for responsive scaling */
  margin-top: var(--space-lg); 
}

.calorie-stat { 
  flex: 1; 
  text-align: center; 
  font-size: var(--size-md); 
}

.calorie-label { 
  font-weight: bold; 
}

.calorie-progress-container { 
  margin-bottom: var(--space-lg); 
}

.calorie-progress-display {
  height: 8vh; /* Keep vh for viewport relation */
  min-height: 80px; /* REVERTED to px */
  border-radius: var(--radius-md);
  position: relative; 
  overflow: hidden; 
}

.calorie-progress-fill {
  position: absolute; 
  inset: 0 auto auto 0; 
  width: 0%; 
  height: 100%;
  transition: width .3s ease;
}

.calorie-progress-text {
  position: relative; 
  z-index: 1; 
  padding: var(--size-sm); 
  text-align: center;
  font-size: var(--size-xxl); 
  font-weight: bold; 
  display: flex; 
  flex-direction: column; 
  justify-content: center; 
  align-items: center;
  height: 100%; 
  line-height: 1.1;
}

.food-input-group, .exercise-input-group { 
  display: flex; 
  gap: var(--space-sm); 
  margin-bottom: var(--space-lg); 
}

.food-input-group input, .exercise-input-group input { 
  flex: 1; 
}

.food-input-group button, .exercise-input-group button { 
  width: auto; 
  margin-top: 0; 
}

.food-name, .exercise-name { 
  min-width: 120px; /* REVERTED to px */
}

.food-calories, .exercise-calories { 
  min-width: 80px; /* REVERTED to px */
  max-width: 120px; /* REVERTED to px */
}

.food-log, .exercise-log { 
  margin-top: var(--space-lg); 
}

.log-item {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  padding: var(--space-sm); 
  border-radius: var(--radius-sm); 
  margin-bottom: var(--space-sm);
}

.log-item-name { 
  flex: 1; 
}

.log-item-calories { 
  font-weight: bold; 
  margin: 0 var(--space-lg); 
}

.log-item-remove {
  border: none;
  width: 1.5rem; 
  height: 1.5rem; 
  border-radius: 50%; 
  cursor: pointer;
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 1rem; 
}

/* ========================================
   PROGRESS TEXT RESPONSIVE SIZING
   ======================================== */

.progress-numbers {
  font-size: clamp(1rem, calc(var(--size-xl) + 0.8vw), 2rem); /* REVERTED to rem/vw */
  white-space: nowrap;
  display: flex;
  align-items: baseline;
  gap: 0.3rem; 
}

.unitDisplay {
  font-size: clamp(0.8rem, calc(var(--size-md) + 0.2vw), 1.2rem); /* REVERTED to rem/vw */
  opacity: 0.8;
  margin-left: 0.2rem; 
}

.progress-label {
  font-size: clamp(0.7rem, calc(var(--size-sm) + 0.2vw), 1rem); /* REVERTED to rem/vw */
  font-weight: normal;
  opacity: 0.9;
  line-height: 1.2;
}

/* ========================================
   JOURNAL SECTION STYLING
   ======================================== */

.journal-section {
  margin-bottom: var(--space-xl);
}

.plan-input-group {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  align-items: center;
}

.plan-input-group label {
  min-width: 80px; /* REVERTED to px */
  font-weight: 600;
}

.check-btn {
  width: 4.5vw; /* Keep vw for responsive scaling */
  height: 4vw; /* Keep vw for responsive scaling */
  border: none;
  border-radius: var(--radius-sm);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

/* ========================================
   TRACKABLE HIERARCHY INDENTATION
   ======================================== */

/* Base child styling */
.trackable-child-item {
  margin-left: calc(var(--space-lg) * 3);
  border-left: 1px dashed transparent; /* REVERTED to px */
  padding-left: calc(var(--space-lg) * 3);
  margin-bottom: var(--space-xs);
}

/* ========================================
   COLLAPSIBLE COUNTER CARDS
   ======================================== */

.counter-card.collapsed .progress-container,
.counter-card.collapsed .input-group,
.counter-card.collapsed button:not(.collapsible-toggle),
.counter-card.collapsed .status {
  display: none;
}

.counter-card .collapsible-header {
  border: none;
  margin: 0;
  padding: 0;
}

.counter-card .counter-name {
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.counter-card .counter-name::after {
  content: '▼';
  font-size: var(--size-md);
  transition: transform 0.2s;
}

.counter-card.collapsed .counter-name::after {
  transform: rotate(-90deg);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
  :root {
    --size-xs: 1.2vw; /* Keep vw sizing for responsive */
    --size-sm: 1.8vw;
    --size-md: 2vw;
    --size-lg: 2.2vw;
    --size-xl: 2.5vw;
    --size-xxl: 3.5vw;
  }
  
  .main-container { 
    grid-template-columns: 1fr; 
  }
  
  .input-group { 
    grid-template-columns: 10vw 1fr; /* Keep vw for responsive */
  }

  .number-input-wrapper,
  .increment-wrapper { 
    width: 18vw; /* Keep vw for responsive */
  }
  
  .increment-wrapper input[type="number"] { 
    width: calc(18vw - 4.5vw); /* Keep vw for responsive */
  }
  
  .progress-btn { 
    width: 6vw; /* Keep vw for responsive */
    min-height: 60px; /* REVERTED to px */
  }
  
  .progress-display, .calorie-progress-display { 
    min-height: 60px; /* REVERTED to px */
  }
  
  .inc-dec-btn { 
    width: 4vw; /* Keep vw for responsive */
    height: 4vw; /* Keep vw for responsive */
  }
  
  .check-btn { 
    width: 4.5vw; /* Keep vw for responsive */
    height: 4vw; /* Keep vw for responsive */
  }
  
  .nav-btn { 
    font-size: clamp(0.9rem, 3.5vw, 1.2rem); /* REVERTED to rem/vw */
  }
  
  .activity-input, .sex-input { 
    max-width: 40vw; /* Keep vw for responsive */
  }
  
  .plan-input-group label { 
    min-width: 60px; /* REVERTED to px */
  }
}

@media (max-width: 768px) {
  :root {
    --size-xs: 2vw; /* Keep vw sizing for responsive */
    --size-sm: 2.5vw;
    --size-md: 3vw;
    --size-lg: 4vw;
    --size-xl: 4vw;
    --size-xxl: 5vw;
  }

  .input-group { 
    flex-wrap: wrap;
    gap: var(--space-xs); 
  }
  
  .input-group label { 
    min-width: 100%;
    margin-bottom: var(--space-xs);
  }

  .inc-dec-btn { 
    width: 8vw; /* Keep vw for responsive */
    height: 8vw; /* Keep vw for responsive */
  }
  
  select { 
    width: 18vw; /* Keep vw for responsive */
  }
  
  .nav-btn svg { 
    width: 1.1rem; 
    height: 1.1rem; 
  }
  
  .nav-btn { 
    font-size: clamp(0.8rem, 5vw, 1.1rem); /* REVERTED to rem/vw */
    padding: 0.4rem 0.8rem; 
  }
  
  .top-nav { 
    gap: 1rem; 
    height: auto;
    padding: 0.5rem; 
    justify-content: center;
  }

  .today-container,
  .tools-container,
  .imagine-container {
    padding: 0.5rem; 
    gap: 1rem; 
  }

  .achieve-card {
    min-height: 300px; /* REVERTED to px */
  }

  .achieve-vision-wrapper {
    min-height: 250px; /* REVERTED to px */
  }

  .vision-content .quote-content {
    font-size: clamp(1.2rem, 6vw, 2rem); /* REVERTED to rem/vw */
    padding: 1rem; 
  }

  .progress-btn { 
    width: 10vw; /* Keep vw for responsive */
    height: 10vh; /* Keep vh for viewport relation */
    min-height: 60px; /* REVERTED to px */
  }
  
  .progress-display, .calorie-progress-display { 
    min-height: 60px; /* REVERTED to px */
  }

  .number-input-wrapper input[type="number"],
  .increment-wrapper input[type="number"] { 
    width: 20vw; /* Keep vw for responsive */
    min-width: 60px; /* REVERTED to px */
  }

  .check-btn { 
    width: 9vw; /* Keep vw for responsive */
    height: 8vw; /* Keep vw for responsive */
  }
  
  .plan-input-group { 
    flex-wrap: wrap; 
  }
  
  .plan-input-group label { 
    min-width: 100%; 
  }
  
  input[type="time"] { 
    width: 100%; 
    min-width: 120px; /* REVERTED to px */
  }

  .stats-inputs {
    flex-direction: column;
    gap: 0.75rem; 
  }
  
  .stat-input-group {
    width: 100%;
  }
  
  .activity-input,
  .sex-input {
    width: 100%;
  }
  
  .progress-text {
    font-size: calc(var(--size-lg) + 0.3vw); /* Keep vw for responsive */
    white-space: nowrap;
  }
  
  /* Mobile positioning updates */  
  #crisisBtn {
    margin-left: 0.5rem; 
  }
  
  /* Reduce indentation on mobile for better space usage */
  
  .trackable-child-item {
    margin-left: calc(var(--space-md) * 2);
    padding-left: calc(var(--space-md) * 2);
  }
}

/* ========================================
   DRAG PREVIEW ENHANCEMENTS
   ======================================== */

.available-trackable-card[draggable="true"]:hover {
  cursor: grab;
  transform: translateY(-2px); /* REVERTED to px */
}

.sequence-item[draggable="true"]:hover {
  cursor: grab;
}

/* ========================================
   NUMBERED INPUT WRAPPERS
   ======================================== */

.number-input-wrapper,
.increment-wrapper {
  display: flex;
  align-items: stretch;
  width: fit-content;
}

.increment-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ========================================
   TOOLS TAB SPECIFIC STYLING  
   ======================================== */

.tool-card {
  width: 100%;
  max-width: none;
  flex-shrink: 0;
}

.tools-container { 
  grid-template-columns: 1fr; 
}

/* ========================================
   GOALS AND RULES CARD STYLES
   ======================================== */

/* Rules Card */
.rule-category {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid transparent; /* REVERTED to px */
}

.rule-category:last-of-type {
  border-bottom: none;
}

.category-label {
  display: block;
  font-size: var(--size-md);
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.rule-entry {
  margin-bottom: var(--space-sm);
}

/* Goals Card */
.goals-section {
  margin-bottom: var(--space-xl);
}

.goal-category {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid transparent; /* REVERTED to px */
}

.goal-category:last-of-type {
  border-bottom: none;
}

/* Goals Card - Pill-style layout */
.goal-entries {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.goal-item {
  border: 2px solid transparent; /* REVERTED to px */
  border-radius: 16px; /* REVERTED to px */
  padding: var(--space-sm) var(--space-md);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--size-xs); 
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  min-width: 150px; /* REVERTED to px */
  justify-content: space-between;
}

.goal-item:hover {
  transform: translateY(-2px); /* REVERTED to px */
}

.goal-info {
  flex: 1;
  overflow: hidden;
}

.goal-title {
  font-weight: 500;
  font-size: var(--size-xs); 
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
}

.goal-description {
  display: none;
}

.goal-actions {
  display: flex;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.edit-goal-btn {
  border: none;
  cursor: pointer;
  padding: 4px; /* REVERTED to px */
  border-radius: 50%;
  width: 24px; /* REVERTED to px */
  height: 24px; /* REVERTED to px */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--size-xs); 
  transition: all 0.2s ease;
  margin: 0;
}

.edit-goal-btn:hover {
  transform: scale(1.1);
}

.add-goal-btn {
  border: 1px solid transparent; /* REVERTED to px */
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--size-sm);
  margin-top: 0;
  width: auto;
  border-radius: var(--radius-sm);
}

/* ========================================
   QUOTA/WORD COUNT TRACKING
   ======================================== */

.quote-content {
  line-height: 1.6;
  word-spacing: 0.1em; /* REVERTED to em */
}

/* Utility Classes */
.hidden {
  display: none;
}

.section-header {
  font-weight: bold;
  margin-bottom: 0.5rem; 
}

/* Flow builder layout styles */
.flow-builder-layout {
  display: flex;
  gap: 2rem; 
  flex: 1;
}

.available-blocks-panel {
  flex: 1;
  border-right: 1px solid transparent; /* REVERTED to px */
  padding-right: 1.5rem; 
  display: flex;
  flex-direction: column;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem; 
}

.block-type-buttons {
  display: flex;
  gap: 1rem; 
}

.actions-pills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem; 
}

.flow-actions {
  display: flex;
  gap: 0.75rem; 
  margin-top: 1rem; 
}

/* ========================================
   VISIONS TAB GRID LAYOUT
   ======================================== */

.visions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-lg);
}

.vision-item {
  border-radius: var(--radius-md);
  /* REMOVED overflow: hidden - this was cutting off controls */
  transition: transform 0.2s;
  /* Ensure proper containment without clipping */
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.vision-item:hover {
  transform: translateY(-2px);
}

/* Grid spanning for various content types */
.vision-item.span-two-columns {
  grid-column: span 2;
}

.vision-item.full-width-vision {
  grid-column: 1 / -1;
}

.vision-content {
  position: relative;
  width: 100%;
  flex: 1; /* Take up available space */
  border-radius: var(--radius-md) var(--radius-md) 0 0; /* Round top corners only */
  overflow: hidden; /* Contain media content */
}

/* Different aspect ratios for different media types */
.vision-content[data-type="youtube"],
.vision-content[data-type="vimeo"] {
  aspect-ratio: 16 / 9;
}

.vision-content[data-type="soundcloud"],
.vision-content[data-type="spotify"] {
  aspect-ratio: 16 / 9;
}

.vision-content[data-type="image"] {
  aspect-ratio: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.vision-content[data-type="link"] {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vision-content[data-type="text"] {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

.vision-content[data-type="embed"] {
  aspect-ratio: auto;
  min-height: 200px;
}

/* Media elements */
.vision-content iframe,
.vision-content img,
.vision-content video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
}

/* Vision controls - ensure always visible */
.vision-controls {
  padding: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid transparent;
  border-radius: 0 0 var(--radius-md) var(--radius-md); /* Round bottom corners only */
  min-height: 48px; /* Ensure minimum height for buttons */
  flex-shrink: 0; /* Prevent shrinking */
}

.vision-title {
  font-weight: 500;
  font-size: var(--size-sm);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: var(--space-sm); /* Space between title and buttons */
}

.vision-actions {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
  flex-shrink: 0;
  /* Ensure buttons are above other elements */
  position: relative;
  z-index: 10;
}

/* Vision control buttons - enhanced visibility */
.edit-vision,
.remove-vision {
  width: 32px;
  height: 32px;
  min-width: 32px; /* Prevent shrinking */
  min-height: 32px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  transition: all 0.2s ease;
  position: relative;
  overflow: visible; /* Allow hover effects to show */
  /* Ensure buttons are clickable */
  pointer-events: auto;
  z-index: 10;
}

.edit-vision:hover {
  transform: scale(1.1);
  z-index: 11;
}

.remove-vision:hover {
  transform: scale(1.1);
  z-index: 11;
}

.edit-vision::before,
.remove-vision::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.2s ease;
}

.edit-vision:hover::before,
.remove-vision:hover::before {
  transform: scale(1);
}

.edit-vision:active,
.remove-vision:active {
  transform: scale(0.95);
}

/* Vision text content */
.vision-text {
  font-size: var(--size-lg);
  font-style: italic;
  text-align: center;
  line-height: 1.6;
}

.quote-content {
  font-size: var(--size-lg);
  font-style: italic;
  padding: var(--space-xl);
  text-align: center;
  max-width: 80%;
}

/* Edit vision modal button styling */
.edit-vision-actions {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 1.5rem;
}

.edit-vision-actions .btn-primary {
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  margin: 0;
}

.edit-vision-actions .btn-secondary {
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  margin: 0;
}

.edit-vision-actions .btn-primary:hover {
  transform: translateY(-1px);
}

.edit-vision-actions .btn-secondary:hover {
  transform: translateY(-1px);
}

/* Link preview styling */
.link-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  text-align: center;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.link-preview a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: center;
}

.link-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.6;
}

.link-title {
  font-weight: 600;
  font-size: var(--size-md);
  margin-bottom: var(--space-sm);
}

.link-url {
  font-size: var(--size-sm);
  word-break: break-all;
  line-height: 1.3;
}

/* Category badge on vision items */
.vision-category-badge {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--size-xs);
  font-weight: 600;
  z-index: 1;
  max-width: calc(100% - 2 * var(--space-sm));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-xxl);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
  opacity: 0.6;
}

.empty-state h3 {
  margin-bottom: var(--space-md);
}

.empty-state p {
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .visions-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .vision-item.span-two-columns {
    grid-column: span 1;
  }
  
  /* Ensure buttons are large enough on mobile */
  .edit-vision,
  .remove-vision {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }
}

/* Google Drive Management Modal */
.google-drive-modal {
  position: fixed;
  inset: 0;
  backdrop-filter: blur(8px); /* REVERTED to px */
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.google-drive-content {
  border-radius: var(--radius-lg);
  padding: 2rem; 
  max-width: 400px; /* REVERTED to px */
  width: 90vw; /* Keep vw for responsive */
}

.google-drive-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem; 
}

.google-drive-header h3 {
  margin: 0;
}

.close-google-drive {
  border: none;
  font-size: 1.5rem; 
  cursor: pointer;
  padding: 0;
  width: auto;
  margin: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem; 
  margin-bottom: 1.5rem; 
  padding: 1rem; 
  border-radius: var(--radius-sm);
}

.user-avatar {
  width: 50px; /* REVERTED to px */
  height: 50px; /* REVERTED to px */
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-weight: 600;
}

.user-email {
  font-size: 0.9rem; 
}

.connection-actions {
  display: flex;
  gap: 1rem; 
  justify-content: space-between;
}

.connection-actions .btn {
  flex: 1;
  margin: 0;
}

@media (max-width: 768px) {
  :root {
    --size-xs: 0.75rem;
    --size-sm: 0.875rem;
    --size-md: 1rem;
    --size-lg: 1.125rem;
    --size-xl: 1.25rem;
    --size-xxl: 1.5rem;
  }

  .main-container {
    gap: 1rem;
    max-width: 100%;
    overflow-x: hidden;
  }

  .counter-card,
  .trackables-card,
  .diet-card,
  .tool-card,
  .playlists-card,
  .container-card {
    max-width: 100%;
  }

  .input-group { 
    flex-wrap: wrap;
    gap: 0.5rem; 
  }
  
  .input-group label { 
    min-width: 100%;
    margin-bottom: 0.25rem; 
  }

  .inc-dec-btn { 
    width: 2.5rem; 
    height: 2.5rem; 
    min-width: 2.5rem; 
  }
  
  .number-input-wrapper,
  .increment-wrapper {
    width: 100%;
    max-width: 100%;
  }
  
  .number-input-wrapper input[type="number"],
  .increment-wrapper input[type="number"] {
    width: calc(100% - 5rem); 
    min-width: 60px; /* REVERTED to px */
  }
  
  select { 
    width: 100%;
    max-width: 100%;
  }
  
  .nav-btn svg { 
    width: 1.1rem; 
    height: 1.1rem; 
  }
  
  .nav-btn { 
    font-size: var(--size-xs); 
    padding: 0.4rem 0.6rem; 
  }
  
  .top-nav { 
    gap: 0.5rem; 
    height: auto;
    padding: 0.5rem; 
    justify-content: center;
  }

  .achieve-card {
    min-height: 300px; /* REVERTED to px */
  }

  .achieve-vision-wrapper {
    min-height: 250px; /* REVERTED to px */
  }

  .vision-content .quote-content {
    font-size: clamp(1.2rem, 4vw, 2rem); /* REVERTED to rem/vw */
    padding: 1rem; 
  }

  .progress-btn { 
    width: 2.5rem; 
    height: 50%;
    min-height: 40px; /* REVERTED to px */
    max-width: 2.5rem; 
  }
  
  .progress-display, .calorie-progress-display { 
    min-height: 60px; /* REVERTED to px */
  }

  .check-btn { 
    width: 3rem; 
    height: 2.5rem; 
    min-width: 44px; /* REVERTED to px */
  }
  
  .plan-input-group { 
    flex-wrap: wrap; 
  }
  
  .plan-input-group label { 
    min-width: 100%; 
  }
  
  input[type="time"] { 
    width: 100%; 
    min-width: 120px; /* REVERTED to px */
  }

  .stats-inputs {
    flex-direction: column;
    gap: 0.75rem; 
  }
  
  .stat-input-group {
    width: 100%;
  }
  
  .stat-input-group input,
  .stat-input-group select {
    width: 100%;
    max-width: 100%;
  }
  
  .activity-input,
  .sex-input {
    width: 100%;
    max-width: 100%;
    min-width: unset;
  }
  
  .progress-text {
    font-size: 1rem; 
    white-space: nowrap;
  }
  
  /* Prevent horizontal scroll on cards */
  .diet-card,
  .counter-card,
  .playlists-card,
  .trackables-card {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
  }
  
  /* Fix diet card inputs */
  .food-input-group,
  .exercise-input-group {
    flex-wrap: wrap;
    gap: 0.5rem; 
  }
  
  .food-input-group input,
  .exercise-input-group input {
    width: 100%;
    max-width: 100%;
  }
  
  .food-input-group button,
  .exercise-input-group button {
    width: 100%;
  }
  
  /* Fix counter controls */
  .input-wrapper {
    width: 100%;
    max-width: 100%;
  }
  
  .intervalUnit {
    width: auto;
    max-width: 100%;
  }
  
  /* Navigation responsiveness */  
  #crisisBtn {
    margin-left: 0.5rem; 
  }
  
  /* Reduce indentation on mobile for better space usage */
  .trackable-child-item {
    margin-left: 1rem; 
    padding-left: 1rem; 
  }
}

@media (max-width: 1024px) {
  :root {
    --size-xs: 0.75rem; 
    --size-sm: 0.875rem; 
    --size-md: 1rem; 
    --size-lg: 1.125rem; 
    --size-xl: 1.25rem; 
    --size-xxl: 1.5rem; 
  }
  
  .main-container { 
    grid-template-columns: 1fr;
    max-width: 100%;
    overflow-x: hidden;
  }
  
  .input-group { 
    grid-template-columns: auto 1fr;
    gap: 0.5rem; 
  }

  .number-input-wrapper,
  .increment-wrapper { 
    width: auto;
    max-width: 200px; /* REVERTED to px */
  }
  
  .increment-wrapper input[type="number"] { 
    width: 100px; /* REVERTED to px */
  }
  
  .progress-btn { 
    width: 3rem; 
    min-height: 60px; /* REVERTED to px */
    max-width: 3rem; 
  }
  
  .progress-display, .calorie-progress-display { 
    min-height: 60px; /* REVERTED to px */
  }
  
  .inc-dec-btn { 
    width: 2.5rem; 
    height: 2.5rem; 
  }
  
  .check-btn { 
    width: 3rem; 
    height: 2.5rem; 
  }
  
  .nav-btn { 
    font-size: 0.9rem; 
  }
  
  .activity-input, .sex-input { 
    max-width: 100%;
  }
  
  .plan-input-group label { 
    min-width: 60px; /* REVERTED to px */
  }
}