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

body {
    font-family: Arial, sans-serif;
    background: #f0f0f0;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 24px;
    color: #333;
}

.subtitle {
    color: #666;
    margin-top: 5px;
}

main {
    background: white;
    padding: 20px;
    border: 1px solid #ddd;
}

#textInput {
    width: 100%;
    height: 150px;
    padding: 10px;
    border: 1px solid #ccc;
    font-size: 14px;
    margin-bottom: 10px;
}

.clear-btn {
    background: #ff4444;
    color: white;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
}

.options-section {
    background: #f0f8ff;
    padding: 15px;
    margin-top: 20px;
    border: 1px solid #ddd;
}

.options-section h3 {
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.option-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.option-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.option-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.option-item span {
    font-size: 14px;
    color: #333;
    user-select: none;
}

.custom-chars-input {
    margin-top: 10px;
}

.custom-chars-input input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.custom-chars-input input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

.result-section {
    background: #f9f9f9;
    padding: 15px;
    margin-top: 20px;
    border: 1px solid #eee;
}

.counter-display {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.counter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 8px 15px;
    border: 1px solid #ddd;
}

.counter-item:nth-child(odd) {
    background: #f9f9f9;
}

.counter-label {
    font-size: 14px;
    color: #333;
    flex: 1;
    text-align: left;
}

.counter-value {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    text-align: center;
    min-width: 80px;
}

.counter-unit {
    font-size: 14px;
    color: #666;
    text-align: right;
    min-width: 50px;
}

.copy-section {
    margin-top: 20px;
    padding: 20px;
    background: #f5f5f5;
    border: 1px solid #ddd;
}

.copy-section h3 {
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
}

#copyText {
    width: 100%;
    height: 120px;
    padding: 10px;
    border: 1px solid #ccc;
    font-size: 12px;
    font-family: monospace;
    resize: vertical;
    background: white;
}

.copy-controls {
    margin-top: 10px;
    text-align: right;
}

.copy-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.copy-btn:hover {
    background: #0056b3;
}

footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 12px;
}

@media (max-width: 600px) {
    .counter-item {
        padding: 6px 10px;
    }
    
    .counter-label {
        font-size: 12px;
    }
    
    .counter-value {
        font-size: 14px;
        min-width: 60px;
    }
    
    .counter-unit {
        font-size: 12px;
        min-width: 40px;
    }
    
    .copy-section {
        padding: 15px;
    }
    
    .copy-section h3 {
        font-size: 14px;
    }
    
    #copyText {
        height: 100px;
        font-size: 11px;
    }
    
    .copy-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .options-section {
        padding: 10px;
    }
    
    .options-section h3 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .option-item {
        padding: 3px;
    }
    
    .option-item span {
        font-size: 12px;
    }
    
    .custom-chars-input input {
        padding: 6px 8px;
        font-size: 12px;
    }
}