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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #333;
    margin-bottom: 20px;
    border-bottom: 3px solid #007bff;
    padding-bottom: 10px;
}

h3 {
    color: #555;
    margin-bottom: 10px;
}

.info-box {
    background: #e7f3ff;
    border-left: 4px solid #007bff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.info-box p {
    margin: 5px 0;
}

.info-box a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

.info-box a:hover {
    text-decoration: underline;
}

.info-box code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.config-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

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

.config-item {
    display: flex;
    flex-direction: column;
}

.config-item label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
    font-size: 14px;
}

.config-item input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.config-item input:focus {
    outline: none;
    border-color: #007bff;
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #0056b3;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
}

.status {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-weight: 600;
}

.status.info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.status.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.status.warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.progress {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    min-height: 20px;
    margin-bottom: 20px;
}

.results {
    margin-top: 20px;
}

.result-box {
    border: 2px solid #ddd;
    border-radius: 4px;
    padding: 20px;
}

.result-box h3 {
    margin-bottom: 15px;
    font-size: 24px;
}

.result-box p {
    margin: 8px 0;
}

.result-box h4 {
    margin-top: 15px;
    margin-bottom: 8px;
    color: #666;
}

.registers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.registers div {
    padding: 8px;
    background: white;
    border-radius: 3px;
    text-align: center;
    font-weight: 600;
}

.flags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.flags span {
    padding: 6px 12px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 14px;
}

.flag-set {
    background: #28a745;
    color: white;
}

.flag-clear {
    background: #6c757d;
    color: white;
}

.memory-dump {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.memory-byte {
    padding: 4px 8px;
    margin: 2px 0;
}

.pc-byte {
    background: #ffc107;
    font-weight: 700;
    border-left: 4px solid #ff9800;
}

.tool-grid {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 15px;
    align-items: end;
    margin-bottom: 20px;
}