/* NHH Smart Nutrition – website features. Everything is scoped to .nhh-app so it never affects the theme. */
.nhh-app {
	--nhh-primary: #388D03; --nhh-primary-2: #5DB12A; --nhh-dark: #1F4D02; --nhh-body: #3D4A38; --nhh-muted: #5E6D58;
	--nhh-mint: #EFF7E9; --nhh-mint-2: #DDEFD0; --nhh-border: #E3EEDB; --nhh-surface: #F8FBF6;
	--nhh-warn: #E59A12; --nhh-danger: #D64545; --nhh-info: #2E86C1; --nhh-radius: 18px;
	--nhh-card: #fff; --nhh-hover: #2D7202; --nhh-shadow: rgba(31,77,2,.05);
	--nhh-warn-bg: #FFF6E5; --nhh-warn-border: #F5D9A3; --nhh-warn-text: #6B4A0B; --nhh-danger-bg: #FDECEC;
	--nhh-doc-bg: #F3FCF5; --nhh-doc-border: #CDEFD6;
	color: var(--nhh-body); font-size: 15px; line-height: 1.5; max-width: 760px; margin: 0 auto 32px; box-sizing: border-box;
	font-family: inherit;
}
.nhh-app *, .nhh-app *::before, .nhh-app *::after { box-sizing: border-box; }
.nhh-app h2, .nhh-app h3, .nhh-app h4 { color: var(--nhh-dark); margin: 0 0 6px; line-height: 1.25; font-weight: 700; }
.nhh-app h2 { font-size: 24px; } .nhh-app h3 { font-size: 18px; } .nhh-app h4 { font-size: 15.5px; }
.nhh-app p { margin: 0 0 10px; }
.nhh-muted { color: var(--nhh-muted); font-size: 13.5px; }
.nhh-card { background: var(--nhh-card); border: 1px solid var(--nhh-border); border-radius: var(--nhh-radius); padding: 18px; box-shadow: 0 6px 18px var(--nhh-shadow); margin-bottom: 14px; }
.nhh-hero { background: linear-gradient(135deg, var(--nhh-primary), var(--nhh-primary-2)); color: #fff; border: 0; }
.nhh-hero h2, .nhh-hero h3, .nhh-hero h4, .nhh-hero .nhh-muted { color: #fff; }
.nhh-big { font-size: 40px; font-weight: 800; line-height: 1.1; }
.nhh-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }
.nhh-grid .nhh-card { margin-bottom: 0; }
.nhh-stat .nhh-label { font-size: 12.5px; color: var(--nhh-muted); }
.nhh-stat .nhh-value { font-size: 21px; font-weight: 700; color: var(--nhh-dark); }
.nhh-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.nhh-row > .nhh-grow { flex: 1 1 200px; }

/* Buttons & inputs (reset theme styles inside the widget) */
.nhh-app button, .nhh-app .nhh-btn { font: inherit; cursor: pointer; border-radius: 14px; padding: 12px 20px; font-weight: 600; font-size: 15px;
	border: 1.5px solid var(--nhh-primary); background: var(--nhh-primary); color: #fff; line-height: 1.2; text-decoration: none; display: inline-flex;
	align-items: center; justify-content: center; gap: 8px; min-height: 48px; transition: background .2s, opacity .2s; text-transform: none; letter-spacing: 0; box-shadow: none; }
.nhh-app button:hover, .nhh-app .nhh-btn:hover { background: var(--nhh-hover); color: #fff; }
.nhh-app button.nhh-outline, .nhh-app .nhh-btn.nhh-outline { background: var(--nhh-card); color: var(--nhh-primary); }
.nhh-app button.nhh-outline:hover { background: var(--nhh-mint); color: var(--nhh-primary); }
.nhh-app button.nhh-link { background: none; border: 0; color: var(--nhh-primary); padding: 6px 8px; min-height: 0; }
.nhh-app button.nhh-danger { background: var(--nhh-card); border-color: var(--nhh-danger); color: var(--nhh-danger); }
.nhh-app button:disabled { opacity: .55; cursor: default; }
.nhh-app button.nhh-small { padding: 6px 12px; min-height: 34px; font-size: 13px; border-radius: 10px; }
.nhh-app label.nhh-field { display: block; margin-bottom: 14px; font-weight: 600; color: var(--nhh-dark); font-size: 14px; }
.nhh-app input[type=text], .nhh-app input[type=number], .nhh-app input[type=date], .nhh-app input[type=email], .nhh-app input[type=tel], .nhh-app input[type=password], .nhh-app input[type=search], .nhh-app textarea, .nhh-app select {
	display: block; width: 100%; margin-top: 6px; font: inherit; font-weight: 400; color: var(--nhh-body); background: var(--nhh-surface);
	border: 1px solid var(--nhh-border); border-radius: 14px; padding: 13px 14px; min-height: 48px; box-shadow: none; }
.nhh-app input:focus, .nhh-app textarea:focus, .nhh-app select:focus { outline: none; border-color: var(--nhh-primary); box-shadow: 0 0 0 3px rgba(56,141,3,.15); }
.nhh-input-suffix { position: relative; } .nhh-input-suffix span { position: absolute; right: 14px; bottom: 14px; color: var(--nhh-muted); font-weight: 400; }

/* Choice tiles */
.nhh-choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }
.nhh-app button.nhh-choice { background: var(--nhh-card); color: var(--nhh-body); border: 1.5px solid var(--nhh-border); text-align: left; justify-content: flex-start;
	flex-direction: column; align-items: flex-start; padding: 14px 16px; font-weight: 600; min-height: 64px; }
.nhh-app button.nhh-choice small { font-weight: 400; color: var(--nhh-muted); font-size: 12.5px; }
.nhh-app button.nhh-choice:hover { background: var(--nhh-mint); color: var(--nhh-body); }
.nhh-app button.nhh-choice.is-on { border-color: var(--nhh-primary); background: var(--nhh-mint); color: var(--nhh-dark); box-shadow: inset 0 0 0 1px var(--nhh-primary); }
.nhh-check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin: 10px 0; cursor: pointer; }
.nhh-check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--nhh-primary); }

/* Steps */
.nhh-steps { display: flex; gap: 6px; margin: 4px 0 8px; } .nhh-steps i { flex: 1; height: 6px; border-radius: 6px; background: var(--nhh-mint-2); transition: background .3s; }
.nhh-steps i.on { background: var(--nhh-primary); }
.nhh-step-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--nhh-muted); margin-bottom: 16px; }
.nhh-step-label b { color: var(--nhh-primary); }
.nhh-actions { display: flex; gap: 10px; margin-top: 8px; } .nhh-actions > * { flex: 1; } .nhh-actions > .nhh-wide { flex: 2; }
.nhh-error { color: var(--nhh-danger); font-size: 14px; margin: 6px 0 10px; }
.nhh-ok { color: var(--nhh-primary); font-size: 14px; margin: 6px 0 10px; }

/* Notes */
.nhh-note { background: var(--nhh-surface); border: 1px solid var(--nhh-border); border-radius: 14px; padding: 12px 14px; font-size: 12.5px; color: var(--nhh-muted); margin-bottom: 14px; }
.nhh-warning { background: var(--nhh-warn-bg); border: 1px solid var(--nhh-warn-border); color: var(--nhh-warn-text); border-radius: 14px; padding: 12px 14px; font-size: 14px; margin-bottom: 10px; }

/* BMI bar */
.nhh-bmi-bar { position: relative; height: 26px; margin: 10px 0 4px; }
.nhh-bmi-bar .seg { position: absolute; top: 8px; height: 10px; border-radius: 6px; display: flex; left: 0; right: 0; overflow: hidden; }
.nhh-bmi-bar .seg span { height: 10px; }
.nhh-bmi-bar .pin { position: absolute; top: 0; width: 18px; height: 26px; margin-left: -9px; background: var(--nhh-card); border-radius: 9px; border: 3px solid var(--nhh-primary); }
.nhh-bmi-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--nhh-muted); }
.nhh-pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12.5px; font-weight: 600; }

/* Goal option list in results */
.nhh-optrow { display: flex; justify-content: space-between; padding: 11px 14px; border: 1px solid var(--nhh-border); border-radius: 14px; margin-bottom: 8px; }
.nhh-optrow.on { border-color: var(--nhh-primary); background: var(--nhh-mint); font-weight: 600; } .nhh-optrow b { color: var(--nhh-dark); }
.nhh-optrow.on b { color: var(--nhh-primary); }

/* Macros */
.nhh-macros { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.nhh-donut { width: 120px; height: 120px; border-radius: 50%; position: relative; flex: none; }
.nhh-donut::after { content: ''; position: absolute; inset: 24px; background: var(--nhh-card); border-radius: 50%; }
.nhh-legend { flex: 1 1 200px; } .nhh-legend div { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.nhh-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; } .nhh-legend b { margin-left: auto; color: var(--nhh-dark); }
.nhh-list { margin: 6px 0 0; padding: 0; list-style: none; } .nhh-list li { padding: 4px 0 4px 24px; position: relative; }
.nhh-list li::before { content: '✓'; position: absolute; left: 2px; color: var(--nhh-primary-2); font-weight: 700; }

/* Products */
.nhh-products { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin-bottom: 8px; }
.nhh-product { background: var(--nhh-card); border: 1px solid var(--nhh-border); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.nhh-product img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--nhh-mint); display: block; }
.nhh-product .nm { font-weight: 600; color: var(--nhh-dark); margin: 8px 0 4px; font-size: 14px; line-height: 1.3; }
.nhh-product .pr { color: var(--nhh-primary); font-weight: 700; margin-bottom: 8px; } .nhh-product .pr del { color: var(--nhh-muted); font-weight: 400; font-size: 12px; margin-left: 4px; }
.nhh-product .nhh-btn { margin-top: auto; min-height: 38px; padding: 8px 10px; font-size: 13.5px; }

/* Chat */
.nhh-chat { display: flex; flex-direction: column; height: min(640px, 78vh); padding: 0; overflow: hidden; }
.nhh-chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--nhh-border); }
.nhh-chat-head .av { width: 38px; height: 38px; border-radius: 50%; background: var(--nhh-mint); display: grid; place-items: center; font-size: 18px; }
.nhh-chat-body { flex: 1; overflow-y: auto; padding: 14px; background: var(--nhh-card); }
.nhh-msg { max-width: 84%; padding: 10px 14px; border-radius: 18px; margin: 6px 0; white-space: pre-wrap; word-wrap: break-word; font-size: 14.5px; }
.nhh-msg.user { background: var(--nhh-primary); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.nhh-msg.bot { background: var(--nhh-mint); border-bottom-left-radius: 4px; } .nhh-msg.err { background: var(--nhh-danger-bg); color: var(--nhh-danger); }
.nhh-msg.safe { background: var(--nhh-warn-bg); }
.nhh-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0; }
.nhh-app button.nhh-chip { background: var(--nhh-mint); color: var(--nhh-dark); border: 1px solid var(--nhh-border); border-radius: 30px; padding: 8px 14px; min-height: 0; font-weight: 500; font-size: 13.5px; }
.nhh-chat-foot { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--nhh-border); align-items: flex-end; }
.nhh-chat-foot textarea { margin: 0; resize: none; min-height: 48px; max-height: 140px; }
.nhh-chat-opts { display: flex; align-items: center; gap: 8px; padding: 6px 14px; background: var(--nhh-surface); font-size: 13px; border-top: 1px solid var(--nhh-border); }
.nhh-typing { color: var(--nhh-muted); font-style: italic; }

/* Progress */
.nhh-chart { width: 100%; height: auto; display: block; }
.nhh-progress-bar { height: 12px; background: var(--nhh-mint); border-radius: 10px; overflow: hidden; margin: 10px 0 6px; }
.nhh-progress-bar span { display: block; height: 100%; background: var(--nhh-primary); border-radius: 10px; transition: width .8s; }
.nhh-tabs { display: flex; gap: 6px; background: var(--nhh-surface); border: 1px solid var(--nhh-border); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.nhh-app button.nhh-tab { flex: 1; background: transparent; color: var(--nhh-muted); border: 0; min-height: 40px; padding: 8px; border-radius: 10px; }
.nhh-app button.nhh-tab.is-on { background: var(--nhh-card); color: var(--nhh-primary); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.nhh-table { width: 100%; border-collapse: collapse; font-size: 14px; } .nhh-table th, .nhh-table td { padding: 10px 8px; border-bottom: 1px solid var(--nhh-border); text-align: left; }
.nhh-table th { color: var(--nhh-muted); font-weight: 600; font-size: 12.5px; } .nhh-up { color: var(--nhh-info); } .nhh-down { color: var(--nhh-primary); }
.nhh-form-inline { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); align-items: end; }
.nhh-form-inline label.nhh-field { margin-bottom: 0; }

/* Diet */
.nhh-plan-sec { margin-top: 14px; } .nhh-plan-sec ul { margin: 6px 0 0 18px; padding: 0; } .nhh-plan-sec li { margin: 4px 0; }

.nhh-loading { display: grid; place-items: center; min-height: 120px; }
.nhh-spinner { width: 34px; height: 34px; border: 3px solid var(--nhh-mint-2); border-top-color: var(--nhh-primary); border-radius: 50%; animation: nhh-spin .8s linear infinite; display: inline-block; }
@keyframes nhh-spin { to { transform: rotate(360deg); } }
.nhh-fade { animation: nhh-fade .35s ease-out; } @keyframes nhh-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 520px) {
	.nhh-app { font-size: 14.5px; } .nhh-card { padding: 14px; } .nhh-big { font-size: 32px; } .nhh-msg { max-width: 92%; }
	.nhh-table th:nth-child(4), .nhh-table td:nth-child(4) { display: none; }
}
@media print {
	body * { visibility: hidden; } .nhh-print, .nhh-print * { visibility: visible; } .nhh-print { position: absolute; left: 0; top: 0; width: 100%; }
	.nhh-noprint { display: none !important; }
}
/* 7-day diet plan PDF: hidden on screen, printed with all days */
.nhh-print-all { display: none; }
@media print {
	html.nhh-printing body > *:not(.nhh-print-root) { display: none !important; }
	html.nhh-printing body { background: #fff !important; margin: 0; padding: 0; }
	html.nhh-printing .nhh-print-root { position: static !important; visibility: visible !important; }
	.nhh-print-all { display: block !important; color: #222 !important; background: #fff !important; font-size: 11.5pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; color-scheme: only light; }
	.nhh-print-all * { color: inherit; }
	.nhh-print-all .pa-head { display: flex; align-items: center; gap: 14px; border-bottom: 3px solid #388D03; padding-bottom: 10px; margin-bottom: 12px; }
	.nhh-print-all .pa-head img { width: 64px; height: 64px; object-fit: contain; }
	.nhh-print-all h2 { color: #1F4D02 !important; margin: 0; font-size: 18pt; }
	.nhh-print-all .pa-sub { color: #555 !important; font-size: 10pt; }
	.nhh-print-all .pa-day { break-inside: avoid; page-break-inside: avoid; border: 1px solid #CFE3C0; border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; }
	.nhh-print-all .pa-day h3 { color: #388D03 !important; margin: 0 0 6px; font-size: 13pt; display: flex; justify-content: space-between; }
	.nhh-print-all .pa-day h3 small { color: #555 !important; font-weight: 400; font-size: 10pt; }
	.nhh-print-all .pa-meal { margin: 4px 0; } .nhh-print-all .pa-meal b { color: #1F4D02 !important; }
	.nhh-print-all .pa-meal ul { margin: 2px 0 2px 18px; padding: 0; } .nhh-print-all .pa-sup { background: #EFF7E9 !important; padding: 3px 8px; border-radius: 6px; display: inline-block; margin-top: 2px; }
	.nhh-print-all .pa-tips { break-inside: avoid; } .nhh-print-all .pa-note { color: #666 !important; font-size: 9pt; border-top: 1px solid #ddd; padding-top: 6px; margin-top: 8px; }
}
.nhh-app .nhh-btn.nhh-wa { background: #25D366; border-color: #25D366; color: #fff; text-align: center; justify-content: center; }
.nhh-app .nhh-doctor { border: 1px solid var(--nhh-doc-border); background: var(--nhh-doc-bg); }

/* Report picture popup */
.nhh-app.nhh-report-modal { position: fixed; inset: 0; z-index: 99999; background: rgba(15, 30, 5, .6); display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 24px 12px; }
.nhh-report-box { background: var(--nhh-card); border-radius: 18px; padding: 16px; width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.nhh-report-box img { width: 100%; border-radius: 12px; border: 1px solid var(--nhh-border); display: block; }

/* Order fit: product that does not fit the plan */
.nhh-optrow.nhh-unfit { border-color: var(--nhh-warn-border); background: var(--nhh-warn-bg); color: var(--nhh-warn-text); }
.nhh-optrow.nhh-unfit b { color: var(--nhh-warn-text); }

/* ---------------------------------------------------------------- Dark mode
   Follows the phone / computer setting (prefers-color-scheme), unless wp-admin sets
   "Always light" (html.nhh-theme-light) or "Always dark" (html.nhh-theme-dark). */
@media (prefers-color-scheme: dark) {
	html.nhh-theme-auto .nhh-app {
	--nhh-primary: #4FA516; --nhh-primary-2: #6CC236; --nhh-dark: #EAF6E1; --nhh-body: #D6E2D0; --nhh-muted: #9DAE95;
	--nhh-mint: #1E3317; --nhh-mint-2: #2D4A22; --nhh-border: #2F4229; --nhh-surface: #1A2717;
	--nhh-warn: #F0B13A; --nhh-danger: #FF8080; --nhh-info: #6DB6EA;
	--nhh-card: #152013; --nhh-link: #8FDB5C; --nhh-hover: #5DB823; --nhh-shadow: rgba(0,0,0,.35);
	--nhh-warn-bg: #362A10; --nhh-warn-border: #6A5221; --nhh-warn-text: #F4D58F; --nhh-danger-bg: #3B1C1C;
	--nhh-doc-bg: #12291A; --nhh-doc-border: #24543A;
	color-scheme: dark;
	}
	html.nhh-theme-auto .nhh-app input::placeholder, html.nhh-theme-auto .nhh-app textarea::placeholder { color: #7F8F79; }
	html.nhh-theme-auto .nhh-app.nhh-report-modal { background: rgba(0, 0, 0, .7); }
}
html.nhh-theme-dark .nhh-app {
	--nhh-primary: #4FA516; --nhh-primary-2: #6CC236; --nhh-dark: #EAF6E1; --nhh-body: #D6E2D0; --nhh-muted: #9DAE95;
	--nhh-mint: #1E3317; --nhh-mint-2: #2D4A22; --nhh-border: #2F4229; --nhh-surface: #1A2717;
	--nhh-warn: #F0B13A; --nhh-danger: #FF8080; --nhh-info: #6DB6EA;
	--nhh-card: #152013; --nhh-link: #8FDB5C; --nhh-hover: #5DB823; --nhh-shadow: rgba(0,0,0,.35);
	--nhh-warn-bg: #362A10; --nhh-warn-border: #6A5221; --nhh-warn-text: #F4D58F; --nhh-danger-bg: #3B1C1C;
	--nhh-doc-bg: #12291A; --nhh-doc-border: #24543A;
	color-scheme: dark;
}
html.nhh-theme-dark .nhh-app input::placeholder, html.nhh-theme-dark .nhh-app textarea::placeholder { color: #7F8F79; }
html.nhh-theme-dark .nhh-app.nhh-report-modal { background: rgba(0, 0, 0, .7); }
/* Light design (default): ask the browser not to auto-darken it ("force dark" in Chrome / Samsung Internet),
   so phones in dark mode show the normal white and green design instead of half-inverted colours. */
html.nhh-theme-light .nhh-app { color-scheme: only light; background-color: transparent; }

/* Links inside the widgets use the NHH green (readable in light and dark mode, whatever the theme sets). */
.nhh-app a:not(.nhh-btn):not(.nhh-product) { color: var(--nhh-link, var(--nhh-primary)); }
.nhh-app .nhh-hero a:not(.nhh-btn) { color: #fff; }
