body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    margin: 1rem;
}

h1 {
    text-align: center;
    color: #007bff;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.control-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.control-item {
    flex: 1;
    min-width: 100%;
    display: flex;
    flex-direction: column;
}

/* Desktop: 3 columns for first row */
@media (min-width: 768px) {
    .control-item {
        min-width: calc(33.333% - 0.75rem);
    }

    h1 {
        font-size: 2rem;
    }

    .container {
        padding: 2rem;
    }
}

label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}

input[type="text"],
select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

input[type="text"]:focus,
select:focus {
    border-color: #007bff;
    outline: none;
}

.captcha-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.captcha-group input[type="text"] {
    flex: 0 1 auto;
    min-width: 100px;
    max-width: 150px;
    width: auto;
}

@media (max-width: 767px) {
    .captcha-group input[type="text"] {
        flex: 1;
        min-width: 120px;
        max-width: none;
    }
}

.captcha-img {
    cursor: pointer;
    border: 1px solid #ddd;
    border-radius: 4px;
    height: 40px;
    background: #f0f0f0;
    flex-shrink: 0;
}

.action-group {
    text-align: center;
    margin-bottom: 1.5rem;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
    max-width: 300px;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-primary:active {
    background-color: #004085;
}

#result-area {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    white-space: pre-wrap;
    min-height: 150px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    display: none;
    font-size: 0.85rem;
    word-break: break-all;
}

/* Better scrolling on mobile */
@media (max-width: 767px) {
    #result-area {
        font-size: 0.75rem;
        max-height: 400px;
    }
}

.loading {
    text-align: center;
    color: #666;
    font-style: italic;
    display: none;
    padding: 1rem;
}

.error {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    display: none;
    font-size: 0.9rem;
}

/* Touch-friendly improvements */
@media (max-width: 767px) {

    input[type="text"],
    select,
    .btn-primary {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }
}