.counter-container {
    max-width: 800px; /* Adjust max-width as needed */
    margin: 1rem auto; /* Center the container */
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--preview-bg); /* Subtle background */
}

.counter-container label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--label-text);
}

#text-input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit; /* Use body font */
    font-size: 1rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    resize: vertical; /* Allow vertical resizing */
    min-height: 150px; /* Set a minimum height */
    transition: border-color 0.2s ease;
}

#text-input:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2); /* Subtle focus indicator */
}
body.dark-mode #text-input:focus {
     box-shadow: 0 0 0 2px rgba(102, 191, 255, 0.25); /* Subtle focus indicator dark*/
}


#stats-container {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--border-color);
}

#stats-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    color: var(--text-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.2rem; /* Spacing between stat items */
}

.stat-item {
    background-color: var(--bg-color);
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
 body.dark-mode .stat-item {
      box-shadow: 0 1px 2px rgba(255,255,255,0.05);
 }

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--label-text);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--accent-color);
}
 body.dark-mode .stat-value {
     color: var(--accent-color-dark);
 }

@media (max-width: 600px) {
     .counter-container {
         padding: 1rem;
     }
    .stats-grid {
         grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* Smaller min width */
        gap: 0.8rem;
    }
     .stat-item {
        padding: 0.8rem;
    }
    .stat-value {
        font-size: 1.4rem;
    }
    .stat-label {
        font-size: 0.8rem;
    }
}