/* CineAHO Food Photo Nutrition Scanner & Intake Calculator Stylesheet */

:root {
  /* Colors */
  --brand-green: #10b981;
  --brand-green-dark: #047857;
  --brand-blue: #3b82f6;
  --brand-blue-dark: #1d4ed8;
  --brand-purple: #a855f7;
  --brand-purple-dark: #7e22ce;
  --brand-orange: #f97316;
  --brand-orange-dark: #ea580c;
  --brand-red: #ef4444;
  --brand-yellow: #fbbf24;

  --bg-dark: #060913;
  --panel-bg: rgba(14, 20, 38, 0.55);
  --border-light: rgba(255, 255, 255, 0.05);
  --text-light: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-premium: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

/* Base resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans KR', 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Grid Background */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -2;
  pointer-events: none;
}

/* Background Lighting */
.bg-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(160px);
  opacity: 0.22;
  pointer-events: none;
  z-index: -3;
}
.bg-glow-green {
  background: radial-gradient(circle, #10b981 0%, transparent 70%);
  top: -200px;
  left: 10%;
}
.bg-glow-blue {
  background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
  top: 30%;
  right: 5%;
}

/* Glass panel helpers */
.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-premium);
  transition: var(--transition-smooth);
}
.glass-panel:hover {
  border-color: rgba(16, 185, 129, 0.2);
  box-shadow: var(--shadow-premium), 0 0 25px rgba(16, 185, 129, 0.05);
}

.glass-panel-inner {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  transition: var(--transition-smooth);
}
.glass-panel-inner:hover {
  background: rgba(255, 255, 255, 0.025);
  border-color: var(--border-light);
}

/* ==========================================
     PORTAL HEADER & FOOTER
     ========================================== */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  z-index: 100;
  margin: 1rem 1.5rem 0 1.5rem;
  border-radius: 50px;
  position: sticky;
  top: 1rem;
}

.glass-header {
  background: rgba(14, 20, 38, 0.75);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.logo-circle {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--brand-green) 0%, var(--brand-blue) 100%);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-text {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.logo-text span {
  color: var(--text-muted);
  font-weight: 400;
}

.header-nav {
  flex-grow: 1;
  margin: 0 2rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.header-nav::-webkit-scrollbar {
  display: none;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 1.25rem;
  white-space: nowrap;
}

.nav-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  padding: 0.5rem 0.25rem;
  position: relative;
}

.nav-list a:hover {
  color: var(--text-light);
}

.nav-list a.active {
  color: var(--text-muted);
}

.nav-list a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--brand-green);
  border-radius: 2px;
}

.btn-back-dashboard {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  padding: 0.5rem 1.2rem;
  color: var(--text-light);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-back-dashboard:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--brand-green);
  transform: translateX(-2px);
}

.main-footer {
  text-align: center;
  padding: 4rem 2rem;
  border-top: 1px solid var(--border-light);
  margin-top: 5rem;
  background: rgba(14, 20, 38, 0.4);
}
.main-footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer-note {
  margin-top: 0.5rem;
  font-size: 0.78rem !important;
}

/* ==========================================
     MAIN CALCULATOR WORKSPACE
     ========================================== */
.calculator-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 2rem 1.5rem 6rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Back Link */
.sub-nav-back {
  display: flex;
}
.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}
.back-link:hover {
  color: var(--brand-green);
  transform: translateX(-3px);
}

/* Header Banner Card */
.app-banner {
  padding: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(14, 20, 38, 0.85) 0%, rgba(30, 41, 59, 0.4) 100%);
}
.app-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
  background: linear-gradient(to bottom, var(--brand-green), var(--brand-blue));
}

.badge-capsule {
  display: inline-block;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--brand-green);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.85rem;
  border-radius: 50px;
  margin-bottom: 0.8rem;
  letter-spacing: 0.5px;
}

.app-banner h2 {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}
.app-banner p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}
.banner-decor {
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.03);
}

/* ==========================================
     INPUTS & RESULTS GRID
     ========================================== */
.calculator-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 2rem;
}
.grid-col-input,
.grid-col-results {
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 1.2rem;
  margin-bottom: 2rem;
}
.panel-header.no-border {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 1.2rem;
}
.panel-header .title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
}
.panel-header .title-sub {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Profile Form styling */
.profile-section-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.form-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.form-select, .form-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-light);
  color: var(--text-light);
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition-smooth);
  width: 100%;
}
.form-select:focus, .form-input:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}
.form-select option {
  background-color: var(--bg-dark);
  color: var(--text-light);
}

/* Daily target mini info */
.daily-targets-banner {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 2rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.daily-targets-banner span strong {
  color: var(--brand-green);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
}

/* Photo Upload styling */
.photo-upload-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}
.upload-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.upload-drop-zone {
  border: 2px dashed rgba(16, 185, 129, 0.2);
  border-radius: 20px;
  height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
  background: rgba(0, 0, 0, 0.15);
}
.upload-drop-zone:hover, .upload-drop-zone.dragover {
  border-color: var(--brand-green);
  background: rgba(16, 185, 129, 0.02);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.05);
}

.upload-icon {
  font-size: 3rem;
  color: var(--brand-green);
  opacity: 0.7;
  transition: var(--transition-smooth);
}
.upload-drop-zone:hover .upload-icon {
  transform: translateY(-5px);
  opacity: 1;
}

.upload-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0 1rem;
}
.upload-text strong {
  color: var(--brand-green);
}

/* Image preview & Scan overlay */
.preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0; left: 0;
  z-index: 1;
  display: none;
}
.scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  background: linear-gradient(to right, transparent, var(--brand-green), transparent);
  box-shadow: 0 0 12px 2px var(--brand-green);
  z-index: 2;
  top: 0;
  display: none;
  animation: scan 2s linear infinite;
}
@keyframes scan {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

.scan-overlay-glow {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(16, 185, 129, 0.05);
  backdrop-filter: saturate(1.4);
  z-index: 1;
  display: none;
}

/* Scanning Console Logs */
.scanning-console {
  background: #02040a;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 0.85rem 1.2rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.72rem;
  color: var(--brand-green);
  min-height: 48px;
  max-height: 80px;
  overflow-y: auto;
  display: none;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.8);
}
.scanning-console .log-line {
  margin-bottom: 0.25rem;
  white-space: nowrap;
}
.scanning-console .log-line::before {
  content: "> ";
  opacity: 0.7;
}

/* Mock presets block */
.mock-presets-block {
  margin-bottom: 2rem;
}
.mock-presets-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}
.presets-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}
.preset-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  border-radius: 10px;
  padding: 0.5rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
}
.preset-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-light);
}

/* Food refine selection input */
.refine-food-section {
  border-top: 1px dashed var(--border-light);
  padding-top: 1.8rem;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.refine-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.refine-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.search-container {
  position: relative;
}
.refine-search-input {
  padding-left: 2rem;
}
.search-icon-pos {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dark);
  font-size: 0.85rem;
}
.autocomplete-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #0f1628;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  z-index: 50;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: none;
}
.autocomplete-item {
  padding: 0.65rem 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.autocomplete-item:hover {
  background: rgba(16, 185, 129, 0.08);
  color: #fff;
}

/* Serving multiplier styling */
.serving-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 0.65rem 1rem;
  margin-top: 0.5rem;
}
.serving-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}
.serving-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 30px;
  padding: 2px;
}
.serving-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.8rem;
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.serving-btn:hover {
  color: #fff;
}
.serving-btn.active {
  background: var(--brand-green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

/* ==========================================
     RESULTS COLUMNS STYLING
     ========================================== */
.radial-calorie-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 2.2rem 1.5rem;
  margin-bottom: 2rem;
  position: relative;
}

.food-details-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--brand-green);
  padding: 0.45rem 1.25rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.food-details-badge .serving-txt {
  font-weight: 500;
  opacity: 0.85;
}

/* Radial Gauge */
.gauge-container {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 1.5rem 0 1rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.radial-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}
.gauge-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 10;
}
.gauge-indicator {
  fill: none;
  stroke: var(--brand-green);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.6s;
}
.gauge-center-txt {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.gauge-val {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}
.gauge-val .kcal-lbl {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}
.gauge-pct {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-green);
  margin-top: 0.15rem;
}

/* Warning alert badges row */
.alert-badges-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  min-height: 24px;
}
.alert-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  display: none;
}
.alert-badge.red {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--brand-red);
}
.alert-badge.yellow {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.2);
  color: var(--brand-yellow);
}
.alert-badge.green {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--brand-green);
}

/* Macronutrient breakdown progress bars */
.nutrition-breakdown-section {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-bottom: 2rem;
}
.nutr-bar-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.nutr-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.82rem;
}
.nutr-label-row .name {
  font-weight: 700;
  color: var(--text-light);
}
.nutr-label-row .val {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--text-muted);
}
.nutr-label-row .val strong {
  color: #fff;
}
.nutr-label-row .pct {
  font-weight: 700;
}
.nutr-label-row.carbs .pct { color: var(--brand-blue); }
.nutr-label-row.protein .pct { color: var(--brand-green); }
.nutr-label-row.fat .pct { color: var(--brand-orange); }
.nutr-label-row.sodium .pct { color: var(--brand-purple); }

.bar-container {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.bar-indicator {
  height: 100%;
  border-radius: 4px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.4s;
}
.bar-indicator.carbs { background: var(--brand-blue); }
.bar-indicator.protein { background: var(--brand-green); }
.bar-indicator.fat { background: var(--brand-orange); }
.bar-indicator.sodium { background: var(--brand-purple); }

/* Burn off exercise recommendations */
.burn-off-section {
  border-top: 1px dashed var(--border-light);
  padding-top: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.burn-off-section h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.burn-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}
.burn-card {
  padding: 0.85rem 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.burn-card i {
  font-size: 1.4rem;
  color: var(--brand-green);
  margin-bottom: 0.4rem;
}
.burn-card .lbl {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}
.burn-card .time {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  margin-top: 0.15rem;
}

/* Meal Logger panel */
.log-meal-btn-wrapper {
  margin-top: auto;
  display: flex;
  gap: 0.75rem;
}
.btn-primary-action {
  flex-grow: 1;
  background: linear-gradient(135deg, var(--brand-green) 0%, var(--brand-green-dark) 100%);
  border: none;
  color: #fff;
  border-radius: 12px;
  padding: 0.9rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

/* ==========================================
     DAILY FOOD DIARY SECTION (BOTTOM)
     ========================================== */
.diary-section {
  padding: 2.2rem;
}
.diary-section h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Summary stats rings */
.diary-summary-grid {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.diary-summary-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-light);
  border-radius: 16px;
}
.summary-cal-circle {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.summary-cal-circle .svg-wrap {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.summary-cal-txt {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.summary-cal-txt .val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}
.summary-cal-txt .lbl {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.summary-cal-info-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.summary-cal-info-meta h4 {
  font-size: 0.95rem;
  font-weight: 700;
}
.summary-cal-info-meta p {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.summary-cal-info-meta strong {
  color: var(--brand-green);
}

.diary-summary-right {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.macro-progress-box {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}
.macro-progress-box .lbl {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.macro-progress-box .total-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}
.macro-progress-box .target-val {
  font-size: 0.68rem;
  color: var(--text-dark);
  margin-bottom: 0.8rem;
}

/* Table of Logged Meals */
.logged-meals-wrapper {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  overflow: hidden;
}
.diary-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}
.diary-table th, .diary-table td {
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border-light);
}
.diary-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-weight: 700;
}
.diary-table tr:last-child td {
  border-bottom: none;
}
.diary-table td.food-title-col {
  font-weight: 700;
  color: #fff;
}
.diary-table td.val-col {
  font-family: 'Outfit', sans-serif;
}
.diary-table .btn-delete-row {
  background: none;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 0.95rem;
}
.diary-table .btn-delete-row:hover {
  color: var(--brand-red);
  transform: scale(1.15);
}
.empty-diary-msg {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-dark);
  font-size: 0.85rem;
}

/* ==========================================
     GUIDE & FAQ & DISCLAIMER SECTION
     ========================================== */
.guide-details-section {
  padding: 2.5rem;
}
.guide-details-section h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.guide-intro {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.guide-card {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.guide-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.guide-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.guide-list li {
  display: flex;
  gap: 0.85rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.guide-list .num {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--brand-green);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.guide-list strong {
  color: var(--text-light);
}

.formula-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.formula-box .formula {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brand-green);
}
.formula-box .example {
  font-size: 0.78rem;
  color: var(--text-dark);
}
.formula-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.kdr-explanation-wrap {
  margin-bottom: 2.5rem;
}
.kdr-explanation-wrap h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.2rem;
}
.kdr-table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-light);
}
.kdr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  text-align: center;
  color: var(--text-muted);
}
.kdr-table th, .kdr-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
}
.kdr-table th {
  background: rgba(255, 255, 255, 0.02);
  color: #fff;
  font-weight: 700;
}
.kdr-table tr:last-child td {
  border-bottom: none;
}
.kdr-table td:last-child, .kdr-table th:last-child {
  border-right: none;
}

.guide-disclaimer {
  border-top: 1px solid var(--border-light);
  padding-top: 2rem;
}
.guide-disclaimer h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.disclaimer-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.disclaimer-bullets li {
  position: relative;
  padding-left: 1rem;
}
.disclaimer-bullets li::before {
  content: "•";
  color: var(--brand-yellow);
  position: absolute;
  left: 0;
  font-weight: 700;
}

/* ==========================================
     FLOATING TOOLBAR CONTROLS
     ========================================== */
.floating-controls-panel {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 100;
}

.progress-ring-wrap {
  width: 50px;
  height: 50px;
  background: rgba(14, 20, 38, 0.85);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.progress-ring-svg {
  transform: rotate(-90deg);
}
.progress-ring-circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 3;
}
.progress-ring-circle-indicator {
  fill: none;
  stroke: var(--brand-green);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 125.66;
  stroke-dashoffset: 125.66;
  transition: stroke-dashoffset 0.1s;
}
.progress-txt {
  position: absolute;
  font-family: 'Outfit', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
}

.floating-btn {
  width: 50px;
  height: 50px;
  background: rgba(14, 20, 38, 0.85);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: var(--transition-smooth);
}
.floating-btn:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--brand-green);
  color: #fff;
  transform: translateY(-2px);
}

/* Mobile Media Queries */
@media (max-width: 900px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }
  .diary-summary-grid {
    grid-template-columns: 1fr;
  }
  .diary-summary-right {
    grid-template-columns: repeat(2, 1fr);
  }
  .guide-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .profile-section-grid {
    grid-template-columns: 1fr;
  }
  .presets-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .exercise-buttons-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .food-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .burn-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .main-header {
    margin: 0.5rem;
    padding: 0.5rem 1rem;
  }
  .header-nav {
    display: none;
  }
  .diary-summary-right {
    grid-template-columns: 1fr;
  }
}
