* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background: #0f1220;
    color: #e8e9f3;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 24px 16px 48px;
}

.Header {
    text-align: center;
    max-width: 560px;
    margin-bottom: 24px;
}

.Header p:first-child {
    letter-spacing: 3px;
    font-size: 12px;
    color: #7f8ae0;
    font-weight: 600;
}

.Header h1 {
    font-size: 40px;
    margin-top: 8px;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #7f8ae0, #4fd1c5);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.Header p:nth-child(2) {
    margin-top: 8px;
    font-size: 14px;
    color: #a3a7c2;
    line-height: 1.4;
}

.Input {
    background: #1a1e33;
    border: 1px solid #2c3153;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.Input p {
    align-self: flex-start;
    font-size: 13px;
    color: #9aa0c7;
}

#functionInput {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #2c3153;
    background: #0f1220;
    color: #e8e9f3;
    font-size: 16px;
    margin-bottom: 8px;
}

#functionInput:focus {
    outline: none;
    border-color: #4fd1c5;
}

#findRootButton {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, #7f8ae0, #4fd1c5);
    color: #0f1220;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

#findRootButton:hover {
    opacity: 0.85;
}

#result {
    margin-top: 10px;
    font-size: 13px;
    color: #ff8a8a;
    min-height: 18px;
    text-align: center;
}

.Output {
    width: 100%;
    max-width: 420px;
    margin-top: 20px;
    background: #1a1e33;
    border: 1px solid #2c3153;
    border-radius: 12px;
    padding: 16px 24px;
    display: grid;
    grid-template-columns: auto 1fr;
    row-gap: 8px;
    column-gap: 12px;
}

.Output p:nth-child(odd) {
    color: #9aa0c7;
    font-size: 14px;
}

.Output p:nth-child(even) {
    font-weight: 600;
    color: #4fd1c5;
    font-size: 14px;
}

.Graph {
    margin-top: 24px;
    background: #1a1e33;
    border: 1px solid #2c3153;
    border-radius: 12px;
    padding: 16px;
    width: 100%;
    max-width: 680px;
}

#graphCanvas {
    display: block;
    width: 100%;
    height: auto;
    background: #0f1220;
    border-radius: 8px;
}

#coordDisplay {
    margin-top: 10px;
    text-align: center;
    font-size: 13px;
    color: #9aa0c7;
    font-variant-numeric: tabular-nums;
}

.Footer {
    margin-top: 32px;
    font-size: 12px;
    color: #6b7099;
}