body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    max-width: 900px;
    margin: auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h1, h2 {
    color: #333;
    text-align: center;
    margin-bottom: 20px;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.input-group {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #e7e7e7;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.input-group input[type="text"],
.input-group input[type="number"] {
    width: calc(100% - 22px); /* Account for padding */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
}

button {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    margin-top: 20px;
    margin-bottom: 30px;
}

button:hover {
    background-color: #0056b3;
}

#results table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    margin-bottom: 20px;
}

#results th, #results td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

#results th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.visualization-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #ccc;
    background-color: #fff;
    margin-top: 10px;
    border-radius: 5px;
}

#visualizationSvg {
    display: block;
    min-width: 400px;
    margin: auto;
}

/* SVG Element Styles */
#visualizationSvg .ground-line {
    stroke: #333;
    stroke-width: 2px;
}

#visualizationSvg .ceiling-line {
    stroke: #888;
    stroke-width: 2px;
    stroke-dasharray: 10, 5;
}

#visualizationSvg .platform-representation {
    fill: #add8e6; /* Light blue */
    stroke: #555;
    stroke-width: 1px;
}

#visualizationSvg .capped-platform {
    fill: #ffcccb !important; /* Light red for capped platforms */
    opacity: 0.8;
}

#visualizationSvg .person-representation { /* For the body line */
    stroke: #333;
    stroke-width: 1.5px;
}

#visualizationSvg .person-head {
    fill: #f0e68c; /* Khaki for head */
    stroke: #333;
    stroke-width: 1px;
}

#visualizationSvg .eye-line {
    stroke: #0000ff; /* Blue */
    stroke-width: 1.5px;
}

#visualizationSvg .screen-representation {
    fill: #d3d3d3; /* Light gray */
    stroke: #333;
    stroke-width: 1px;
}

#visualizationSvg .horizontal-view-line { /* Long eye-level projections to screen X */
    stroke: #28a745; /* Green */
    stroke-width: 1px;
    stroke-dasharray: 5, 3;
}

#visualizationSvg .los-line { /* Line Of Sight from P2 eye to screen bottom */
    stroke: #007bff; /* Brighter Blue */
    stroke-width: 1.5px;
}

#visualizationSvg .horizontal-reference-line { /* Short line from P2 eye for angle */
    stroke: #888; /* Grey for reference */
    stroke-width: 1px;
    stroke-dasharray: 2, 2;
}

#visualizationSvg .los-clearance-line { /* For the clearance over P1's head */
    stroke: #ffa500; /* Orange */
    stroke-width: 1.5px;
    stroke-dasharray: 3,3;
}

#visualizationSvg .dimension-line {
    stroke: #666;
    stroke-width: 1px;
}

#visualizationSvg .dimension-line-light { /* For specific vertical dimension lines */
    stroke: #aaa; 
    stroke-width: 0.8px;
    stroke-dasharray: 2, 2;
}

#visualizationSvg .dimension-line-special { /* For below-ground or uniquely placed dimensions */
    stroke: #4682B4; /* SteelBlue */
    stroke-width: 1px;
}

#visualizationSvg .dimension-text, 
#visualizationSvg .svg-text { /* General class for text within SVG if not specific */
    font-family: Arial, sans-serif;
    font-size: 10px;
    fill: #333;
    dominant-baseline: middle;
}

#visualizationSvg .dimension-text-special { /* For below-ground or uniquely placed dimension text */
    font-family: Arial, sans-serif;
    font-size: 10px;
    fill: #4682B4; /* SteelBlue */
    text-anchor: middle; 
    dominant-baseline: middle;
}

#visualizationSvg .riser-box-volume {
    fill: #cce5ff; /* Light blueish color for the riser volume */
    stroke: #555;
    stroke-width: 0.5px;
    opacity: 0.8; /* Slight transparency if desired */
}

/* Message Styles */
.error-message {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}
.error-message p {
    margin: 0.5em 0;
}
.error-message p:first-child {
    margin-top: 0;
}
.error-message p:last-child {
    margin-bottom: 0;
}

.warning-message {
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}
.warning-message b {
    font-weight: bold;
}