:root {
    --pico-font-size: 100%; /* Reduced from 100% */
}

html, body {
    height: 100%;
    overflow: hidden;
}

main {
    height: calc(100% - 100px);
}

button {
    margin: 10px 0;
    float: right;
    padding: 0.5rem 1rem; /* Compact button padding */
    font-size: 0.9rem;
}

section {
    height: 100%;
    overflow: hidden;
    padding: 1rem; /* Reduced section padding */
}

th {
    font-weight: bold;
}

#results div {
    clear: both;
    height: calc(100% - 140px);
    overflow: scroll;
}

#options > div {
    height: calc(100% - 140px);
    overflow: scroll;
    padding-right: 0.5rem; /* Add some padding for scrollbar */
}

#report,
#output textarea{
    height: calc(100% - 140px);
    font-family: monospace;
    white-space: pre-wrap;
}

#help {
    cursor: pointer;
}

#help:hover {
    color: var(--pico-primary-background);
}

#example code {
    display: block;
    white-space: pre;
    user-select: all;
    height: 300px;
    overflow: scroll;
}

.output {
    white-space: break-spaces;
}

h2 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

h3 {
    font-size: 1.1rem;
    margin: 0.8rem 0 0.5rem 0; /* Reduced margins */
}

/* Home button styling */
.home-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: background-color 0.3s;
}

.home-button:hover {
    background-color: var(--bg-tertiary);
    text-decoration: none;
}

.home-icon {
    width: 18px;
    height: 18px;
    color: var(--text-primary);
}

/* Compact form elements */
label {
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    font-weight: 500;
}

select {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

/* Default compact textarea */
textarea {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    min-height: 1.8rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    resize: vertical;
}

/* Large textarea variant - add this class to textareas that need more space */
textarea.large {
    min-height: 8rem;
}

/* Grid spacing */
.grid {
    grid-gap: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Horizontal rules */
hr {
    margin: 1rem 0;
    opacity: 0.3;
}

#options > div > div[id] {
    display: grid;
    grid-template-columns: 1fr 80px; /* input area | checkbox column */
    grid-gap: 1rem;
    align-items: start;
    margin-bottom: 0.5rem;
}

/* Create simple header for Summary column */
#options > div > h4 {
    display: grid;
    grid-template-columns: 1fr 80px;
    grid-gap: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid rgba(128, 128, 128, 0.2);
}

/* First span is empty, second span says "Summary" */
#options > div > h4 span:last-child {
    text-align: center;
}

/* Labels and inputs stay together in first column */
#options label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    font-weight: 500;
}

/* The .grid div contains the input elements */
#options .grid {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0;
}

/* Checkbox styling in second column */
.summary-checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
    background-color: rgba(128, 128, 128, 0.05);
    border-radius: 4px;
    border: 1px solid rgba(128, 128, 128, 0.15);
    height: fit-content;
    margin-top: 1.3rem; /* Align with input field, accounting for label height */
}

.summary-checkbox-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--pico-primary);
}

/* Hide the label text since we have a column header */
.summary-checkbox-container label {
    display: none;
}

.summary-checkbox-container:hover {
    background-color: rgba(128, 128, 128, 0.08);
    border-color: rgba(128, 128, 128, 0.25);
}

.summary-checkbox-container:has(input[type="checkbox"]:checked) {
    background-color: rgba(0, 128, 0, 0.05);
    border-color: rgba(0, 128, 0, 0.2);
}
