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

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f4f4f9;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    touch-action: manipulation;
}

.header {
    background: #1a1a2e;
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

h1 {
    font-size: 1.4rem;
    font-weight: 600;
}

.controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #00c853;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.toggle-label {
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
}

.font-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.font-container label {
    font-weight: 500;
    white-space: nowrap;
}

select {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.editor-container {
    flex: 1;
    padding: 16px;
    display: flex;
    min-height: 0;
}

#editor {
    flex: 1;
    width: 100%;
    height: 100%;
    padding: 20px;
    font-size: 1.25rem;
    line-height: 1.6;
    border: 2px solid #ddd;
    border-radius: 12px;
    resize: none;
    outline: none;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: font-family 0.2s ease;
    overflow-y: auto;
}

#editor:focus {
    border-color: #00c853;
    box-shadow: 0 0 0 4px rgba(0, 200, 83, 0.15);
}

.footer {
    background: #1a1a2e;
    color: #aaa;
    padding: 12px 16px;
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.4;
    border-top: 1px solid #333;
}

.footer strong {
    color: #00c853;
}

@media (max-width: 600px) {
    .header {
        padding: 10px 12px;
    }
    
    h1 {
        font-size: 1.25rem;
    }
    
    #editor {
        font-size: 1.15rem;
        padding: 16px;
    }
    
    .controls {
        gap: 12px;
    }
}