/* style.css */

/* ============================
   MASTER VALUES
============================ */
:root {
	--primary-color: #2563eb;
	/* Modern blue */
	--primary-hover: #1d4ed8;
	--surface-color: #ffffff;
	--background-color: #f8fafc;
	--text-primary: #0f172a;
	--text-secondary: #475569;
	--secondary-color: #4A90E2; /* blue left nav */
	
	--very-low-color: #ef4444;
	/* Red */
	--low-color: #f97316;
	/* Orange */
	--fair-color: #eab308;
	/* Yellow */
	--good-color: #84cc16;
	/* Light Green */
	--better-color: #4CAF50; /* #22c55e; */
	/* Green */
	--excellent-color: #15803d;
	/* Dark Green */
	--space-xs: 0.25rem;
	--space-sm: 0.5rem;
	--space-md: 1rem;
	--space-lg: 1.5rem;
	--space-xl: 2rem;
	--radius-sm: 4px;
	--radius-md: 4px;
	--radius-lg: 4px;
	--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
	--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
	--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
	--transition-fast: 150ms ease;
	--transition-normal: 250ms ease;
}

/* ============================
   DEFERRAL MESSAGE STYLES
============================ */
#deferralMessage {
    margin: 10px auto;
    padding: 10px;
    font-size: clamp(14px, 1.8vw, 16px);
    text-align: center;
    border-radius: var(--radius-md);
    border: 0px solid var(--primary-color);
    background-color: rgba(240, 240, 240, 0.5);
    max-width: calc(1000px - 20px);
    display: none; /* Hidden by default, shown after calculation */
}

#deferralMessage span {
    display: inline-block;
    margin: 2px 0;
    border-radius: var(--radius-sm);
}

/* impact description */
.hidden {
	display: none;
}

/* ============================
   ENTIRE DOC STYLING
============================ */
body {
	font-family: 'Inter', system-ui, sans-serif;
	margin: 0;
	padding: 0;
	background-color: var(--background-color);
	color: var(--text-primary);
	line-height: 1.5;
	overflow-x: hidden;
	/* Prevent horizontal scrolling */
}

.page-break {
		page-break-before: always;
		/* Forces a page break before this div */
	}

/* Container for both buttons */
.button-container {
	position: absolute;
	top: 4px;
	right: 5%;
	display: flex;
	gap: 10px; /* Default spacing between buttons */
}

/* RESET | PRINT BUTTON | LANGUAGE BUTTON */
.reset-link,
.print-link,
.language-link {
	padding: var(--space-sm) var(--space-md);
	background-color: var(--primary-color);
	color: white;
	border: none;
	border-radius: var(--radius-md);
	font-weight: 500;
	transition: background-color var(--transition-normal);
	cursor: pointer;
	text-decoration: none;
	vertical-align: center;
	text-align: center;
	font-size: clamp(12px, 2.5vw, 16px);
}

/* Adjust hover color for print-link */
.reset-link:hover,
.print-link:hover,
.language-link:hover {
	background-color: var(--primary-hover);
}

/* FRAMING OF CONTENT */
.container {
	width: min(100%, 1800px);
	margin: 0 auto;
	padding: var(--space-sm);
	background-color: var(--surface-color);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-md);
	overflow-x: hidden;
	box-sizing: border-box;
	max-width: 100%;
}

/* Typography */
/* GENERAL TEXT FORMATTING */
h1 {
	font-size: clamp(16px, 2.0vw, 24px);
	padding: 0px;
	margin: 0px;
	text-align: center;
}

h2 {
	font-size: clamp(16px, 2.00vw, 22px);
	padding: 0px;
	margin: 0px;
}

hr {
	padding: 0px;
	margin: 3px 0px;
}

.logos {
	grid-column: span 4;
	display: flex;
	justify-content: space-between;
	padding: 10px;
}

/* ============================
   INPUT CONTAINER OVERALL STYLING
============================ */
.inputContainer {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 10px;
	max-width: 1000px;
	width: 80%;
	padding: 20px 0px;
	text-align: center;
	margin: 0 auto;
	box-sizing: border-box; /* Add this to include padding in width calculation */
}

.buffer {
	padding-top: 18px;
}

/* Update input group styles for better unit alignment */
.input-group {
	display: block;
	align-items: center;
	gap: 0px;
	margin: 0px;
	padding: 0px;
	vertical-align: bottom;
}

/* Input Group Base Styles */
.input-group input[type="number"],
.input-group input[type="text"],
.input-group input[type="date"],
.input-group input[type="checkbox"],
.input-group select {
	padding: 3px;
	height: 28px; /* Set explicit height */
	box-sizing: border-box;
	border-radius: 4px;
	border: 1px solid #ddd;
	font-size: clamp(16px, 2.5vw, 16px);
	text-align: center;
	width: 10ch;
}

.input-group input[type="checkbox"] {
	width: auto;
	/* Checkbox should not be full width */
}

.input-group .effective_Tax_Rate {
	font-size: clamp(16px, 2.5vw, 16px);
}

/* Unit Styling */
.input-group .unit-left,
.input-group .unit-right {
	padding: 3px;
	height: 28px; /* Match input height */
	line-height: 20px; /* Center text vertically */
	box-sizing: border-box;
	background-color: #fff;
	border: 1px solid #ddd;
	color: #333;
	font-size: clamp(16px, 2.50vw, 16px);
	display: inline-flex;
	align-items: center;
}

.input-group .unit-left {
	border-right: none;
	border-radius: 4px 0 0 4px;
}

.input-group .unit-right {
	border-left: none;
	border-radius: 0 4px 4px 0;
}

.input-group label {
	display: block;
	color: #333;
	margin-bottom: 2px;
	font-size: clamp(16px, 2.5vw, 16px);
	font-weight: bold;
}

/* Input Group Controls - Update for better mobile alignment */
.input-group-controls {
	display: inline-flex;  /* Change to inline-flex */
	align-items: center;
	justify-content: center;
	width: auto;  /* Allow natural width */
	max-width: 100%;
}

/* Mobile adjustments for input groups and units */
@media (max-width: 767px) {
	.input-group-controls {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: auto;
		margin: 0 auto;
	}

	/* Adjust unit styling for mobile */
	.input-group .unit-left,
	.input-group .unit-right {
		display: inline-flex;
		align-items: center;
		height: 28px;
		padding: 3px;
		margin: 0;
		white-space: nowrap;
	}

	/* Ensure inputs and units stay together */
	.input-group input[type="number"],
	.input-group input[type="text"],
	.input-group input[type="date"],
	.input-group select {
		width: auto;
		max-width: 15ch;
		margin: 0;
		display: inline-block;
	}

	/* Specific styling for input groups with units */
	.input-group-controls input + .unit-right,
	.input-group-controls .unit-left + input {
		margin: 0;
	}
}

/* Hide hr by default */
.full-width-line {
	display: none;
}

#beginAge {
	width: 6ch;
	text-align: center;
}

#retirement_Age {
	width: 6ch;
	text-align: center;
}

#employeePayFrequency {
	width: 15ch;
}

#employeePayPerPeriod {
	width: 9ch;
	text-align: center;
}

#payFrequencyDisplay {
	font-weight: normal;
	font-size: 12px;
	padding-left: 2ch;
}

#employee401kContributionRate {
	width: 6ch;
	text-align: center;
}

/* + / - TOGGLING */
.toggle-button-left {
	margin-right: 5px;
	border-radius: 4px;
	background-color: #ddd;
	border: 1px solid #ccc;
	/* otherwise red but too strong */
	color: red;
	font-weight: bold;
	vertical-align: center;
	width: auto;
	height: auto;
	padding-left: 8px;
	padding-right: 8px;
	text-align: center;
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 19px;
	touch-action: manipulation;
	/* Prevents double-tap zooming on buttons */
}

.toggle-button-left.active {
	background-color: red;
	/* New background color when active */
	color: white;
	/* New text color when active */
}

.toggle-button-right {
	margin-left: 5px;
	border-radius: 4px;
	background-color: #ddd;
	border: 1px solid green;
	color: green;
	font-weight: bold;
	vertical-align: center;
	width: auto;
	height: auto;
	padding-left: 8px;
	padding-right: 8px;
	text-align: center;
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 19px;
	touch-action: manipulation;
	/* Prevents double-tap zooming on buttons */
}

.toggle-button-right.active {
	background-color: green;
	/* New background color when active */
	color: white;
	/* New text color when active */
}

#tax_Filing_Marital_Status {
	width: 20ch;
	text-align: center;
}

#retirement_Tax_Rate {
	width: 7ch;
	text-align: center;
}

#inputGrade {
	margin-top: 0px;
	/* Space between controls and label */
	font-weight: bold;
	font-size: 12px;
	text-align: center;
	padding-right: 4ch;
}

/* Center the button horizontally on the page */
#calculate {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	/* Ensures the container spans the page width */
	height: auto;
}

/* Container styles - Ensure no extra clickable area */
.button,
.button-reset-print {
	display: inline-block;
	/* Shrinks the div to fit the button's size */
	text-align: center;
}

/* Button styles */
.button-reset-print button {
	background-color: #ffffff;
	color: var(--secondary-color);
	font-size: clamp(.7rem, 2.0vw, .7rem);
	border: 1px solid var(--secondary-color);
	padding: 5px 10px;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

/* Hover effect */
.button-reset-print button:hover {
	background-color: var(--secondary-color);
	color: #ffffff;
}

/* Button styles */
.button button {
	background-color: var(--primary-color);
	color: #fff;
	font-size: clamp(16px, 2.5vw, 16px);
	border: none;
	padding: 10px 20px;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

/* Hover effect */
.button button:hover {
	background-color: var(--primary-hover);
}

/* Ensure no extra space around the button is clickable */
#calculate {
	pointer-events: none;
}

#calculate button {
	pointer-events: all;
}

#calc-note {
	margin: 0px auto 5px auto;
	width: min(90vw, 1000px);
	text-align: center;
	font-size: clamp(10px, 2.5vw, 14px);
	padding: 5px 5px;
	background-color: var(--primary-color);
	color: white;
}

#questions {
	margin: 0px auto 5px auto;
	width: min(90%, 800px);
	text-align: left;
	font-size: clamp(10px, 2.5vw, 14px);
	padding: 5px 5px;
	color: black;
	border: 1px solid var(--primary-color);
	border-radius: 4px;
}

/* ============================
   LARGE SCREEN LAYOUT
============================ */
@media (min-width: 768px) {

	#title-display {
		text-align: left;
		margin-right: 0px;
	}	

	/* LOGOS DIV */
	/* Add specific margin to the left and right logos */
	.advisor-logo {
		margin-left: 150px;
		/* Margin to the left of the left image */
		max-height: 80px;
	}

	.sponsor-logo {
		margin-right: 150px;
		/* Margin to the right of the right image */
		max-height: 80px;
	}
}

/* ============================
   MOBILE SCREEN LAYOUT
============================ */

/* MOBILE screens */
@media (max-width: 767px) {

	.inputContainer {
		width: 95%;
		padding: 10px 5px; /* Reduce padding */
		gap: 5px; /* Reduce gap between items */
		margin: 0 auto;
		grid-template-columns: repeat(2, 1fr); /* Change to 2 columns on mobile */
		max-width: 100%;
		overflow-x: hidden;
	}

	/* Adjust input groups for mobile */
	.input-group {
		width: 100%;
		margin: 0;
		padding: 0 5px;
		box-sizing: border-box;
	}

	/* Ensure inputs don't overflow */
	.input-group input[type="number"],
	.input-group input[type="text"],
	.input-group input[type="date"],
	.input-group select {
		width: 100%;
		max-width: 15ch; /* Maximum width for inputs */
		margin: 0 auto;
	}

	/* Button styles */
	.button button {
		background-color: var(--primary-color);
		color: #fff;
		font-size: clamp(12px, 2.5vw, 12px);
		font-weight: bold;
		border: none;
		padding: 10px 12px;
		border-radius: 4px;
		cursor: pointer;
		transition: background-color 0.3s ease;
	}

	.logos {
		grid-column: span 2;
		flex-direction: row;
		align-items: center;
	}

	#title-display {
		padding: 10px 0px 0px 10px;
		margin-right: 0px;
		max-width: calc(100vw - 225px);
		text-align: left;
	}

	.full-width-line {
		display: none;
	}

	/* Targets screens with a width of 767px or smaller */
	.button-container {
		right: 20px; /* Keep the container at 20px from the right */
	}

	.print-link {
		display: none;
		/* Hide the print button on mobile */
	}

	.language-link {
		margin-left: auto;
		/* Shift the language button to the right when print button is hidden */
	}

	/* LOGOS Div */
	/* Add specific margin to the left and right logos */
	.advisor-logo {
		margin-left: 5px;
		/* Margin to the left of the left image */
		max-height: 60px;
		max-width: 40vw;
	}

	.sponsor-logo {
		margin-right: 5px;
		/* Margin to the right of the right image */
		max-height: 60px;
		max-width: 40vw;
	}

	/* Ensure tooltips don't cause horizontal scroll */
	.tooltip-content {
		max-width: 95vw;
		left: 50%;
		transform: translateX(-50%);
		width: auto;
	}

	/* Adjust output sections for mobile - full width */
	#paycheckSectionContainer,
	#barchartSectionContainer,
	#detailedTablesSectionContainer,
	#nextStepsOnPageContainer,
	#plan_And_Tips {
		width: 100%;
		margin: 10px 0;  /* Changed from auto to 0 */
		box-sizing: border-box;
		border-radius: 0;  /* Remove border radius on mobile */
	}

	/* Keep input container centered with margins */
	.inputContainer {
		width: 95%;
		margin: 0 auto;
	}

	/* Adjust disclaimer section for full width */
	#disclaimer {
		width: 100%;
		max-width: 100%;
		margin: 10px auto;
		padding: 5px;
		box-sizing: border-box;
	}

	/* Adjust calc-note for full width */
	#calc-note {
		width: 100%;
		margin: 0;
		box-sizing: border-box;
	}

	/* Adjust questions section for full width */
	#questions {
		width: 100%;
		margin: 5px 0;
		box-sizing: border-box;
		border-radius: 0;
	}
}

/* END MOBILE */

/* ============================
   OUTPUT FROM CALC LAYOUT
============================ */

/* RESULTS MESSAGING */
#plan_And_Tips {
	display: none;
	font-size: clamp(16px, 1.8vw, 16px);
	text-align: left;
	max-width: calc(1000px - 20px);
	/* Sets max width to 1000px minus 20px padding */
	margin: auto;
	/* Ensure the text is centered within the cell */
	position: relative;
	padding: 10px;
	border-radius: 4px;
	border: 2px solid var(--primary-color);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#plan_And_Tips>div {
	text-align: left;
	/* Ensures inner divs' content is left-aligned */
	margin: 0 auto;
	/* Centers the div itself within plan_And_Tips */
	max-width: 100%;
	/* Prevents overflow beyond the container */
}

#plan_And_Tips td hr {
	margin: 0 auto;
	/* Centers the div itself within plan_And_Tips */
	max-width: calc(1000px - 20px);
	/* Sets max width to 1000px minus 20px padding */
}

/* Output Summary */
/* OUTPUT SECTION WITH BORDER */
#paycheckSectionContainer,
#barchartSectionContainer,
#detailedTablesSectionContainer,
#nextStepsOnPageContainer {
	display: none;
	text-align: center;
	border-radius: 4px;
	border: 2px solid var(--primary-color);
	padding: 0;
	margin: auto;
	max-width: 1000px;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
	z-index: 999;
}

#nextStepsOnPageContainer {
	border: 15px solid var(--primary-color);
}

#paycheckSectionTitle,
#barchartSectionTitle,
#detailedTablesSectionTitle {
	display: inline-block;
	/* Ensure the elements are visible */
	padding: 3px 20px;
	/* Add some padding for better spacing */
	margin: 5px auto;
	text-align: center;
	font-size: clamp(10px, 2.5vw, 18px);
	font-weight: bold;
	background-color: var(--primary-color);
	/* Set the background color */
	color: white;
	/* Ensure the text is readable */
	border-radius: 50px;
	/* Rounded ends */
	vertical-align: top;
	width: auto;
}

/* OUTPUT MESSAGING IN TOP OF OUTPUT SUMMARY*/
#paycheckSectionResultText {
	margin: auto;
	width: 80%;
	font-size: clamp(16px, 1.8vw, 16px);
	font-weight: normal; /* bold */
	text-align: center;
	padding: 0px 0px 0px 10px;
}

/* OUTPUT TABLE */
#paycheckPiechartAndTable table {
	margin: auto;
	width: 100%;
	border-collapse: collapse;
	font-family: "Inter", serif;
	font-size: clamp(10px, 1.5vw, 16px);
}

/* OUTPUT TABLE BORDERS AND SPACING */
#paycheckPiechartAndTable th,
#paycheckPiechartAndTable td {
	text-align: center;
	vertical-align: middle;
	white-space: nowrap;
	position: relative;
	padding: 7px 0px 7px 0px;
}

/* OUTPUT TABLE HEADER ROW */
#paycheckPiechartAndTable th {
	border-top: 2px solid var(--primary-color);
	font-size: clamp(11px, 2.25vw, 20px);
	/* Adjust size as needed */
}

/* OUTPUT TABLE FIRST COLUMN */
#paycheckPiechartAndTable td:first-child {
	padding-left: 5px;
}

/* Modify font-size for all td elements in percentageRow except the first one */
.percentageRow td:not(:first-child) {
	font-size: clamp(13px, 2.25vw, 20px);
	/* Adjust size as needed */
}

/* Modify font-size for the third td element in percentageRow */
.percentageRow td:nth-child(4) {
	font-size: clamp(16px, 3.0vw, 24px);
	/* Adjust size as needed */
	font-weight: bold;
	text-decoration: underline;
}

/* OUTPUT TABLE CENTER COLUMN BORDERS */
#paycheckPiechartAndTable td.center-column,
#paycheckPiechartAndTable th.center-column {
	border-left: 2px solid var(--primary-color);
	border-right: 2px solid var(--primary-color);
}

#paycheckPiechartAndTable th.center-column {
	border-top: 2px solid var(--primary-color);
}

#paycheckPiechartAndTable tr:last-child {
	border-bottom: 0px solid var(--primary-color);
	/* bottom row of table below grades */
}

/* Chart Styling */
/* PIE-CHART FORMATTING */
.pie-chart-container {
	display: flex;
	justify-content: center;
	align-items: flex-end;
	width: 100%;
	padding: 0;
	margin: 0;
	flex-wrap: nowrap;
}

/* PIE-CHART GENERAL PLACEMENT */
.pie-chart {
	margin: auto;
}

/* Retirement Grade text formatting below pie chart */
.retirement-grade {
	color: white;
	text-shadow: 1px 1px 2px black;
	font-size: clamp(13px, 2.25vw, 20px);
}

/* ============================
    TABLE LAYOUT
============================ */
/* Ensure the table is responsive and contained within its parent */
div.detailed {
	width: 100%;
	/* Ensure the div takes up full available width */
	overflow: hidden;
	/* Prevent horizontal scrolling */
}

section.detailed {
	padding: 1px;
	/* Optional: Add padding for better spacing around the table */
	width: 100%;
}

table.detailed {
	width: 100%;
	/* Make sure table fills the parent */
	border-collapse: collapse;
	/* For neat borders */
	table-layout: fixed;
	/* Distribute space evenly and prevent overflow */
	font-size: clamp(6px, 1.5vw, 16px);
	/* Dynamically adjusts font size */
}

table.detailed td,
table.detailed th {
	padding: 5px 1px 5px 1px;
	/* Add padding to table cells for readability */
	border: 1px solid #ddd;
	/* Add light borders */
	text-align: center;
	/* Align text to the center */
	word-wrap: break-word;
	/* Prevent text overflow in cells */
}

table.detailed td {
	font-size: clamp(6px, 1.50vw, 16px);
	/* Dynamically adjusts font size for each cell */
}

table.detailed td:not(:first-child) {
	white-space: nowrap;
}

table.detailed th {
	font-size: clamp(6px, 1.50vw, 16px);
	/* Dynamically adjusts font size for headers */
	background-color: #f2f2f2;
	/* Light background for header */
	font-weight: bold;
}

table.detailed td:first-child {
	text-align: left;
	/* Optional: Make the last column bold for emphasis */
}

table.detailed tr:nth-last-child(2) td {
	font-weight: bold;
	/* Center all cells in the second-to-last row */
}

/* Add spacing between list items within the div */
.question-roth-vs-pretax li {
	margin-bottom: 5px;
	/* Add vertical spacing between bullets */
}

/* ============================
   DISCLAIMER LAYOUT
============================ */
#disclaimer {
  font-size: clamp(12px, 1.5vw, 14px);
  margin: 20px auto 0;
  width: 100%;
  max-width: 1000px;
  padding: 20px;
  box-sizing: border-box;      /* include padding in width calculations */
  white-space: normal;         /* allow normal wrapping */
  overflow-wrap: break-word;   /* break long words if needed */
  word-wrap: break-word;       /* legacy support */
  hyphens: auto;               /* enable hyphenation in supported browsers */
  overflow-x: hidden;          /* prevent horizontal overflow */
}

#disclaimer .disclaimer-section {
  margin-bottom: 20px;
  display: block;
  width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;          /* changed from break-word to normal for better readability */
  hyphens: auto;
}

#disclaimer p {
  width: 100%;
  max-width: 100%;
  margin-bottom: 10px;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* ============================
   MOBILE LANDSCAPE LOCKDOWN
============================ */
/* Rotate lock styles for mobile devices in landscape mode */
.rotate-lock {
	overflow: hidden;
	height: 100vh;
	display: flex;
	justify-content: center;
	align-items: center;
	background-color: #f0f0f0;
}

/* Hide content and display rotate message */
.rotate-lock .container,
.rotate-lock #outputSummaryContainer,
.rotate-lock .inputTables {
	display: none;
}

.rotate-message {
	display: none;
	/* Hidden by default */
	font-size: 20px;
	text-align: center;
	color: #333;
	padding: 20px;
}

/* ============================
   PRINTING
============================ */

/* Media Queries for Print */
@media print {
    body {
        font-size: clamp(16px, 2.5vw, 36px);
        display: block;
        justify-content: center;
        align-items: center;
        height: auto;
        margin: 0;
        width: 100%;
    }

    .container {
        width: min(100%, 1200px) !important;
        margin: 0 auto !important;
        padding: var(--space-sm) !important;
    }

    #paycheckSectionContainer,
    #barchartSectionContainer,
    #detailedTablesSectionContainer,
    #nextStepsOnPageContainer,
    #plan_And_Tips {
        width: min(100%, 1000px) !important;
        margin: 20px auto !important;
        padding: 10px !important;
    }

    #nextStepsSection {
        display: block;
        width: min(100%, 1000px);
        max-width: 1000px;
        position: relative;
        clear: both;
        float: none;
        margin: 0 auto;
        padding: 0;
        page-break-before: always;
        page-break-after: always;
    }

    #nextStepsSection:first-child {
        page-break-before: avoid;
    }

    #nextStepsSection #nextStepsOnPageContainer {
        width: 100% !important;
        max-width: 1000px !important;
        margin: 0 auto !important;
        padding: 0 !important;
    }

    #fvBarChart,
    #disclaimer {
        width: min(100%, 1000px) !important;
        height: auto !important;
        margin: 0 auto !important;
    }

    .language-link,
    .print-link,
    .mobile-message,
    #calculate {
        display: none;
    }

    /* Show nextStepsPrint only on print */
    #nextStepsPrint {
        display: block !important;
        margin: 20px auto;
        width: calc(100% - 50px);
        text-align: left;
        font-size: clamp(12px, 2.5vw, 16px);
        color: #333;
        border-radius: 4px;
        border: 15px solid var(--primary-color);
        padding: 10px;
    }

    /* Hide nextStepsPrint in other views */
    @media screen {
        #nextStepsPrint {
            display: none !important;
        }
    }

    /* Hide the inputs-section when printing */
    .inputs-section {
        display: none !important;
    }

    #nextStepsOnPageContainer {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        clear: both !important;
        float: none !important;
        position: relative !important;
        margin: 20px 0px 0px 0px !important;
        padding: 0 !important;
    }

    /* Clone that appears at the top of first page */
    #nextStepsOnPageContainer:first-of-type {
        page-break-before: avoid;
        page-break-after: always;
        margin-top: 0 !important;
        position: relative;
        top: 20px;
        left: 0;
        right: 0;
    }

    /* Original instance that appears in normal flow */
    #nextStepsOnPageContainer:last-of-type {
        page-break-before: always;
        margin-top: 20px !important;
    }

    /* Ensure the content inside takes full width */
    #nextStepsOnPage {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 10px !important;
        box-sizing: border-box !important;
    }
}

/* Show nextStepsOnPage */
#nextStepsOnPage {
	margin: 10px auto;
	width: auto;
	text-align: left;
	font-size: clamp(12px, 2.5vw, 16px);
	color: #333;
	padding: 10px;
}

/* TABLE DETAILED */
.detailed table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 20px;
}

.detailed th,
.detailed td {
	border: 1px solid #ddd;
	padding: 2px;
	text-align: center;
}

.detailed th,
.detailed thead {
	background-color: none;
	/* Ensure it doesn't override dynamic color */
	vertical-align: top;
}

.detailed tr:nth-child(even) {
	background-color: #f9f9f9;
}

/* Prevent highlighting for header row */
table.detailed th:hover {
	background-color: transparent !important;
}

/* Hover effect on row (excluding first column and last row) */
table.detailed tr:not(:last-child):hover td:not(:first-child) {
	background-color: #f1f1f1;
}

/* Hover effect on specific cells (excluding first column) */
table.detailed td:not(:first-child):hover {
	background-color: #f1f1f1;
	/* Highlight background */
	border: 1px solid var(--primary-color);
	/* Apply border only on the hovered cell */
}

/* Prevent the last row from being affected when hovering over any second td */
table.detailed tr:last-child td {
	background-color: transparent !important;
	/* Ensure no background change */
	border: none !important;
	/* Prevent border changes */
}

/* Additional safeguard for the last row's second td */
table.detailed tr:last-child td:nth-child(2) {
	background-color: transparent !important;
	/* No highlight */
	border: none !important;
	/* No border */
	pointer-events: auto;
	/* Allow interaction if needed */
}

/* Ensure text wrapping and sizing remain intact */
table.detailed td {
	font-size: clamp(6px, 1.50vw, 16px);
}

table.detailed td:not(:first-child) {
	white-space: nowrap;
}

/* Add general overflow control */
html, body {
	max-width: 100%;
	overflow-x: hidden;
}

/* Add to your CSS file */
#nextStepsSection {
    display: none; /* Hidden by default */
}

/* Show at top when printing */
@media print {
    #nextStepsSection {
        display: block;
        width: 100%;
        max-width: 100%;
        position: relative;
        clear: both;
        float: none;
        margin: 0;
        padding: 0;
        page-break-before: always;
        page-break-after: always;
    }

    /* Position at top of first page when printing */
    #nextStepsSection:first-child {
        page-break-before: avoid;
    }

    #nextStepsSection #nextStepsOnPageContainer {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Ensure proper layout flow */
    body {
        display: block !important;
    }

    .container {
        display: block !important;
        width: 100% !important;
    }
}

/* Show at bottom on screen */
@media screen {
    #nextStepsSection {
        display: block;
        margin-top: 2em;
    }
}

/* Update container styles for better print handling */
#detailedTablesSectionContainer,
#nextStepsOnPageContainer {
    width: min(100%, 1000px) !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0px !important;
    box-sizing: border-box !important;
    overflow: hidden !important; /* Prevent content overflow */
}

/* Ensure tables inside detailed section fit print margins */
#detailedTablesSectionContainer table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* Adjust cell content for print */
#detailedTablesSectionContainer td,
#detailedTablesSectionContainer th {
    word-break: normal !important; /* Prevent words from breaking */
    white-space: normal !important; /* Allow wrapping between words */
    padding: 5px 1px !important;
    font-size: clamp(8px, 1.5vw, 14px) !important;
}

/* Update print media query */
@media print {
    #detailedTablesSectionContainer,
    #nextStepsOnPageContainer {
        width: min(100%, 1000px) !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 2px !important;
        box-sizing: border-box !important;
        page-break-inside: avoid !important;
    }

    /* Ensure content stays within page margins */
    .container {
        margin: 0 auto !important;
        padding: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Adjust table layout for printing */
    table.detailed {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        table-layout: fixed !important;
    }

    /* Ensure text in cells doesn't break words but wraps between them */
    table.detailed td,
    table.detailed th {
        word-break: normal !important;
        white-space: normal !important;
        font-size: clamp(8px, 1.5vw, 14px) !important;
    }
}