/*
Daily Nutrition Calculator V2
Calculator-only visual enhancement layer.

IMPORTANT: 
This file intentionally sits AFTER css/style.css. 
It changes the calculator presentation without replacing the 
existing Progress/Profile styling or calculator JavaScript. 

*/

:root {
--dnc-bg: #f6f8fb;
--dnc-surface: #ffffff;
--dnc-text: #162033;
--dnc-muted: #667085;
--dnc-primary: #f4b740;
--dnc-primary-dark: #d89412;
--dnc-primary-soft: #fff4d6;
--dnc-primary-border: #f4d27b;
--dnc-navy: #1e2a3a;
--dnc-navy-soft: #eef2f7;
--dnc-border: #e1e6ed;
--dnc-success: #087f6b;
--dnc-radius: 16px;
--dnc-shadow: 0 10px 28px rgba(22, 32, 51, 0.07);
}

/* =========================================================
PAGE / HEADER
========================================================= */

body {
background:
radial-gradient(circle at 8% 0%, rgba(244, 183, 64, 0.08), transparent 28%),
var(--dnc-bg);
color: var(--dnc-text);
}

.site-header {
background: var(--dnc-navy) !important;
border-bottom: 0 !important;
box-shadow: 0 5px 20px rgba(22, 32, 51, 0.12);
}

.brand {
min-height: 72px;
}

.brand-link {
display: flex;
align-items: center;
gap: 12px;
color: inherit;
text-decoration: none;
}

.brand-logo {
width: 44px;
height: 44px;
object-fit: contain;
border-radius: 50%;
flex: 0 0 44px;
background: #fff;
}

.brand-copy h1 {
color: #fff !important;
margin: 0;
font-size: 1.15rem;
line-height: 1.15;
letter-spacing: -0.02em;
}

.brand-copy h1 span {
color: var(--dnc-primary);
}

.brand-copy p {
color: rgba(255,255,255,0.68) !important;
margin: 4px 0 0;
font-size: 0.72rem;
}

.main-nav {
margin-left: auto;
gap: 6px;
}

.main-nav a {
color: rgba(255,255,255,0.76) !important;
border-radius: 999px;
padding: 9px 13px;
transition: 0.18s ease;
}

.main-nav a:hover,
.main-nav a.active {
color: var(--dnc-navy) !important;
background: var(--dnc-primary);
}

.theme-toggle {
border-color: rgba(255,255,255,0.2) !important;
background: rgba(255,255,255,0.08) !important;
color: #fff !important;
border-radius: 999px !important;
}

/* =========================================================
CALCULATOR PAGE LAYOUT
========================================================= */

.calculator-main {
max-width: 1440px !important;
margin: 0 auto !important;
padding: 20px 24px 36px !important;
gap: 16px !important;
}

.calculator-main > section {
border-radius: var(--dnc-radius) !important;
border-color: var(--dnc-border) !important;
box-shadow: var(--dnc-shadow);
}

/* =========================================================
HERO
========================================================= */

.calculator-hero {
grid-column: 1 / -1;
min-height: 142px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 20px;
padding: 18px 28px;
overflow: hidden;
position: relative;
background:
linear-gradient(100deg, #fff9e9 0%, #fff 52%, #f5f8fb 100%);
border: 1px solid var(--dnc-primary-border);
}

.hero-copy {
position: relative;
z-index: 2;
max-width: 650px;
}

.hero-kicker {
display: inline-block;
margin-bottom: 6px;
color: var(--dnc-primary-dark);
font-size: 0.68rem;
font-weight: 800;
letter-spacing: 0.13em;
}

.hero-copy h2 {
margin: 0;
color: var(--dnc-text);
font-size: clamp(1.35rem, 2.2vw, 2rem);
line-height: 1.12;
letter-spacing: -0.035em;
}

.hero-copy p {
margin: 8px 0 0;
color: var(--dnc-muted);
max-width: 600px;
font-size: 0.88rem;
}

.hero-art {
width: 260px;
height: 130px;
flex: 0 0 260px;
position: relative;
}

.hero-art svg {
width: 100%;
height: 100%;
position: relative;
z-index: 2;
}

.hero-orb {
position: absolute;
width: 115px;
height: 115px;
right: 38px;
top: 4px;
border-radius: 50%;
background: var(--dnc-primary-soft);
}

/* =========================================================
SECTION HEADINGS
========================================================= */

.section-heading {
gap: 12px !important;
}

.section-number {
width: 34px !important;
height: 34px !important;
min-width: 34px;
display: grid;
place-items: center;
border-radius: 50% !important;
background: var(--dnc-primary) !important;
color: var(--dnc-navy) !important;
font-weight: 900;
box-shadow: 0 4px 12px rgba(244,183,64,0.25);
}

.section-heading h2 {
color: var(--dnc-text) !important;
letter-spacing: -0.025em;
}

.section-description {
color: var(--dnc-muted) !important;
}

/* =========================================================
CALCULATION MODE
========================================================= */

.mode-section {
grid-column: 1 / -1;
padding: 18px 20px !important;
}

.mode-options {
display: grid !important;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 12px;
margin-top: 14px;
}

.mode-option {
min-height: 94px;
display: block !important;
position: relative;
cursor: pointer;
}

.mode-option > input {
position: absolute;
opacity: 0;
pointer-events: none;
}

.mode-option-content {
height: 100%;
display: flex;
align-items: center;
gap: 14px;
padding: 15px 18px;
border: 1px solid var(--dnc-border);
border-radius: 13px;
background: #fff;
transition: 0.18s ease;
}

.mode-option:hover .mode-option-content {
border-color: var(--dnc-primary-border);
transform: translateY(-1px);
}

.mode-option > input:checked + .mode-option-content {
border: 2px solid var(--dnc-primary);
background: linear-gradient(100deg, #fff8df, #fff);
box-shadow: 0 6px 18px rgba(244,183,64,0.13);
}

.visual-icon {
width: 50px;
height: 50px;
min-width: 50px;
display: grid;
place-items: center;
border-radius: 50%;
background: var(--dnc-navy-soft);
color: var(--dnc-navy);
}

.visual-icon svg {
width: 31px;
height: 31px;
}

.mode-option > input:checked + .mode-option-content .visual-icon {
background: var(--dnc-primary);
}

.mode-text {
display: grid;
gap: 4px;
}

.mode-text strong {
color: var(--dnc-text);
font-size: 0.98rem;
}

.mode-text small {
color: var(--dnc-muted);
line-height: 1.35;
}

/* =========================================================
CALCULATOR CARD
========================================================= */

.calculator-card {
padding: 20px !important;
}

.calculator-card form {
margin-top: 10px;
}

.calculator-card fieldset {
border: 0;
padding: 14px 0 0;
margin: 0;
}

.calculator-card fieldset + fieldset {
margin-top: 8px;
padding-top: 15px;
border-top: 1px solid var(--dnc-border);
}

.calculator-card legend {
color: var(--dnc-text);
font-weight: 800;
font-size: 0.9rem;
margin-bottom: 10px;
}

/* =========================================================
PERSONAL INFORMATION
========================================================= */

.personal-grid {
grid-template-columns: minmax(65px, .55fr) minmax(145px, 1fr) minmax(100px, .8fr) minmax(250px, 1.35fr) !important;
gap: 12px !important;
}

.field label {
color: var(--dnc-text);
font-size: 0.76rem;
font-weight: 700;
margin-bottom: 5px;
}

.field input,
.field select,
.height-controls input,
.height-controls select {
border-color: var(--dnc-border) !important;
background: #fbfcfe !important;
color: var(--dnc-text) !important;
border-radius: 9px !important;
min-height: 40px;
}

.field input:focus,
.field select:focus,
.height-controls input:focus,
.height-controls select:focus {
border-color: var(--dnc-primary) !important;
box-shadow: 0 0 0 3px rgba(244,183,64,0.18) !important;
outline: none;
}

.inline-options {
min-height: 40px;
gap: 8px !important;
}

.radio-option {
border: 1px solid var(--dnc-border);
border-radius: 9px;
padding: 8px 10px;
background: #fbfcfe;
font-size: 0.78rem;
}

/* HEIGHT: compact numeric control */
.height-controls {
display: grid !important;
grid-template-columns: minmax(118px, .9fr) minmax(92px, 1fr) !important;
gap: 6px !important;
}

.height-controls:has(#Feet:not([hidden])) {
grid-template-columns: minmax(115px, 1fr) 54px 54px !important;
}

.height-controls #Feet,
.height-controls #Inches {
min-width: 0;
}

/* =========================================================
ACTIVITY / GOAL CARDS
========================================================= */

.activity-grid {
gap: 9px !important;
}

.choice-card {
min-height: 102px;
position: relative;
cursor: pointer;
border: 1px solid var(--dnc-border) !important;
border-radius: 11px !important;
background: #fff !important;
transition: 0.18s ease;
padding: 0 !important;
}

.choice-card:hover {
border-color: var(--dnc-primary-border) !important;
transform: translateY(-1px);
}

.choice-card > input {
position: absolute;
opacity: 0;
pointer-events: none;
}

.choice-card-inner,
.goal-card-inner {
min-height: inherit;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 4px;
padding: 12px 8px;
text-align: center;
}

.choice-icon {
width: 40px;
height: 40px;
display: grid;
place-items: center;
border-radius: 50%;
background: var(--dnc-navy-soft);
color: var(--dnc-navy);
margin-bottom: 3px;
}

.choice-icon svg {
width: 24px;
height: 24px;
}

.choice-card strong,
.goal-card-inner > span:last-child {
color: var(--dnc-text);
font-size: 0.78rem;
line-height: 1.15;
}

.choice-card small {
color: var(--dnc-muted);
font-size: 0.68rem;
}

.choice-card > input:checked + .choice-card-inner,
.choice-card > input:checked + .goal-card-inner {
background: linear-gradient(145deg, #fff8df, #fff);
border-radius: 10px;
}

.choice-card:has(input:checked) {
border: 2px solid var(--dnc-primary) !important;
box-shadow: 0 5px 16px rgba(244,183,64,0.12);
}

.choice-card:has(input:checked) .choice-icon {
background: var(--dnc-primary);
}

.goal-grid {
gap: 9px !important;
}

.goal-grid .choice-card {
min-height: 66px;
}

.goal-grid .choice-card-inner {
flex-direction: row;
justify-content: flex-start;
gap: 9px;
padding: 10px 15px;
}

.goal-grid .choice-icon {
margin: 0;
width: 36px;
height: 36px;
min-width: 36px;
}

/* =========================================================
TRAINER MODE
========================================================= */

.trainer-section {
border: 1px solid var(--dnc-primary-border) !important;
border-radius: 12px !important;
background: #fffaf0 !important;
margin-top: 14px;
}

.trainer-note {
color: var(--dnc-muted);
}

/* =========================================================
BUTTON
========================================================= */

.calculator-submit {
width: 100%;
min-height: 46px;
display: flex;
align-items: center;
justify-content: center;
gap: 12px;
margin-top: 15px;
border: 0 !important;
border-radius: 10px !important;
background: linear-gradient(100deg, #f4b740, #ffc94f) !important;
color: var(--dnc-navy) !important;
font-weight: 900 !important;
box-shadow: 0 7px 18px rgba(244,183,64,0.22);
cursor: pointer;
transition: 0.18s ease;
}

.calculator-submit:hover {
background: linear-gradient(100deg, #e9a82a, #f4b740) !important;
transform: translateY(-1px);
}

.calculator-submit span:last-child {
font-size: 1.2rem;
}

.privacy-note {
color: var(--dnc-muted) !important;
}

/* =========================================================
RESULTS / EMPTY STATE
========================================================= */

.results-card {
padding: 20px !important;
background: #fff !important;
}

.results-card[hidden] {
display: block !important;
min-height: 100%;
}

.results-card[hidden] > *:not(.results-empty-state) {
display: none !important;
}

.results-card:not([hidden]) .results-empty-state {
display: none !important;
}

.results-empty-state {
min-height: 390px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
padding: 28px;
border: 1px dashed #d9e0e8;
border-radius: 13px;
background: linear-gradient(145deg, #fff, #fbfcfe);
}

.results-empty-state > strong {
margin-top: 10px;
color: var(--dnc-text);
font-size: 1.25rem;
}

.results-empty-state > p {
max-width: 360px;
margin: 6px 0 0;
color: var(--dnc-muted);
font-size: 0.8rem;
line-height: 1.5;
}

.empty-state-art {
width: 190px;
height: 125px;
position: relative;
}

.empty-plate {
position: absolute;
width: 112px;
height: 58px;
left: 23px;
bottom: 14px;
border: 10px solid #162033;
border-radius: 50%;
transform: rotate(-5deg);
background: #fff4d6;
}

.empty-food {
position: absolute;
border-radius: 50%;
}

.empty-food-one {
width: 45px;
height: 45px;
left: 53px;
bottom: 47px;
background: #4f9f50;
}

.empty-food-two {
width: 30px;
height: 30px;
left: 93px;
bottom: 53px;
background: var(--dnc-primary);
}

.empty-calculator {
position: absolute;
width: 52px;
height: 67px;
right: 25px;
bottom: 7px;
border-radius: 9px;
background: var(--dnc-navy);
padding: 12px 7px;
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 5px;
transform: rotate(7deg);
}

.empty-calculator::before {
content: "";
grid-column: 1 / -1;
height: 10px;
border-radius: 3px;
background: var(--dnc-primary-soft);
}

.empty-calculator span {
width: 10px;
height: 10px;
border-radius: 2px;
background: var(--dnc-primary);
}

/* RESULTS AFTER CALCULATION */
.results-header h2 {
color: var(--dnc-text) !important;
}

.calorie-highlight {
border-color: var(--dnc-primary-border) !important;
background: linear-gradient(110deg, #fff8df, #fff) !important;
}

.calorie-value output {
color: var(--dnc-text) !important;
}

.metric-card,
.macro-card,
.target-card {
border-color: var(--dnc-border) !important;
border-radius: 11px !important;
}

.metric-card output,
.macro-card output,
.target-card output {
color: var(--dnc-text);
}

.macro-card.protein {
background: #eff8ff !important;
}

.macro-card.carbs {
background: #f1faef !important;
}

.macro-card.fat {
background: #fff7ed !important;
}

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

@media (max-width: 1100px) {

.calculator-main { 
    grid-template-columns: 1fr !important; 
} 

.calculator-hero, 
.mode-section, 
.calculator-card, 
.results-card { 
    grid-column: 1 !important; 
} 

.results-card { 
    min-height: auto !important; 
} 

.results-empty-state { 
    min-height: 300px; 
} 

.personal-grid { 
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important; 
} 

.activity-grid { 
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important; 
} 

}

@media (max-width: 700px) {

.calculator-main { 
    padding: 14px 12px 26px !important; 
} 

.brand { 
    padding: 8px 12px; 
} 

.brand-copy h1 { 
    font-size: 0.98rem; 
} 

.brand-copy p { 
    display: none; 
} 

.main-nav { 
    order: 3; 
    width: 100%; 
    justify-content: center; 
    margin-top: 5px; 
} 

.main-nav a { 
    padding: 7px 9px; 
    font-size: 0.72rem; 
} 

.theme-toggle { 
    font-size: 0.72rem; 
} 

.calculator-hero { 
    min-height: 145px; 
    padding: 18px; 
} 

.hero-art { 
    width: 145px; 
    flex-basis: 145px; 
    height: 105px; 
} 

.mode-options { 
    grid-template-columns: 1fr; 
} 

.personal-grid { 
    grid-template-columns: 1fr 1fr !important; 
} 

.activity-grid { 
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important; 
} 

}

@media (max-width: 600px) {

.brand-logo { 
    width: 38px; 
    height: 38px; 
    flex-basis: 38px; 
} 

.brand-copy h1 { 
    font-size: 0.9rem; 
} 

.calculator-card, 
.results-card, 
.mode-section { 
    padding: 15px !important; 
} 

.calculator-hero { 
    min-height: 0; 
    display: block; 
} 

.hero-copy h2 { 
    font-size: 1.35rem; 
} 

.hero-art { 
    width: 170px; 
    height: 92px; 
    margin: 4px auto -5px; 
} 

.personal-grid { 
    grid-template-columns: 1fr !important; 
} 

/* 
   MOBILE HEIGHT FIX: 
   the unit selector gets the flexible width, 
   while the numeric height input stays compact. 
*/ 
.height-controls { 
    grid-template-columns: minmax(0, 1fr) 108px !important; 
    gap: 6px !important; 
} 

.height-controls:has(#Feet:not([hidden])) { 
    grid-template-columns: minmax(0, 1fr) 54px 54px !important; 
} 

.height-controls:has(#Centimeters:not([hidden])) #Centimeters { 
    width: 108px; 
    min-width: 108px; 
    max-width: 108px; 
} 

.activity-grid { 
    grid-template-columns: 1fr 1fr !important; 
} 

.goal-grid { 
    grid-template-columns: 1fr !important; 
} 

.goal-grid .choice-card-inner { 
    justify-content: center; 
} 

.results-empty-state { 
    min-height: 270px; 
    padding: 18px; 
} 

.empty-state-art { 
    transform: scale(.86); 
} 

}

@media (max-width: 420px) {

.brand { 
    flex-wrap: wrap; 
} 

.brand-link { 
    max-width: calc(100% - 48px); 
} 

.theme-toggle { 
    margin-left: auto; 
} 

.main-nav { 
    gap: 2px; 
    overflow-x: auto; 
    justify-content: flex-start; 
} 

.main-nav a { 
    white-space: nowrap; 
} 

.activity-grid { 
    grid-template-columns: 1fr !important; 
} 

.choice-card { 
    min-height: 78px; 
} 

.choice-card-inner { 
    flex-direction: row; 
    justify-content: flex-start; 
    text-align: left; 
    padding: 10px 13px; 
} 

.choice-icon { 
    margin: 0; 
    flex: 0 0 38px; 
} 

.choice-card small { 
    display: block; 
} 

}

/* =========================================================
DNC V2 — LAYOUT REPAIR LAYER
Fixes conflicts caused by the older accumulated style.css.
========================================================= */

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

main.calculator-main {
width: 100% !important;
min-width: 0 !important;
}

/* The old stylesheet keeps the calculator in two columns at
widths where the new cards no longer have enough room. */
@media (max-width: 1100px) {
main.calculator-main {
display: grid !important;
grid-template-columns: minmax(0, 1fr) !important;
}
}

@media (min-width: 1101px) {
main.calculator-main {
display: grid !important;
grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr) !important;
}
}

/* =========================================================
MODE CARDS — completely reset the old span styling
========================================================= */

.mode-options {
width: 100% !important;
display: grid !important;
grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
align-items: stretch !important;
}

.mode-option,
.mode-option > input,
.mode-option-content,
.mode-option-content > .visual-icon,
.mode-option-content > .mode-text {
min-width: 0 !important;
}

.mode-option {
width: 100% !important;
height: 100% !important;
}

.mode-option-content {
width: 100% !important;
min-height: 86px !important;
height: 100% !important;
display: grid !important;
grid-template-columns: 48px minmax(0, 1fr) !important;
align-items: center !important;
gap: 12px !important;
}

.mode-option-content .visual-icon {
width: 48px !important;
height: 48px !important;
min-width: 48px !important;
flex: none !important;
}

.mode-option-content .mode-text {
width: 100% !important;
min-width: 0 !important;
display: flex !important;
flex-direction: column !important;
justify-content: center !important;
gap: 4px !important;
}

.mode-option-content .mode-text strong,
.mode-option-content .mode-text small {
display: block !important;
white-space: normal !important;
}

.mode-option-content .mode-text strong {
font-size: .9rem !important;
}

.mode-option-content .mode-text small {
font-size: .72rem !important;
line-height: 1.3 !important;
}

.mode-option-content svg {
display: block !important;
width: 30px !important;
height: 30px !important;
overflow: visible !important;
}

@media (max-width: 600px) {
.mode-options {
grid-template-columns: 1fr !important;
}
}

/* =========================================================
PERSONAL INFORMATION — predictable two-column layout
========================================================= */

.personal-grid {
width: 100% !important;
min-width: 0 !important;
}

.personal-grid .field {
min-width: 0 !important;
width: 100% !important;
}

.personal-grid .field input,
.personal-grid .field select {
width: 100% !important;
min-width: 0 !important;
max-width: 100% !important;
}

.radio-group.inline-options {
width: 100% !important;
min-width: 0 !important;
display: flex !important;
flex-wrap: nowrap !important;
align-items: stretch !important;
gap: 6px !important;
}

.radio-group.inline-options .radio-option {
flex: 1 1 0 !important;
min-width: 0 !important;
width: auto !important;
margin: 0 !important;
text-align: center !important;
white-space: nowrap !important;
}

/* Height controls are always contained by their parent. */
.height-controls {
width: 100% !important;
max-width: 100% !important;
min-width: 0 !important;
}

.height-controls > * {
width: 100% !important;
min-width: 0 !important;
max-width: 100% !important;
}

.height-controls input,
.height-controls select {
box-sizing: border-box !important;
}

@media (max-width: 1100px) {
.personal-grid {
grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.personal-grid .field:nth-child(4) { 
    grid-column: 1 / -1 !important; 
} 

}

@media (max-width: 600px) {
.personal-grid {
grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
gap: 10px !important;
}

.personal-grid .field:nth-child(4) { 
    grid-column: 1 / -1 !important; 
} 

.height-controls { 
    grid-template-columns: minmax(0, 1fr) 108px !important; 
} 

.height-controls:has(#Feet:not([hidden])) { 
    grid-template-columns: minmax(0, 1fr) 54px 54px !important; 
} 

}

@media (max-width: 400px) {
.personal-grid {
grid-template-columns: 1fr !important;
}

.personal-grid .field:nth-child(4) { 
    grid-column: auto !important; 
} 

.radio-group.inline-options { 
    flex-wrap: wrap !important; 
} 

}

/* =========================================================
ACTIVITY CARDS — no clipping, no inherited span conflicts
========================================================= */

.activity-grid {
width: 100% !important;
min-width: 0 !important;
}

.activity-grid .choice-card {
width: 100% !important;
min-width: 0 !important;
overflow: visible !important;
}

.activity-grid .choice-card-inner {
width: 100% !important;
min-width: 0 !important;
overflow: visible !important;
}

.activity-grid .choice-icon {
width: 42px !important;
height: 42px !important;
min-width: 42px !important;
flex: 0 0 42px !important;
margin: 0 0 4px !important;
overflow: visible !important;
}

.activity-grid .choice-icon svg {
display: block !important;
width: 26px !important;
height: 26px !important;
min-width: 26px !important;
min-height: 26px !important;
overflow: visible !important;
}

.activity-grid .choice-card strong,
.activity-grid .choice-card small {
max-width: 100% !important;
overflow: visible !important;
white-space: normal !important;
}

@media (max-width: 600px) {
.activity-grid {
grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
}

@media (max-width: 400px) {
.activity-grid {
grid-template-columns: 1fr !important;
}
}

/* =========================================================
GOALS — same reset
========================================================= */

.goal-grid {
width: 100% !important;
min-width: 0 !important;
}

.goal-grid .choice-card {
width: 100% !important;
min-width: 0 !important;
overflow: visible !important;
}

.goal-grid .goal-card-inner {
width: 100% !important;
min-width: 0 !important;
overflow: visible !important;
}

.goal-grid .choice-icon {
width: 38px !important;
height: 38px !important;
min-width: 38px !important;
flex: 0 0 38px !important;
overflow: visible !important;
}

.goal-grid .choice-icon svg {
display: block !important;
width: 24px !important;
height: 24px !important;
overflow: visible !important;
}

@media (max-width: 600px) {
.goal-grid {
grid-template-columns: 1fr !important;
}
}

/* =========================================================
TRAINER SECTION
========================================================= */

.trainer-section {
width: 100% !important;
min-width: 0 !important;
overflow: hidden !important;
}

.trainer-controls {
min-width: 0 !important;
}

.trainer-control {
min-width: 0 !important;
}

.trainer-control input,
.trainer-control select {
width: 100% !important;
max-width: 100% !important;
min-width: 0 !important;
}

/* =========================================================
RESULTS EMPTY STATE — don't let old pseudo-elements collide
========================================================= */

.results-card[hidden]::before,
.results-card[hidden]::after {
content: none !important;
}

.results-empty-state {
width: 100% !important;
max-width: 100% !important;
overflow: hidden !important;
}

@media (max-width: 600px) {
.results-empty-state {
min-height: 250px !important;
}
}

/* =========================================================
GENERAL OVERFLOW PROTECTION
========================================================= */

.calculator-card,
.mode-section,
.results-card,
.calculator-hero,
.calculator-card form,
.calculator-card fieldset {
min-width: 0 !important;
max-width: 100% !important;
}

.calculator-card input,
.calculator-card select,
.calculator-card button {
max-width: 100% !important;
}

/* =========================================================
PNG ICON SYSTEM
Uses the user's supplied visual asset sheet.
========================================================= */

.visual-icon img {
display: block;
width: 34px;
height: 34px;
object-fit: contain;
object-position: center;
}

.mode-option-content .standard-icon img {
width: 34px;
height: 34px;
}

.mode-option-content .trainer-icon img {
width: 40px;
height: 40px;
}

/* Activity / goal PNGs */
.choice-icon img {
display: block;
width: 28px;
height: 28px;
max-width: 100%;
max-height: 100%;
object-fit: contain;
object-position: center;
}

.activity-grid .choice-icon img {
width: 30px;
height: 30px;
}

.goal-grid .choice-icon img {
width: 27px;
height: 27px;
}

/* =========================================================
GENDER — same compact visual language as the other choices
========================================================= */

.gender-options {
width: 100%;
min-width: 0;
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 6px;
}

.gender-option {
position: relative;
display: block;
width: 100%;
min-width: 0;
cursor: pointer;
}

.gender-option > input {
position: absolute;
opacity: 0;
pointer-events: none;
}

.gender-option-content {
width: 100%;
height: 40px;
min-width: 0;
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
padding: 5px 7px;
border: 1px solid var(--dnc-border);
border-radius: 9px;
background: #fbfcfe;
color: var(--dnc-text);
transition: .18s ease;
}

.gender-option-content img {
width: 22px;
height: 22px;
flex: 0 0 22px;
object-fit: contain;
}

.gender-option-content strong {
font-size: .7rem;
line-height: 1;
}

.gender-option:hover .gender-option-content {
border-color: var(--dnc-primary-border);
}

.gender-option > input:checked + .gender-option-content {
border: 2px solid var(--dnc-primary);
background: var(--dnc-primary-soft);
box-shadow: 0 4px 10px rgba(244,183,64,.10);
}

@media (max-width: 400px) {
.gender-options {
gap: 6px;
}
}

/* =========================================================
DNC V2 — DARK MODE REPAIR
Supports the existing theme class/data-attribute patterns.
========================================================= */

body.dark-theme,
body.dark,
body[data-theme="dark"],
html.dark-theme body,
html.dark body,
html[data-theme="dark"] body {
--dnc-bg: #0f1724;
--dnc-surface: #172235;
--dnc-text: #f2f4f7;
--dnc-muted: #a9b3c2;
--dnc-primary: #f7c65a;
--dnc-primary-dark: #e2a52b;
--dnc-primary-soft: #342b18;
--dnc-primary-border: #6b5425;
--dnc-navy: #0b1220;
--dnc-navy-soft: #202d40;
--dnc-border: #334155;
}

body.dark-theme,
body.dark,
body[data-theme="dark"],
html.dark-theme body,
html.dark body,
html[data-theme="dark"] body {
background: var(--dnc-bg) !important;
color: var(--dnc-text) !important;
}

/* Main cards */
body.dark-theme .calculator-main > section,
body.dark .calculator-main > section,
body[data-theme="dark"] .calculator-main > section {
background: var(--dnc-surface) !important;
border-color: var(--dnc-border) !important;
color: var(--dnc-text) !important;
}

/* Hero */
body.dark-theme .calculator-hero,
body.dark .calculator-hero,
body[data-theme="dark"] .calculator-hero {
background: linear-gradient(105deg, #252716 0%, #172235 58%, #111c2b 100%) !important;
border-color: var(--dnc-primary-border) !important;
}

body.dark-theme .hero-copy h2,
body.dark .hero-copy h2,
body[data-theme="dark"] .hero-copy h2,
body.dark-theme .section-heading h2,
body.dark .section-heading h2,
body[data-theme="dark"] .section-heading h2,
body.dark-theme .calculator-card legend,
body.dark .calculator-card legend,
body[data-theme="dark"] .calculator-card legend,
body.dark-theme .field label,
body.dark .field label,
body[data-theme="dark"] .field label,
body.dark-theme .mode-text strong,
body.dark .mode-text strong,
body[data-theme="dark"] .mode-text strong,
body.dark-theme .choice-card strong,
body.dark .choice-card strong,
body[data-theme="dark"] .choice-card strong,
body.dark-theme .goal-card-inner > span:last-child,
body.dark .goal-card-inner > span:last-child,
body[data-theme="dark"] .goal-card-inner > span:last-child {
color: var(--dnc-text) !important;
}

body.dark-theme .hero-copy p,
body.dark .hero-copy p,
body[data-theme="dark"] .hero-copy p,
body.dark-theme .section-description,
body.dark .section-description,
body[data-theme="dark"] .section-description,
body.dark-theme .mode-text small,
body.dark .mode-text small,
body[data-theme="dark"] .mode-text small,
body.dark-theme .choice-card small,
body.dark .choice-card small,
body[data-theme="dark"] .choice-card small,
body.dark-theme .privacy-note,
body.dark .privacy-note,
body[data-theme="dark"] .privacy-note {
color: var(--dnc-muted) !important;
}

/* Form controls */
body.dark-theme .field input,
body.dark-theme .field select,
body.dark-theme .height-controls input,
body.dark-theme .height-controls select,
body.dark .field input,
body.dark .field select,
body.dark .height-controls input,
body.dark .height-controls select,
body[data-theme="dark"] .field input,
body[data-theme="dark"] .field select,
body[data-theme="dark"] .height-controls input,
body[data-theme="dark"] .height-controls select {
background: #101a2a !important;
color: var(--dnc-text) !important;
border-color: var(--dnc-border) !important;
}

body.dark-theme .field input::placeholder,
body.dark-theme .height-controls input::placeholder,
body.dark .field input::placeholder,
body.dark .height-controls input::placeholder,
body[data-theme="dark"] .field input::placeholder,
body[data-theme="dark"] .height-controls input::placeholder {
color: #7f8da1 !important;
}

/* Radio / mode / activity / goal cards */
body.dark-theme .radio-option,
body.dark .radio-option,
body[data-theme="dark"] .radio-option,
body.dark-theme .mode-option-content,
body.dark .mode-option-content,
body[data-theme="dark"] .mode-option-content,
body.dark-theme .choice-card,
body.dark .choice-card,
body[data-theme="dark"] .choice-card,
body.dark-theme .gender-option-content,
body.dark .gender-option-content,
body[data-theme="dark"] .gender-option-content {
background: #172235 !important;
border-color: var(--dnc-border) !important;
color: var(--dnc-text) !important;
}

body.dark-theme .visual-icon,
body.dark .visual-icon,
body[data-theme="dark"] .visual-icon,
body.dark-theme .choice-icon,
body.dark .choice-icon,
body[data-theme="dark"] .choice-icon {
background: var(--dnc-navy-soft) !important;
color: #f7c65a !important;
}

body.dark-theme .mode-option > input:checked + .mode-option-content,
body.dark .mode-option > input:checked + .mode-option-content,
body[data-theme="dark"] .mode-option > input:checked + .mode-option-content,
body.dark-theme .choice-card:has(input:checked),
body.dark .choice-card:has(input:checked),
body[data-theme="dark"] .choice-card:has(input:checked),
body.dark-theme .gender-option > input:checked + .gender-option-content,
body.dark .gender-option > input:checked + .gender-option-content,
body[data-theme="dark"] .gender-option > input:checked + .gender-option-content {
background: #342b18 !important;
border-color: var(--dnc-primary) !important;
}

body.dark-theme .choice-card > input:checked + .choice-card-inner,
body.dark-theme .choice-card > input:checked + .goal-card-inner,
body.dark .choice-card > input:checked + .choice-card-inner,
body.dark .choice-card > input:checked + .goal-card-inner,
body[data-theme="dark"] .choice-card > input:checked + .choice-card-inner,
body[data-theme="dark"] .choice-card > input:checked + .goal-card-inner {
background: transparent !important;
}

/* Trainer settings */
body.dark-theme .trainer-section,
body.dark .trainer-section,
body[data-theme="dark"] .trainer-section {
background: #292517 !important;
border-color: var(--dnc-primary-border) !important;
}

/* Results */
body.dark-theme .results-empty-state,
body.dark .results-empty-state,
body[data-theme="dark"] .results-empty-state {
background: linear-gradient(145deg, #172235, #111c2b) !important;
border-color: #3a4657 !important;
}

body.dark-theme .results-empty-state > strong,
body.dark .results-empty-state > strong,
body[data-theme="dark"] .results-empty-state > strong,
body.dark-theme .results-header h2,
body.dark .results-header h2,
body[data-theme="dark"] .results-header h2,
body.dark-theme .metric-card output,
body.dark .metric-card output,
body[data-theme="dark"] .metric-card output,
body.dark-theme .macro-card output,
body.dark .macro-card output,
body[data-theme="dark"] .macro-card output,
body.dark-theme .target-card output,
body.dark .target-card output,
body[data-theme="dark"] .target-card output {
color: var(--dnc-text) !important;
}

body.dark-theme .results-empty-state > p,
body.dark .results-empty-state > p,
body[data-theme="dark"] .results-empty-state > p,
body.dark-theme .results-header p,
body.dark .results-header p,
body[data-theme="dark"] .results-header p {
color: var(--dnc-muted) !important;
}

body.dark-theme .calorie-highlight,
body.dark .calorie-highlight,
body[data-theme="dark"] .calorie-highlight {
background: linear-gradient(110deg, #342b18, #172235) !important;
border-color: var(--dnc-primary-border) !important;
}

body.dark-theme .macro-card.protein,
body.dark .macro-card.protein,
body[data-theme="dark"] .macro-card.protein {
background: #162a3b !important;
}

body.dark-theme .macro-card.carbs,
body.dark .macro-card.carbs,
body[data-theme="dark"] .macro-card.carbs {
background: #183025 !important;
}

body.dark-theme .macro-card.fat,
body.dark .macro-card.fat,
body[data-theme="dark"] .macro-card.fat {
background: #332719 !important;
}

/* Details */
body.dark-theme .calculation-details,
body.dark .calculation-details,
body[data-theme="dark"] .calculation-details,
body.dark-theme .details-content,
body.dark .details-content,
body[data-theme="dark"] .details-content {
color: var(--dnc-text) !important;
border-color: var(--dnc-border) !important;
}

/* Empty-state illustration */
body.dark-theme .empty-plate,
body.dark .empty-plate,
body[data-theme="dark"] .empty-plate {
border-color: #e7edf5 !important;
background: #342b18 !important;
}

/* Submit */
body.dark-theme .calculator-submit,
body.dark .calculator-submit,
body[data-theme="dark"] .calculator-submit {
color: #111827 !important;
}
/* ============================================================
   DNC V2 — FINAL DARK ACTIVITY + GOAL CARD FIX
   ============================================================ */


/* ------------------------------------------------------------
   ACTIVITY + GOAL CARDS — BASE
------------------------------------------------------------ */

.activity-grid .choice-card,
.goal-grid .choice-card {
    background: var(--dnc-surface, #ffffff) !important;
    border-color: var(--dnc-border, #e4e7ec) !important;
    color: var(--dnc-text, #172033) !important;
}


/* ------------------------------------------------------------
   SELECTED ACTIVITY CARD
------------------------------------------------------------ */

.activity-grid
.choice-card:has(> input:checked) {

    background: var(--dnc-primary-soft, #fff7d6) !important;
    border: 2px solid var(--dnc-primary, #f4b740) !important;
    color: var(--dnc-text, #172033) !important;

    box-shadow:
        0 4px 12px rgba(244, 183, 64, 0.12) !important;
}


/* IMPORTANT:
   Override the old white gradient inside the selected card.
*/

.activity-grid
.choice-card:has(> input:checked)
.choice-card-inner {

    background: transparent !important;
    color: var(--dnc-text, #172033) !important;
}


/* Activity title */

.activity-grid
.choice-card:has(> input:checked)
.choice-card-inner strong {

    color: var(--dnc-text, #172033) !important;
}


/* Activity description */

.activity-grid
.choice-card:has(> input:checked)
.choice-card-inner small {

    color: var(--dnc-muted, #667085) !important;
}


/* Activity selected icon */

.activity-grid
.choice-card:has(> input:checked)
.choice-card-inner
.choice-icon {

    background: var(--dnc-primary, #f4b740) !important;
    color: #172033 !important;
}


/* ------------------------------------------------------------
   SELECTED GOAL CARD
------------------------------------------------------------ */

.goal-grid
.choice-card:has(> input:checked) {

    background: var(--dnc-primary-soft, #fff7d6) !important;
    border: 2px solid var(--dnc-primary, #f4b740) !important;
    color: var(--dnc-text, #172033) !important;

    box-shadow:
        0 4px 12px rgba(244, 183, 64, 0.12) !important;
}


/* Remove old white selected gradient */

.goal-grid
.choice-card:has(> input:checked)
.goal-card-inner {

    background: transparent !important;
    color: var(--dnc-text, #172033) !important;
}


/* Goal text */

.goal-grid
.choice-card:has(> input:checked)
.goal-card-inner > span:last-child {

    color: var(--dnc-text, #172033) !important;
}


/* Goal selected icon */

.goal-grid
.choice-card:has(> input:checked)
.goal-card-inner
.choice-icon {

    background: var(--dnc-primary, #f4b740) !important;
    color: #172033 !important;
}


/* ============================================================
   DARK MODE
   ============================================================ */

html[data-theme="dark"] .activity-grid .choice-card,
html[data-theme="dark"] .goal-grid .choice-card,
body.dark-theme .activity-grid .choice-card,
body.dark-theme .goal-grid .choice-card,
body.dark .activity-grid .choice-card,
body.dark .goal-grid .choice-card,
body[data-theme="dark"] .activity-grid .choice-card,
body[data-theme="dark"] .goal-grid .choice-card {

    background: #172235 !important;
    border-color: #334155 !important;
    color: #f2f4f7 !important;
}


/* Selected activity — DARK */

html[data-theme="dark"]
.activity-grid
.choice-card:has(> input:checked),

body.dark-theme
.activity-grid
.choice-card:has(> input:checked),

body.dark
.activity-grid
.choice-card:has(> input:checked),

body[data-theme="dark"]
.activity-grid
.choice-card:has(> input:checked) {

    background: #342b18 !important;
    border: 2px solid #f7c65a !important;
    color: #f2f4f7 !important;
}


/* Selected goal — DARK */

html[data-theme="dark"]
.goal-grid
.choice-card:has(> input:checked),

body.dark-theme
.goal-grid
.choice-card:has(> input:checked),

body.dark
.goal-grid
.choice-card:has(> input:checked),

body[data-theme="dark"]
.goal-grid
.choice-card:has(> input:checked) {

    background: #342b18 !important;
    border: 2px solid #f7c65a !important;
    color: #f2f4f7 !important;
}


/* ------------------------------------------------------------
   DARK SELECTED INNER CONTENT
------------------------------------------------------------ */

html[data-theme="dark"]
.activity-grid
.choice-card:has(> input:checked)
.choice-card-inner,

html[data-theme="dark"]
.goal-grid
.choice-card:has(> input:checked)
.goal-card-inner,

body.dark-theme
.activity-grid
.choice-card:has(> input:checked)
.choice-card-inner,

body.dark-theme
.goal-grid
.choice-card:has(> input:checked)
.goal-card-inner,

body.dark
.activity-grid
.choice-card:has(> input:checked)
.choice-card-inner,

body.dark
.goal-grid
.choice-card:has(> input:checked)
.goal-card-inner,

body[data-theme="dark"]
.activity-grid
.choice-card:has(> input:checked)
.choice-card-inner,

body[data-theme="dark"]
.goal-grid
.choice-card:has(> input:checked)
.goal-card-inner {

    background: transparent !important;
    color: #f2f4f7 !important;
}


/* ------------------------------------------------------------
   DARK SELECTED TEXT
------------------------------------------------------------ */

html[data-theme="dark"]
.activity-grid
.choice-card:has(> input:checked) strong,

html[data-theme="dark"]
.activity-grid
.choice-card:has(> input:checked) small,

html[data-theme="dark"]
.goal-grid
.choice-card:has(> input:checked)
.goal-card-inner > span:last-child,

body.dark-theme
.activity-grid
.choice-card:has(> input:checked) strong,

body.dark-theme
.activity-grid
.choice-card:has(> input:checked) small,

body.dark-theme
.goal-grid
.choice-card:has(> input:checked)
.goal-card-inner > span:last-child,

body.dark
.activity-grid
.choice-card:has(> input:checked) strong,

body.dark
.activity-grid
.choice-card:has(> input:checked) small,

body.dark
.goal-grid
.choice-card:has(> input:checked)
.goal-card-inner > span:last-child,

body[data-theme="dark"]
.activity-grid
.choice-card:has(> input:checked) strong,

body[data-theme="dark"]
.activity-grid
.choice-card:has(> input:checked) small,

body[data-theme="dark"]
.goal-grid
.choice-card:has(> input:checked)
.goal-card-inner > span:last-child {

    color: #f2f4f7 !important;
}


/* ------------------------------------------------------------
   DARK SELECTED ICON
------------------------------------------------------------ */

html[data-theme="dark"]
.activity-grid
.choice-card:has(> input:checked)
.choice-icon,

html[data-theme="dark"]
.goal-grid
.choice-card:has(> input:checked)
.choice-icon,

body.dark-theme
.activity-grid
.choice-card:has(> input:checked)
.choice-icon,

body.dark-theme
.goal-grid
.choice-card:has(> input:checked)
.choice-icon,

body.dark
.activity-grid
.choice-card:has(> input:checked)
.choice-icon,

body.dark
.goal-grid
.choice-card:has(> input:checked)
.choice-icon,

body[data-theme="dark"]
.activity-grid
.choice-card:has(> input:checked)
.choice-icon,

body[data-theme="dark"]
.goal-grid
.choice-card:has(> input:checked)
.choice-icon {

    background: #f7c65a !important;
    color: #172033 !important;
}


/* ============================================================
   KEEP THE EXISTING CARD SIZES
   ============================================================ */

.activity-grid .choice-card {
    min-height: 102px !important;
}

.goal-grid .choice-card {
    min-height: 66px !important;
}


/* ============================================================
   DNC V2 — DARK MODE CALCULATION MODE SELECTION
============================================================ */

/* Standard / Trainer outer option */
html[data-theme="dark"] .mode-option {
    border-color: #334155 !important;
    background: #172235 !important;
    color: #F2F4F7 !important;
}


/* ------------------------------------------------------------
   SELECTED STANDARD / TRAINER MODE
------------------------------------------------------------ */

html[data-theme="dark"] .mode-option input:checked + span,
html[data-theme="dark"] .mode-option:has(input:checked) {

    background: linear-gradient(
        135deg,
        #3B3218,
        #302916
    ) !important;

    border-color: #F7C65A !important;

    color: #F8FAFC !important;

    box-shadow:
        0 0 0 1px rgba(247, 198, 90, 0.35),
        0 5px 18px rgba(247, 198, 90, 0.10) !important;
}


/* ------------------------------------------------------------
   SELECTED MODE ICON
------------------------------------------------------------ */

html[data-theme="dark"]
.mode-option:has(input:checked) .mode-icon,
html[data-theme="dark"]
.mode-option:has(input:checked) .choice-icon {

    background: #F7C65A !important;
    color: #172033 !important;

    box-shadow:
        0 3px 10px rgba(247, 198, 90, 0.20) !important;
}


/* ------------------------------------------------------------
   SELECTED MODE TITLE
------------------------------------------------------------ */

html[data-theme="dark"]
.mode-option:has(input:checked) strong,
html[data-theme="dark"]
.mode-option:has(input:checked) .mode-title {

    color: #FFFFFF !important;
}


/* ------------------------------------------------------------
   SELECTED MODE DESCRIPTION
------------------------------------------------------------ */

html[data-theme="dark"]
.mode-option:has(input:checked) small,
html[data-theme="dark"]
.mode-option:has(input:checked) .mode-description {

    color: #D5DBE5 !important;
}


/* ------------------------------------------------------------
   UNSELECTED MODE
------------------------------------------------------------ */

html[data-theme="dark"]
.mode-option:not(:has(input:checked)) {

    background: #172235 !important;
    border-color: #334155 !important;

    box-shadow: none !important;
}


/* Slight hover indication */

html[data-theme="dark"]
.mode-option:not(:has(input:checked)):hover {

    border-color: #64748B !important;
    background: #1C293B !important;
}


/* ------------------------------------------------------------
   RADIO / CHECK INDICATOR
------------------------------------------------------------ */

html[data-theme="dark"]
.mode-option input:checked {

    accent-color: #F7C65A !important;
}


/* ============================================================
   END CALCULATION MODE DARK FIX
============================================================ */
/* ============================================================
   DNC V2 — FINAL DARK NAVIGATION
============================================================ */

html[data-theme="dark"] .site-header .main-nav a {
    background: transparent !important;
    color: #D7DEE8 !important;
    border: 1px solid transparent !important;
}


/* Active page */

html[data-theme="dark"] .site-header .main-nav a.active {
    background: #F7C65A !important;
    color: #172033 !important;

    border-color: #F7C65A !important;

    box-shadow:
        0 3px 10px rgba(247, 198, 90, 0.18) !important;
}


/* Hover */

html[data-theme="dark"] .site-header .main-nav a:hover {
    background: #302A18 !important;
    color: #F7C65A !important;

    border-color: #66551A !important;
}


/* Active + hover should remain yellow */

html[data-theme="dark"] .site-header .main-nav a.active:hover {
    background: #FFD45F !important;
    color: #172033 !important;
    border-color: #FFD45F !important;
    box-shadow:
        0 4px 12px rgba(247, 198, 90, 0.22) !important;
}


/* ============================================================
   NAVIGATION SPACING
============================================================ */

html[data-theme="dark"] .site-header .main-nav {
    gap: 6px !important;
}

html[data-theme="dark"] .site-header .main-nav a {
    padding: 8px 12px !important;
    border-radius: 999px !important;
}


/* ============================================================
   DARK THEME BUTTON
============================================================ */

html[data-theme="dark"] .site-header .theme-toggle {
    background: #172235 !important;
    color: #F2F4F7 !important;
    border: 1px solid #475569 !important;
}

html[data-theme="dark"] .site-header .theme-toggle:hover {
    background: #302A18 !important;
    color: #F7C65A !important;
    border-color: #F7C65A !important;
}


/* ============================================================
   END FINAL DARK NAV
============================================================ */