/* --- General --- */
body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    color: #1c2a48;
    font-weight: 700;
    margin-bottom: 30px;
}

h2 {
    color: #1c2a48;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-top: 0;
}

/* --- Layout --- */
.container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.card {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.input-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.input-item {
    display: flex;
    flex-direction: column;
}

/* --- UI Elements --- */
label {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 5px;
}

input[type="text"] {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

button {
    padding: 10px 20px;
    background-color: #007bff;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 700;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

#draw-button {
    background-color: #28a745;
}

#draw-button:hover {
    background-color: #1e7e34;
}

/* --- Result Area --- */
#result-area h3 {
    margin-top: 20px;
    color: #1c2a48;
}

#integral-result {
    background-color: transparent;
    padding: 0;
    border: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.result-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 5px solid #007bff;
}

.result-line span:first-child {
    font-weight: bold;
    color: #555;
}

.result-line span:last-child {
    font-family: monospace;
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
}


/* --- Graph Area --- */
.graph-area {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    padding: 15px;
}

#graph-placeholder {
    color: #adb5bd;
    font-size: 1.2em;
    font-weight: 500;
}


/* --- Romberg Area --- */
.romberg-area p {
    color: #555;
    font-size: 0.9em;
}

#run-romberg-button {
    background-color: #6f42c1;
    margin-bottom: 20px;
}

#run-romberg-button:hover {
    background-color: #5a32a3;
}

.convergence-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 1em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-radius: 6px;
    overflow: hidden;
}

.convergence-table th, .convergence-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.convergence-table th {
    background-color: #6f42c1;
    color: #ffffff;
    font-weight: 700;
    text-align: center;
}

.convergence-table tbody tr {
    transition: background-color 0.2s ease;
}

.convergence-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.convergence-table tbody tr:hover {
    background-color: #e9ecef;
}

.convergence-table tbody tr:last-child {
    background-color: #f4f0f8;
    font-weight: bold;
}

.convergence-table td:nth-child(1) {
    text-align: center;
}

.convergence-table td:nth-child(2),
.convergence-table td:nth-child(3) {
    font-family: monospace;
    text-align: right;
    font-size: 1.1em;
    font-weight: bold;
}