* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #222;
    font-size: 16px;
}

.container {
    width: 96%;
    max-width: 1700px;
    margin: 0 auto;
    padding: 30px 0;
}

h1 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 32px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.card {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.results-card {
    height: 500px;
    overflow-y: auto;
}

.card h2 {
    margin-top: 0;
    margin-bottom: 18px;
}

.parameter-layout {
    display: grid;
    grid-template-columns: 0.9fr 1.3fr;
    gap: 22px;
    align-items: start;
}

.parameter-figure {
    width: 100%;
    text-align: center;
    margin-top: 80px;
}

.parameter-figure img {
    width: 100%;
    max-height: 510px;
    object-fit: contain;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    padding: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(200px, 1fr));
    gap: 14px;
}

.result-layout {
    display: grid;
    grid-template-columns: 1.0fr 1.0fr;
    gap: 24px;
    align-items: start;
}

.action-row {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 22px;
}

label {
    display: flex;
    flex-direction: column;
    font-size: 16px;
    color: #333;
    line-height: 1.35;
}

.label-text {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
}

.var-inline {
    display: inline-flex;
    align-items: baseline;
    white-space: nowrap;
}

.var-inline sub {
    line-height: 1;
}

input,
select {
    margin-top: 6px;
    padding: 9px 11px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    background: #fff;
}

button {
    width: 160px;
    padding: 11px 16px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: white;
    font-size: 15px;
    cursor: pointer;
}

button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

button:hover:not(:disabled) {
    background: #1d4ed8;
}

#status {
    margin: 0;
    color: #2563eb;
    font-weight: 600;
}

.hint-text {
    color: #666;
    margin: 16px 0 0 0;
    font-size: 14px;
}

.edge-hint {
    display: none;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 8px;
    text-align: left;
    font-size: 16px;
}

th {
    width: 60%;
    color: #374151;
    font-weight: 600;
}

td {
    color: #111827;
    font-family: Consolas, monospace;
}

#curvePlot {
    width: 100%;
    height: 415px;
}

.site-footer {
    text-align: center;
    margin-top: 24px;
    padding: 18px 0;
    color: #666;
    font-size: 14px;
}

.site-footer a {
    color: #666;
    text-decoration: none;
}

.site-footer a:hover {
    color: #2563eb;
    text-decoration: underline;
}

@media (max-width: 1400px) {
    .parameter-layout {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: repeat(4, minmax(180px, 1fr));
    }
}

@media (max-width: 1200px) {
    .result-layout {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .container {
        width: 94%;
        padding: 18px 0;
    }

    .action-row {
        flex-direction: column;
        align-items: flex-start;
    }

    button {
        width: 100%;
    }

    #curvePlot {
        height: 420px;
    }
}
