:root {
    --measure: 80ch;

    /* Spacing: Tailwind-inspired, 1 unit = 0.25rem */
    --s1: 0.25rem;
    --s2: 0.5rem;
    --s3: 0.75rem;
    --s4: 1rem;
    --s5: 1.25rem;
    --s6: 1.5rem;
    --s8: 2rem;

    /* Colors */
    --color-white: #fff;
    --color-gray-50: #fafafa;
    --color-gray-100: #eee;
    --color-gray-300: #ccc;
    --color-gray-500: #999;
    --color-gray-600: #666;
    --color-gray-700: #555;
    --color-gray-800: #333;
    --color-red: #d33;
    --color-green: #2a2;

    /* Font sizes */
    --text-xs: 0.85rem;
    --text-sm: 1.05rem;
    --text-base: 1.1rem;
    --text-lg: 1.25rem;
    --text-xl: 1.5rem;
    --text-2xl: 2rem;

    /* Radii */
    --radius: 8px;

    /* Borders */
    --border: 2px solid var(--color-gray-300);
}

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

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: system-ui, sans-serif;
    background: var(--color-gray-50);
}

footer {
    margin-top: auto;
    padding: var(--s6) var(--s4);
    font-size: var(--text-xs);
    color: var(--color-gray-500);

    a {
        color: var(--color-gray-500);
        font-size: var(--text-xs);
    }
}

form,
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s4);
    width: 100%;
    max-width: var(--measure);
    padding: var(--s8);
    margin: auto;
}

.prose {
    align-items: flex-start;

    h2 {
        font-size: var(--text-lg);
        margin-top: var(--s6);
    }

    p {
        font-size: var(--text-base);
        line-height: 1.6;
        color: var(--color-gray-800);
    }

    em {
        font-style: italic;
    }
}

h1 {
    font-size: var(--text-2xl);
    margin-bottom: var(--s2);
}

input {
    width: 100%;
    padding: var(--s4);
    font-size: var(--text-lg);
    border: var(--border);
    border-radius: var(--radius);
    text-align: center;

    &:focus {
        outline: none;
        border-color: var(--color-gray-800);
    }
}

button {
    padding: var(--s3) var(--s8);
    font-size: var(--text-base);
    border: none;
    border-radius: var(--radius);
    background: var(--color-gray-800);
    color: var(--color-white);
    cursor: pointer;

    &:hover:not(:disabled) {
        background: var(--color-gray-700);
    }

    &:disabled {
        background: var(--color-gray-500);
        cursor: default;
    }
}

.result {
    margin-top: var(--s4);
    font-size: var(--text-xl);
    font-weight: bold;
}

.result.yes {
    color: var(--color-red);
}
.result.no {
    color: var(--color-green);
}

a {
    color: var(--color-gray-800);
    font-size: var(--text-base);
}

.breakdown {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin: var(--s2) 0;
    text-align: left;
    font-size: var(--text-sm);
    border: var(--border);
    border-radius: var(--radius);
    overflow: hidden;

    th,
    td {
        padding: var(--s3) var(--s6);
    }

    th {
        font-weight: 600;
        border-bottom: var(--border);
        color: var(--color-gray-600);
        font-size: var(--text-xs);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    td {
        border-bottom: 1px solid var(--color-gray-100);
    }

    tr:last-child td {
        border-bottom: none;
    }

    td:last-child,
    th:last-child {
        text-align: right;
    }
}
