/* ===== Procalai tools: calculators + foods ===== */
.tool-hero { padding: 150px 0 40px; }
.tool-hero .display { max-width: 900px; }

.tool-body { padding: 20px 0 90px; }
.tool-grid { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 40px; align-items: start; }

.calc-card {
	background: #171717; border: 1px solid #2a2a2a; border-radius: 18px;
	padding: 28px; position: sticky; top: 110px;
}
.calc-form { display: flex; flex-direction: column; gap: 18px; }
.calc-row { display: flex; flex-direction: column; gap: 8px; }
.calc-row label { font-size: .9rem; font-weight: 600; color: #c9c4bc; }
.calc-row input, .calc-row select {
	width: 100%; background: #121212; border: 1px solid #2e2e2e; color: #f2efe9;
	border-radius: 10px; padding: 13px 14px; font-size: 1.05rem; outline: none;
}
.calc-row input:focus, .calc-row select:focus { border-color: #f2e3c6; }
.calc-duo { display: flex; gap: 10px; }
.calc-duo > div { display: flex; align-items: center; gap: 8px; flex: 1; }
.calc-duo input { flex: 1; }
.calc-duo .unit, .calc-row .unit { color: #8d887f; font-size: .85rem; white-space: nowrap; }

.segmented { display: inline-flex; background: #121212; border: 1px solid #2e2e2e; border-radius: 10px; padding: 4px; gap: 4px; width: 100%; }
.segmented .seg { flex: 1; background: none; border: 0; color: #9a958d; padding: 10px 12px; border-radius: 7px; cursor: pointer; font: inherit; font-size: .95rem; white-space: nowrap; }
.segmented .seg.active { background: #f2e3c6; color: #121212; font-weight: 700; }

.calc-submit { width: 100%; justify-content: center; margin-top: 4px; }

.calc-result {
	margin-top: 22px; padding: 22px; border-radius: 14px;
	background: linear-gradient(135deg, #1f1a12, #17130d); border: 1px solid #3a2f1f;
	text-align: center;
}
.calc-result-label { font-size: .95rem; color: #a09a90; }
.calc-result-value { font-size: 2.6rem; font-weight: 800; letter-spacing: -.02em; color: #f2e3c6; margin: 4px 0; }
.calc-result-value small { font-size: 1.2rem; }
.calc-result-cat { font-size: 1.1rem; color: #e8e2d5; font-weight: 600; }
.calc-result-rows { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.calc-result-rows .r-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #2a2a2a; }
.calc-result-rows .r-row:last-child { border-bottom: 0; }
.calc-result-rows .r-row span { color: #a09a90; font-size: .9rem; }
.calc-result-rows .r-row strong { color: #f2e3c6; font-size: 1.1rem; }

.tool-content { display: flex; flex-direction: column; gap: 20px; }
.tool-prose { background: #161616; border: 1px solid #262626; border-radius: 14px; padding: 26px; }
.tool-prose h2 { font-size: 1.35rem; font-weight: 700; color: #f2efe9; margin-bottom: 12px; letter-spacing: -.01em; }
.tool-prose p { color: #b9b3aa; line-height: 1.75; }

/* ===== Foods page ===== */
.foods-hero { padding: 150px 0 30px; }
.foods-search { max-width: 560px; margin-bottom: 6px; }
.foods-search input {
	width: 100%; background: #171717; border: 1px solid #2e2e2e; color: #f2efe9;
	border-radius: 12px; padding: 15px 18px; font-size: 1.05rem; outline: none;
}
.foods-search input:focus { border-color: #f2e3c6; }

.foods-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 40px 0 18px; flex-wrap: wrap; }
.foods-sec-title { font-size: 1.5rem; font-weight: 800; color: #f2efe9; letter-spacing: -.01em; margin: 0; }
.foods-units { width: auto; }
.foods-units .seg { padding: 8px 14px; font-size: .85rem; }

/* popular foods */
.foods-popular-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.popular-item {
	display: flex; align-items: center; gap: 12px; background: #171717; border: 1px solid #2a2a2a;
	border-radius: 16px; padding: 10px 14px; color: inherit; text-decoration: none; transition: border-color .2s, transform .2s;
}
.popular-item:hover { border-color: #4a4032; transform: translateY(-2px); }
.popular-main { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.popular-item img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; }
.popular-meta { min-width: 0; }
.popular-name { margin: 0; font-weight: 700; color: #f2efe9; font-size: .98rem; }
.popular-serving { margin: 2px 0 0; color: #8d887f; font-size: .82rem; }
.popular-cal { flex: none; color: #f2e3c6; font-size: .9rem; white-space: nowrap; }
.popular-cal strong { font-size: 1.05rem; font-weight: 800; }
.popular-chev { flex: none; color: #f2e3c6; width: 18px; height: 18px; }

/* category cards */
.foods-cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.food-cat-card {
	position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
	background: #171717; border: 1px solid #2a2a2a; border-radius: 16px; padding: 0 0 14px 0;
	overflow: hidden; cursor: pointer; font: inherit; color: inherit; text-align: left; transition: border-color .2s, transform .2s;
}
.food-cat-card:hover { border-color: #4a4032; transform: translateY(-2px); }
.food-cat-card.active { border-color: #f2e3c6; box-shadow: 0 0 0 1px #f2e3c6 inset; }
.food-cat-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.food-cat-name { padding: 0 14px; font-weight: 700; color: #f2efe9; font-size: .95rem; }
.food-cat-count { position: absolute; top: 10px; right: 10px; background: rgba(18,18,18,.72); color: #f2e3c6; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }

/* show more / list head */
.foods-more-wrap { display: flex; justify-content: center; margin-top: 20px; }
.foods-more {
	background: #171717; border: 1px solid #2e2e2e; color: #f2efe9; border-radius: 999px; padding: 11px 30px;
	cursor: pointer; font: inherit; font-weight: 700; font-size: .92rem; transition: border-color .2s;
}
.foods-more:hover { border-color: #f2e3c6; }

.foods-list-head { display: flex; align-items: center; gap: 12px; margin: 46px 0 18px; }
.foods-list-count { color: #8d887f; font-size: .9rem; }
.foods-clear { margin-left: auto; background: none; border: 1px solid #2e2e2e; color: #c9c4bc; border-radius: 999px; padding: 6px 15px; cursor: pointer; font: inherit; font-size: .85rem; }
.foods-clear:hover { border-color: #f2e3c6; color: #f2efe9; }

.foods-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; padding-bottom: 90px; }
.food-card {
	background: #171717; border: 1px solid #2a2a2a; border-radius: 14px; padding: 20px;
	display: flex; flex-direction: column; gap: 12px; transition: border-color .2s, transform .2s;
}
.food-card:hover { border-color: #4a4032; transform: translateY(-2px); }
.food-card h3 { font-size: 1.05rem; font-weight: 700; color: #f2efe9; margin: 0; }
.food-kcal { font-size: 1.5rem; font-weight: 800; color: #f2e3c6; }
.food-kcal small { font-size: .8rem; color: #8d887f; font-weight: 500; }
.food-macros { display: flex; gap: 14px; font-size: .85rem; color: #b9b3aa; }
.food-macros b { color: #f2efe9; font-weight: 700; }
.food-empty { color: #8d887f; padding: 40px 0; }

@media (max-width: 1023px) {
	.popular-hidden, .cat-hidden { display: none; }
	.foods-popular.is-open .popular-hidden { display: flex; }
	.foods-cats-section.is-open .cat-hidden { display: flex; }
	.foods-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
	.foods-more-wrap { display: none; }
}
@media (max-width: 560px) {
	.foods-popular-grid { grid-template-columns: 1fr; }
	.foods-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
	.tool-grid { grid-template-columns: 1fr; }
	.calc-card { position: static; }
}
