#caseOutput {
    padding: 15px;
    background: var(--tool-bg);
    border-radius: 6px;
    margin-top: 20px;
    white-space: pre-wrap;       /* preserve line breaks but wrap text */
    word-wrap: break-word;       /* break long words */
    overflow-wrap: break-word;   /* newer syntax for breaking long words */
    word-break: break-all;       /* ensure long strings without spaces wrap */
    max-width: 100%;            /* ensure content stays within container */
    font-family: monospace;     /* keep monospace font for code-like content */
}
.case-buttons-container {
    display: flex;
    gap: 20px;
    margin: 15px 0;
}
.case-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    flex: 3;
}
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}
.text-input h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-color);
    font-size: 1.2em;
    font-family: 'Barlow', sans-serif;
}
#caseConverter .tool-section {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
#caseConverter .input-output-section {
    flex: 4; /* Increase from 2 to 3 to reduce button section width */
}
#caseConverter .button-section {
    flex: 1; /* Take 1/4 of the space */
    position: sticky;
    top: 20px;
    align-self: flex-start;
    max-width: 400px; /* Limit maximum width */
}
#caseConverter .case-buttons {
    display: grid;
    grid-template-columns: 1fr; /* Single column by default */
    gap: 8px;
    margin-bottom: 15px;
}
#caseConverter .case-buttons button {
    padding: 8px 12px;
    font-size: 0.9em;
    white-space: nowrap;
    width: 100%;
}

/* Responsive design */
@media (min-width: 1200px) {
#caseConverter .case-buttons {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on larger screens */
}
}

@media (max-width: 768px) {
#caseConverter .tool-section {
    flex-direction: column;
}
#caseConverter .button-section {
    position: static;
    max-width: 100%;
    width: 100%;
}
#caseConverter .case-buttons {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
}
}

@media (max-width: 480px) {
#caseConverter .case-buttons {
    grid-template-columns: 1fr; /* Single column on very small screens */
}
}
#caseConverter .case-buttons button {
    padding: 8px 12px;
    font-size: 0.9em;
    white-space: nowrap;
    width: 100%;
}
#caseConverter .action-buttons {
    display: grid;
    grid-template-columns: 1fr; /* Single column */
    gap: 8px;
    margin-top: 15px;
}
#caseConverter .action-buttons button {
    width: 100%;
}
#caseConverter .form-check {
    margin: 15px 0;
}
#caseConverter textarea {
    width: 100%;
    resize: vertical;
    min-height: 200px;
    max-height: 600px;
}