:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #ccfbf1;
  --accent: #f97316;
  --accent-light: #fff7ed;
  --text: #1e293b;
  --text-light: #64748b;
  --bg: #f8fafc;
  --white: #ffffff;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* Header */
header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.logo span { color: var(--accent); }

nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

nav a {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

nav a:hover { background: var(--primary-light); color: var(--primary); }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  padding: 4px;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #0d9488 0%, #0891b2 100%);
  color: white;
  padding: 60px 0 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  text-align: center;
}

.hero p {
  font-size: 1.15rem;
  color: white !important;
  opacity: 0.95;
  max-width: 600px;
  margin-bottom: 32px;
  text-align: center;
  margin: 0 auto;
}

/* Calculator Form */
.calc-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  color: var(--text);
  max-width: 720px;
  margin: 0 auto;
}

.calc-card h2 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: var(--text);
}

.unit-toggle {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.unit-toggle button {
  flex: 1;
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
}

.unit-toggle button.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.form-group { display: flex; flex-direction: column; }
.form-group.full-width { grid-column: 1 / -1; }

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--white);
  color: var(--text);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,148,136,0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  width: 100%;
}

.btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover { background: var(--primary-light); }

/* Results */
.results {
  display: none;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}

.results.visible { display: block; }

.result-main {
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--primary-light) 0%, #e0f2fe 100%);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.result-main .value {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.2;
}

.result-main .label {
  font-size: 0.9rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.result-item {
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid var(--border);
}

.result-item .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.result-item .label {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 2px;
}

.result-item.highlight {
  background: var(--accent-light);
  border-color: var(--accent);
}

.result-item.highlight .value { color: var(--accent); }

/* Sections */
section { padding: 60px 0; }

section h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

section h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
  margin-top: 24px;
}

section p { margin-bottom: 16px; }

.section-alt { background: var(--white); }

/* Two-column explainer section */
.split {
  display: grid;
  grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
  gap: 44px;
  align-items: center;
}

.split-visual img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  height: auto;
}

.split-body p:last-child { margin-bottom: 0; }

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.card-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.card-icon-bmr { background: #fef3c7; color: #92400e; }
.card-icon-bmi { background: #dbeafe; color: #1d4ed8; }
.card-icon-macro { background: #fce7f3; color: #9d174d; }
.card-icon-cal { background: var(--primary-light); color: var(--primary-dark); }
.card-icon-protein { background: #fee2e2; color: #991b1b; }
.card-icon-bf { background: #e0e7ff; color: #3730a3; }
.card-icon-tdee { background: #d1fae5; color: #065f46; }
.card-icon-def { background: #ffedd5; color: #9a3412; }
.card-icon-lbm { background: #cffafe; color: #155e75; }
.card-icon-ibw { background: #fef9c3; color: #854d0e; }
.card-icon-water { background: #e0f2fe; color: #075985; }
.card-icon-rd { background: #dcfce7; color: #166534; }
.card-icon-res { background: #ede9fe; color: #5b21b6; }
.card-icon-fit { background: #ffe4e6; color: #9f1239; }
.card-icon-wr { background: #f1f5f9; color: #334155; }
.card-icon-meth { background: #e0f2fe; color: #075985; }
.card-icon-disc { background: #fee2e2; color: #991b1b; }
.card-icon-priv { background: #ede9fe; color: #5b21b6; }

.card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  margin-top: 0;
}

.card p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

.card .card-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card .card-link:hover { gap: 8px; }

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

thead { background: var(--primary); color: white; }

th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg); }

/* FAQ */
.faq-list { margin-top: 24px; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: var(--white);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 18px 24px;
  background: none;
  border: none;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.faq-question:hover { background: var(--bg); }

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--primary);
  transition: transform 0.3s;
  flex-shrink: 0;
  margin-left: 16px;
}

.faq-item.open .faq-question::after { transform: rotate(45deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 500px;
  padding: 0 24px 18px;
}

.faq-answer p {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* Breadcrumb */
.breadcrumb {
  padding: 16px 0;
  font-size: 0.85rem;
}
.breadcrumb a{ color: #ffffff; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 8px; }

/* Article Content */
.article-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 0;
}

.article-content h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
  line-height: 1.3;
}

.article-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 32px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.article-content h2 {
  font-size: 1.6rem;
  margin-top: 40px;
  margin-bottom: 16px;
}

.article-content h3 {
  font-size: 1.2rem;
  margin-top: 28px;
  margin-bottom: 12px;
}

.article-content p {
  margin-bottom: 16px;
  color: var(--text);
  line-height: 1.8;
}

.article-content ul, .article-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 8px;
  line-height: 1.7;
  color: var(--text);
}

.article-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-content blockquote p {
  color: var(--primary-dark);
  font-style: italic;
  margin-bottom: 0;
}

.key-takeaway {
  background: var(--accent-light);
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 24px 0;
}

.key-takeaway h4 {
  color: var(--accent);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.key-takeaway p { color: var(--text); margin-bottom: 0; }

/* Info Box */
.info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 24px 0;
}

.info-box h4 {
  color: #1d4ed8;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.info-box p { color: var(--text); margin-bottom: 0; }

/* Disclaimer */
.disclaimer {
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 0.85rem;
  color: #92400e;
}

.disclaimer strong { display: block; margin-bottom: 4px; }

.site-disclaimer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 20px 0;
  margin-top: 40px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Tags */
.tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 2px 4px;
}

.tag.accent {
  background: var(--accent-light);
  color: var(--accent);
}

/* Footer */
footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 60px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .logo { color: white; margin-bottom: 12px; display: inline-block; }
.footer-brand p { font-size: 0.9rem; line-height: 1.6; }

footer h4 {
  color: white;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

footer ul { list-style: none; }

footer ul li { margin-bottom: 8px; }

footer ul a {
  color: #94a3b8;
  font-size: 0.9rem;
  transition: color 0.2s;
}

footer ul a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
}

/* Page Header */
.page-header {
  background: linear-gradient(135deg, #0d9488 0%, #0891b2 100%);
  color: white;
  padding: 48px 0;
  text-align: center;
}

.page-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.page-header p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* Sidebar layout for calculator pages */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 80px;
}

.sidebar-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.sidebar-card h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  margin-top: 0;
}

.sidebar-card ul {
  list-style: none;
}

.sidebar-card ul li {
  margin-bottom: 8px;
}

.sidebar-card ul a {
  font-size: 0.9rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-card ul a:hover { color: var(--primary); }

/* Learn page grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.article-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.article-card-img {
  height: 180px;
  background: linear-gradient(135deg, var(--primary-light) 0%, #e0f2fe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.article-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card-body { padding: 24px; }

.article-card-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  margin-top: 0;
}

.article-card-body h3 a { color: var(--text); }
.article-card-body h3 a:hover { color: var(--primary); }

.article-card-body p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

/* Comparison highlight */
.winner { background: var(--primary-light); font-weight: 600; }

/* Results - Formula badge */
.result-formula {
  text-align: center;
  margin-top: 8px;
}

.formula-badge {
  display: inline-block;
  padding: 4px 14px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Results - Mini cards */
.result-mini-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.mini-card {
  padding: 16px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid var(--border);
}

.mini-card .mc-label {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.mini-card .mc-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.mini-card .mc-sub {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 2px;
}

/* Concept cards */
.concept-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.concept-card {
  padding: 24px 20px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  text-align: center;
}

.concept-card .cc-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.concept-card .cc-desc {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* Goal table */
.goal-table-wrapper {
  margin: 20px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.goal-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: none;
}

.goal-table thead {
  background: var(--primary);
  color: white;
}

.goal-table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  white-space: nowrap;
}

.goal-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  white-space: nowrap;
}

.goal-table tbody tr:last-child td { border-bottom: none; }
.goal-table tbody tr:hover { background: var(--bg); }

.goal-table tr.goal-row-maintain {
  background: var(--primary-light);
  font-weight: 600;
}

.goal-table tr.goal-row-maintain:hover {
  background: #b2f5ea;
}

.goal-table tr.goal-row-maintain td {
  border-color: #99e0d5;
}

.goal-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

.goal-tag.cut { background: #dbeafe; color: #1d4ed8; }
.goal-tag.maintain { background: var(--primary-light); color: var(--primary-dark); }
.goal-tag.bulk { background: #fef3c7; color: #92400e; }

/* Macro tabs */
.macro-section { margin-top: 24px; }

.macro-tabs {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.macro-tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
  text-align: center;
}

.macro-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow);
}

.macro-tab:hover:not(.active) {
  color: var(--text);
  background: var(--white);
}

/* Action buttons */
.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.result-actions .btn-sm {
  flex: 1;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
}

.result-actions .btn-sm:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.result-actions .btn-sm.copied {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* Responsive */
@media (max-width: 968px) {
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 768px) {
  .hero h1 { font-size: 1.8rem; }
  .hero { padding: 40px 0 60px; }
  section { padding: 40px 0; }
  section h2 { font-size: 1.6rem; }
  .form-grid { grid-template-columns: 1fr; }
  .calc-card { padding: 24px 16px; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .cards-grid { grid-template-columns: 1fr; }
  .articles-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  
  nav { display: none; }
  nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
  .mobile-menu-btn { display: block; }
  
  .article-content h1 { font-size: 1.8rem; }

  .result-mini-cards,
  .concept-cards { grid-template-columns: 1fr; }

  .goal-table th,
  .goal-table td { padding: 8px 10px; font-size: 0.8rem; }

  .result-actions { flex-direction: column; }

  .macro-tab { font-size: 0.75rem; padding: 8px 6px; }
}

/* References */
.references {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 28px 32px;
}

.references h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.references ol {
  padding-left: 20px;
  counter-reset: ref-counter;
  list-style: none;
}

.references ol li {
  position: relative;
  padding-left: 8px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.65;
  counter-increment: ref-counter;
}

.references ol li::before {
  content: counter(ref-counter) ".";
  position: absolute;
  left: -24px;
  font-weight: 600;
  color: var(--text);
}

.references ol li em {
  font-style: italic;
  color: var(--text);
}

.references ol li a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.references ol li a:hover {
  color: var(--primary-dark);
}
