.container {
    width: 100%;
    height: 100%;
    max-width: 1400px;
    max-height: 900px;
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 1px rgba(255, 255, 255, 0.1) inset;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.simulator {
    display: flex;
    height: auto;
    max-height: 900px;
    min-height: 500px;
    gap: 2px;
    overflow: hidden;
}

.cpu,
.ram {
    resize: both;
    flex: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
    background: rgba(30, 30, 50, 0.5);
    backdrop-filter: blur(10px);
}

.cpu {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    resize: none;
}

.ram {
    resize: none;
}

.top-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
    flex-shrink: 0;
}

.top-row .register {
    flex: 1 1 0;
    min-width: 0;
}

.bottom-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
    flex-shrink: 0;
}

#execution-phases {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.bottom-row .register {
    flex: 1 1 0;
    min-width: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.cpu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
    flex-shrink: 0;
}

.cpu-header h2 {
    margin-bottom: 0;
    flex-shrink: 0;
}

.mode-toggle {
    display: flex;
    align-items: center;
}

.mode-controls {
    margin-bottom: 20px;
    flex-shrink: 0;
    position: relative;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ram-table-container {
    flex-grow: 1;
    flex-shrink: 1;
    overflow-y: auto;
    overflow-x: auto;
    margin-top: 10px;
    padding: 0 10px;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
}

.ram-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 12px;
    flex-shrink: 0;
    min-height: 52px;
}

.mode-switch {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 0;
    height: 52px;
}

.mode-switch button span {
    font-size: 14px;
    font-weight: 600;
    color: #ffa366;
    white-space: nowrap;
    line-height: 1;
    display: flex;
    align-items: center;
}

.explanation {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out;
    padding: 0;
    box-sizing: border-box;
    background: rgba(30, 30, 50, 0.5);
}

.explanation.visible {
    padding: 0;
    border-radius: 0 0 24px 24px;
}

.explanation-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 0 0;
}

.explanation-content > *:last-child {
    margin-bottom: 0;
}

.explanation-content ul,
.explanation-content ol {
    padding-left: 24px;
}