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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.container {
    width: 100%;
    max-width: 1024px;
    height: 600px;
    background: white;
    border-radius: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

.status-indicator {
    background: rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* Transcript Area */
.transcript-area {
    flex: 0 0 100px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 8px 15px;
    display: flex;
    flex-direction: column;
}

.transcript-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.transcript-content {
    flex: 1;
    overflow-y: auto;
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    padding: 4px 0;
}

.transcript-content .placeholder {
    color: #999;
    font-style: italic;
}

/* Keyboard Area */
.keyboard-area {
    flex: 1;
    padding: 12px 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.keyboard-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.keyboard-buffer {
    min-height: 32px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 500;
    color: #333;
    word-wrap: break-word;
    min-height: 40px;
    line-height: 1.4;
}

/* Keyboard Layout */
.keyboard {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: flex-start;
}

.keyboard-row {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.key {
    flex: 1;
    min-width: 0;
    padding: 8px 4px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    color: #333;
    touch-action: manipulation;
}

.key:hover {
    background: #e0e0e0;
    border-color: #999;
}

.key:active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: scale(0.95);
}

.key.num {
    background: #fff3cd;
    border-color: #ffc107;
}

.key.num:active {
    background: #ffc107;
    color: white;
}

.key.sym {
    background: #e7f3ff;
    border-color: #2196F3;
}

.key.sym:active {
    background: #2196F3;
    color: white;
}

.key.special {
    background: #f3e5f5;
    border-color: #9c27b0;
}

.key.special:active {
    background: #9c27b0;
    color: white;
}

.keyboard-row.action {
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid #e0e0e0;
}

.key.action {
    background: #f5f5f5;
    border-color: #999;
    font-size: 12px;
}

.key.action.primary {
    background: #4CAF50;
    color: white;
    border-color: #45a049;
    font-weight: 700;
}

.key.action.primary:hover {
    background: #45a049;
}

.key.action.primary:active {
    background: #3d8b40;
    transform: scale(0.95);
}

/* Footer */
.footer {
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    padding: 8px 15px;
    display: flex;
    justify-content: space-around;
    font-size: 12px;
}

.status-item {
    display: flex;
    gap: 6px;
    align-items: center;
}

.status-item .label {
    font-weight: 600;
    color: #666;
}

.status-item .value {
    color: #4CAF50;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 600px) {
    .key {
        font-size: 11px;
        padding: 6px 2px;
    }

    .header h1 {
        font-size: 18px;
    }

    .keyboard-buffer {
        font-size: 16px;
        min-height: 36px;
    }
}

/* Scrollbar styling */
.transcript-content::-webkit-scrollbar,
.keyboard-area::-webkit-scrollbar {
    width: 4px;
}

.transcript-content::-webkit-scrollbar-track,
.keyboard-area::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.transcript-content::-webkit-scrollbar-thumb,
.keyboard-area::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

.transcript-content::-webkit-scrollbar-thumb:hover,
.keyboard-area::-webkit-scrollbar-thumb:hover {
    background: #555;
}
