/* =========================================
   GLOBAL
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #0f0f0f; color: #e8e8e8;
  display: flex; justify-content: center;
  padding: 3rem 1rem; min-height: 100vh;
}
.container { max-width: 720px; width: 100%; }

/* =========================================
   BRAND & HEADER
   ========================================= */
.brand { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 2.5rem; }
.brand a { display: flex; align-items: center; gap: 0.6rem; color: inherit; text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: #f97316; color: #0f0f0f; /* <-- Changed from #fff */
  display: grid; place-items: center;
  font-weight: 700; font-size: 1rem;
}
.brand-name { font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand-name span { color: #f97316; }
h1 { font-size: 1.8rem; margin-bottom: 0.25rem; letter-spacing: -0.02em; text-wrap: balance; }
h1 span { color: #f97316; }
.subtitle { color: #999; margin-bottom: 2rem; font-size: 0.95rem; }

/* =========================================
   CARDS & FORMS
   ========================================= */
.card {
  background: #1a1a1a; border: 1px solid #2a2a2a;
  border-radius: 12px; padding: 1.5rem; margin-bottom: 1.5rem;
}
.row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.field { flex: 1; min-width: 140px; }
label { display: block; font-size: 0.85rem; color: #aaa; margin-bottom: 0.35rem; }
label .optional { color: #555; font-size: 0.75rem; margin-left: 0.25rem; }
label .hint { display: block; font-size: 0.72rem; color: #555; margin-top: 0.2rem; font-weight: 400; }
input, select {
  width: 100%; padding: 0.6rem 0.75rem;
  background: #0f0f0f; border: 1px solid #333;
  border-radius: 8px; color: #e8e8e8; font-size: 1rem;
}
input:focus, select:focus { outline: none; border-color: #f97316; }
.field-hint { font-size: 0.72rem; color: #555; margin-top: 0.35rem; line-height: 1.4; }
.field-hint a { color: #f97316; text-decoration: none; }

/* =========================================
   BUTTONS & TOGGLES
   ========================================= */
.unit-toggle { display: flex; gap: 0.5rem; margin-bottom: 1rem; justify-content: space-between; align-items: center; }
.unit-toggle .units { display: flex; gap: 0.5rem; }
.unit-toggle button {
  padding: 0.4rem 1rem; border-radius: 999px; border: 1px solid #333;
  background: transparent; color: #aaa; cursor: pointer; font-size: 0.85rem;
}
.unit-toggle button.active { background: #f97316; color: #0f0f0f; border-color: #f97316; }
.reset-link { color: #aaa; font-size: 0.8rem; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.reset-link:hover { color: #f97316; }

.calculate-btn {
  width: 100%; padding: 0.9rem; border: none; border-radius: 8px;
  background: #f97316; color: #0f0f0f; font-size: 1rem; font-weight: 600;
  cursor: pointer; margin-top: 0.5rem;
}
.calculate-btn:hover { background: #ea580c; }
.calculate-btn:disabled { background: #333; color: #666; cursor: not-allowed; }

.tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1rem 0; }
.tabs button {
  padding: 0.4rem 0.9rem; border-radius: 999px;
  border: 1px solid #333; background: transparent;
  color: #aaa; cursor: pointer; font-size: 0.85rem;
}
.tabs button.active { background: #f97316; color: #0f0f0f; border-color: #f97316; }

.gender-toggle { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }
.gender-toggle button {
  flex: 1; padding: 0.6rem 1rem; border-radius: 8px;
  border: 1px solid #333; background: transparent;
  color: #aaa; cursor: pointer; font-size: 0.9rem; font-family: inherit;
}
.gender-toggle button.active { background: #f97316; color: #0f0f0f; border-color: #f97316; }

/* =========================================
   RESULTS & STATS
   ========================================= */
.summary-bar {
  background: #1a1a1a; border: 1px solid #2a2a2a;
  border-radius: 12px; padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem; display: none; align-items: center; justify-content: space-between;
  gap: 1rem; font-size: 0.85rem; color: #999; flex-wrap: wrap;
}
.summary-bar.visible { display: flex; }
.summary-bar .edit-link { color: #f97316; cursor: pointer; font-size: 0.8rem; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }

.results { display: none; }
.results.visible { display: block; }
.big-number { font-size: 2.4rem; font-weight: 700; color: #f97316; letter-spacing: -0.02em; }
.big-number span { font-size: 1rem; color: #888; font-weight: 400; }
.metric-label { font-size: 0.85rem; color: #888; margin-bottom: 0.25rem; }
.formula-note { font-size: 0.75rem; color: #555; margin-top: 0.35rem; }

.section-title { font-size: 0.75rem; color: #666; text-transform: uppercase; letter-spacing: 0.08em; margin: 1.5rem 0 0.5rem; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1rem; }
.stat-item { text-align: center; }
.stat-value { font-size: 1.3rem; font-weight: 600; color: #f97316; }
.stat-label { font-size: 0.75rem; color: #888; margin-top: 0.15rem; }
.stat-detail { font-size: 0.7rem; color: #555; margin-top: 0.1rem; }
.disclaimer { font-size: 0.8rem; color: #666; margin-top: 1.5rem; line-height: 1.5; }
.hidden { display: none; }

/* =========================================
   TOOL SPECIFIC (Macro, Deficit, BMI, BodyFat)
   ========================================= */
.macro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1rem; }
.macro-item { text-align: center; }
.macro-value { font-size: 1.4rem; font-weight: 600; }
.macro-label { font-size: 0.8rem; color: #888; }
.macro-pct { font-size: 0.7rem; color: #555; }

.bmi-scale, .bf-scale { position: relative; margin: 1.75rem 0 2.25rem; padding-top: 0.35rem; }
.bmi-bar, .bf-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; }
.bmi-bar .seg, .bf-bar .seg { flex: 1; }
.bmi-marker, .bf-marker {
  position: absolute; top: 0; width: 3px; height: 20px;
  background: #fff; border-radius: 2px; transform: translateX(-50%);
  transition: left 0.4s ease; box-shadow: 0 0 0 2px #0f0f0f;
}
.bmi-scale-labels { display: flex; margin-top: 0.5rem; font-size: 0.65rem; color: #666; }
.bmi-scale-labels span { text-align: center; }
.bf-scale-ends { display: flex; justify-content: space-between; font-size: 0.65rem; color: #555; margin-top: 0.4rem; }
.category-label { font-size: 1rem; font-weight: 600; margin-top: 0.25rem; }
.cat-table { margin-top: 1.5rem; background: #0f0f0f; border: 1px solid #262626; border-radius: 10px; overflow: hidden; }
.cat-table .cat-row { display: flex; justify-content: space-between; padding: 0.5rem 1rem; font-size: 0.8rem; color: #888; border-bottom: 1px solid #1f1f1f; }
.cat-table .cat-row:last-child { border-bottom: none; }
.cat-table .cat-row.active { background: #1a1005; color: #f97316; font-weight: 600; }

.hero { text-align: center; padding: 0.5rem 0 1.5rem; border-bottom: 1px solid #262626; }
.hero-value { font-size: 3rem; font-weight: 700; color: #f97316; letter-spacing: -0.03em; line-height: 1; }
.hero-unit { font-size: 1rem; color: #888; margin-top: 0.5rem; }
.hero-date { font-size: 0.9rem; color: #aaa; margin-top: 0.75rem; }
.hero-date strong { color: #e8e8e8; }
.milestones { margin-top: 1.5rem; background: #0f0f0f; border: 1px solid #262626; border-radius: 10px; overflow: hidden; }
.milestone-row { display: flex; justify-content: space-between; align-items: center; padding: 0.7rem 1rem; border-bottom: 1px solid #1f1f1f; font-size: 0.85rem; }
.milestone-row:last-child { border-bottom: none; }
.milestone-row.goal { background: #1a1005; color: #f97316; font-weight: 600; }
.milestone-week { color: #888; font-size: 0.8rem; }
.milestone-row.goal .milestone-week { color: #f97316; }
.milestone-weight { font-weight: 600; }
.milestone-loss { color: #555; font-size: 0.78rem; }
.milestone-row.goal .milestone-loss { color: #a75c1a; }
.warning { margin-top: 1.25rem; padding: 0.9rem 1.1rem; background: #2a1505; border: 1px solid #4a2508; border-radius: 8px; font-size: 0.82rem; color: #f0b27a; line-height: 1.5; }
.warning strong { color: #f97316; }

/* =========================================
   RECOMMENDED / AFFILIATE
   ========================================= */
.recommended { margin-top: 2rem; }
.recommended h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 0.35rem; }
.recommended .intro { font-size: 0.85rem; color: #888; margin-bottom: 1.25rem; line-height: 1.5; }
.rec-subhead { font-size: 0.7rem; color: #666; text-transform: uppercase; letter-spacing: 0.08em; margin: 1.25rem 0 0.6rem; }
.rec-subhead:first-of-type { margin-top: 0; }
.rec-item { display: flex; align-items: center; gap: 1rem; background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 10px; padding: 0.85rem 1rem; margin-bottom: 0.5rem; text-decoration: none; color: inherit; transition: border-color 0.15s, background 0.15s; }
.rec-item:hover { border-color: #f97316; background: #1d1d1d; }
.rec-item img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: #262626; }
.rec-body { flex: 1; min-width: 0; }
.rec-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.15rem; }
.rec-desc { font-size: 0.78rem; color: #888; line-height: 1.4; }
.rec-arrow { color: #555; font-size: 1rem; flex-shrink: 0; }
.rec-item:hover .rec-arrow { color: #f97316; }
.affiliate-note { font-size: 0.72rem; color: #555; margin-top: 1rem; line-height: 1.5; }

/* =========================================
   NEXT STEPS
   ========================================= */
.next-steps { margin-top: 2rem; background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 12px; padding: 1.25rem 1.5rem; }
.next-steps h2 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.35rem; }
.next-steps p { font-size: 0.85rem; color: #888; line-height: 1.5; margin-bottom: 0.85rem; }
.next-steps a { display: inline-flex; align-items: center; gap: 0.4rem; color: #f97316; text-decoration: none; font-size: 0.9rem; font-weight: 600; margin-right: 1rem; }
.next-steps a:hover { color: #ea580c; }

/* =========================================
   FOOTER (Styles used by the JS)
   ========================================= */
footer { text-align: center; color: #888; font-size: 0.8rem; margin-top: 2rem; line-height: 1.6; }
footer a { color: #999; text-decoration: none; }
footer a:hover { color: #f97316; }
footer .sep { color: #666; margin: 0 0.5rem; }
footer .copyright { margin-top: 0.75rem; color: #888; font-size: 0.75rem; }

/* =========================================
   HOME PAGE SPECIFIC
   ========================================= */
h1.home-h1 { font-size: 2.2rem; margin-bottom: 0.5rem; line-height: 1.15; }
.lede { color: #999; font-size: 1rem; margin-bottom: 2.5rem; line-height: 1.6; max-width: 52ch; }
.tools { display: grid; gap: 0.75rem; }
.tool { display: flex; align-items: center; gap: 1rem; background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 12px; padding: 1.1rem 1.25rem; text-decoration: none; color: inherit; transition: border-color 0.15s, background 0.15s; }
.tool:hover { border-color: #f97316; background: #1d1d1d; }
.tool-icon { width: 40px; height: 40px; border-radius: 10px; background: #262626; display: grid; place-items: center; font-size: 1.15rem; flex-shrink: 0; }
.tool-body { flex: 1; }
.tool-title { font-weight: 600; margin-bottom: 0.15rem; }
.tool-desc { font-size: 0.85rem; color: #888; line-height: 1.4; }
.tool-arrow { color: #555; font-size: 1.2rem; }
.tool:hover .tool-arrow { color: #f97316; }
.badge { display: inline-block; font-size: 0.65rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 999px; background: #f9731622; color: #f97316; text-transform: uppercase; letter-spacing: 0.05em; margin-left: 0.5rem; vertical-align: middle; }

/* =========================================
   TEXT PAGES (About, FAQ, Privacy, Terms)
   ========================================= */
.card h2 {
  font-size: 1.05rem; margin-bottom: 0.75rem; margin-top: 1.5rem;
  letter-spacing: -0.01em;
}
.card h2:first-child { margin-top: 0; }
.card p {
  line-height: 1.7; color: #c8c8c8; margin-bottom: 1rem; font-size: 0.9rem;
}
.card p:last-child { margin-bottom: 0; }
.card ul {
  margin: 0.5rem 0 0.75rem 1.25rem; color: #c8c8c8; font-size: 0.9rem; line-height: 1.7;
}
.card ul li { margin-bottom: 0.35rem; }
.card a {
  color: #f97316; text-decoration: none;
}
.card a:hover { text-decoration: underline; }
.card strong { color: #e8e8e8; }

/* Specific styling for the About page tool list */
.tool-list { list-style: none; margin-top: 0.5rem; margin-left: 0 !important; }
.tool-list li {
  font-size: 0.9rem; color: #c8c8c8;
  padding: 0.5rem 0;
  border-bottom: 1px solid #262626;
  line-height: 1.5;
  margin-bottom: 0 !important;
}
.tool-list li:last-child { border-bottom: none; }
.tool-list a { color: #e8e8e8; text-decoration: none; }
.tool-list a:hover { color: #f97316; }
.tool-list a strong { color: inherit; }
.tool-list strong { color: #e8e8e8; }

/* =========================================
   FAQ / ACCORDION
   ========================================= */
details {
  background: #1a1a1a; border: 1px solid #2a2a2a;
  border-radius: 12px; padding: 1.1rem 1.25rem;
  margin-bottom: 0.75rem;
}
details[open] { border-color: #333; }
summary {
  font-weight: 600; cursor: pointer;
  list-style: none; display: flex; justify-content: space-between;
  align-items: center; gap: 1rem;
  font-size: 0.95rem;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: '+'; color: #f97316; font-weight: 400;
  font-size: 1.3rem; line-height: 1;
}
details[open] summary::after { content: '−'; }
details p {
  margin-top: 0.85rem; line-height: 1.7;
  color: #c8c8c8; font-size: 0.9rem;
}
details a { color: #f97316; text-decoration: none; }
details a:hover { text-decoration: underline; }